A datagram is a unit of data transfer primarily used for wireless communication. Datagrams are similar to data packets in that they are both smaller pieces of data that make up a whole video, photograph, message, or other forms of online communication. All communication done over the Internet is usually broken down into smaller and more manageable bits of data called “datagrams” or “packets.”
Each datagram has a header that typically contains the IP addresses of the sender and the recipient. They also have payload sections that store the actual message. But despite having this structure, communication using datagrams is considered unreliable since data delivery is not guaranteed.
The word “datagram” was coined in the early 1970s and is a combination of “data” and “telegram.” However, the concept behind it dates back to the 1960s as a means of military communication.
Other interesting terms…
Read More about “Datagram”
Datagrams may sound old-school, but they are still present in our everyday online activities. And since it’s dubbed “unreliable,” you may wonder why it is still used in data transmission today. We explain more about datagrams below.
What Makes Datagrams Unreliable?
Formally, a datagram is defined by Request for Comments (RFC), the standard-setting publication for the Internet, as “a self-contained, independent entity of data carrying sufficient information to be routed from the source to the destination computer without relying on earlier exchanges between the two and the transporting network.”
Unpacking this definition, we know that a datagram is self-contained and independent, meaning it has all the information required to get the data to the destination computer. So how come data delivery is not guaranteed, making datagrams unreliable?
The second part of the definition plays a role here. Datagrams do not rely on earlier exchanges between the source and the transporting network because they don’t follow a predefined route. Therefore, the receiving network cannot confirm that it received the information.
It’s like the telegram system of old times, where you send a message to family members through telegraphy, but you won’t know for sure if they received it until you receive a response. Also, some telegrams may not arrive at all.
What Is the Difference between a Datagram and a Packet?
Datagrams and packets may often be interchangeable, but they have subtle differences. Both are units of information, but datagrams are lighter than most data packets.
Datagrams don’t require the destination computer to respond and communicate with the sender. For this reason, datagrams make data transmission faster, but they are not reliable since the source has no way of knowing if the data was indeed transmitted.
Data packets work differently. They carry more information so the recipient can confirm it received all data packets. As such, it is more reliable than datagrams, but it is also slower.
Where Is a Datagram Used?
Datagrams are mostly used in wireless communication. They are present in some types of packet switching, a data transmission method that divides data into packets. However, in connectionless packet switching, the data is split into datagrams. Hence, it is also referred to as “datagram switching.”
Each datagram contains a header with all the necessary information. But it doesn’t travel on the same route. As a result, datagrams don’t arrive at their destination in the correct order, and the destination computer would have to rearrange them appropriately. Still, some datagrams may not even reach the recipient.
The User Datagram Protocol (UDP) is one of the most prominent uses of datagrams. UDP is a network communication protocol that can be used in gaming, voice and video calls, and other online processes where latency is more critical than data loss.
You probably won’t notice a 2% packet or datagram loss when playing online games. But if the latency reaches more than 100 milliseconds, you may start getting frustrated. UDP can help speed up data transmission, although some data could get lost along the way.
—
Like data packets, datagrams are small units of data that need to be transmitted to the destination imprinted on their headers. However, it does not require the recipient to try and retrieve dropped data, making protocols that use datagrams both fast and unreliable. Despite the possibility of data loss, datagrams are helpful in communication where latency cannot be tolerated.