Skip to content
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

[BEP32] Implement IPv6 DHT support #636

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

alanmcgovern
Copy link
Owner

@alanmcgovern alanmcgovern commented Feb 20, 2023

This implements BEP32 by hosting two independent DHT stacks. This can be augmented in future to allow returning IPv4 responses to IPv6 queries, and vice versa.

Features:

  • a node should use the same node id in both tables
  • Do not send UDP datagrams with a payload larger than 1024 octets
  • IPv6 DHT should use a socket bound to one of the host's global unicast IPv6 addresses
  • The port message from BEP5 is set to the IPV4 dht port, or IPV6 dht port, depending on which protocol is used to send the message.
  • values should be a list of compact ipv4 peers, or a list of compact ipv6 peers.
  • FindNodesResponse and GetPeersResponse should (optionally?) support nodes6
  • FindNodes and GetPeers should support the want parameter, a bencoded list of n4 and/or n6. This controls whether to include a nodes or nodes6 response.
  • If there's no want parameter, return nodes matching the request addressfamily.
  • values must only contain peers whose contact information matches the request addressfamily

@alanmcgovern alanmcgovern force-pushed the dualstack-dht branch 6 times, most recently from 8922d39 to 548d787 Compare February 26, 2023 00:58
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.

1 participant