1. Protocol Type
- TCP (Transmission Control Protocol):
Connection-oriented protocol. It establishes a reliable connection before data transfer. - UDP (User Datagram Protocol):
Connectionless protocol. No prior connection setup; data is sent directly.
2. Reliability
- TCP:
Reliable – ensures data delivery, error checking, and retransmission if packets are lost. - UDP:
Unreliable – no guarantee of delivery, no retransmission, minimal error checking.
3. Speed
- TCP:
Slower due to overhead of connection setup, acknowledgments, and error handling. - UDP:
Faster because it skips these steps; suitable for real-time applications.
4. Use Cases
- TCP:
Web browsing (HTTP/HTTPS), email (SMTP), file transfer (FTP), remote login (SSH). - UDP:
Streaming (video/audio), online gaming, VoIP, DNS queries.
5. Packet Structure
- TCP:
Larger header (20 bytes) – includes sequence numbers, acknowledgment, etc. - UDP:
Smaller header (8 bytes) – only source/destination ports, length, checksum.
6. Error Handling
- TCP:
Built-in mechanisms for error correction and retransmission. - UDP:
Minimal error detection (checksum), no correction.
Summary:
- TCP = Reliable, slower, connection-oriented.
- UDP = Fast, lightweight, connectionless, best for real-time apps.
| Feature | TCP | UDP |
|---|---|---|
| Protocol Type | Connection-oriented | Connectionless |
| Reliability | Reliable (acknowledgments, retransmission) | Unreliable (no guarantee of delivery) |
| Speed | Slower (due to overhead) | Faster (minimal overhead) |
| Use Cases | Web browsing, email, file transfer | Streaming, gaming, VoIP |
| Packet Header | Larger (20 bytes) | Smaller (8 bytes) |
| Examples | HTTP/HTTPS, FTP, SMTP, SSH | DNS, Video Streaming, Zoom, Online Games |
No comments:
Post a Comment