Reputation: 1
I'm implementing the DHT protocol
, and I have received many find_node
responses from which I got new nodes. I put the nodes in the queue, send a find_node
request to them too. I'm running my java program on Linux.
So I think my decoding is right, I can parse IP and port from find_node
responses.
But strangely I never received get_peers
or announce_peers
requests. What mistake caused my situation?
One thing I can't explain is that in find_node
responses, I got a key IP
which is my own IP and port after parsing. But the port is different every time. Why is the port different?
Upvotes: 0
Views: 305
Reputation: 43125
But strangely I never received get_peers or announce_peers requests. What mistake caused my situation?
DHT node A will only send requests if you have been added to some routing table of another node B along the path to their destination. You only get added to routing tables if your node is well-behaved, i.e. has a good uptime, has a stable IP, port, ID and correctly responds to various query types such as pings.
One thing I can't explain is that in find_node responses, I got a key IP which is my own IP and port after parsing. But the port is different every time. Why is the port different?
The bittorrent DHT doesn't work if your publicly visible IP:port tuple is not stable.
Upvotes: 0