Symmetric NAT traversal

Viewed 214

Let's say there is 2 peers, A and B, each under a symmetric NAT with a random port allocation.

If A sends a packet to B's address on a specific port, the NAT will map the request to it's public IP address and a random port.

A'private:           A'public:             B:
192.168.0.7:8000 --> 94.109.0.76:43576 --> 35.232.76.41:5000

If A keeps sending packets to B's address on the same port, the NAT will keep using the same combination of IP address and port.

A'private:           A'public:             B:
192.168.0.7:8000 --> 94.109.0.76:43576 --> 35.232.76.41:5000
192.168.0.7:8000 --> 94.109.0.76:43576 --> 35.232.76.41:5000
192.168.0.7:8000 --> 94.109.0.76:43576 --> 35.232.76.41:5000

If A decides to send a packet to B's address on a different port, the NAT will randomly allocate another port to send the packet.

A'private:           A'public:             B:
192.168.0.7:8000 --> 94.109.0.76:43576 --> 35.232.76.41:5000
192.168.0.7:8000 --> 94.109.0.76:27650 --> 35.232.76.41:5001

When A sends a packet to B the NAT will allow a reply from B to come through if it's sent from the port A sent a message to and if it has the address/port mapped by A's NAT as a destination.

A'private:           A'public:             B:
192.168.0.7:8000 --> 94.109.0.76:43576 --> 35.232.76.41:5000

B:                   A'public:             A's private
35.232.76.41:5000 --> 94.109.0.76:43576 --> 192.168.0.7:8000

Theoretically if A sends a packet to B on each of its ports (0-65535), A allows a reply coming from any of B's port to come through, but the reply will only come through if B sends a packet to one of the address/port mapped by A's NAT while sending the 65535 packets.

If B were to send a packet to each of A's ports (0-65535), B would most likely manage to find one of the port mapped by A's NAT and will therefore get through A's firewall.

Does this make sense to you guys or am I missing a point? I've been trying to connect 2 peers under symmetric NATs using this technique but haven't managed yet.

0 Answers
Related