NAT Traversal: Difference between revisions
Line 8: | Line 8: | ||
== Network Address Translation == |
== Network Address Translation == |
||
A network address is simply the IP ( + Port number for UDP/TCP). A NAT router receives an incoming IP packet, saves the address in its NAT table, rewrites sender address to one of its |
A network address is simply the IP ( + Port number for UDP/TCP). A NAT router receives an incoming IP packet, saves the address in its NAT table, rewrites sender address to one of its public addresses and sends the packet to the destination address. Now, the NAT router accepts incoming packets on this public address (NAT endpoint). These packets are forwarded to the private host. |
||
The most important facts are: |
|||
<ul> |
|||
IMG (general configuration + NAT communication) |
|||
<li>The mapping depends on the sender's port number. If the private host uses two different outgoing port numbers, the NAT endpoints will differ.</li> |
|||
<li>The private host has to send first. Otherwise no incoming packets will be forwarded to the private host.</li> |
|||
</ul> |
|||
Four NAT types: |
Four NAT types: |
||
Line 19: | Line 22: | ||
<li>Symmetric</li> |
<li>Symmetric</li> |
||
</ul> |
</ul> |
||
[[Image:NAT_full_cone.png]] |
|||
A private host sends an initial request to A. As a result, the NAT router opens a public endpoint. |
|||
== router configuration == |
== router configuration == |
Revision as of 22:36, 10 February 2006
Note: work in progress
Overview
NAT (Network Address Translation) is widely used to connect private networks to the internet. The main idea is to map several private IP addresses to only one public IP address. Having in mind that P2P network clients should be able to communicate with each other, one basic question comes into mind: how can internet hosts communicate with a host in a private network? We will first have a look at NAT itself and problems it brings. Then, we show how to traverse NATs by either changing router's configuration or by using other tricks.
Network Address Translation
A network address is simply the IP ( + Port number for UDP/TCP). A NAT router receives an incoming IP packet, saves the address in its NAT table, rewrites sender address to one of its public addresses and sends the packet to the destination address. Now, the NAT router accepts incoming packets on this public address (NAT endpoint). These packets are forwarded to the private host. The most important facts are:
- The mapping depends on the sender's port number. If the private host uses two different outgoing port numbers, the NAT endpoints will differ.
- The private host has to send first. Otherwise no incoming packets will be forwarded to the private host.
Four NAT types:
- Full Cone
- Restricted Cone
- Port Restricted Cone
- Symmetric
A private host sends an initial request to A. As a result, the NAT router opens a public endpoint.
router configuration
Port forwarding
UPnP
STUN
TURN
Hole punching
Text