View Single Post
  #2 (permalink)  
Old December 12th, 2001
Moak's Avatar
Moak Moak is offline
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Post TTL, Hops and horizon

TTLs are used to limit message live time and broadcast.

TTL = Time to live. Each time a message is forwarded it's TTL is decremented by one. If a message has reached TTL=0 it is not send out to other servants. There is also a 'Hop' field in every message, it's a kind of reverse TTL field. Hops = Number of times a message has been forwarded.

Example: When you send out a search request, the TTL make sure it will be forwarded within the so called 'horizon' and then be stopped (the horizon is what you can reach with your TTL). Otherwise the message would be forwarded infinite and the broadcast traffic would be increased by every new message.
You are connected to, lets say, five hosts. Each of this hosts is connected to five hosts as well and so on ad infinitum. Now when you send a search request, it passes the first five hosts. Having done this, it will be forwarded to the hosts they are connected to (5x5=25), and then they will be forwarded again (5x5x5=125 hosts). Each step your message makes is called a "Hop". As we know each of your messages has a "Time to Live (TTL)" which is about 7 by most servents, but this is also servant dependent. After a hop the TTL is decreased by one, that means, your request will pass about seven levels of forwarding (also called "broadcasting"). The servents that your request is able to reach before it dies (that means its TTL has reached 0) is called your "Network Horizon". It depends on your TTL and the number of connections that you and each of your peers have.
In reality the message routing is slightly more complicated. A servant makes sure it does not send broadcasts back to every servant, not to those it has received the message from and also tries to avoid round trips. It is also very common to lower extraordinary high TTLs to something healthy (TTL<=7) while you route them. So misconfigured Gnutella clients can't flood the network. You find details in the Gnutella specification.

Hope it helps.
Some parts of this text taken from Gnutella protocoll and Abaris.
Reply With Quote