-
Notifications
You must be signed in to change notification settings - Fork 14
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
DHT Server transaction timeout #3
Comments
One thing, I'm able to understand by looking at source code is Ref: https://github.com/xgfone/bt/blob/master/dht/dht_server.go#L435 |
May be blocked by the peer? Suggest: only start one DHT server on one ip. If not, DHT server may be blocked by the peer. When starting one DHT server, it works. If you have two ips, it maybe works to start two DHT servers.
Because
There is a bug when handling the response of |
This bug still exists. I'm using v0.4.3. Below is a small smaple code with logs main
logs
|
|
It is not a bug. There are two reasons leading to timeout:
|
I'm behind a NAT firewall so my client is not directly reachable from remote peers. But like most torrent clients, it should try to use the UDP hole punching technique to open the port and make it reachable. Can this technique be implemented? |
Yes, it may be implemented, but not belong on the scope of |
For establishing it is really a bug, change If printing not only the timeout error but also no peers for the same peer ip, it may be a bug. |
I found few threads related to NAT Traversal
I'm getting an intuition that implementing BEP 11 & 55 might solve it. I checked out various libraries for UDP Hole punching & UPnP but no luck. |
BEP 11 is used to implement a tracker based on UDP, not HTTP, BEP 55 is holepunch extension, but for the peer protocol with uTP, not DHT. It's same for UDP hole punching technique, but not for the implementation. So it may be difficult to provide a unified & consistent implementation. |
In general, hole-punching requires a shared introducer. But how to communicate with the introducer? I haven't found a standard. |
In general, therefore, the DHT server isn't run behind NAT, but the peer server may be OK. DHT/BEP5 supports the peers running behind NAT. |
Following the code from this file:
https://github.com/xgfone/bt/blob/master/dht/dht_server_test.go
everything is same, main looks like this:
output:
Two things to note from the above output:
Server2
is not able to connect to other nodes (timeout error). Why?Server1
which was bootstrapped with 1 IP andserver2
got added later, remains same. Why?I'm trying to build a router DHT node and expect my
server1
to get filled with other nodes. There are plenty of peers for the aboveinfohash
.The text was updated successfully, but these errors were encountered: