-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DhtPacket Human documentation #120
Comments
When we send PingRequest:
When we send NodesRequest:
When we just add to kbucket:
|
The bootstrap_nodes has only 8 nodes from NodesResponses. |
https://github.com/tox-rs/tox/blob/master/src/toxcore/dht/packet/nodes_response.rs#L133 |
Yes, one NodesResponse has maximum 4 nodes. |
Description of DHT packets
1. Overview
PingRequest and NodesRequest provide method to interact with Tox Networks.
Purpose of packet
Data types used
2. PingRequest
When DHT node receives PingRequest, it responds with PingResponse and sends PingRequest.
When DHT node receives NodesRequest, it responds with NodesResponse and sends PingRequest.
Before DHT node sends PingRequest, it checks if the node is addable to close list
3. PingResponse
4. NodesRequest
There are two timers interval
There are two case sending NodesRequest
BootStrapping is checking nodes whether it is alive or not.
The nodes to bootstrap are nodes in NodesResponse and if
When DHT node receives NodesRequest, it responds with NodesResponse.
NodesResponse contains maximum 4 nodes in close list and friend's close list.
Maximum 4 nodes are closest to requested Public Key.
5. NodesResponse
When DHT node receives NodesResponse, it unpack nodes in packet's payload.
Unpacked nodes are added to
6. Replacing order of Kbucket and Bucket
Nodes in close list have two status
The old node in close list is replaced by new node order by
7. NatPingRequest
If a friend is not connected with me and friend is online, at every 3 seconds
Close nodes of a friend have SocketAddrs, if
are true then starts hole punching.
When DHT node receives NatPingRequest, it checks if Receiver PK is same with my PK
8. NatPingResponse
When DHT node receives NatPingResponse, it checks if Receiver PK is same with my PK
The text was updated successfully, but these errors were encountered: