Essay sample library > What is the difference between UDP and TCP internet protocols?

What is the difference between UDP and TCP internet protocols?

2023-04-03 00:21:54

Q: Can I use an example to illustrate the difference between UDP traffic and TCP Internet Protocol (IP) traffic and how to use it?

A. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are transport protocols and are one of the core protocols of the Internet protocol suite. Both TCP and UDP function under the TCP / IP model of the transport layer. The two uses are very different.

Reliability: TCP is a connection type protocol. When a file or message is sent, it will be delivered unless the connection fails. If the connection is lost, the server will request the missing part. No damage when forwarding mail

Reliability: UDP is a connectionless protocol. When you send data or message, I do not know if it will get there, it may be lost on the road. There may be damage when forwarding mail

Ordering: If you send two messages in order along a connection, you will see that the first message arrives first. You do not have to worry that the order of the data is incorrect.

Heavyweight: - If the low-level part of the TCP "stream" arrives in the wrong order, a retransmission request must be sent and all out-of-order parts must be reassembled, so some work It is necessary to summarize.

Lightweight: No need to rearrange messages, trace tracking connections, etc. This is just a fire. This means that it is much faster, and the NIC / OS does not need to do much work to convert the data from the packet.

Stream: Data is read as a "stream" that does not distinguish between the end of one packet and the beginning of another packet. There may be multiple packets per read call

Datagram: Packets are sent separately and guaranteed to be complete if they arrive. One read packet per read call

Example: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), file transfer protocol (FTP port 21), and secure shell (OpenSSH port 22)

Examples: Domain Name System (DNS UDP port 53), Streaming application (IPTV and movie etc.), Voice over IP (VoIP), Simple File Transfer Protocol (TFTP), Online multiplayer game

TCP and UDP are both protocols for sending data bits (called packets) over the Internet. They are all built on the Internet protocol. That is, regardless of whether TCP or UDP sends a packet, the packet is sent to the IP address. These packets are forwarded from the computer to an intermediate router and processed in the same way as they are forwarded to the destination. When you load a web page, the computer sends a TCP packet to the web server's address and requests the web page to be sent. The web server responds by sending TCP packets. TCP packets are joined by a web browser to form a web page and display it. When you click a link, log in, post a comment, or perform other operations, the web browser sends a TCP packet to the server, and the server returns that TCP packet. TCP is more than one way communication - the remote system sends the packet back to confirm receipt of the packet

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.