liveBook · Manning

Port number

As explained in Acing the CCNA Exam: Volume 1 Fundamentals and Protocols

A port number is a transport-layer identifier ranging from 0 to 65535 that directs network data to a particular application process on a host.

A port number is a Layer 4 transport identifier from 0 through 65,535. It directs network data to a particular application process on the destination host, not to a physical connector. This distinction matters because one computer can run many networked applications simultaneously. section 4.3.1 section 22.1.1

Figure 22.2 PC1 sends a TCP segment to SRV1. The segment is sourced from port 50000 on PC1 and destined for port 443 on SRV1. SRV1’s reply reverses the ports: it is sourced from port 443 on SRV1 and destined for port 50000 on PC1.

Follow a client request from source port 50000 to destination port 443, then observe how the server reverses the ports in its reply. section 22.1.1

Understand a port number through its role in communication:

  • The destination port identifies the service or application process receiving the message; a server running that service is said to listen on the port. section 4.3.1 section 22.1.1
  • Layer 4 adds the port number in its header before Layer 3 adds the destination IP address and Layer 2 addresses the next hop. section 4.3.2
  • TCP and UDP use ports, and each application-layer protocol commonly uses a particular port, such as HTTP 80, HTTPS 443, DNS 53, and SSH 22. section 22.1.1
  • A connection identifies traffic using source and destination port numbers together with protocol and IP-address information; omitting a port in an ACL allows every port in that position to match. section 24.1.2

Filtering HTTPS with an extended ACL

Cisco IOS can match TCP port 443 to control HTTPS traffic: `permit tcp 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255 eq 443` permits that source network to reach the destination network's HTTPS services. A later `deny tcp any any eq 443` denies other HTTPS traffic, while `permit ip any any` permits remaining IPv4 traffic. Every specified match parameter must match. section 24.1.2

For troubleshooting and exams, separate the jobs clearly: IP addresses deliver data to the destination host, MAC addresses deliver it across each hop, and port numbers deliver it to the correct application process. section 4.4

How Acing the CCNA Exam: Volume 1 Fundamentals and Protocols covers it

How deep it goes
Explains the numeric range, encapsulation, request-reply reversal, common assignments, and extended-ACL matching.
Examples
Uses HTTPS on TCP 443, a client source port 50000, common protocol assignments, and Cisco extended-ACL entries.
What it assumes
Builds from Layer 2 and Layer 3 delivery while distinguishing logical Layer 4 ports from physical device ports.
What you can do after
Apply port matching in Cisco extended ACLs and interpret source and destination ports in client-server exchanges.
How it connects
Connects port numbers with the transport layer, TCP, UDP, IP addresses, application-layer protocols, and extended ACLs.

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 1 Fundamentals and Protocols. The section links point to the parts of the book it draws on.