QKR

From Gnutella2
Revision as of 20:02, 11 January 2009 by Dcat (talk | contribs)
Jump to navigation Jump to search

Root Packets
CRAWLA - CRAWLR
HAW - LNI
KHL - KHLA - KHLR
PI - PO - PUSH
QKA - QKR
Q2 - QA - QH2 - QHT
UPROC - UPROD

/QKR - Query Key Request

The query key request asks a destination hub to provide a query key that the requesting node can use to securely perform queries. This mechanism ensures that the network cannot be used to direct unsolicited packets to external hosts.

Sending

A query key request should be sent to a hub via the connectionless transport if a key is not already available for that hub for the local node address, or if a previously acquired key no longer works or has expired. There is no reason to request a query key via a TCP link.

Receiving

Upon receiving a query key request, a hub should respond with a query key answer (/QKA) packet if it is willing to supply a query key. The answer packet should be dispatched to the return address indicated in the request packet only, and the allocated key should be locked to that address.

Payload

This packet has no payload at the current time.

Children

The QKR packet has these child packets defined at the current time:

  • /QKR/RNA
  • /QKR/SNA
  • /QKR/QNA
  • /QKR/REF

/QKR/RNA - Requesting Node Address

A query key may be requested for a node address other than that of the sender, for example when a UDP-firewalled leaf node wishes to acquire a query key for a remote hub that it will route through a locally connected hub. In this case it must request a query key for the node address of a connected hub.

Sending

This child is required to ensure that the sender knows its address.

Payload

The network address of the requesting node. See Datatypes for more information.

Children

This packet has no known children at the current time.

/QKR/QNA - Queried Node Address

This packet should only be transmitted over a TCP link from a leaf to a hub. It asks the hub to look in its query key cache and return a key matching the requested address.

Sending

This packet is sent by a leaf that is firewalled to one of its hubs that it will use to proxy its search results.

Receiving

When a hub receives this packet it should see if the node has already issued it a query key. If so then it will return the query key to the leaf in a QKA. Otherwise it will send a new QKR over UDP to the node and attach the leaf's address in an SNA packet. See /QKR/SNA for more information.

Payload

The network address of the node that the leaf needs a query key for. See Datatypes for more information.

Children

This packet has no known children at the current time.

/QKR/SNA - Sending Node Address

This packet indicates the original initiator of the query key proxy request. It is needed by the hub so it knows who to forward the query key onto when it eventually receives a QKA

Sending

This packet is sent by a hub over UDP to another hub on behalf of the leaf in SNA that is firewalled.

Receiving

When a hub receives this packet it should issue a query key for hub that sent the packet. The QKA response should include an identical SNA packet so the recipient knows which leaf to notify that it now has a query key.

Payload

The network address of the leaf that initiated the query key request. See Datatypes for more information.

Children

This packet has no known children at the current time.

/QKR/REF - Refresh the query key

Indicates that the query key for /QKR/QNA should not be retrieved from cache but instead the node in /QKR/QNA should be asked for its key. This packet appears to not be in widespread use.

Payload

This packet has no payload at the current time.

Children

This packet has no known children at the current time.