1Stan KurkovskyComputer NetworksConnectionless Transport:UDPBased on Computer Networking, 4thEdition by Kurose and RossStan KurkovskyUDP: 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 othersWhy 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 desired2Stan KurkovskyUDP• 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 bitsApplicationdata (message)UDP segment formatlengthchecksumLength, inbytes of UDPsegment,includingheaderStan KurkovskyUDP checksumGoal: detect “errors” (e.g., flipped bits) in transmitted segmentSender:• 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 fieldReceiver:• compute checksum of received segment• check if computed checksum equals checksum field value:• NO - error detected• YES - no error detected. But maybe errors nonetheless?3Stan KurkovskyInternet 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 integers1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 01 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 11 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 11 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 01 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1
View Full Document