There are some similarities and differences between Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). One difference is that TCP is a connection-oriented protocol because it establishes an end-to-end connection between computers before transferring data. On the other hand, UDP is a connectionless protocol. It is because I can not be sure about the connection before sending the data. The similarity is that both TCP and UDP exist in the transport layer of the TCP / IP model. Other differences are described in the next article
UDP sends data directly to the target computer without confirming whether the system is ready to receive
TCP or Transmission Control Protocol is a connection type protocol in the transport layer of the TCP / IP model. Before starting communication, establish a connection between the source and destination computers.
It is very reliable because it uses three handshakes, traffic, error and congestion control. The target computer correctly receives the data sent from the source computer. If the received data is not in the correct format, TCP retransmits the data.
UDP or User Datagram Protocol is a connectionless protocol in the transport layer of the TCP / IP model. You can establish a connection, check whether the target computer is ready to receive, or just send the data directly. UDP is used to transfer data at a faster rate. Because it is unreliable, it is used for transferring data such as audio files and video files.
TCP confirms the information sent, it is very reliable when sending useful data. If there is a lost packet, we will resend it. In the case of UDP, retransmission is not required even if packets are lost, and the target computer receives corrupted data. Therefore, UDP is an unreliable protocol.
TCP establishes a connection before sending data and TCP is slower than UDP to ensure that packets are sent correctly. On the other hand, UDP does not check whether or not transmission data is received.
The UDP header size is 8 bytes, and the TCP header size is more than twice. The size of the TCP header is 20 bytes, and the TCP header contains options, padding, checksum, flag, data offset, acknowledgment number, serial number, source and destination port, and so on.
Both TCP and UDP can check for errors, but only TCP can fix the error. This is due to both congestion and flow control.
TCP and UDP have advantages and disadvantages, respectively. Because UDP is faster, easier, more efficient, it is usually used to send audio, video files, and TCP.
When Person A sends a message to Person B, the way that the message first tries to relay is to use UDP (User Datagram Protocol). In addition to UDP, there is TCP (Transmission Control Protocol). The main difference between TCP and UDP you may care about is that UDP has a high rate of passing through the firewall, whereas TCP is not. Another difference is that TCP will transmit data at a slower rate than UDP because the sender and receiver are always connected and the messages are checked in order for TCP to function. In order for UDP to function correctly, the sender simply continues to send data to the recipient and the sender does not even have to wait for the recipient to receive the message. Continue to send as it is. Therefore, UDP is much faster than TCP.
There are some similarities and differences between Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). One difference is that TCP is a connection-oriented protocol because it establishes an end-to-end connection between computers before transferring data. On the other hand, UDP is a connectionless protocol. It is because I can not be sure about the connection before sending the data. The similarity is that both TCP and UDP exist in the transport layer of the TCP / IP model. Other differences are described in the next article