

Datagram Datagram is a type of packet that represents an entire communication. There is no necessity to have connection or disconnection stages when communicating using datagrams. This is less reliable than TCP/IP. There are two classes in Java, which enables communication-using datagrams. DatagramPacket is the class, which acts as the data container, and DatagramSocket is a mechanism used to send or receive DatagramPackets.