Home / Network / NAT / P-NAT / How is it NAT-friendly your Transit Network?

How is it NAT-friendly your Transit Network?

Networks (and applications) are getting more and more global and the usage of NAT is inevitable. To run application efficiently such global networks (that are built over internet) should be NAT-friendly, which means aware of NAT operation!

In this post, we’ll review the general idea behind NAT operation and how it could affect positively (friendly) or negatively (unfriendly) the performance of our network services on the cloud.

First of all, what NAT Stands for

NAT stands for network address translation which means that to join a destination, a source will use at least two addresses (IP): one to the NATter (the device that will do this translation, firewall, router, application gateway, etc.) and another one from the NATter to the destination. This helps resolve many routing issues, IP address space starvation, management, add more security by hidden the original IP information…

NAT and P-NAT

Ideally, the NATter (application) would map each “inside” address (that is towards the NATted source) to an “outside” or “global” address (that is towards the destination) in a one to one fashion. But, it is possible to overload the outside interface of the NATter by mapping inside addresses to application ports (TCP or UPD); many inside address could be mapped to one global address and many ports. In this case the NATter is called P-NATter (P for port).

Hierarchical NATting

Things could get more complicated in case at least two NATters exist in the transit path from the source to the destination. Let’s see what happens in those scenarios: 1) two NATters, 2) one NATter and one P-NATter, 3) two P-NATters.

Session ports usage

In the case where the traffic goes through two P-NATters, the first P-NATter creates an entry in its translation table mapping the inside IP address to the overlapping outside IP address and adds a distinguisher that is a port number. This port information should be sent in the packet (from the source) so that the destination returns it to the correct source port (the outside interface is acting as an application server).

When the second P-NATter receives the firstly P-NATted packet (with the first outside global address and source port TCP or UDP), would it keep the same in its translation table? or use another one? the answer to this question may depend also on where was firstly stored this packet source port information and how… but as for now, only source and destination ports in the in the TCP/UDP headers are altered.

Application ports information

From an upper-layer point of view, the application have specific service ports that it passes to TCP and UDP (FTP application for example may use multiple TCP sessions) and that shouldn’t be altered (the service may break). How to store this information? in the payload? and reserve the header port fields for NAT (to ensure network continuity)? or at NATer level in its translation table?

Translation table size

Let’s note also that the translation tables (of all NAT nodes in the path) are of limited size. What happens if no port is available for the next translation? is there any mechanisms to hint on the end of a session? Yes, in TCP thanks to FIN and SYN packets, we may know when to drop a session. But it is another story using UDP…

As a summary

How NAT friendly is your network depends on two things : how your network is configured but also on you application behavior.

Leave a Reply

  • Transmit Power Control in IEEE 802.11 Cisco WLAN networks
    TPC stands for Transmit Power Control. It’s a one of Cisco RRM, Radio Resources Management, techniques that are aimed at tackling interference, cross and co-channel, in Wlan networks. RRM: TPC, CHD and DCA It works tightly with CHD, Covergate Hole Detection, to optimize transmit power. TPC tends to minimize the transmit power and CHD to eliminate
  • 10 security measures against 10 attacks in a LAN network – Part I
    An Ethernet switch is the central element of a LAN network and operates at data link OSI layer. Every switch port defines a collision domain and can extend a broadcast or broadcast frame domain that is stopped by a router routed interface that operates at network OSI layer. By default switches support one broadcast domain
  • Understand how Aruba ARMizes your WLAN for sure!
    Presenting ARM In this post, that is a part of a serie of post that discuss how Wlan to radio ressources management, we talk of Aruba way of doing it. The figure shows a simple wlan network of 6 AP or access points. This is heatmap showing that radio signal is very strong (in red)
  • Understand RIP Routing Timers All in One Shot!
    This post is part of a series of posts about dynamic routing protocols and especially RIP. We’ll try to get a deep understanding of its operation and function as an introductory to dynamic routing logic in general. You’ll see that what we think easy may hide an incrementing complexity… a little introduction Berfore we start
  • DUAL route FSM Processing of EIGRP Queries
    This blog is a part of series of posts about EIGRP routing protocol. Let’s recall that EIGRP is one of the so called IGP routing protocols. IGP stands for interior routing protocols as opposed to EGP or exterior routing protocols. In addition EIGRP is a hybrid as it borrows some similiarities to distance-vector and link-state
August 2025
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
Table of Contents