GNUnet
GNU’s decentralized anonymous and censorship-resistant P2P framework.
GNUnet logo  
[English | Afrikaans | Bulgarian | Catalan | Czech | Danish | Dutch | Esperanto | Finnish | French | Galician | German | Hungarian | Italian | Japanese | Polish | Portuguese | Romanian | Russian | Simplified chinese | Slovak | Spanish | Swedish | Traditional chinese | Ukrainian]

GNUnet Protocol: node-to-node: DHT

DHT DISCOVERY

A DISCOVERY message is used to let another peer know that the sender supports the DHT protocol and also to exchange topology information. A DISCOVERY message contains the amount of space available for the DHT at the sender as well as the identities of other DHT participants known to the sender. The format of the DISCOVERY message is the following:

P2P_DHT_Discovery
OffsetBit position
0-78-1516-2324-31
0message size (8 + N * 64)(NBO)request type (18,NBO)
4available space (in bytes)(NBO)
8known DHT participants

DHT ASK HELLO

ASK HELLO messages are used by DHT peers if they would like to contact another peer in the network but do not have the necessary address information. If possible, other peers respond to ASK HELLO messages with the respective HELLO message. The format of the ASK HELLO message is the following:

P2P_DHT_ASK_HELLO
OffsetBit position
0-78-1516-2324-31
0message size (72,NBO)request type (19,NBO)
4resreved (0,NBO)
8identity of peer

DHT GET

A DHT_GET message is used to ask other peers to find content matching a particular type and key. Other peers should respond with the respective DHT RESULT message if they can find the data.

DHT_MESSAGE
OffsetBit position
0-78-1516-2324-31
0message size (80,NBO)request type (20,NBO)
4type of requested content(NBO)
8hop count(NBO)
12network size estimate(NBO)
16key

DHT PUT

A DHT PUT message is used to store data in the DHT. Peers should make an effort to store the data either in their own datastore or in the datastore of other peers (by forwarding the request). Peers do not send any response or confirmation to a DHT PUT request. Peers can validate the success of a PUT by issuing the corresponding GET request and wainting for results.

DHT_MESSAGE
OffsetBit position
0-78-1516-2324-31
0message size (80 + X)(NBO)request type (21,NBO)
4type of requested content(NBO)
8hop count(NBO)
12network size estimate(NBO)
16key
80data(NBO)
0-78-1516-2324-31

DHT RESULT

A DHT RESULT message is transmitted in response to a DHT GET request. Peers should forward the result to the previous peer in the request chain (or the respective local client for local requests). Peers do not send any response or confirmation to a DHT RESULT request.

DHT_MESSAGE
OffsetBit position
0-78-1516-2324-31
0message size (80 + X)(NBO)request type (22,NBO)
4type of requested content(NBO)
8hop count(NBO)
12network size estimate(NBO)
16key
80result data(NBO)
0-78-1516-2324-31



Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Christian Grothoff.
Verbatim copying and distribution of this entire article
is permitted in any medium, provided this notice is preserved.

Translation engine based on i18nHTML (C) 2003, 2004, 2005, 2006, 2007 Christian Grothoff.

go to i18nHTML administration page


Footnotes

NBO - network byte order

Fields of this type are in network byte order. Before reading these fields, they must be converted to host byte order using htons for 2-byte values, htonl for 4-byte values and htonll for 8-byte values. Before writing to these fields, the value must be converted using ntohs, ntohl and ntohll respectively.