1.5 Compare how TCP and UDP behave
CCNA 200-301 v1.1 · 1.0 Network Fundamentals
TCP and UDP both carry application data between ports on two hosts. TCP is connection-oriented and reliable: it sets up a session, numbers every byte, acknowledges and retransmits, and slows down when the network is busy. UDP just sends datagrams with no setup and no guarantees, which suits voice, video, DNS and anything that prefers speed to completeness.
What you must know
- Compare TCP and UDP: connection, reliability, ordering, flow control, header size.
- Describe the three-way handshake and the four-way close.
- Explain sequence numbers, acknowledgements and windowing.
- Name common well-known ports and their transport.
Side by side
| TCP | UDP | |
|---|---|---|
| Connection | Three-way handshake first | None |
| Reliability | Acknowledgements and retransmission | None |
| Ordering | Sequence numbers reorder data | None |
| Flow control | Sliding window | None |
| Header | 20 bytes (minimum) | 8 bytes |
| Used by | HTTP/HTTPS, SSH, Telnet, FTP, SMTP, BGP | DNS queries, DHCP, TFTP, SNMP, syslog, NTP, voice and video (RTP) |
Setting up and closing a TCP session
- SYN: the client picks a random sequence number and asks to connect to the server's port.
- SYN-ACK: the server acknowledges it and sends its own sequence number.
- ACK: the client acknowledges; data can flow both ways.
The handshake (1) agrees on starting sequence numbers and window sizes. Closing uses FIN and ACK in each direction (four segments), or RST to abort. The window says how many bytes may be sent before waiting for an acknowledgement; the receiver shrinks it when it is overwhelmed and TCP backs off when packets are lost.
Ports
| Port | Transport | Application |
|---|---|---|
| 20, 21 | TCP | FTP data, control |
| 22 | TCP | SSH |
| 23 | TCP | Telnet |
| 25 | TCP | SMTP |
| 53 | UDP (TCP) | DNS |
| 67, 68 | UDP | DHCP server, client |
| 69 | UDP | TFTP |
| 80, 443 | TCP | HTTP, HTTPS |
| 123 | UDP | NTP |
| 161, 162 | UDP | SNMP, SNMP traps |
| 514 | UDP | Syslog |
Commands
netstat -an | On a host: open TCP connections and listening ports. |
show tcp brief | On IOS: the device's own TCP sessions (SSH, BGP). |
show control-plane host open-ports | Ports IOS is listening on. |
Exam traps
- UDP has no handshake and no acknowledgements; applications that need reliability over UDP build their own.
- Voice and video prefer UDP: a late packet is useless, so retransmitting it does not help.
- DNS queries use UDP 53; zone transfers and large answers use TCP 53.
- The client uses a random high source port (49152 and above); the server listens on the well-known port.
Check yourself
- Which segments open a TCP session?
- SYN, SYN-ACK, ACK.
- Why does VoIP use UDP?
- Low overhead and no retransmission delay: a lost voice packet is better skipped than resent late.
- What does the TCP window size control?
- How many bytes the sender may transmit before it must wait for an acknowledgement.
More topics in 1.0 Network Fundamentals
- 1.1 Explain what each kind of network component does
- 1.2 Describe common network topology designs
- 1.3 Compare cabling and physical interface types
- 1.7 Describe private IPv4 address space
- 1.8 Configure and verify IPv6 addresses and prefixes
- 1.9 Describe the IPv6 address types
- 1.10 Verify IP settings on Windows, macOS and Linux clients
- 1.11 Describe wireless fundamentals
- 1.12 Explain virtual machines, containers and VRFs
- 1.13 Describe how a switch forwards frames