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.