Content
- UDP v.s. TCP
- User Datagram Protocol (UDP)
- UDP Header
- Internet checksum
UDP v.s. TCP
- UDP
- No guarantee on data delivery
- No guarantee on arrival order of segments
- Optional error checking
- TCP
- Reliable data transfer
- In order & correct data transfer
- Error checking, acknowledgement, sequencing, retransmission
- Flow control
- Not overflowing buffer for receiving side
- Congestion control
- Not sending excessive data and overflow buffer for packet switches
- Connection management
- Services not provided
- Delay guarantees
- Bandwidth guarantees
User Datagram Protocol (UDP)
- Minimal transport layer services provided
- Multiplexing & demultiplexing
- Allow process-to-process delivery (different from raw IP host-to-host)
(destnation IP, destination port)
for demultiplexing, not caring about source
- Connectionless
- No connection setup needed
- Less overhead managing the logical communication channel
- Not able to precompute optimized data routes
- Independent data segment handled
- Need to provide sender/receiver's address in the header of each segment
- Small UDP header
- No flow/congestion control
Internet checksum
- Sending side
- View the message of k-bit strings as a sequence of 16-bit strings, add with one's complement addition ->
X
- i.e. carryout added to least significant bit
- Take one's complement -> checksum
~X
- Append to original message ->
M + ~X = M'
- Receiving side
- Add the message with one's complement addition ->
M' = M + ~X = X + ~X = all 1s
- Take one's complement ->
0