Course contentsShow
← Computer Science
Lesson 1498 of 2,87234. Internet Protocol SuiteFree lesson

Overhead and Header Size Comparison

Compare TCP and UDP header sizes and understand how protocol complexity affects bandwidth efficiency.

Overhead and Header Size Comparison

What you'll learn: You'll understand how TCP and UDP header sizes differ and why choosing the right protocol impacts your network's bandwidth efficiency.

The Concept

Every packet you send over a network carries not just your data but also control information in a header. Think of it like mailing a package: the box and shipping label add weight and cost, even though they're not the actual gift inside. In networking, this extra information is called overhead.

TCP and UDP have dramatically different header sizes because they serve different purposes:

  • TCP header: minimum 20 bytes (often 40+ with options)
  • UDP header: fixed 8 bytes

Why the Difference?

TCP's larger header accommodates all the features you've learned: sequence numbers (4 bytes), acknowledgment numbers (4 bytes), window size (2 bytes), checksum (2 bytes), flags, and more. It needs this space to guarantee reliable, ordered delivery with flow and congestion control.

UDP's tiny 8-byte header contains only the essentials: source port (2 bytes), destination port (2 bytes), length (2 bytes), and checksum (2 bytes). That's it. No sequence tracking, no acknowledgments, no connection state.

The Bandwidth Impact

Imagine sending small messages—say, 100 bytes each:

  • TCP: 100 bytes data + 20+ bytes header = 20%+ overhead
  • UDP: 100 bytes data + 8 bytes header = 8% overhead

For tiny packets like DNS queries or gaming updates, UDP's efficiency shines. For large file transfers where TCP's 20-byte header is negligible compared to megabytes of data, reliability matters more than header size.

Key Takeaway: TCP's larger header (20+ bytes) enables reliability and flow control but adds overhead; UDP's minimal 8-byte header maximizes bandwidth efficiency at the cost of guaranteed delivery—choose based on whether you need protocol features or raw speed.