UDP Features
UDP Features
UDP has several important features that distinguish it from TCP. The major features discussed are connectionless service, lack of error control, and lack of congestion control. Each can be either an advantage or a disadvantage depending on the application.
1. Connectionless Service
UDP is a connectionless protocol. Each UDP packet is independent of other packets sent by the same application.
There is:
- No connection establishment
- No connection termination
- No relationship between successive packets
- No sequencing of packets
Advantage
Connectionless communication is useful when the application needs to send a short request and receive a short response.
For example, in DNS, a client generally sends a short request and receives a short response. Both can usually fit into one UDP datagram.
Only two packets are required:
Client Server Request ───────────────────→ Response ←────────────────────
There is no need to spend time establishing and terminating a connection.
In contrast, a connection-oriented communication involves additional packets for connection establishment and termination. Therefore, UDP can provide lower delay for short request-response applications.
Example: DNS
DNS is a good example of an application that benefits from UDP.
- Client sends a short query.
- Server sends a short response.
- The exchange can be completed using one datagram in each direction.
- There is little concern about the ordering of multiple datagrams.
Therefore, the connectionless nature of UDP is an advantage for DNS.
Disadvantage
Connectionless service becomes a disadvantage when an application needs to send a long message.
For example, consider SMTP.
An e-mail may contain:
- large amounts of text,
- images,
- audio,
- video, etc.
If the message cannot fit into one UDP datagram, the application has to divide it into multiple datagrams.
Since UDP does not number or relate these datagrams, they may arrive at the receiver out of order.
Sender Receiver Datagram 1 ─────────────────→ 1 Datagram 2 ─────────────────→ 3 Datagram 3 ─────────────────→ 2
The receiving application may not be able to correctly reconstruct the original message.
Therefore, UDP's connectionless feature is not suitable for applications transmitting long messages that require reliable, ordered delivery.
2. Lack of Error Control
UDP does not provide error control. It provides an unreliable service, with the checksum providing error detection.
If a packet is lost or corrupted, UDP does not retransmit it.
Why can this be an advantage?
Reliable protocols such as TCP retransmit lost or corrupted packets.
Although retransmission improves reliability, it can introduce uneven delays.
Consider a real-time application transmitting:
Frame 1 → Frame 2 → Frame 3 → Frame 4
If Frame 2 is lost, a reliable protocol may retransmit Frame 2.
The application may have to wait for Frame 2 before continuing, producing a delay.
For some real-time applications, this delay is worse than simply losing one frame.
Example: Large Text File
Suppose we download a very large text file.
Part 1 → Part 2 → Part 3 → Part 4 → ...
If Part 2 is lost, we definitely want it to be retransmitted.
We are willing to wait for the missing part because the final file must be complete and correct.
Therefore:
UDP is not suitable for this type of application.
A reliable transport protocol such as TCP is more appropriate.
Example: Real-Time Interactive Application
Consider a real-time interactive application such as Skype,
Audio and video are divided into frames:
Frame 1 → Frame 2 → Frame 3 → Frame 4 → ...
Suppose Frame 2 is corrupted.
If the transport protocol retransmits Frame 2, it may arrive after Frame 3 or Frame 4.
This can disturb the synchronization of the real-time transmission.
With UDP, the corrupted or lost datagram can simply be ignored, allowing the remaining frames to continue to the application.
The user may see a small temporary blank area or missing portion, but the overall transmission continues without waiting for retransmission.
Thus, for some real-time interactive applications, the lack of error control in UDP can actually be an advantage.
3. Lack of Congestion Control
UDP does not provide congestion control.
It does not regulate the transmission rate based on the level of congestion in the network.
Advantage
The lack of retransmission can sometimes prevent UDP from making congestion worse.
Consider a congested network:
Network Congestion ↓ Packet Loss ↓ TCP retransmits ↓ More packets enter the network ↓ Congestion may increase
TCP may retransmit lost packets several times. These additional packets can contribute to congestion.
UDP does not automatically retransmit lost packets.
Therefore, in some situations, the lack of error control and congestion-control mechanisms in UDP can be considered an advantage when congestion is a major concern.
UDP Features: Summary
| Feature | Advantage | Disadvantage |
|---|---|---|
| Connectionless service | Low delay; ideal for short request-response communication | Long messages may arrive out of order |
| Lack of error control | No retransmission delay; useful for real-time applications | Lost/corrupted data is not recovered |
| Lack of congestion control | Does not generate retransmissions that can worsen congestion | UDP itself does not regulate network load |
Important Examples
| Application | UDP Suitability | Reason |
|---|---|---|
| DNS | Suitable | Short request and quick response |
| SMTP | Not suitable | Messages can be long and require reliable delivery |
| Large file download | Not suitable | Missing/corrupted data must be recovered |
| Real-time audio/video | Suitable in many cases | Avoids retransmission delays |
| Interactive applications such as Skype | Suitable | Timely delivery is more important than perfect reliability |
Key Point
UDP sacrifices reliability and control mechanisms in exchange for simplicity, low overhead, and low delay.
Therefore, whether a UDP feature is an advantage or disadvantage depends on the requirements of the application.
Comments
Post a Comment