A Larger Network

Directions -

Connect to the Gnutella network by sending out a ping.  The ping will be forwarded by Nodes 2 and 3.  Each ping will get a corresponding pong routed back on the same route as the ping was sent. 

Then you can search for a "file" (just a letter for our example) by typing in the "file name" and hitting the query button.  For simplicity we have only four nodes on the network.  In reality our source node could be the 300th node and could have gotten the ping or query descriptor from its directly connected neighbor.  In this way Gnutella is very scalable and fault tolerant.  The QueryHit will be routed in the reverse direction as the Query.

Notice that the Descriptor ID stays the same for each forward of a descriptor for a ping or a query.  Also the corresponding pongs and queryhits have the same Descriptor ID's.  In this way if a node sees a pong with a Descriptor ID that it has not seen before it will discard it as an error.  Each descriptor has a TTL and Hops field (to avoid clutter we will not show them on the pongs and queryhits). 

The TTL is decremented and the Hops is incremented after each step.  If at anytime TTL(0) != TTL( i ) + Hops( i ) the node can discard the descriptor as an error.  When TTL gets to zero the packet is not forwarded to anymore nodes from the Node 4 (i.e. the packet is dead).

After our source node has gotten a QueryHit it will set up an HTTP connection to make the download (not shown).

Hit "Add ID Error" and then Query a file in Node 4 to show what happens when a node sees a QueryHit with an ID that it has not already seen in a Query.  The node in the upper right will see a different ID and immediately remove the descriptor from the network, not routing the QueryHit to the source node.

Hit "Add TTL Error" and do any search to see what happens when TTL(0) != TTL(i) + Hops(i).  Our TTL(0) is 2 for all cases.  In this case the TTL will be changed to 3000 by Node 2.  Node 4 will then see that the equation does not add up and kill the packet, eventhough the TTL is greater than zero.

On the right is a routing table for Node 2.  This is just a basic routing table.  It contains a list of where it has recieved packets.  It contains the ID of the message, the descriptor and the source of the node.  This is necessary so that each node can correctly route Pongs and QueryHits to the original source of the Pings and Querys.

Files in Each Node