Transport Layer

# Connectionless Transport: UDP

UDP takes messages from the application process, attaches source and destination port number fields for the multiplexing/demultiplexing service, adds two other small fields, and passes the resulting segment to the network layer

UDP can be choose over TCP for the following reasons:

• Finer application-level control over the sent data - Real-time applications often require a minimum sending rate, do not want to overly delay segment transmission, and can tolerate some data loss
• No connection establishment - UDP just blasts away without any formal preliminaries getting rid of set up delay
• No connection state - By not maintaining a connection state a server can typically support many more active clients when the application runs over UDP rather than TCP
The UDP checksum is used to check for data corruption. It’s created by calculating the $1s$ complement of the sum of all 16 bit word in the segment (with the overflow carried around). On the receiving side, to check for data integrity is sufficient to sum this checksum with the sum of all 16 bit word in the segment, for the data to be not altered the result should be 1111111111111111.