UDP


Intro

Multiplexing and De-multiplexing

This is how we can send messages to specific applications within one IP address, as well as send multiple messages from one IP address. Both of these are resolved using ports

Therefore, when using UDP, the transport layer is responsible for labelling packets with the port number of the origin application as well as the port number for the destination application.

UDP Header

UDP prepends four 2-byte fields as a header to every datagram, so the header is 8 bytes in size.

  1. Source port
  2. Destination port
  3. Datagram length
  4. Checksum

Why UDP?

  1. UDP is faster, since it doesn't have the overhead of the TCP retransmission mechanism.
  2. Reliability can be built on top of UDP.
  3. UDP gives finer control over what messages are sent, when they're sent, and how reliably they're sent.
  4. UDP allows custom protocols
  5. Quick UDP Internet Connections (QUIC) is an experimental transport layer built on top of UDP and designed by Google. It is used by most Chrome connections to Google's servers.
  6. UDP has a smaller header, and so is significantly faster.

Examples of UDP

  1. Xbox Live
  2. DNS
  3. Failed messages are either resent, or send to another server.
  4. Used because DNS is a bottleneck, so it makes web browsing as a whole quicker.
  5. Network management & monitoring
  6. See Simple Network Management Protocl.

Exercise:

tcpdump captures packets. Here is an example from the output of tcpdump udp -X -c 1.