Skip to content

Conversation

Winter-Soren
Copy link
Contributor

What was wrong?

Demonstrating an example of NAT traversal using Circuit Relay v2, DCUtR hole punching, and AutoNAT was missing from the codebase.

Issue #870

How was it fixed?

Implemented a comprehensive NAT traversal example that demonstrates the complete flow:

  1. A publicly reachable relay node running Circuit Relay v2
  2. A listener node behind NAT that advertises via relay and supports DCUtR
  3. A dialer node that connects via relay and upgrades to direct connection via hole punching

The implementation includes three components:

  • relay.py: Publicly accessible relay node with resource management
  • listener.py: NAT'd peer that accepts connections via relay and supports direct upgrades
  • dialer.py: NAT'd peer that connects through relay and attempts hole punching
graph TD
    subgraph "Dialer (Behind NAT)"
        A[Dialer Node]
        A1[AutoNAT]
        A2[Circuit Relay CLIENT Role]
        A3[DCUtR Protocol]
    end
    
    subgraph "Public Relay"
        B[Relay Node]
        B1[Circuit Relay HOP Role]
        B2[Resource Management]
    end
    
    subgraph "Listener (Behind NAT)"
        C[Listener Node]
        C1[AutoNAT]
        C2[Circuit Relay STOP Role]
        C3[DCUtR Protocol]
    end
    
    A -->|"1. Connect via relay"| B
    B -->|"2. Relay connection"| C
    A -->|"3. DCUtR hole punching"| C
    
    %% Component connections
    A --- A1
    A --- A2
    A --- A3
    B --- B1
    B --- B2
    C --- C1
    C --- C2
    C --- C3
    
    class A,C natNode
    class B publicNode
Loading

To-Do

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

@seetadev
Copy link
Contributor

seetadev commented Oct 8, 2025

@Winter-Soren : Appreciate your great efforts, Soham.

Re-ran the CI/CD pipeline. There are a couple of issues, which need resolution.

We will need a proper screencast demonstrating the example along with proper documentation to enable hole punching interop testing as the next step.

CCing @acul71, who could help you on the hole punching interop testing front using the example as a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants