nim-eth
nim-eth copied to clipboard
Run discovery DHT behind nat
This ticket describes issues with the current code, when running behind a nat:
- node A runs on port 50000 on network X.0
- node B runs on port 50001 on network X.0
- node C runs on port 50002 on network Y.0
- to node C, node A runs on network X.1, behind a NAT
A and B connect to each other on local network - they will have each others 'X.0' addresses in the DHT. Now C connects to A because it had a bootstrap address with X.1:50000, and is unable to connect to node B, because there is no DHT entry with X.1 - A only sees B as X.0:50001
FIREWALL
+----+
| |
| | +-----------------+
| | | |
| | | |
| | | A |
| +-------+ |
| | | |
| | | |
| | | X.0:50000 |
+-----------+ | | +-----------------+
| | | | |
| | | | |
| | | | |
| C +------------+X.1 | |
| | | | |
| | | | |
| | | | |
+-----------+ | | |
| | |
| | +-----------------+
| | | X.0:50001 |
| | | |
| | | B |
| +-------+ |
| | | |
| | | |
| | | |
| | | |
| | +-----------------+
| |
+----+