-
1. Overview
TCP and UDP are the protocol of Transport Layer (L4) which allows multiple applications to use one network connection simultaneously.
2. TRANSMISSION CONTROL PROTOCOL (TCP)
TCP is a connection-oriented protocol. Connection-orientation means that the communicating devices should establish a connection before transmitting data and should close the connection after transmitting the data.
TCP provides reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network.
TCP is connection-oriented, and a connection between client and server is established (passive open) before data can be sent. Three-way handshake (active open), retransmission, and error-detection adds to reliability but lengthens latency.
TCP is still dominantly used for the web, i.e. for the HTTP protocol, and later HTTP/2, while not used by latest standard HTTP/3.
3. USER DATAGRAM PROTOCOL (UDP)
UDP is the Datagram oriented protocol. It's a Connectionless Transmission. This is because there is no overhead for opening a connection, maintaining a connection, and terminating a connection. UDP is efficient for broadcast and multicast type of network transmission.
UDP uses a simple connectionless communication model with a minimum of protocol mechanisms. UDP provides
- Checksums: for data integrity
- Port numbers: for addressing different functions at the source and destination of the datagram.
It has no handshaking dialogues, and thus exposes the user's program to any unreliability of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection.
4. Difference between TCP and UDP
TRANSMISSION CONTROL PROTOCOL (TCP) USER DATAGRAM PROTOCOL (UDP) TCP is reliable as it guarantees delivery of data to the destination router. The delivery of data to the destination cannot be guaranteed in UDP. TCP provides extensive error checking mechanisms. It is because it provides flow control and acknowledgment of data. UDP has only the basic error checking mechanism using checksums. Sequencing of data is a feature of Transmission Control Protocol (TCP). this means that packets arrive in-order at the receiver. There is no sequencing of data in UDP. If ordering is required, it has to be managed by the application layer. TCP is comparatively slower than UDP. UDP is faster, simpler and more efficient than TCP. Retransmission of lost packets is possible in TCP, but not in UDP. There is no retransmission of lost packets in User Datagram Protocol (UDP). TCP has a (20-80) bytes variable length header. UDP has a 8 bytes fixed length header. TCP is heavy-weight. UDP is lightweight. Only Unicast Unicast, Multicast, Broadcast Email, Web browsing(HTTP, HTTPS), FTP UDP is used by DNS, DHCP, TFTP, SNMP, RIP, and VoIP. 5. Reference
https://en.wikipedia.org/wiki/Transmission_Control_Protocol
https://en.wikipedia.org/wiki/User_Datagram_Protocol
https://www.geeksforgeeks.org/differences-between-tcp-and-udp/
'Web > Network' 카테고리의 다른 글
Classless Inter-Domain Routing(CIDR), Private, and Public IP (0) 2020.07.12 Uniform Resource Identifier(URI), Uniform Resource Locator(URL), and Uniform Resource Name(URN) (0) 2020.03.29 Transmission Types: Unicast, Multicast, Broadcast, and Anycast (0) 2020.03.07 HUB, Switch, and Router (0) 2020.03.07 Simplex, Half duplex, and Full duplex (0) 2020.03.07