2.1.4 Network Address Translation

NAT (network address translation) is an interesting trick that allows Dick and Harry connect to the Internet through Tom in our example.

An IP connection connects from a source port from a requesting computer to a destination port of the destination computer. This means that when Harry wants to connect to yahoo.com, it picks a source port, say 15923, and attempts to connect to a destination port 80 of the IP address 66.94.234.13.

This is where it gets interesting. The following is the sequence of events:

The key of this trick is that Tom tracks the the source port from Harry, and translate that port to one of its own ports. This way, all activities of Tom's exterior port (5829) are relayed to Tom's interior port (15923), and vice versa.

Note that there are different variants of NAT. For the purposes of this class, however, we will not get into variants of NAT.

Copyright © 2006-05-10 by Tak Auyeung