Skip to content

Verify IPv6 NAT Punchthrough Behaviour #669

@CMCDragonkai

Description

@CMCDragonkai

While I was on a separate network that was capable of IPv6 I noticed a few differences in behaviour for NAT punchthrough.

Basically if the home network (or office network) is one of the latest ones, the general configuration is to give every device that's connected to the router a unique IPv6 address, while the router itself is given an IPv4 address.

For IPv6 capable systems, IPv6 is preferred. So when you do look up https://whatismyipaddress.com/ the IPv6 address appears first.

Furthermore using ip addr you can see the local IPv4 address as well as a scope global temporary dynamic address - looks like this:

    inet6 2603:8080:26f0:c2e0:c424:cb1f:5f7c:a4d6/64 scope global temporary dynamic 
       valid_lft 86368sec preferred_lft 82168sec

From the perspective of NAT punch-through, for IPv4, it's the problem of finding the right port between peers, which is why you need the help of a signaller.

But for IPv6, finding the right port is only 1 part of the problem, you also have to find the right IPv6 address.

So for 2 peers on IPv4, neither of which knows their public IPv4 address (because that's assigned to the router), and neither knows each others port, the signaller helps coordinate both pieces of information.

For 2 peers on IPv6, both peers knows their public IPv6 address, as such addresses are specific to the device. But neither know each other's public IPv6 address AND neither knows each other's port. The signaller again has to do the same thing.

So in effect, in both cases, the end result should be the same. One should prefer to contact the IPv6 address if it is possible on the machine.

However as we talked about before, connecting between v6 and v4 cannot be done directly, which requires a dual stack relay.

Tests for this need to be part of the Polykey-Simulation.

Now what is interesting here is that if you have IPv6, if you can configure the router, you can ask the router to basically fully DMZ the IPv6 address for a given device. That exposes the device to the internet fully allowing home networks to easily run hosted services now without the need to have to coordinate a limited number of ports (or to distinguish ports between different instances of
the same service). Each host just has their own unique IPv6 address that is globally/publically routable. This is pretty cool, and enables alot more peer to peer things. In fact because of this, it is possible for IPv6-hosts to just use the same port and use signaller to find the right public IPv6s...

Tasks

  • 1. Verify that we prefer IPv6 over IPv4 if possible.
  • 2. Test that NAT signaller is able to coordinate IPv6 public IP addresses.
  • 3. Test signalled punch-through
  • 4. Ensure Polykey-Simulation works

Metadata

Metadata

Assignees

No one assigned

    Labels

    procedureAction that must be executedr&d:polykey:core activity 4End to End Networking behind Consumer NAT Devices

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions