TCP vs UDP & Verifying Client IP Settings
CCNA 200-301 · Network Fundamentals
TCP and UDP are the two transport-layer protocols, and the exam tests the comparison between them relentlessly — not as abstract theory, but as a decision: given an application, which protocol does it use, and why? The answer always comes back to one trade-off: TCP buys reliability with overhead, UDP buys speed with risk. Once you can make that trade-off instinctively, the port numbers and the handshake details fall into place.
TCP: reliable, ordered, connection-oriented
TCP (Transmission Control Protocol) guarantees delivery. Before any data flows, the two hosts perform a three-way handshake: the client sends a SYN, the server replies with SYN-ACK, and the client answers with ACK. Only then does the connection exist. Every segment of data is numbered, and the receiver acknowledges what it gets; if an acknowledgement does not arrive in time, the sender retransmits. TCP also provides flow control (the receiver advertises a window size so the sender does not overwhelm it) and congestion control (the sender slows down when the network drops packets). The result is a stream that arrives complete, in order, and without duplicates — at the cost of extra packets, extra latency, and extra state on both ends.
Applications that cannot tolerate lost or reordered data use TCP: web browsing (HTTP/HTTPS), email (SMTP, POP3, IMAP), file transfer (FTP), remote administration (SSH, Telnet), and DNS zone transfers. If a web page arrived with a chunk missing, the page would break — so the overhead is worth paying.
UDP: fast, connectionless, best-effort
UDP (User Datagram Protocol) does none of that. There is no handshake, no acknowledgement, no retransmission, and no ordering. A host simply sends datagrams and hopes they arrive. The header is only 8 bytes (against TCP's 20), so the overhead is minimal and the latency is low — which is exactly what real-time applications need. A lost packet in a voice call is a tiny glitch; waiting for a retransmission would be a noticeable delay, so voice and video prefer to lose the occasional packet rather than wait.
Applications that use UDP include DNS queries, DHCP, SNMP, TFTP, and real-time media (VoIP, video streaming, online gaming). DNS is the exam's favourite example: a query is a single small packet, the answer is a single small packet, and if the answer is lost the client simply asks again — the application handles reliability itself, so it does not need TCP's machinery. The exam also likes the fact that UDP supports broadcast and multicast, which TCP cannot do, because a connection-oriented protocol has no way to handshake with a group.
The comparison the exam wants
Memorise the contrast as a table and you will answer most questions on this topic in seconds: TCP is connection-oriented, reliable, ordered, uses acknowledgements and retransmission, has a larger header, and is slower; UDP is connectionless, unreliable (best-effort), unordered, has no acknowledgements, has a small header, and is faster. When a question describes an application, ask one question: does it need every byte, or does it need every byte now? Web, email, and file transfer need every byte — TCP. Voice, video, and DNS need speed — UDP.
Both protocols use port numbers to deliver data to the right application on a host. Well-known ports are the ones the exam tests: FTP 20/21, SSH 22, Telnet 23, SMTP 25, DNS 53, DHCP 67/68, TFTP 69, HTTP 80, POP3 110, SNMP 161/162, HTTPS 443. Notice which are TCP and which are UDP: DNS is UDP 53 for queries (TCP 53 for zone transfers), DHCP is UDP 67/68, SNMP is UDP 161/162, TFTP is UDP 69, and the rest of the list is TCP. Port-number questions are easy points if you drill the list until it is automatic — the cheat sheet page collects them all.
Verifying IP parameters on a client
The second half of this topic is practical: checking a host's IP configuration. On Windows, ipconfig shows the address, subnet mask, and default gateway, and ipconfig /all adds the MAC address, DHCP server, DNS servers, and lease times. On Mac and Linux, ifconfig (older) or ip addr (modern Linux) shows the same information. The exam expects you to know which command belongs to which operating system, and to be able to spot the problem in a sample output: an address of 169.254.x.x means the host failed to get DHCP and assigned itself an APIPA link-local address; a missing or wrong default gateway means local traffic works but nothing beyond the subnet is reachable; a wrong DNS server means names do not resolve even though IP connectivity is fine.
Two more commands complete the toolkit. ping tests basic IP reachability to another host, and traceroute (Windows: tracert) shows each router hop along the path, which is how you find where a packet stops. A useful troubleshooting order, and one the exam rewards, is: check the local configuration first, ping the default gateway, ping a remote address, then ping a name — each step isolates a different layer of the problem.
TCP windowing and flow control
Two TCP mechanisms deserve a closer look because the exam tests them directly. Flow control uses the window size: the receiver tells the sender how much data it can accept at once, and the sender never sends more than that window allows. If the receiver's buffer fills up, it advertises a smaller window — or a zero window, telling the sender to stop entirely until the receiver catches up. This is how a fast sender avoids overwhelming a slow receiver. Windowing also improves efficiency: instead of sending one segment and waiting for its acknowledgement, TCP sends a whole window of segments and acknowledges them together, which keeps the connection fast over high-latency links. A related concept is the maximum segment size (MSS), negotiated during the handshake, which is the largest chunk of data a host will accept in a single segment — typically 1460 bytes on an Ethernet network, after the IP and TCP headers are subtracted from the 1500-byte MTU. When a question mentions a window size of zero, the answer is flow control: the receiver is telling the sender to pause.
Port numbers in context
Port numbers are easier to remember in groups than as a flat list. The remote access group is SSH 22 and Telnet 23 — always pick SSH, because Telnet sends passwords in plaintext. The mail group is SMTP 25 (sending mail), POP3 110, and IMAP 143 (reading mail). The web group is HTTP 80 and HTTPS 443. The infrastructure group is DNS 53, DHCP 67/68, TFTP 69, NTP 123, SNMP 161/162, and syslog 514. Notice that the infrastructure protocols mostly use UDP, because they send small messages where speed matters more than guaranteed delivery, while the user-facing protocols (web, mail, file transfer, remote access) mostly use TCP, because they cannot tolerate lost data. When the exam asks which protocol an application uses, think about what the application does with lost data: if it would break, the answer is TCP; if it would shrug and retry or carry on, the answer is UDP.
Exam traps to watch for
- Saying DNS uses TCP. DNS queries use UDP 53; TCP 53 is only for zone transfers between servers.
- Claiming UDP is unreliable and therefore useless. UDP is best-effort by design — real-time applications choose it deliberately because retransmission would hurt more than loss.
- Confusing the three-way handshake with connection teardown. SYN, SYN-ACK, ACK opens a connection; FIN/ACK closes it.
- Reading 169.254.x.x as a normal DHCP address. It is APIPA — the host could not reach a DHCP server.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.Which sequence correctly describes the TCP three-way handshake?
Explanation: The handshake is: the client sends SYN, the server replies with SYN-ACK, and the client completes it with ACK — after which the connection is established and data can flow. Option A is wrong because the server's combined SYN-ACK must come before the client's final ACK. Option B is wrong because a connection cannot begin with an ACK, which acknowledges something that has not been sent yet. Option D is wrong because the server cannot send SYN-ACK before receiving the client's SYN.
Exam objective: 200-301 1.5: Compare TCP to UDP — three-way handshake
Q2.A voice-over-IP application needs minimal delay and can tolerate an occasional lost packet. Which transport protocol should it use, and why?
Explanation: UDP is connectionless with no handshake, acknowledgement, or retransmission, so its latency is minimal — exactly what real-time voice needs, where a retransmitted packet would arrive too late to be useful anyway. Option B is wrong because strict ordering matters less than low delay for voice, and TCP's retransmission delays would degrade the call. Option C is wrong because UDP does not guarantee delivery at all — it is best-effort. Option D is wrong because TCP's header (20 bytes minimum) is larger than UDP's (8 bytes), not smaller.
Exam objective: 200-301 1.5: Compare TCP to UDP — UDP use cases
Q3.Which protocol and port does a DNS client normally use to query a DNS server?
Explanation: DNS queries use UDP port 53: the query and response are each a single small packet, and the client simply re-asks if no answer arrives, so TCP's reliability machinery is unnecessary. Option A is wrong because TCP 53 is reserved for DNS zone transfers between servers, not ordinary client queries. Option B is wrong because UDP 67 is the DHCP server port. Option C is wrong because TCP 80 is HTTP.
Exam objective: 200-301 1.5: Compare TCP to UDP — DNS over UDP
Q4.A Windows PC cannot reach any website, but it can ping other devices on its local network. ipconfig shows an address of 169.254.14.22. What is the most likely problem?
Explanation: An address in the 169.254.0.0/16 range is APIPA (Automatic Private IP Addressing): Windows assigns itself one of these link-local addresses when it cannot contact a DHCP server, so the PC has no valid gateway or DNS configuration for reaching the internet. Option A is a possible symptom but not the root cause — with an APIPA address the PC has no working gateway at all. Option C is wrong because the PC can ping its gateway, so the gateway is reachable; the problem is the PC's own address. Option D is wrong because an unplugged cable would leave the interface disconnected, not assigned an APIPA address.
Exam objective: 200-301 1.10: Verify IP parameters for Client OS (Windows, Mac OS, Linux)
Q5.Which two features does TCP provide that UDP does not? (Choose the best pair.)
Explanation: TCP acknowledges received segments and retransmits anything that goes unacknowledged, and it sequences segments so the receiver can reassemble them in order — UDP does neither. Option A is wrong because broadcast support and the smaller header belong to UDP, not TCP. Option C is wrong because connectionless operation and multicast support are UDP characteristics. Option D is wrong because lower latency and no handshake are also UDP characteristics; they describe what TCP gives up to gain reliability.
Exam objective: 200-301 1.5: Compare TCP to UDP
Q6.An engineer needs to see the DHCP server address and DNS servers configured on a Windows host. Which command provides this information?
Explanation: ipconfig /all displays the full IP configuration, including the DHCP server, DNS servers, lease times, and the MAC address. Option A is wrong because ping only tests reachability to a host. Option B is wrong because tracert shows the path packets take to a destination. Option D is wrong because ipconfig /release gives up the current DHCP lease rather than displaying configuration details.
Exam objective: 200-301 1.10: Verify IP parameters for Client OS (Windows, Mac OS, Linux)
Q7.A host can ping 8.8.8.8 successfully but cannot load any website by name. What is the most likely cause?
Explanation: Reaching 8.8.8.8 by IP proves that the host's address, gateway, and internet path all work; failing only on names points squarely at DNS — a wrong or unreachable DNS server. Option B is wrong because a gateway problem would prevent reaching 8.8.8.8 as well. Option C is wrong because a host with no IP address could not ping anything. Option D is wrong because a duplex mismatch causes slow or error-prone links, not a clean split between IP connectivity working and name resolution failing.
Exam objective: 200-301 1.10: Verify IP parameters for Client OS (Windows, Mac OS, Linux)
Q8.Which of these applications relies on UDP rather than TCP?
Explanation: DHCP uses UDP (ports 67/68) because a client that has no IP address yet cannot establish a TCP connection — it broadcasts a UDP discover message and the server answers. Option A is wrong because HTTPS runs over TCP 443. Option C is wrong because SMTP uses TCP 25. Option D is wrong because FTP uses TCP 20/21.
Exam objective: 200-301 1.5: Compare TCP to UDP — UDP applications