next up previous contents index
Next: QueryHit message Up: Protocol messages Previous: Pong message   Contents   Index

Query message

Query messages, with a payload type of 0x80, are broadcasted to all neighbour nodes in the Gnutella network. Messages larger than 256 bytes may be discarded to lower the load on the network. A Query message has the fields shown in table tbl:gnutellaquery.


Table 3.4: Gnutella Query message fields
Bytes Description
0-1 Minimum speed, kb/s
2- Null terminated search criteria
Rest Optional extensions



The fields in the Query message have the following meaning and semantics.

Minimum speed
is the lower bound of connection speed a servent accepts. A servent receiving a Query message should only respond to the querying servent with a QueryHit if it is able to communicate at least at this speed.
Search criteria
is a string of keywords. Servents should only respond with files matching all keywords. Matching should be case insensitive. GGEP extensions may be used to specify an alternate matching procedure, such as interpreting the search criteria as a regular expression, but servents can never be sure that other servents understand these GGEP directives.

A Query message with a TTL field of 1, a hops field of 0 and a search criteria of exactly four spaces is used to index all files a host is sharing. If necessary several QueryHit messages may be sent. Servents should reply with all its shared files, unless it considers it harmful for privacy or bandwidth.

Optional extensions
is only available in Gnutella version 0.6. Allowed extension types are HUGE (Hash/URN Gnutella Extensions), XML or GGEP. For more information on these extensions see [Gnu02].


next up previous contents index
Next: QueryHit message Up: Protocol messages Previous: Pong message   Contents   Index
Marcus Bergner 2003-06-10