![Texas TMS320C6000 Programmer'S Reference Manual Download Page 199](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844199.webp)
NAT Operation
B-6
B.1.3 NAT Port Mapping
So far we’ve only examined communications that has been initiated by hosts
on the home LAN. Note that any unsolicited packets sent to HR from the WAN
will not match any entry in the NAT table. These packets will be forwarded to
the internal protocol stacks on HR, where they may or may not be used.
Now assume that a host on the home LAN (say H2) wishes to place an HTTP
server on the Internet. With what we’ve examined so far, it would be impossible
to contact such a sever from the WAN since no unsolicited traffic (like an HTTP
connect request) can pass from the WAN to the LAN. However, H2 can acquire
a portion of HR’s WAN presence by mapping one of the well-known port values
on the public WAN IP address to itself through port mapping.
In port mapping, a NAT entry is created to send all traffic destined for a specific
port on the public IP address to an alternate destination. For well known ports
like HTTP, the port value is not usually altered. Only the destination IP address
changes. In this case, port 80 (HTTP) on the public IP address is mapped to
port 80 of the LAN host H2. The entry would look as follows:
NAT Entry Table
Foreign IP
Foreign
Port
Local IP
Local
Port
Mapped
Port
IP Protocol
TCP State
Timeout
wild
wild
192.168.0.32
80
80
TCP
–
STATIC
When a connection request arrives from a remote host for the public IP ad-
dress assigned to HR, as with the basic NAT discussion of the previous sec-
tion, the destination port of the packet is matched with the Mapped Port value
of the NAT entry. Normally, the Foreign IP and Port of the NAT entry must also
match for source IP and port of the packet, but here the values are ”wild”. This
is because when the entry is created, the foreign peer is unknown. Since, ev-
ery TCP connection state must be tracked in its own NAT entry, a second entry
must be spawned. Any match of a wild NAT entry will spawn a fully qualified
entry. For example, assume the following packet arrives:
Packet 4
To
From
Protocol
128.1.2.12 : 80
64.1.1.100 : 2006
TCP