Conversation
This is a quick and dirty hack for Minima partial IPv6 support as a proof of concept, for demonstration purposes. This allows for peers IP:PORT to be defined for IPv6 addresses as well, by simple notation: e.g.: fda9:e0aa:589f::2:9001. For proper implementation we may want to only allow the unambiguous square brackets notation, e.g. [fda9:e0aa:589f::2]:9001 ? Can send messages over Maxima; Maxima contact addresses w/ IPv6. With this simple hack Maxima may not be backward compatible w/ IPv4-only connectable nodes. For that further changes would be needed. There may be additional backwards compatibility considerations to think of.
|
@spartacusrex99 @Jazminima For some reason I cannot add you as reviewers (maybe access rights thing?), thus tagging you here. |
|
Thanks! I'm having a play.. as we discussed the issue is whether to just switch to v6.. or use Both.. |
|
Just switching to v6 is not an option, both would need to be supported as IPv6 and IPv4 are not directly compatible: If Alice has only IPv6 connectivity and Bob has only IPv4 connectivity, then they would not be able to communicate. However, IPv6 and IPv4 can coexist (dual-stack): you can have both IPv4 and IPv6 connectivity. You may have only IPv4, you may have both IPv4 and IPv6, or in rare cases you may have only IPv6 (more in closed environments where IPv4 compatibility is not essential, not with end user devices). Usually, if you are an end user, if you've got IPv6, you would also have IPv4 connectivity as well. So, for Minima inter-nodes connectivity, the way I see it and explained above, a relatively simple change would enable IPv6. But for Maxima I see some further considerations would need to be taken: if Alice has both IPv4 & IPv6, and she wishes to communicate over Maxima with Bob who only has IPv4, then if Alice shares a Maxima host (contact address) with Bob, she should only share a contact address with IPv4. However, Alice could share a Maxima contact address with IPv6 to another user that has IPv6 connectivity with no problem. |
This is a quick and dirty hack, but working prototype, for Minima partial IPv6 support as a proof of concept; for demonstration purposes.
This allows for peers IP:PORT to be defined for IPv6 addresses as well, by simple notation: e.g.:
fda9:e0aa:589f::2:9001. For proper implementation we may want to only allow the unambiguous square brackets notation, e.g.:[fda9:e0aa:589f::2]:9001?For proper implementation we may want to filter-out "local" addresses: link local
(fe80::/10)and unique local(fc00::/7), and loopback (::1/128). Analogous as the code currently does with IPv4 (and then an-allipoption override).Testing: Running on testnet in docker containers w/ unique local IPv6 addresses.
Can send messages over Maxima; Maxima contact addresses w/ IPv6:
"contact":"MxG18HGG6FJ038614Y8CW46US6G20810K0070CD00Z83282G60G13P2JWVKB65Y6C9H4SCM03RY9DRFSBYDAVTRZ3286DRC6426MHAEZZ3GB8G23VCR5EWN82R22843R34056M06Z6BQEY6SJKYGEWZZ3J9T9WHFHSVNFBS222YA0QDAVYGGGNR4HSBNZ87JNHFAJ08ZQQVMP64M1GHHDSEHCEUZ110303NJBW1TUGD5D3CTK0Z5UD3QBSDVFZUUK10608006QWVV1A@fda9:e0aa:589f:0:0:0:0:4:9001"This does mean that such a node may not be able to communicate over Maxima with a node that may only be connectable via IPv4 (as this node's maxima contact address has only an IPv6 relay address).
The current assumption is there is 1 relay IPv4 address in the Maxima contact address. If adding IPv6 support, maybe Maxima addresses could be extended to be able to have 1 or more IPv4 and/or IPv6 addresses of relay nodes? Maybe simply separated by a comma? e.g.:
"contact":"MxG18HGG6FJ038614Y8CW46US6G20810K0070CD00Z83282G60G13P2JWVKB65Y6C9H4SCM03RY9DRFSBYDAVTRZ3286DRC6426MHAEZZ3GB8G23VCR5EWN82R22843R34056M06Z6BQEY6SJKYGEWZZ3J9T9WHFHSVNFBS222YA0QDAVYGGGNR4HSBNZ87JNHFAJ08ZQQVMP64M1GHHDSEHCEUZ110303NJBW1TUGD5D3CTK0Z5UD3QBSDVFZUUK10608006QWVV1A@fda9:e0aa:589f:0:0:0:0:4:9001,172.20.0.4"There may be additional backwards compatibility considerations to think of.
node 2: Add initial peer as an IPv6 address:port
node 1: after node 2 has added it as its initial peer:
Netstat shows connections via IPv4 and IPv6. I don't know why multiple connections to the same IP:PORT occur, though.
with
-allipoption: