The User Datagram Protocol (UDP) is one of the most common ways in which data on the Internet is transmitted. UDP is often discussed alongside another commonly used communication protocol, the transmission control protocol (TCP). UDP and TCP both have their strengths and weaknesses, and they are used in different situations to maximize their strengths and minimize their downsides.
Different protocols for transmitting data over the Internet operate at different layers of the open systems interconnection (OSI) seven-layer model. Like the TCP, UDP also operates at the transport layer. Conceptually, transmitting data using UDP is similar to TDP: data must first be divided into small individual units called protocol data units (PDUs) before the units are transmitted over the Internet through the process of routing.
The PDU for UDP is the datagram. Instead of dividing data into packets (which is the PDU for TCP), data transmitted using UDP is divided into datagrams which are then routed over the Internet and received on the receiver’s end.
UDP is a connectionless protocol. Unlike the TCP which first requires a connection to be established using the three-way SYN, SYN-ACK, and ACK handshake before packets can be transmitted, UDP does not require the establishment of any connection between the sending and receiving machines. Once the receiving machine makes a request to the sending machine, the sending machine will continuously send datagrams over without establishing any connection.
The main UDP Benefit is reduced latency or delay between the transmission of individual units of data (i.e. datagrams in the context of the UDP). For TCP, for each unit of data (i.e. packets), an acknowledgement receipt needs to be sent back to the sender, which increases the delay between transmission of packets. This delay is kept to a minimum for UDP because the datagrams are continuously sent one after another to the receiver who does not have to acknowledge receipt of the datagrams.
Let’s use a simple analogy to illustrate. Instead of transmitting the contents of a file over the Internet, let’s say you want to send all the contents of your old house to your new overseas apartment because you have migrated. You ask your brother to help you to send all the items in your old house over to your new apartment.
Your brother goes to your old house, packs up every item individually and drops everything off at a cheap courier company that does not provide any form of tracking. Because the courier company is cheap, its workers do not bother about the order in which the items are dropped off. The workers process the items as in the order of picking them up from the company’s front door and pass them onto third-party delivery contractors with only one instruction: send the items as fast as they can. As the items arrive at your new apartment, they are piled on your doorstep, however, there is no guarantee that all the items will arrive as there is no tracking for the movement of the items via acknowledgement receipts (TCP has ACK packets).
As a result, you get your items really quickly at your new home, but if something goes missing, you may not even know that it has gone missing because you receive everything without knowing the total number of items to be expected. You probably received almost everything, but you have no way of knowing if you've receive everything.
The "Transport Layer" handles traffic between hosts and clients (TCP/UDP).
UDP refers to the User Datagram Protocol (UDP).
Open Systems Interconnection Model (a seven layer model).