TCP vs UDP: The Complete Transport Layer Guide for CCNA Students

By Zack M. | IT Cert Bound  •  February 15, 2026  •  25 min read  •  CCNA 200-301

Table of Contents

Understanding the Transport Layer is one of the most tested areas on the CCNA 200-301 exam. This guide breaks down TCP and UDP from the ground up — covering headers, port numbers, flow control, and real-world application selection. By the end of this article you will be able to confidently answer any exam question about Layer 4 behavior.

1. Why the Transport Layer Matters

The OSI model divides networking functions into seven layers, each with a specific job. Layer 3 — the Network Layer — is responsible for getting packets from one network to another by routing them based on IP addresses. But routing alone is not enough. When a packet arrives at a destination host, the operating system needs to know which application should receive that data. That is the job of Layer 4, the Transport Layer.

The Transport Layer is responsible for end-to-end communication between applications running on different hosts. It provides process-to-process delivery using port numbers to identify which application on the destination host should receive incoming data. Think of an IP address as a street address for a building, and a port number as the specific apartment number inside that building. The IP address gets the packet to the right machine; the port number gets the data to the right application running on that machine.

Layer 4 Core Responsibilities

Multiplexing / Demultiplexing: Multiple applications can communicate simultaneously over a single network connection using different port numbers.

Segmentation: Large data streams from applications are broken into smaller units called segments (TCP) or datagrams (UDP).

Connection Management: TCP establishes, maintains, and terminates logical connections between applications.

Reliability (TCP only): Ensuring all segments arrive, are in order, and are error-free through sequencing and acknowledgment.

Flow Control (TCP only): Preventing a fast sender from overwhelming a slow receiver.

The two dominant Transport Layer protocols you must know for the CCNA are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). These two protocols represent a fundamental design trade-off in networking: reliability versus speed. TCP provides a reliable, ordered, error-checked connection-oriented service. UDP provides a best-effort, connectionless, low-overhead service. Neither is universally better — the right choice depends entirely on what the application needs.

Key Point: Layer 4 vs Layer 3

Layer 3 (IP) provides host-to-host delivery. It gets a packet from one IP address to another. Layer 4 (TCP/UDP) provides process-to-process delivery. It ensures that data reaches the correct application process on the destination host. Without Layer 4, you could communicate between machines but not between specific applications running on those machines. Both layers are essential and work together for complete communication.

Both TCP and UDP are defined in RFCs published by the IETF. TCP is defined in RFC 793 (originally) and updated by RFC 9293. UDP is defined in RFC 768. Both protocols operate at Layer 4 of the OSI model and Layer 4 of the TCP/IP model. On the CCNA exam, you will be expected to know the characteristics of each protocol, their header fields, the port numbers associated with common applications, and how to select the appropriate protocol for a given scenario.

2. TCP: Connection-Oriented Reliability

TCP is a connection-oriented protocol, meaning that before any application data is exchanged, TCP requires that a connection be formally established between the two communicating endpoints. This connection is not a physical circuit but a logical agreement between the two parties that both are ready to communicate and have agreed on initial parameters such as sequence numbers.

The Three-Way Handshake

TCP establishes connections using a process called the three-way handshake. This process uses three messages: SYN, SYN-ACK, and ACK. Understanding each step is critical for the CCNA exam.

TCP Three-Way Handshake Client (Initiator) Server (Listener) | | | 1. SYN (Seq=100, Flags: SYN) | |------------------------------------->| | "I want to connect. | | My starting sequence# is 100" | | | | 2. SYN-ACK (Seq=300, Ack=101) | |<-------------------------------------| | "OK, I accept. My starting | | seq# is 300. I expect your | | next byte to be #101" | | | | 3. ACK (Seq=101, Ack=301) | |------------------------------------->| | "Acknowledged. I expect your | | next byte to be #301" | | | | [Connection Established] | | [Data Transfer Begins] | | |

Step 1 — SYN (Synchronize): The client sends a TCP segment with the SYN flag set. This segment includes the client's Initial Sequence Number (ISN), which is randomly chosen. The random ISN is a security measure to prevent TCP sequence number prediction attacks. In this example, the client chooses ISN=100.

Step 2 — SYN-ACK (Synchronize-Acknowledge): The server responds with a segment that has both the SYN and ACK flags set. The server acknowledges the client's SYN by setting the Acknowledgment Number to the client's ISN + 1 (101), meaning "I received byte 100, now send me byte 101." The server also announces its own ISN (300 in this example).

Step 3 — ACK (Acknowledge): The client acknowledges the server's SYN by setting the ACK flag and Acknowledgment Number to 301 (server's ISN + 1). The connection is now fully established and data transfer can begin.

Exam Tip: SYN Flood Attack

The CCNA exam may reference SYN flood attacks. In a SYN flood, an attacker sends many SYN packets with spoofed source IPs. The server allocates resources and sends SYN-ACK responses, but since the source IPs are fake, no ACK is ever returned. The server's connection table fills up and legitimate connections are refused. This is a Denial-of-Service (DoS) attack. Modern mitigation includes SYN cookies, which allow servers to avoid allocating state until the three-way handshake completes.

The Four-Way Connection Teardown

TCP connections are terminated gracefully using a four-way process. Either side can initiate the teardown. Each side must independently close its end of the connection, which is why it takes four messages instead of two.

TCP Four-Way Connection Teardown Client Server | | | 1. FIN (Seq=500, Flags: FIN,ACK) | |------------------------------------>| | "I'm done sending data." | | | | 2. ACK (Ack=501) | |<------------------------------------| | "Got it. But I might still | | have data to send you..." | | | | [Server finishes sending] | | | | 3. FIN (Seq=700, Flags: FIN,ACK) | |<------------------------------------| | "OK, I'm done sending too." | | | | 4. ACK (Ack=701) | |------------------------------------>| | "Acknowledged. Goodbye." | | | | [Connection Closed] | | (Client waits in TIME-WAIT) | | |

After step 4, the client enters a TIME-WAIT state for 2x the Maximum Segment Lifetime (typically 60-120 seconds). This ensures the final ACK was received and prevents old duplicate packets from being mistaken for new connections.

Reliability Through Sequencing and Acknowledgment

TCP's reliability mechanism is built on sequence numbers and acknowledgment numbers. Every byte of data transmitted is assigned a sequence number. The receiver tracks which bytes have been received and sends acknowledgments telling the sender which byte it expects next. If a segment is lost, the sender detects the loss (because the acknowledgment for that sequence range never arrives) and retransmits the missing segment.

TCP uses a cumulative acknowledgment scheme. If segments 1, 2, and 3 are sent but only segments 1 and 3 arrive, the receiver sends ACK=2, indicating it expects segment 2 next. Modern TCP also supports Selective Acknowledgment (SACK), which allows the receiver to inform the sender exactly which segments were received, even if they are out of order, enabling more efficient retransmission.

Real-World Analogy: Registered Mail

Think of TCP as sending a registered letter with signature confirmation through a postal service. Before the letter leaves, you establish that both sender and recipient are ready. Every package is numbered in order. If a package is lost, the postal service tracks it and resends it. The recipient must sign for each delivery, confirming receipt. You never wonder if your letter arrived — you receive confirmation. This reliability has overhead: it takes more time and resources than simply dropping something in a mailbox, but you have complete assurance of delivery.

TCP Key Characteristics Summary

Connection-oriented: Three-way handshake before data transfer

Reliable: Sequencing and acknowledgment ensure all data arrives

Ordered delivery: Data is reassembled in the correct sequence

Error detection: Checksum on every segment

Retransmission: Lost segments are automatically resent

Flow control: Sliding window prevents buffer overflow

Congestion control: Slow start and congestion avoidance algorithms

Full-duplex: Both sides can send and receive simultaneously

3. UDP: Connectionless Speed

UDP is a connectionless protocol. Unlike TCP, UDP does not establish a connection before sending data. There is no handshake, no session setup, and no formal teardown. The sender simply formats a datagram and sends it to the destination. Whether the datagram arrives is irrelevant to the UDP protocol itself — that concern is either handled by the application layer or simply not handled at all.

Best-Effort Delivery

UDP provides best-effort delivery. This means:

Low Overhead and Minimal Latency

The absence of all these reliability features is not simply a deficiency — it is a deliberate design choice that yields significant advantages. UDP's header is only 8 bytes compared to TCP's minimum 20 bytes. There is no connection setup delay, meaning the first datagram can be sent immediately. There is no waiting for acknowledgments before sending the next packet. The cumulative result is dramatically lower latency and higher throughput for applications that can tolerate some data loss.

Key Point: Application-Level Reliability

Just because UDP itself provides no reliability does not mean applications using UDP are inherently unreliable. Many applications implement their own reliability mechanisms on top of UDP when needed. For example, QUIC (used by HTTP/3) is built on UDP but implements its own ordering, loss detection, and retransmission mechanisms. DNS implements its own timeout and retry logic at the application layer. This gives application developers complete control over what reliability mechanisms to use, rather than being forced to accept TCP's all-or-nothing approach.

Real-World Analogy: Radio Broadcast

UDP is like a radio broadcast. The radio station transmits its signal without knowing who is listening or whether anyone receives it clearly. If you are in a tunnel and miss part of a song, the station does not replay those seconds just for you. Everyone listening either receives the transmission or they do not. This makes radio broadcasts extremely efficient — one transmission reaches millions of listeners simultaneously — but it also means there is no guarantee of reception. This model is perfect for real-time streaming where replaying old data would be worse than simply moving on.

Primary Use Cases for UDP

UDP is the right choice when one or more of the following conditions apply:

Exam Tip: Know Which Applications Use UDP

The CCNA exam frequently tests whether you know which protocol specific applications use. The key UDP applications to memorize are: DNS (53), DHCP (67/68), TFTP (69), NTP (123), SNMP (161), SNMP Trap (162), Syslog (514), VoIP/RTP (various), and video streaming. Remember: anything real-time or broadcast-based typically uses UDP. Anything that requires guaranteed delivery (web browsing, email, file transfer) uses TCP.

4. TCP Header Fields Explained

The TCP header is a minimum of 20 bytes long (without options) and contains all the control information TCP needs to provide its reliable, ordered, connection-oriented service. Understanding each field helps you understand why TCP works the way it does.

TCP Header Structure (Minimum 20 bytes) 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | 4 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | 4 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Acknowledgment Number | 4 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | |U|A|P|R|S|F| | | Offset| Reserved |R|C|S|S|Y|I| Window Size | 4 bytes | | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | 4 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options (if Data Offset > 5) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Field Size Description
Source Port16 bitsPort number of the sending application. For clients, typically a dynamic/ephemeral port (49152-65535).
Destination Port16 bitsPort number of the receiving application. For servers, typically a well-known port (e.g., 80 for HTTP, 443 for HTTPS).
Sequence Number32 bitsIdentifies the byte offset of the first byte of data in this segment. Used for ordering and acknowledgment.
Acknowledgment Number32 bitsThe next sequence number the sender of this segment expects to receive. Only valid when the ACK flag is set.
Data Offset (Header Length)4 bitsSpecifies the size of the TCP header in 32-bit words, indicating where data begins. Minimum value is 5 (20 bytes).
Reserved6 bitsReserved for future use; must be zero.
URG Flag1 bitUrgent: Indicates the Urgent Pointer field is significant. Marks data as urgent.
ACK Flag1 bitAcknowledge: Indicates the Acknowledgment Number field is valid. Set in all segments except the initial SYN.
PSH Flag1 bitPush: Tells the receiver to pass data to the application immediately without waiting to fill a buffer.
RST Flag1 bitReset: Abruptly terminates a connection. Used when an error occurs or an unexpected packet arrives.
SYN Flag1 bitSynchronize: Used during connection establishment to synchronize sequence numbers.
FIN Flag1 bitFinish: Indicates the sender has finished sending data and wishes to close the connection.
Window Size16 bitsThe number of bytes the receiver is willing to accept before requiring an acknowledgment. Used for flow control.
Checksum16 bitsError-detection field covering the TCP header and data, plus a pseudo-header from the IP layer.
Urgent Pointer16 bitsPoints to the end of urgent data in the segment. Only valid when URG flag is set.
Options0-320 bitsVariable-length options such as Maximum Segment Size (MSS), Window Scale, SACK, and timestamps.

Mnemonic: TCP Control Flags — "Unskilled Attackers Pester Real Security Folk"

To remember the six original TCP control flags in order:

Unskilled = URG (Urgent)

Attackers = ACK (Acknowledge)

Pester = PSH (Push)

Real = RST (Reset)

Security = SYN (Synchronize)

Folk = FIN (Finish)

5. UDP Header Fields Explained

UDP's header is remarkably simple — only 8 bytes total, compared to TCP's minimum 20 bytes. This simplicity is a direct result of UDP not providing reliability, ordering, connection management, or flow control. There are only four fields, each 16 bits wide.

UDP Header Structure (Fixed 8 bytes) 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | 4 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Checksum | 4 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Total header overhead: 8 bytes (vs TCP's minimum 20 bytes) No sequence numbers, no acknowledgments, no window size, no flags
Field Size Description
Source Port16 bitsPort number of the sending application. Optional in UDP — may be set to zero if not used.
Destination Port16 bitsPort number of the receiving application. This is how the OS knows which application gets the datagram.
Length16 bitsTotal length of the UDP header plus data in bytes. Minimum value is 8 (header only, no data).
Checksum16 bitsError detection over the UDP header and data. Optional in IPv4 (but recommended), mandatory in IPv6.

UDP vs TCP Header Overhead Comparison

UDP header: 8 bytes fixed — Source Port (2), Destination Port (2), Length (2), Checksum (2)

TCP header: 20-60 bytes — Source Port (2), Destination Port (2), Sequence Number (4), Acknowledgment Number (4), Header Length (1), Flags (1+), Window Size (2), Checksum (2), Urgent Pointer (2), Options (0-40)

Savings per datagram: At minimum 12 bytes per packet. For small DNS queries of 50 bytes total payload, that is a 24% reduction in overhead per packet.

No connection state: TCP requires both endpoints to maintain state tables for each connection. UDP requires zero state at the transport layer.

The UDP checksum is computed over a "pseudo-header" that includes source IP, destination IP, protocol number, and UDP length — similar to TCP. In IPv4, the checksum is technically optional (a value of zero means no checksum), though virtually all modern implementations compute it. In IPv6, the UDP checksum is mandatory because IPv6 removed the header checksum from the IP header itself.

6. Port Numbers: Identifying Applications

Port numbers are 16-bit integers ranging from 0 to 65535. They are the mechanism by which TCP and UDP enable multiple applications to share a single network connection simultaneously. The combination of an IP address and a port number is called a socket. A TCP connection is uniquely identified by a four-tuple: (Source IP, Source Port, Destination IP, Destination Port).

Port Number Ranges

Range Name Description
0 – 1023Well-Known PortsReserved for common, standardized services. Assigned and maintained by IANA. Servers listen on these ports. Requires root/administrator privileges to bind on most systems.
1024 – 49151Registered PortsRegistered by vendors for specific applications. Less strictly controlled than well-known ports. Examples: 3389 (RDP), 8080 (HTTP alternate), 3306 (MySQL).
49152 – 65535Dynamic / Ephemeral PortsRandomly assigned by the OS to client applications when they initiate a connection. Also called private or temporary ports. After the connection closes, the port is returned to the available pool.

Essential Port Numbers for the CCNA Exam

Port Protocol Service Notes
20TCPFTP DataActive mode FTP data channel. The actual file data travels on this port.
21TCPFTP ControlFTP command and control channel. Login, directory listing commands go here.
22TCPSSHSecure Shell — encrypted remote management. Replaced Telnet for secure access.
23TCPTelnetUnencrypted remote management. Deprecated for security reasons; avoid in production.
25TCPSMTPSimple Mail Transfer Protocol — sends email between mail servers.
53TCP & UDPDNSUDP for standard queries (<512 bytes). TCP for zone transfers and large responses (>512 bytes).
67UDPDHCP ServerDHCP server listens on this port to receive client requests.
68UDPDHCP ClientDHCP client listens on this port to receive server offers and acknowledgments.
69UDPTFTPTrivial File Transfer Protocol — simple file transfer, no authentication. Used for IOS images, configs.
80TCPHTTPHypertext Transfer Protocol — unencrypted web traffic.
110TCPPOP3Post Office Protocol v3 — downloads email from server to client.
123UDPNTPNetwork Time Protocol — synchronizes clocks. Uses UDP because dropped packets are tolerable.
143TCPIMAPInternet Message Access Protocol — manages email on the server; keeps mail server-side.
161UDPSNMPSimple Network Management Protocol — manager polls agents for device statistics.
162UDPSNMP TrapAgent sends unsolicited notifications (traps) to the manager when events occur.
179TCPBGPBorder Gateway Protocol — routing protocol between autonomous systems. Uses TCP for reliability.
443TCPHTTPSHTTP over TLS/SSL — encrypted web traffic. Default for modern web browsing.
514UDPSyslogSystem logging protocol — sends log messages to a central syslog server.
3389TCPRDPRemote Desktop Protocol — Microsoft's graphical remote access protocol.
8080TCPHTTP AlternateAlternative HTTP port, commonly used for web proxies and development servers.

Exam Tip: DNS Uses Both TCP and UDP on Port 53

One of the most common trick questions on the CCNA exam involves DNS port 53. DNS uses both TCP and UDP on port 53. UDP port 53 is used for standard DNS queries where the response is small enough to fit in a single packet (under 512 bytes, or up to 4096 bytes with EDNS0). TCP port 53 is used for DNS zone transfers (AXFR) — when an authoritative server replicates its entire zone database to a secondary server — and for any DNS response that exceeds the UDP size limit. Never answer "DNS uses only UDP" — it uses both.

Key Point: How the OS Uses Port Numbers

When a packet arrives at a host, the OS examines the destination port number to determine which application should receive it. The OS maintains a table of active sockets — combinations of IP address, port, and protocol — and delivers incoming data to the correct application process. When you open a web browser and make two separate HTTP requests to the same server, the OS keeps them separate using different ephemeral source port numbers (e.g., 50234 and 50235), even though both connect to destination port 80.

7. TCP Flow Control and Windowing

TCP's flow control mechanism prevents a fast sender from overwhelming a slow receiver. If a sender transmits data faster than the receiver can process it, the receiver's buffer fills up and data is dropped — causing retransmissions that waste bandwidth and increase latency. TCP's solution is the sliding window mechanism.

The Receive Window

Every TCP segment includes a Window Size field in its header. This field is set by the receiver to advertise how many bytes the receiver is willing to accept before requiring an acknowledgment. This is called the receive window (or rwnd). The sender must not transmit more unacknowledged data than the receiver's advertised window size.

TCP Sliding Window Mechanism Sender Receiver | | | Window Size = 3000 bytes | | (receiver can buffer up to 3000) | | | | ---[Seg 1: bytes 1-1000]------> | | ---[Seg 2: bytes 1001-2000]----> | | ---[Seg 3: bytes 2001-3000]----> | | | | (Wait — window is now full) | | | | <---[ACK=3001, Win=3000]--- | | | | ---[Seg 4: bytes 3001-4000]----> | | ---[Seg 5: bytes 4001-5000]----> | | ---[Seg 6: bytes 5001-6000]----> | | | | (Receiver buffer filling up) | | <---[ACK=6001, Win=1500]--- | | (Receiver says: slow down!) | | | | ---[Seg 7: bytes 6001-7000]----> | | ---[Seg 8: bytes 7001-7500]----> | | (Only 1500 bytes sent, window | | is now full again) | | | | <---[ACK=7501, Win=3000]--- | | (Receiver caught up, open window)| | |

The window "slides" forward as the receiver acknowledges data. As the sender gets ACKs, it can send new segments to keep the pipeline full. The window size dynamically adjusts throughout the connection based on the receiver's current buffer availability.

TCP Slow Start

When a TCP connection first starts, the sender does not immediately use the full window size. Instead, TCP implements a slow start algorithm to avoid congesting the network. The sender begins with a small congestion window (cwnd) — typically 1 to 10 Maximum Segment Sizes (MSS) — and doubles it with each round-trip time (RTT) as long as no packet loss is detected.

TCP Congestion Control: Slow Start Round Trip 1: cwnd = 1 MSS -- Send 1 segment Round Trip 2: cwnd = 2 MSS -- Send 2 segments (doubled) Round Trip 3: cwnd = 4 MSS -- Send 4 segments (doubled) Round Trip 4: cwnd = 8 MSS -- Send 8 segments (doubled) Round Trip 5: cwnd = 16 MSS -- Reached ssthresh (slow start threshold) Above ssthresh: Congestion Avoidance begins Round Trip 6: cwnd = 17 MSS -- Linear increase (+1 per RTT) Round Trip 7: cwnd = 18 MSS Round Trip 8: cwnd = 19 MSS ... Packet Loss Detected! cwnd reset to 1, ssthresh = cwnd/2, slow start begins again

Window Scaling

The TCP Window Size field is only 16 bits, limiting the window to a maximum of 65,535 bytes. On high-speed networks (gigabit and above) or long-latency connections (satellite links), this limitation becomes a bottleneck. The Window Scale option (RFC 7323) allows the window size to be scaled up by a factor of 2^n (up to 2^14), enabling window sizes up to about 1 gigabyte. The Window Scale option is negotiated during the three-way handshake.

Flow Control vs Congestion Control

Flow Control: Prevents the sender from overwhelming the receiver. The receiver advertises its buffer capacity using the Window Size field. This is an end-to-end mechanism between the two communicating hosts.

Congestion Control: Prevents the sender from overwhelming the network (routers and links between sender and receiver). Uses algorithms like Slow Start, Congestion Avoidance, Fast Retransmit, and Fast Recovery. This is based on the sender detecting packet loss as a signal of network congestion.

Both mechanisms work simultaneously. The sender's effective transmission rate is limited to the minimum of the receive window and the congestion window.

8. Choosing TCP vs UDP: The Decision Guide

Selecting the right transport protocol is a fundamental networking design decision. The choice directly impacts application performance, reliability, and complexity. Here is a comprehensive comparison followed by specific application examples with reasoning.

Characteristic TCP UDP
Connection SetupRequired (3-way handshake)None — send immediately
ReliabilityGuaranteed delivery of all dataBest-effort, no guarantee
OrderingSegments delivered in orderMay arrive out of order
RetransmissionAutomatic retransmission of lost segmentsNo retransmission
Flow ControlYes — sliding windowNo
Congestion ControlYes — slow start, AIMDNo
Header Size20-60 bytes8 bytes (fixed)
Connection StateStateful — both endpoints track stateStateless
Speed/OverheadHigher overhead, lower throughput for small dataLow overhead, minimal latency
Error CheckingChecksum + retransmission on errorChecksum only (no correction)
Broadcast SupportNo — point-to-point onlyYes — supports broadcast and multicast
Full-DuplexYesYes
PDU NameSegmentDatagram
RFCRFC 9293RFC 768

Real-World Application Protocol Selection

Application Protocol Reason
Web browsing (HTTP/HTTPS)TCPWeb pages must arrive completely and correctly. A missing image or corrupted JavaScript would break the page. Reliability is essential.
VoIP / Voice callsUDPRealtime audio cannot tolerate the delay of retransmission. A 200ms delayed audio packet is more disruptive than a brief glitch. Application handles concealment of lost packets.
Video streaming (Netflix/YouTube)TCP (buffered) or UDP (live)Buffered video (VOD) uses TCP — the extra latency of retransmission is hidden by the buffer. Live streaming uses UDP — real-time delivery beats reliability.
DNS queriesUDP (queries), TCP (zone transfers)DNS queries are small and need fast responses. UDP eliminates connection setup overhead. Zone transfers need guaranteed delivery of entire database.
Email (SMTP, IMAP, POP3)TCPEmail must arrive completely and without corruption. Users would be upset if emails arrived garbled or incomplete.
File transfer (FTP, SCP, SFTP)TCPFiles must be transferred completely and without data corruption. A partially transferred executable or archive is useless or dangerous.
Online gamingUDPGame state updates (player positions, events) must be delivered in real time. Stale retransmitted data about where a player was 100ms ago is worthless.
DHCPUDPClient has no IP address yet and cannot establish a TCP connection. DHCP uses UDP broadcasts on ports 67/68.
TFTP (IOS image transfer)UDPSimple protocol using UDP with its own stop-and-wait ACK mechanism. No authentication needed, useful for network booting.
BGP routing updatesTCPBGP routing tables must be reliably maintained. A dropped update could cause routing loops or black holes. BGP uses TCP port 179.
SNMP monitoringUDPManagement queries are simple request-response. Dropped polls are simply retried. Syslog notifications (traps) are fire-and-forget.
NTP time syncUDPTime synchronization packets are sent frequently. A missed sync is acceptable since the next one arrives shortly.

Exam Tip: VoIP Uses UDP

The CCNA exam may ask which protocol VoIP uses. The answer is UDP. VoIP uses Real-time Transport Protocol (RTP) which runs over UDP. The reason is that voice communication is extremely latency-sensitive — humans detect audio delays greater than 150ms. If a voice packet is lost in transit, TCP would retransmit it, but by the time the retransmitted packet arrived (one full RTT later), it would be too late to play it back at the right time. It is better to have a tiny glitch in the audio than to have the entire conversation delayed waiting for retransmission. VoIP codecs include packet loss concealment algorithms to handle occasional dropped UDP packets gracefully.

9. CCNA Exam Tips for TCP and UDP

The following exam tips are based on the actual CCNA 200-301 exam objectives and common question patterns. Study these carefully before your exam date.

Exam Tip 1: The Three-Way Handshake Sequence

  • Always remember the exact sequence: SYN → SYN-ACK → ACK. Never mix up the order.
  • Only the first SYN has no ACK flag set. Every subsequent segment in a TCP connection (including SYN-ACK) has the ACK flag set.
  • The ACK number is always the other side's sequence number + 1, meaning "I received up to X, now send me X+1."
  • The connection teardown uses FIN → ACK → FIN → ACK (four steps, not two) because each side independently closes its half of the connection.
  • RST immediately terminates a connection without a graceful teardown. You may see this in Wireshark when a connection is refused.

Exam Tip 2: Port Number Ranges and Well-Known Ports

  • Well-known ports: 0-1023 — memorize the most common ones listed in the table above.
  • Registered ports: 1024-49151 — vendor-assigned ports like 3389 (RDP).
  • Ephemeral ports: 49152-65535 — dynamically assigned to clients.
  • The highest possible port number is 65535 (2^16 - 1). This is a common fill-in-the-blank question.
  • The exam may ask you to identify whether a port number is in the well-known, registered, or ephemeral range — know the boundaries.
  • FTP uses TWO ports: 21 for control and 20 for data. Knowing both is frequently tested.
  • DHCP uses BOTH port 67 (server) AND 68 (client). Know which is which.

Exam Tip 3: DNS Uses Both TCP and UDP on Port 53

  • DNS queries (client asking a resolver) use UDP port 53.
  • DNS zone transfers (between authoritative servers) use TCP port 53.
  • Large DNS responses that exceed 512 bytes also fall back to TCP.
  • If the exam asks "What port does DNS use?" the answer is 53, and if asked protocol, say "both TCP and UDP."
  • Do NOT write an ACL that only permits TCP 53 — this will break DNS queries which use UDP 53.

Exam Tip 4: Identifying TCP vs UDP by Application Characteristics

  • If an application requires guaranteed delivery, it uses TCP: web browsing, email, file transfer, remote login (SSH/Telnet).
  • If an application requires low latency and can tolerate loss, it uses UDP: VoIP, streaming, online gaming, DNS, DHCP, TFTP, NTP, SNMP.
  • The exam may describe a scenario and ask which protocol to use. Look for keywords: "real-time" and "latency-sensitive" point to UDP; "reliable" and "must not lose data" point to TCP.
  • BGP is the one routing protocol that uses TCP (port 179). OSPF, EIGRP, and RIP run directly over IP or use their own mechanisms, not TCP or UDP.

Exam Tip 5: TCP Windowing and Flow Control Concepts

  • The window size field in the TCP header controls flow control. A larger window means the sender can transmit more data before waiting for ACKs.
  • If the receiver's buffer is full, it advertises a window size of zero — this is called a "zero window" and tells the sender to stop transmitting until further notice.
  • Window sizes are negotiated dynamically throughout the connection — they are not fixed at the start.
  • Slow start begins with a small congestion window and grows exponentially until the slow start threshold (ssthresh) is reached, then grows linearly.
  • Packet loss is interpreted by TCP as a sign of congestion, triggering a reduction in the congestion window.

10. Summary Comparison Table: TCP vs UDP

Use this final comparison table as a quick reference when reviewing for the exam. Memorizing these key distinctions will prepare you for any TCP vs UDP question on the CCNA 200-301.

Feature / Dimension TCP UDP
Full NameTransmission Control ProtocolUser Datagram Protocol
RFCRFC 9293 (original: RFC 793)RFC 768
OSI LayerLayer 4 — TransportLayer 4 — Transport
Connection TypeConnection-orientedConnectionless
HandshakeThree-way (SYN, SYN-ACK, ACK)None
ReliabilityGuaranteed deliveryBest-effort only
SequencingYes — sequence numbers on every byteNo
AcknowledgmentYes — cumulative ACKsNo
RetransmissionYes — automatic on timeoutNo
OrderingIn-order delivery guaranteedMay arrive out of order
Flow ControlYes — sliding window (receive window)No
Congestion ControlYes — slow start, congestion avoidanceNo
Header Size20-60 bytes8 bytes (fixed)
PDU NameSegmentDatagram
SpeedSlower (overhead of reliability)Faster (minimal overhead)
Broadcast SupportNoYes
Multicast SupportNoYes
ChecksumYes (mandatory)Yes (optional in IPv4, mandatory in IPv6)
ApplicationsHTTP, HTTPS, SSH, Telnet, FTP, SMTP, IMAP, POP3, BGPDNS (queries), DHCP, TFTP, NTP, SNMP, Syslog, VoIP, Video streaming
Use WhenData integrity and completeness are criticalSpeed and low latency are critical; application can handle loss

Mnemonic: UDP Applications — "DNS Does Trivially Need Simple Network Streaming"

To remember the most important UDP applications:

DNS — Domain Name System (port 53)

DHCP — Dynamic Host Configuration Protocol (ports 67/68)

Trivially = TFTP — Trivial File Transfer Protocol (port 69)

Need = NTP — Network Time Protocol (port 123)

Simple = SNMP — Simple Network Management Protocol (port 161/162)

Network = No connection = UDP characteristic

Streaming = Video/Voice streaming over RTP

Key Point: Putting It All Together

The Transport Layer is where networking becomes truly application-aware. TCP and UDP are both indispensable — TCP provides the reliable foundation that makes the web, email, and file transfer work correctly, while UDP provides the low-latency backbone that makes real-time communication, time synchronization, and network management practical. As a network engineer, your job is to ensure both protocols flow correctly through your network infrastructure, which means understanding firewall rules, access control lists, and QoS policies that must handle both TCP and UDP traffic appropriately for different applications.

Mastering TCP and UDP is not just about passing the CCNA exam — it is foundational knowledge that you will apply every single day as a network engineer. When troubleshooting connectivity, you will use telnet <IP> <port> to test TCP connectivity. When analyzing traffic in Wireshark, you will identify protocols by their port numbers and flags. When writing access control lists on Cisco routers and switches, you will specify whether to permit or deny TCP or UDP traffic on specific ports. This knowledge is truly fundamental.

ZM

Written by Zack M. | IT Cert Bound

Zack holds the Cisco CCNA and CompTIA Network+ certifications and has worked as a network engineer for over 8 years. He built IT Cert Bound to give aspiring network professionals the free, high-quality study resources he wishes had existed when he was preparing for his own certifications.