UDP

What
UDP is a transport layer protocol that provides the following services: Because UDP does not guarantee that data will arrive at end hosts intact or at all and there is no handshaking process involved, it is said to be connectionless
 * process-to-process data delivery
 * error detection

Process to Process Data Delivery
This service requires we implement both the multiplexing and demultiplexing processes

Multiplexing
When we need to send a UDP segment, we just fill out a standard transport layer segment and package it into an IP datagram and send it off to the correct IP address. IP then makes a best effort delivery.

Demultiplexing
When we receive a UDP segment, we check which port to send the segment to and it correctly routes the segment

UDP Segment
The UDP segment has the standard source port number and destination port number. It also has two additional fields

Length
This 2 byte (16 bit) field specifies how long the segment is including the header length

Checksum
This checksum is checked by the receiver and used as an error detection code. UDP does not have any built in functionality to recover from an error. Sometimes it will discard the damaged segment and sometimes it will pass it on with a warning

Finer Grain Control
With UDP, the transport protocol immediately creates a segment and passes it to IP for transport when it receives some application layer data

No Connection Establishment
With UDP, we do not need to have a 3 step handshaking process and because of this, we can avoid the delay of having to establish a connection

No Connection State
With UDP, we do not need to keep any additional information about the messages in order to implement features such as reliable delivery. Therefore, we lower the amount of data that we need to keep around per connection

Small Packet Header Overhead
We only need 8 bytes of header with UDP versus the 20 bytes we need for TCP