| Lesson 3 |
TCP and UDP |
| Objective |
Define the two transport-layer protocols provided in TCP/IP that allow client/server transactions.
|
TCP and UDP: Transport-Layer Protocols in TCP/IP
At the heart of modern computer networking lies the transport layer, whose responsibility is to move data reliably—or efficiently—between applications running on different systems. Within the TCP/IP protocol suite, this role is fulfilled by two foundational protocols: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).
Although TCP and UDP both operate above the Internet Protocol (IP) and below application-layer protocols,
they are designed to support very different communication patterns. Understanding these differences is essential
for network administrators, system engineers, and application developers.
Key Differences Between TCP and UDP
TCP and UDP address the same problem—delivering data between applications—but they do so using fundamentally
different design philosophies:
-
Connection-oriented vs. connectionless
TCP is a connection-oriented protocol. Before data is transmitted, a virtual connection is established
between the client and server using a handshake process. This connection remains in place for the duration
of the session. UDP, by contrast, is connectionless: data is sent as independent datagrams without prior
coordination or session setup.
-
Reliability and ordering
TCP guarantees reliable delivery. It uses sequence numbers, acknowledgements, and retransmission to ensure
that data arrives intact and in the correct order. UDP provides no such guarantees; packets may be lost,
duplicated, or arrive out of order without notification.
-
Flow control and congestion control
TCP dynamically adjusts its transmission rate using flow control and congestion control algorithms to avoid
overwhelming receivers or congesting networks. UDP has no built-in mechanisms for rate adjustment, leaving
such responsibilities to the application if needed.
-
Performance characteristics
Because UDP avoids connection setup and reliability overhead, it typically offers lower latency than TCP.
TCP incurs additional processing and delay but provides correctness and completeness, which are critical
for many applications.
-
Typical use cases
TCP is used by applications that require accuracy and completeness, such as web traffic (HTTP/HTTPS),
file transfers, email, and remote administration. UDP is favored by applications that prioritize speed
and can tolerate loss, including streaming media, online gaming, real-time voice and video, and DNS queries.
Client/Server Transactions in TCP/IP
Within TCP/IP networking, client/server communication generally falls into two broad categories, each aligning
naturally with one of the transport-layer protocols.
-
Simple request–reply transactions
These interactions consist of a single request followed by a single response. If a response is lost,
the client can simply retry the request after a timeout. Services such as DNS commonly use this pattern,
making UDP an efficient choice.
-
Ongoing reliable data transfers
Some client/server interactions require a continuous, ordered stream of data. Examples include interactive
terminal sessions and bulk file transfers. In these cases, TCP is essential because it guarantees that all
transmitted data can be reconstructed correctly at the receiving end.
Why Transport-Layer Choice Matters
Most modern computers—desktops, servers, and mobile devices—function primarily as communication tools.
They exchange web content, synchronize data, stream media, and support distributed applications. The effectiveness
of these interactions depends heavily on choosing the appropriate transport protocol.
One of the enduring strengths of TCP/IP is its ability to provide interoperable communication across diverse
hardware platforms and operating systems. TCP and UDP form the backbone of this interoperability by offering
flexible transport services that applications can select based on their reliability and performance needs.
Summary
TCP/IP provides two transport-layer protocols because no single approach satisfies all networking requirements. TCP emphasizes reliability, ordering, and congestion control, making it ideal for critical data transfers. UDP emphasizes speed and simplicity, making it well suited for lightweight, time-sensitive communication.
By understanding when and why each protocol is used, network administrators can better diagnose performance
issues, design scalable systems, and support modern client/server applications effectively.
