summaryrefslogtreecommitdiff
path: root/docs/updates
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-04-15 18:09:07 -0400
committerirungentoo <irungentoo@gmail.com>2014-04-15 18:09:07 -0400
commitf9bf7b074acd29b0448d36a66db4339c6ae659c4 (patch)
tree0b46cfd4a2989f06004c5e57ed26a735ff9a5d4f /docs/updates
parent229b2b2dcdcab20f35063da9e69b6ef0ded70231 (diff)
Major protocol changes, this commit breaks all network compatibility.
Removed a bunch of useless space from various structs. pack_nodes() and unpack_nodes() are now used to transmit lists of nodes for the DHT and onion parts. They provide a way to transmit both ipv6 and ipv4 nodes in the same packet in a portable way that takes as little space as possible without compression. Using pack_nodes, merged the send nodes and send nodes ipv6 packets into one packet greatly reducing the risk of amplification attacks.
Diffstat (limited to 'docs/updates')
-rw-r--r--docs/updates/DHT.md16
1 files changed, 4 insertions, 12 deletions
diff --git a/docs/updates/DHT.md b/docs/updates/DHT.md
index db825a3c..9e94ab11 100644
--- a/docs/updates/DHT.md
+++ b/docs/updates/DHT.md
@@ -79,12 +79,9 @@ Protocol
79 79
80Node format: 80Node format:
81``` 81```
82[char array (node_id), length=32 bytes][ip (in network byte order), length=4 bytes][port (in network byte order), length=2 bytes][Padding , length=2 bytes] 82[uint8_t family (2 == IPv4, 10 == IPv6, 130 == TCP IPv4, 138 == TCP IPv6)][ip (in network byte order), length=4 bytes if ipv4, 16 bytes if ipv6][port (in network byte order), length=2 bytes][char array (node_id), length=32 bytes]
83``` 83```
84see also: DHT.h (Node4_format struct) 84see also: DHT.h (pack_nodes() and unpack_nodes())
85
86IPv6 Node format:
87see: DHT.h (Node_format struct)
88 85
89Valid queries and Responses: 86Valid queries and Responses:
90 87
@@ -102,12 +99,7 @@ Packet contents:
102``` 99```
103Valid replies: a send_nodes packet 100Valid replies: a send_nodes packet
104 101
105Send_nodes (response (for ipv4 addresses)): 102Send_nodes (response (for all addresses)):
106```
107[byte with value: 03][char array (client node_id), length=32 bytes][random 24 byte nonce][Encrypted with the nonce and private key of the sender:[Nodes in node format, length=40 * (number of nodes (maximum of 8 nodes)) bytes][Encrypted data, length=NODES_ENCRYPTED_MESSAGE_LENGTH bytes]]
108```
109
110Send_nodes_IPv6 (response (for ipv6 addresses)):
111``` 103```
112[byte with value: 04][char array (client node_id), length=32 bytes][random 24 byte nonce][Encrypted with the nonce and private key of the sender:[Nodes in ipv6_node format, length=56 * (number of nodes (maximum of 8 nodes)) bytes][Encrypted data, length=NODES_ENCRYPTED_MESSAGE_LENGTH bytes]] 104[byte with value: 04][char array (client node_id), length=32 bytes][random 24 byte nonce][Encrypted with the nonce and private key of the sender:[Nodes in node format, length=?? * (number of nodes (maximum of 8 nodes)) bytes][Encrypted data, length=NODES_ENCRYPTED_MESSAGE_LENGTH bytes]]
113``` 105```