A servent issues a query by sending a Query message to all its neighbours. The neighbours pass this message on to their other neighbours and so on, for a certain number of steps defined by the TTL (Time To Live) field in the message header.
A servent receiving a query checks if it has something that matches this query. If it does, it responds with a QueryHit message, but still passes the Query message on to its other neighbours.
If a servent receives a QueryHit message from a host that does not support incoming connections a Push message is sent to that host. This message causes the host holding the file in question to open the connection. This usually makes it possible to bypass firewalls.
The Gnutella protocol, and many other protocols for that matter, exploit what is known as the ``small world'' phenomenon. This basically says that whereever you want to go you do not have to go very far. In more networking related terms this means that number the of hops you need to take to find what you are looking for is not as many as one might think. More details on this can be found in [Ora01] or [JAB01].
The remainder of this chapter describes the components of the protocol more in detail. The descriptions are based on both the Gnutella protocol version 0.4 and the Gnutella protocol draft version 0.6. If no version number is given a certain description applies to both versions.