Wednesday, January 9, 2008

Packets vs. datagrams

In general, the term packet applies to any message formatted as a packet, while the term datagram is generally reserved for the packets of an unreliable service. A reliable service is one where the user is notified if delivery fails. An unreliable one is where the user is not notified if delivery fails.

For example, IP provides an unreliable service. TCP uses IP to provide a reliable service, whereas UDP uses IP to provide an unreliable one. All these protocols use packets, but UDP packets are generally called datagrams.

When the ARPANET pioneered packet switching, it provided a reliable packet delivery procedure to its connected hosts via its 1822 interface. A host computer simply arranged the data in the correct packet format, inserted the address of the destination host computer, and sent the message across the interface to its connected IMP. Once the message was delivered to the destination host, an acknowledgement was delivered to the sending host. If the network could not deliver the message, it would send an error message back to the sending host.

Meanwhile, the developers of CYCLADES and of ALOHAnet demonstrated that it was possible to build an effective computer network without providing reliable packet transmission. This lesson was later embraced by the designers of Ethernet.

If a network does not guarantee packet delivery, then it becomes the host's responsibility to provide reliability by detecting and retransmitting lost packets. Subsequent experience on the ARPANET indicated that the network itself could not reliably detect all packet delivery failures, and this pushed responsibility for error detection onto the sending host in any case. This led to the development of the end-to-end principle, which is one of the Internet's fundamental design assumptions.

No comments: