Skip to content

feat/606-enable-nat-traversal-via-hole-punching #668

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Winter-Soren
Copy link
Contributor

What was wrong?

Issue #606 requested the implementation of Direct Connection Upgrade through Relay (DCUtR) protocol in py-libp2p. This protocol enables peers that initially connect through a relay to establish direct connections when possible, improving performance and reducing relay load.

Issue #606

How was it fixed?

I implemented the DCUtR protocol according to the libp2p spec The implementation includes:

  1. A DCUtRProtocol class that handles the protocol logic for hole punching
  2. NAT detection utilities to determine if peers are publicly reachable
  3. Protocol message handling for connection upgrade coordination
  4. Integration with the existing relay functionality

The implementation allows peers to exchange observed addresses and synchronize connection attempts to punch through NATs. When successful, peers can upgrade from relayed connections to direct connections, improving performance and reducing load on relay nodes.

To-Do

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

Cute Animal Picture

image

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