libp2p / libp2p/specs

AutoNAT v2 spec improvement proposal: dial-back from a distinct interface when available on Autonat server

Open
#714 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
1.8k
Forks
320
Avg merge
11d 15h
Merged PRs (30d)
1

Description

This issue distills findings from a systematic cross-implementation evaluation of AutoNAT v2, conducted by ProbeLab. The final report of the investigation is available in the following link.

AutoNAT v2 dial-back is performed by the same server that received the dial-request, so the dial-back source IP is always an IP the client has already contacted. ADF (address-dependent filtering) NAT filters inbound traffic by source IP only (not port): it allows any inbound traffic from previously contacted IPs. This means an ADF-filtered client will always see v2 dial-back succeed, regardless of whether peers from other IPs can reach it — the client is declared globally reachable when it is not.

Note on impact. This is a low-impact improvement — ADF-filtered NAT is not known to be used by any modern consumer router (RFC 7857 moved recommendations toward port-restricted APDF filtering), and no real-world deployment is known to be affected. It is proposed as a best practice for AutoNAT v2 server behavior, not an urgent fix.

Proposal

As a best practice, when the AutoNAT v2 server has multiple network interfaces, the dial-back SHOULD be initiated from a different interface than the one that received the dial-request. The server needs at least one public IP to be reachable as an AutoNAT server in the first place; the alternate interface used for dial-back MAY be public or private — what matters is that it produces a different source IP at the client.

Concretely:

  • the server receives the DialRequest on IP A;
  • the server uses a different interface (IP B) to perform the dial-back;
  • if the client's NAT is full-cone (EIF), the dial-back succeeds regardless of source IP → REACHABLE;
  • if the client's NAT is ADF, the dial-back appears to come from an IP the client has never contacted → NAT blocks it → UNREACHABLE (correctly revealing the restriction);
  • if the client's NAT is port-restricted (APDF), the dial-back from B is blocked → UNREACHABLE (unchanged from today).

Effectiveness depends on whether the alternate interface produces a different source IP as seen by the client. On servers where both interfaces route through the same egress NAT (collapsing to the same external IP), this is a no-op — harmless but doesn't detect ADF. On servers with genuinely separate network paths (cloud hosts with multiple public IPs, physical servers with multiple uplinks), ADF detection works as designed.

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 with the linked AutoNAT v2 final report and the existing AutoNAT v2 specification in this repository, then trace how dial-back behavior is defined. Clarify the specification's requirements for selecting a distinct interface and document the expected outcomes for EIF, ADF, and APDF NATs.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.