Do we really need UDP?
September 27th, 2007
I’m not asking if we need UDP as a network protocol at all, but if we really need it as a transport protocol? Does it actually provide any real transport layer features? Let’s take a look at the UDP header:
We see a couple port numbers and a checksum. If we look at the TCP header we see a lot more:
It has port numbers and a checksum as well, but there’s also a sequence number, an ack number, control flags, window size, and other goodies. If you want to compare feature lists you can see how disparate they are. UDP provides:
- port numbers
- simple error-checking
So it’s useful, but nothing compared to what TCP offers:
- port numbers
- simple error-checking
- reliable delivery
- in-order delivery
- flow control
- congestion control
- segmentation
But maybe it’s not fair to compare UDP against TCP, the end-all-be-all-get-my-packets-there-or-else of the transport layer protocols. How about some of the others? Here’s a table I stole borrowed from Wikipedia:
| UDP | TCP | DCCP | SCTP | |
|---|---|---|---|---|
| Packet header size | 8 Bytes | 20 Bytes | Varies | 12 Bytes + Variable Chunk Header |
| Transport layer packet entity | Datagram | Segment | Datagram | Datagram |
| Port numbering | Yes | Yes | Yes | Yes |
| Error detection | Optional | Yes | Yes | Yes |
| Reliability: Error recovery by automatic repeat request (ARQ) | No | Yes | No | Yes |
| Virtual circuits: Sequence numbering and reordering | No | Yes | Yes | Optional |
| Flow control | No | Yes | Yes | Yes |
| Congestion avoidance: Variable congestion window, slow start, time outs | No | Yes | Yes | Yes |
| Multiple streams | No | No | No | Yes |
As you can see, UDP is really the runt of the family. So it seems as if our TCP/IP model is a little off:
TCP and the some of the other transport protocols offer everything that UDP does and more. So why is this redundant functionality in UDP, a sibling protocol? Wouldn’t it make more sense to put it in a layer beneath these other protocols:
Creating a new “Session” layer (term borrowed from the OSI model) seems to fix the problem here. The protocols that don’t need UDP and don’t provide any real transport layer features were moved into this new layer too.
I like this new model a lot more. It better represents the real world and how these protocols are actually used: If you need simple port-to-port connectionless communication you choose UDP. If you need all that, but also a connection-oriented reliable communication stream, you choose TCP. So why hasn’t it been this way all along…




