Host A (10.0.0.1) is connecting to 2 servers (TCP and UDP) on host B (130.129.123.2) both running on port 53. How does a traditional NAT handle this?
|
|
A NAT rule mapping So you can have the same numerical value for a port using different IP protocols result in two different translations, if you want. |
|||
|
|
|
Static NAT – Mapping an unregistered IP address to a registered IP address on a one-to-one basis. Particularly useful when a device needs to be accessible from outside the network. ex: In static NAT, the computer with the IP address of 192.168.32.10 will always translate to 213.18.123.110 Dynamic NAT – Maps an unregistered IP address to a registered IP address from a group of registered IP addresses. Dynamic NAT also establishes a one-to-one mapping between unregistered and registered IP address, but the mapping could vary depending on the registered address available in the pool, at the time of communication. ex: In dynamic NAT, the computer with the IP address of 192.168.32.10 will translate to the first available address in the range from 213.18.123.100 to 213.18.123.150 Is that what you are asking? |
|||
|
|
|
Host A will select some random high (<1024) port, and connect to B. NAT box (usually a router) will change the source IP(of box A) to a public IP it owns (and if the outgoing port is used, it will also change the port number), and remember the change. When B recieves packet, it answers back with a packet to a public IP assigned to the router (where the packet seems to have come from because of the NAT). The router will then check the NAT table, and notice the translation it has done before, and reverse it (change the destination IP to IP(of box A), and also the port, if it has done this before), and send it to box A. With tcp, it can forget the nat table entry after TCP FIN/RST/..., or it waits for a timeout. With UDP it just waits for a timeout (after no packets come either way on this IP/port combo). |
|||
|
|