What is a Datagram?
A datagram is a small piece of data that is sent over a network. It is similar to a packet, but it does not guarantee delivery or order of arrival. Datagrams are used in connectionless communication protocols, where the sender does not establish a connection with the receiver before sending data. Instead, the sender sends a stream of datagrams and the receiver receives them as they arrive.
Datagrams are useful in situations where it is not necessary to ensure the exact order of arrival, such as in real-time applications like video streaming or online gaming. They are also useful in networks with high latency or packet loss, as they can be retransmitted if they are lost or corrupted during transmission.
Some common protocols that use datagrams include UDP (User Datagram Protocol), DCCP (Datagram Congestion Control Protocol), and SCTP (Stream Control Transmission Protocol).