Unreliable Communication Layers

This lesson discusses UDP/IP as an example of an unreliable communication layer.

As we discussed in the last lesson, packet loss is very common in networking. One simple way is this: we don’t deal with it. Because some applications know how to deal with packet loss, it is sometimes useful to let them communicate with a basic unreliable messaging layer, an example of the end-to-end argument one often hears about (see the Aside in this later lesson of the chapter).

Example of unreliable communication layer: UDP/IP

One excellent example of such an unreliable layer is found in the UDP/IP networking stack available today on virtually all modern systems. To use UDP, a process uses the sockets API in order to create a communication endpoint; processes on other machines (or on the same machine) send UDP datagrams to the original process (a datagram is a fixed-sized message up to some max size).

The code files below show a simple client and server built on top of UDP/IP:

Get hands-on with 1200+ tech skills courses.