Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd IPv6 DHT support #950
Open
Add IPv6 DHT support #950
+172
−105
Conversation
This was referenced Oct 17, 2016
This comment has been minimized.
This comment has been minimized.
|
@feross: Are there any changes you need me to make to this? |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Aug 2, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Aaron1011 commentedOct 17, 2016
•
edited
k-rpc-socket | k-rpc | bittorrent-dht | torrent-discovery | webtorrent
This is one of many pull requests across the WebTorrent ecosystem to add IPv6 DHT support, as per webtorrent/bittorrent-dht#88
Per the BEP 32 statement about maintaining distinct IPv4/IPv6 DHTs and the discussion on webtorrent/bittorrent-dht#88, my implementation requires separate instances of
bittorrent-dhtand everything below it on the protocol stack (k-rpcandk-rpc-socket).torrent-discoverymaintains up to twoDHTinstances, one for each IP version used. Fortunately, WebTorrent already supports IPv6 peers, so no changes are needed in it beyond properly using the IPv6 DHT, if enabled in the options.The best way to run all of my changes is by using the npm link command. Assuming that all of the necessary modules (
k-rpc-socket,k-rpc,bittorrent-dht,torrent-discovery,webtorrent, andwebtorrent-cliare sibling directories, the following commands will set things up properly (starting from the parent directory):From there, you can test and run individual modules as you choose.
webtorrent specific notes:
This PR bring together all of my changes across the other repositories, allowing IPv6 DHT support to actually be used :).
I've added a new
dht6option, which functions in the same way as the already existentdhtoption does.Notes:
Caveats:
webtorrent-cliandwebtorrent-desktopdon't expose any way to selectively enable either the IPv4 DHT or the IPv6 DHT (thought it can be done through the API). However, I don't anticipate this being a very common usecase.Running the implementation:
No direct changes are needed to
webtorrent-cliorwebtorrent-desktopare needed to run this. Since you can't really see any results withwebtorrent-desktop(neither the peer list nor DHT information is shown),webtorrent-clishould be used to test this.The following steps describe how to best test the IPv6 DHT with
webtorrent-cli:webtorrent-clidirectory, runDEBUG=torrent-discovery bin/cmd.js download bf6f2be549a8aca5776638b59b2bca53d7bbc748. (the infohash is forubuntu-16.10-server-amd64.iso) You should see lots of peer message being printed out to the console, many containing IPv6 addresses.As a side note, you can use only IPv6 peers (both tracker and DHT) by using a blocklist containing this line: Whole IPV4-Internet:1.1.1.1-224.0.0.0. This can be enabled with the
--blocklistflag. With the blocklist saved toblocklist.txtin the root of the project, the command would look like this:DEBUG=torrent-discovery bin/cmd.js download bf6f2be549a8aca5776638b59b2bca53d7bbc748 --blocklist blocklist.txt