k, e.g., the open Internet. When an application running on host A starts sending packets to host B, the source address and port address (i.e., the internal transport address) are replaced by an exter- nal network address, possibly being assigned to one of the interfaces of the NAT, and an external port, which constitute the external transport address. The NAT stored the binding between the internal transport address and the external one in an internal binding table. When host B receives the packets, it believes that the sender has the external network address A1, which it uses in its replies. The packets sent by host B are received by the NAT, which looks for the target network address and port in its binding table. By doing this, the NAT discovers that this packet is targeted to a specific internal trans- port address. The NAT rewrites the destination network address and port of the packets and then forwards them in the internal network SO that they can reach the proper application running on host A. One widespread application scenario for NAT is when the internal network is deploying private addresses. NATs can be categorized based on their mapping behavior. The network scenario in Figure 12.2 is deployed in the following to introduce the possi- ble mapping behaviors of a NAT: host A is behind NAT A, which maps the internal transport address (A:a) on the external transport address (A1:a1) when packets are sent to host B, and to the external transport address (A2:a2) when packets are sent to host C. If (A1:a1) and (A2:a2) are the same external transport address, the NAT implements an endpoint independent mapping behavior. On the contrary if (A1:a1) differs from (A2:a2), but (A1:a1) does not change when sending pack- ets to different ports of host B, an address dependent mapping behavior is adopted; if changing the target port on B(A1:a1) changes, an address and port dependent mapping behavior is used. The requirement established in RFC 4787 says that an application-friendly NAT must have an endpoint independent 