Week 8 · Lesson 2

The Transport Layer (OSI Layer 4)

Lesson 1 gave you the transport layer’s identity. This lesson pins down its exact duties inside the OSI model, where its header sits during encapsulation, and the canonical port numbers and ranges from the IANA registry that the exam expects you to recall precisely.

CCNA 200-301 Domain 1.0 Network Fundamentals Verified 2026-10-11
Part 1

Position: between application and network

The OSI transport layer sits in the middle of the stack — layer 4 of 7 — directly between the application layers (5–7, which provide the data) and the network layer (3, which forwards it). It is the bridge between “what the user’s program wants” and “what the network can carry”. When engineers debug, they draw a line here: everything above L4 is called upper layers (application-focused), and everything at or below L4 handles delivery details.

Because it sits in this position, the transport layer provides the first host-to-host (end-to-end) service in the model. Each host runs its transport layer; intermediate routers do not. That is what makes the transport header invisible to the network itself and read only by the two endpoints.

End-to-end delivery

Moves data between two applications, identified by source and destination port numbers. TCP and UDP.

Reliability

Receives acknowledgements and retransmits segments that time out. TCP only.

Flow control

Uses the advertised window so the sender cannot overwhelm the receiver. TCP only.

Error detection

A checksum over the header and data; corrupt segments are discarded. TCP and UDP.

Part 2

The four duties of Layer 4

Exam answers about “what does the transport layer do?” must cover these four jobs. Select one to see who provides it.

DutyWhat it doesWho provides it
End-to-end deliveryMoves data between two applications on two hosts, identified by port numbers (source + destination).TCP and UDP
ReliabilityReceives acknowledgements (ACKs); retransmits segments that timeout or are negative-ACKed.TCP only
Flow controlPrevents the sender from overwhelming the receiver by using windows: the receiver advertises how much data it can accept; the sender may send only that much.TCP only (window); UDP does none
Error detectionCalculates a checksum over the header and data; the receiver discards or flags corrupt segments.TCP and UDP (both carry a checksum field)
Note UDP also has an error-detection checksum and carries source/destination ports, but it has none of the recovery machinery: no ACKs, no retransmission, no flow control, no ordering.
Exam tip A multiple-choice question lists transport-layer jobs. The four safe answers: port identification of applications, reliable delivery (via ACK/retransmission), flow control (via windows), and error detection (via checksum). Do not pick “physical addressing” (that is Layer 2) or “routing” (that is Layer 3).
The four duties · select one

Part 3

Encapsulation order (L4 → L3)

During encapsulation the transport layer is the first to add a header to the raw application data:

  1. Application produces data.
  2. Transport adds its header (TCP or UDP) — the result is a segment (TCP) or datagram (UDP).
  3. Network adds its IP header around that — the result is a packet.
  4. Data link adds its Ethernet header and FCS trailer — the result is a frame.

So the transport header always ends up inside the IP header. De-encapsulation is the reverse order: the receiver’s IP layer strips the IP header, then hands the segment to TCP, which strips its header and delivers the data to the application named by the destination port. The L4 header fields (source port, destination port, sequence number, etc.) are read by TCP/UDP in the host’s operating system — never by the routers in between.

Definition — ordering rule L4 header → segment; L3 header added afterward → packet. A segment does not exist outside a host; the moment it is passed to IP it is a packet.
Build it down the stack · step through
What the unit looks like now · select a field

Application data

Part 4

Port ranges (IANA, canonical)

The IANA registry (RFC 6335) divides the 16-bit port space into three ranges. These numbers are non-negotiable on the exam.

RangeNumbersWho uses it
Well-known0–1023System and server services (HTTP 80, HTTPS 443, SSH 22, DNS 53).
Registered1024–49151User applications and vendor services that have registered a port (many games, database servers, web services on >1023).
Dynamic / private49152–65535Ephemeral (temporary) client source ports; not assigned to any service.
Exam tip Three numbers only: 1023, 49151, 49152. Well-known ends at 1023. Registered goes from 1024 up to 49151. Dynamic/private starts at 49152 and ends at 65535 (the top of the 16-bit space). A question like “which range is 443 in?” should be instant: well-known.

Every range boundary is a shared rule, not a security boundary: listening on a well-known port does not make a service more “official” — the ranges are conventions managed by IANA so that when two programs meet, they can agree on the port without asking each other first.

Port range locator · drag the slider

Part 5

The well-known port table

Memorise these IANA service values exactly. The “Protocol” column is what the exam checks: it says whether the service uses TCP, UDP, or both. Select a service to see its port and transport.

Well-known services · select one

ServicePortProtocolNote
FTP data20TCPActive FTP opens a second, data connection to port 20.
FTP control21TCPCommands and replies; the “control” connection.
SSH22TCPSecure shell; encrypted remote access.
Telnet23TCPUnencrypted remote access (never use on the Internet).
SMTP25TCPEmail sending / mail transfer.
DNS53Both TCP & UDPUDP for queries; TCP for zone transfers and large replies.
TFTP69UDP“Trivial” file transfer — no reliability built in.
HTTP80TCPPlain web traffic.
POP3110TCPEmail retrieval (downloads mail to the client).
IMAP4143TCPEmail retrieval (mail stays on the server).
HTTPS443TCPEncrypted web traffic (TLS).
DHCP client68UDPClient’s side of DHCP address assignment.
DHCP server67UDPServer’s side of DHCP; answers broadcasts from 67.
SNMP161UDPNetwork management polling and traps.
NTP123UDPNetwork Time Protocol — time synchronisation.
Exam tip — the classic traps
  • DNS is both TCP and UDP — the honest answer is “both”, not just UDP.
  • DHCP has two ports: server 67, client 68 (both UDP).
  • FTP is two connections: command on 21, data on 20.
  • SNMP is 161 UDP; remote syslog messaging’s legacy port is 514 — do not blur them.
  • TFTP (69) is UDP, FTP (20/21) is TCP — the similarity in name is the whole trick.
  • HTTPS is 443 TCP; HTTP is 80 TCP. Do not swap them.
Part 6

Servers fix their ports; clients go ephemeral

For a client to reach a server, the client must know the server’s port in advance — so the server binds to a well-known port and listens there for the lifetime of the service. The client, by contrast, picks a temporary ephemeral source port for each connection and releases it when the conversation ends. Modern operating systems take ephemeral ports from the dynamic/private range (49152–65535); some older systems and textbooks also allow the registered range down to 1024. What never changes is the principle: the destination port selects the service; the source port identifies the conversation.

Host A 192.168.1.10 (client) Web server 209.165.200.226 (listens on :80) HTTP request dst port = 80 (well-known) src port = 49152 (ephemeral) Client socket (source) 192.168.1.10:49152 Server socket (destination) 209.165.200.226:80 The 4-tuple (src IP, src port, dst IP, dst port) is unique for this conversation.

Trace it: when the server replies, it swaps the pair — the reply uses destination port 49152 (host A’s socket) and source port 80. That is how the server’s reply finds the exact browser tab that asked. Two clients on host A to the same server differ only in source port, so even they remain distinct conversations.

Remember The destination port is famously stable (well-known service), the source port is short-lived (ephemeral). If you see a “client spray” in a packet capture — thousands of requests from high port numbers to port 80 — that is normal multiplexing, not an attack. Lesson 4 discusses the abnormal version (a SYN flood).

Key terms

TermMeaning
Well-known portPort 0–1023, reserved for standard server services.
Registered portPort 1024–49151, for user applications and vendor services.
Dynamic / private portPort 49152–65535, used for ephemeral client source ports.
Ephemeral portA short-lived source port a client picks for one conversation.
4-tuple / socket pairSource IP, source port, destination IP, destination port — uniquely identifies a conversation.
ACK / retransmitTCP’s reliability mechanism: the receiver acknowledges data; unacknowledged data is resent.
WindowThe amount of data a receiver advertises it is ready to accept; the basis of flow control.
Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Sources

Sources & references

  1. Cotton, M., Eggert, L., Touch, J., Westerlund, M. & Cheshire, S. RFC 6335: IANA Procedures for the Management of the Service Name and Transport Protocol Port Number Registry (2011), Sections 8.1–8.3 (port ranges). rfc-editor.org/rfc/rfc6335.
  2. IANA. Service Name and Transport Protocol Port Number Registry. iana.org.
  3. Postel, J. RFC 793: Transmission Control Protocol (1981), Section 1.3 (the four TCP header ports are among the fields defined). rfc-editor.org/rfc/rfc793.
  4. Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989). rfc-editor.org/rfc/rfc1122.
  5. Cisco. CCNA (200-301) Exam Topics, Network Fundamentals (transport and application-layer well-known ports). cisco.com.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.