OSI Model - Transport Layer
The transport layer is where the network stops thinking about wires and starts thinking about conversations between programs. It breaks application data into pieces, tags each piece with port numbers, decides whether reliability is needed, and puts the pieces back together at the far end. This lesson introduces it; Week 8 goes deep.
The role of the transport layer
The transport layer is Layer 4 of the OSI model. It delivers data between application processes running on different hosts. Where the network layer worries about which host should receive a packet, the transport layer worries about which program on that host should receive it — and how the data should be carried.
Segmentation
Split a large message into segments and rebuild it at the receiver.
Application identification
Use port numbers to deliver each segment to the correct program.
Reliability (optional)
Detect loss and reorder data when the chosen protocol demands it.
Flow control (optional)
Prevent a fast sender from overwhelming a slow receiver.
Note the phrase end-to-end. The transport layer runs on the two communicating hosts, not on the routers in between; the devices in the middle only need to look as high as the network layer. That is what makes the transport layer a matter between the endpoints.
Segmentation and reassembly
Applications can produce data far larger than any single network frame can carry. The transport layer chops that data into segments (for TCP) or datagrams (for UDP), each small enough to travel through the network. Each piece is numbered so the receiver can put them back in the right order — even if they arrive out of order.
Reassembly is the reverse at the destination: collect the pieces, order them, and hand the original data up to the application. This is why a large download can complete even though no single network packet carried the whole file.
Port numbers and multiplexing
A host runs many programs at once: a browser, a mail client, a game, a file transfer. When segments arrive, the transport layer must know which program each belongs to. It does this with port numbers — a 16-bit number (0–65535) identifying an application endpoint.
- The source port identifies the sending application (often an ephemeral port chosen by the host).
- The destination port identifies the receiving service (often a well-known port chosen by the protocol).
A socket is the pairing of an IP address and a port number, for example 192.0.2.10:443. A conversation is uniquely identified by the source socket and the destination socket together, which is how one server can serve thousands of clients at the same time. Sharing one connection among many applications this way is called multiplexing.
Port ranges (IANA)
The Internet Assigned Numbers Authority (IANA) divides the 16-bit port space into three ranges:
| Range | Name | Use |
|---|---|---|
| 0–1023 | Well-known ports | Assigned to standard services (for example HTTP, DNS, SSH). Usually require privileges to bind. |
| 1024–49151 | Registered ports | Assigned by IANA to specific, often vendor, applications on request. |
| 49152–65535 | Dynamic / private (ephemeral) ports | Used automatically by clients as temporary source ports for a connection. |
Common well-known ports
These are the values you are expected to know. All are correct well-known assignments from the IANA registry.
| Service | Port | Transport |
|---|---|---|
| FTP (data) | 20 | TCP |
| FTP (control) | 21 | TCP |
| SSH | 22 | TCP |
| Telnet | 23 | TCP |
| SMTP | 25 | TCP |
| DNS | 53 | UDP/TCP |
| DHCP (server / client) | 67 / 68 | UDP |
| HTTP | 80 | TCP |
| POP3 | 110 | TCP |
| IMAP4 | 143 | TCP |
| HTTPS | 443 | TCP |
21 for control commands and 20 for the actual data transfer. DHCP uses 67 on the server and 68 on the client.TCP vs UDP
The transport layer offers two principal protocols, with opposite design goals: TCP for reliability, UDP for speed and simplicity.
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented (handshake first) | Connectionless (just send) |
| Reliability | Reliable — acknowledgements and retransmission | Best-effort — no guarantee of delivery |
| Ordering | Data reassembled in the original order | No ordering guarantee |
| Flow control | Yes — protects a slow receiver | No |
| Overhead | Higher (larger header, more state) | Lower (small header, stateless) |
| Typical use | Web, email, file transfer, remote access | DNS queries, DHCP, TFTP, streaming, voice/video |
The trade-off is simple to state: TCP spends bandwidth and time to guarantee that the data arrives complete and in order, while UDP sends datagrams and moves on, leaving any reliability to the application. Choose TCP when correctness matters more than latency; choose UDP when low delay matters more than the occasional lost packet.
Review
Check what you have learned with these review questions.
Key terms
- Transport layer — Layer 4 of OSI; provides end-to-end delivery between applications.
- Segment — a Layer 4 data unit when TCP is used.
- Datagram — a Layer 4 data unit when UDP is used.
- Port number — a 16-bit number (0–65535) identifying an application endpoint.
- Socket — an IP address paired with a port number.
- Multiplexing — using port numbers to carry many applications over one host connection.
- Ephemeral port — a temporary source port from the dynamic range (49152–65535).
- TCP — Transmission Control Protocol; connection-oriented and reliable.
- UDP — User Datagram Protocol; connectionless and best-effort.
Sources: RFC 1122 (Requirements for Internet Hosts — Communication Layers); the IANA Service Name and Transport Protocol Port Number Registry; ISO/IEC 7498-1; Cisco CCNA 200-301 exam topics.
Sources & references
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989), which defines TCP and UDP and the transport-layer requirements. rfc-editor.org/rfc/rfc1122.
- IANA. Service Name and Transport Protocol Port Number Registry (well-known, registered, and dynamic port ranges; per-service port assignments). iana.org.
- ISO/IEC 7498-1. Information technology — Open Systems Interconnection — Basic Reference Model, which describes the transport layer. iso.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.