UDP:User Datagram Protocol [RFC 768] "no frills,""bare bones" Internet transport Why is there a UDP? protocol ▣no connection "best effort"service,UDP establishment (which can segments may be: add delay) o lost simple:no connection state o delivered out of order at sender,receiver to app ▣small segment header ▣connectionless: no congestion control:UDP o no handshaking between can blast away as fast as UDP sender,receiver desired o each UDP segment handled independently of others Transport Layer 3-16
Transport Layer 3-16 UDP: User Datagram Protocol [RFC 768] “no frills,” “bare bones” Internet transport protocol “best effort” service, UDP segments may be: lost delivered out of order to app connectionless: no handshaking between UDP sender, receiver each UDP segment handled independently of others Why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receiver small segment header no congestion control: UDP can blast away as fast as desired
UDP:more often used for streaming multimedia apps 32 bits o loss tolerant Length,in source port dest port o rate sensitive bytes of UDP →length checksum ▣other UDP uses segment, including o DNS header o SNMP reliable transfer over UDP: Application add reliability at data application layer (message) o application-specific error recovery! UDP segment format Transport Layer 3-17
Transport Layer 3-17 UDP: more often used for streaming multimedia apps loss tolerant rate sensitive other UDP uses DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error recovery! source port # dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header
UDP checksum Goal:detect "errors"(e.g.,flipped bits)in transmitted segment Sender: Receiver: treat segment contents ▣compute checksum of as sequence of 16-bit received segment integers check if computed checksum checksum:addition(1's equals checksum field value: complement sum)of o NO-error detected segment contents O YES-no error detected. ▣sender puts checksum But maybe errors value into UDP checksum nonetheless?More later field . Transport Layer 3-18
Transport Layer 3-18 UDP checksum Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? More later . Goal: detect “errors” (e.g., flipped bits) in transmitted segment
Internet Checksum Example 口Note o When adding numbers,a carryout from the most significant bit needs to be added to the result Example:add two 16-bit integers 111001100110010 1101010101010101 wraparound ①1011101110111011 sum 1011101110111100 checksum 0100010001000011 Transport Layer 3-19
Transport Layer 3-19 Internet Checksum Example Note When adding numbers, a carryout from the most significant bit needs to be added to the result Example: add two 16-bit integers 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound sum checksum
Chapter 3 outline 3.1 Transport-layer 3.5 Connection-oriented services transport:TCP ▣3.2 Multiplexing and o segment structure demultiplexing o reliable data transfer ▣3.3 Connectionless o flow control transport:UDP o connection management 3.4 Principles of ▣3.6 Principles of reliable data transfer congestion control 3.7 TCP congestion control Transport Layer 3-20
Transport Layer 3-20 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control