Differentiate between TCP and UDP.
| Feature | TCP | UDP |
|---|---|---|
| Connection Type | Connection-oriented | Connectionless |
| Reliability | Reliable: ensures data delivery | Unreliable: no guaranteed delivery |
| Acknowledgments | Yes (acknowledgment for each packet) | No acknowledgment of packet delivery |
| Order of Delivery | Yes (maintains order of sent packets) | No (order of delivery not guaranteed) |
| Flow Control | Yes (implements flow control to manage data transfer) | No (limited flow control, relies on the application) |
| Error Checking | Yes (error-checking through checksums) | Limited (optional checksum) |
| Header Size | Larger header size | Smaller header size |
| Transmission Speed | Slower than UDP due to connection setup | Faster than TCP due to no connection setup |
| Usage | Reliable data transfer (e.g., file transfer, web browsing) | Real-time applications (e.g., video streaming, online gaming) |
| Examples | HTTP, FTP, SMTP | DNS, DHCP, VoIP |