TCP vs UDP
Major differences between the TCP(Transmission Control) & UDP(User Datagram) transport layer protocols:
| TCP | UDP |
| Stream-Oriented : Data transmitted as a virtual stream of bytes | Message-Oriented : Data transmitted as individual data packets called datagrams(the basic unit of data transferred) |
| Reorders packets | Does not reorder packets; leaves it to the application layer |
| Data Reliability:Absolute guarantee that data remains intact | No guarantee; No data reliability |
| Two-way connection reliable | One-way connection reliable |
| Uses a 20 bytes header | Uses a 8 bytes header |
| Error checking | No error checking |
| Flow control | No flow control |
| Slower speed (due to the above) | Faster than TCP |
| Used when speed is not critical | Used in games and applications where speed(time) is critical |
| Examples include SMTP, HTTP, FTP, Telnet, etc | Examples include DNS, TFTP, RIP, VoIP, SNMP, etc |







1 Comment
thanks.