Compare and contrast UDP and TCP.

Summary Comparison of UDP and TCP

Characteristic / Description

UDP

TCP

General Description

Simple, high-speed, low-functionality “wrapper” that interfaces applications to the network layer and does little else.

Full-featured protocol that allows applications to send data reliably without worrying about network layer issues.

Protocol Connection Setup

Connectionless; data is sent without setup.

Connection-oriented; connection must be established prior to transmission.

Data Interface To Application

Message-based; data is sent in discrete packages by the application.

Stream-based; data is sent by the application with no particular structure.

Reliability and Acknowledgments

Unreliable, best-effort delivery without acknowledgments.

Reliable delivery of messages; all data is acknowledged.

Retransmissions

Not performed. Application must detect lost data and retransmit if needed.

Delivery of all data is managed, and lost data is retransmitted automatically.

Features Provided to Manage Flow of Data

None

Flow control using sliding windows; window size adjustment heuristics; congestion avoidance algorithms.

Overhead

Very low

Low, but higher than UDP

Transmission Speed

Very high

High, but not as high as UDP

Data Quantity Suitability

Small to moderate amounts of data (up to a few hundred bytes)

Small to very large amounts of data (up to gigabytes)

Types of Applications That Use The Protocol

Applications where data delivery speed matters more than completeness, where small amounts of data are sent; or where multicast/broadcast are used.

Most protocols and applications sending data that must be received reliably, including most file and message transfer protocols.

Well-Known
Applications and Protocols

Multimedia applications, DNS, BOOTP, DHCP, TFTP, SNMP, RIP, NFS (early versions)

FTP, Telnet, SMTP, DNS, HTTP, POP, NNTP, IMAP, BGP, IRC, NFS (later versions)

 

 

TCP FRAME STRUCTURE

UDP FRAME STRUCTURE