liveBook · Manning

Port number

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

A port number is a transport-layer identifier that distinguishes application endpoints and concurrent communication sessions on a host.

A port number identifies a TCP or UDP application endpoint and helps distinguish concurrent communication sessions on one host. Dynamic PAT uses this identifier to let many inside hosts share one public IPv4 address. section 9.3.3

Dynamic PAT uses port numbers as follows:

  • The router translates inside local IP addresses and, when necessary, TCP or UDP port numbers. section 9.3.3
  • A unique translated port number distinguishes each simultaneous session sharing an inside global address. section 9.3.3
  • There are 65,536 possible port numbers, although practical capacity depends partly on router memory and other factors. section 9.3.3
  • The router preserves the original port when possible, changes it when already allocated, and keeps the chosen translation for the session. section 9.3.3
  • ICMP has no TCP or UDP ports; translated ICMP messages use the 16-bit Identifier field for a similar tracking role. section 9.3.3

PAT translation table

A router can map 10.0.0.11:44578, 10.0.0.12:33032, and 10.0.0.13:39102 to the same public address, 203.0.113.2, while retaining distinct port numbers for each TCP session. section 9.3.3

R1(config)# interface g0/0
R1(config-if)# ip nat inside
R1(config-if)# interface g0/1
R1(config-if)# ip nat outside
R1(config-if)# exit
R1(config)# access-list 1 permit 10.0.0.0 0.0.0.255
R1(config)# ip nat pool POOL1 192.0.2.1 192.0.2.5 prefix-length 29
R1(config)# ip nat inside source list 1 pool POOL1 overload         #1
#1 Adds the overload keyword to the NAT statement

Configure PAT overload with inside and outside interfaces, an access list for inside addresses, and either a NAT pool or an interface address. section 9.3.3

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Explains port allocation, preservation, collisions, persistence, capacity, and ICMP’s Identifier alternative, then demonstrates Cisco configuration and output.
Examples
Uses shared-address translation tables, NAT pools, PAT overload commands, and ICMP Identifier handling as concrete examples.
What it assumes
Assumes TCP/UDP and NAT terminology while distinguishing ICMP’s Identifier field from transport-layer port numbers.
What you can do after
Diagnose PAT translations by relating inside-local and inside-global addresses to translated TCP/UDP ports and session entries.
How it connects
Connects port numbers with TCP, UDP, dynamic NAT, PAT, IPv4 address sharing, NAT pools, and ICMP identifiers.

Also explained in

Compare how 7 books explain port number →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.