libp2p / libp2p/go-libp2p

The Autonat manager should test the public IP with the tcp/udp listen ports

Open
#789 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

Opening based on the memory of a convo with @Stebalien a couple of weeks ago.

Currently running a libp2p host on "/ip4/0.0.0.0/tcp/4001" inside a NAT with Autonat enabled does not automatically detect that the router port may have been manually open. The "/ip4/public_address/tcp/4001" addressed is becomes only part of the current host Addresses only after it has received several successful connections to it, however, since it is never among the official addresses provided on dhts or exchanged in Identify, that is unlikely to happen.

For the history of p2p (eMule, Bittorrent, some multiplayer games...), users have simply gone and opened the necessary ports on the routers, rather than relying on upnp etc.. However libp2p autonat components do not check at all if the peers are reachable on the public IP+default listen port, which is actually likely.

What is also very easy is to tell users with NAT problems that they should just open port 4001 in their routers and things will work. We cannot tell them this at the moment and that sucks for them and for us.

The current workaround is to manually set the announce addresses, but that prevents the parts of the address-autodiscovery that work (i.e. LAN interfaces etc).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Autonat manager and the code that handles public and listen addresses; no specific files or tests are named in the issue. Trace how reachability is currently detected, then define tests for checking the public IP on the configured TCP/UDP listen ports while preserving LAN address autodiscovery.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.