This illustration uses a series of text boxes and arrows to indicate the series of steps in a client-server application using UDP. These steps appear in two side-by-side columns: the column on the left corresponds to the server, and is labeled "Server (Running on serverIP);" the column on the right corresponds to the client and is labeled as such.

Below the Server is a text box with blue and black text. It reads:

Create socket, port=x: (in black)

serverSocket = socket (AF_INET, SOCK_DGRAM) (in blue)

A black arrow points vertically downward to the next text box, which reads:

Read UDP segment from (in black)

serverSocket (in blue)

A black arrow points vertically downward to the next text box, which reads:

Write reply to (in black)

serverSocket (in blue)

specifying client address,

port number (in black)

Below the Client is a text box containing blue and black text it reads:

Create socket: (in black)

clientSocket = socket (AF_INET, SOCK_DGRAM) (in blue)

A black arrow points vertically downward to the next text box, which reads:

Create datagram with serverIP

and port=x;

send datagram via (in black)

clientSocket (in blue)

A blue arrow points leftward from this text box to the second text box below the Server ("Read UDP segment from serverSocket"). The third text box below the Server ("Write reply to serverSocket specifying client address, port number") has a blue arrow pointing from it to the next text box below the Client. This third text box below the Client also has a black arrow pointing to it from the second text box above it. The third text box reads:

Read datagram from (in black)

clientSocket (in blue).

A black arrow points vertically downward from this text box to the next one, which reads:

Close (in black)

clientSocket (in blue).