To further improve the usage of public IP addresses, NAT can also translate the port numbers in IP packets. Port allocation means that a device allocates port numbers to IP packets during NAT.
a NAT device initiates NAT port allocation after receiving the first packet sent by a specific private IP address.
Dynamic port allocation, also called Port Dynamic mode, enables a NAT device to assign a port number each time a session table is created. Dynamic port allocation maximizes the efficiency of public IPv4 address and port usage and is applicable when a few public IPv4 addresses are available. Each time a port is assigned, the NAT device records a log. Therefore, a log server needs to be deployed to save a lot of logs sent by the NAT device. Dynamic port allocation supports port multiplexing. When receiving packets destined for different public IP addresses, a NAT device can map the private IP addresses and port numbers to the same public IP address and port number, which saves public IP addresses.