Download presentation
Presentation is loading. Please wait.
1
Checksum Calculations
Instructor: Anirban Mahanti Office: ICT 745 Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived from “Computer Networking: A Top Down Approach Featuring the Internet”, 2005, 3rd edition, Jim Kurose, Keith Ross, Addison-Wesley. Slides are adapted from the companion web site of the book, as modified by Anirban Mahanti (and Carey Williamson). CPSC 441: Checksum
2
IP Checksum Calculation
At the sender Set the value of the checksum field to 0. Divide the header into 16-bit words Add all segments using one’s complement arithmetic The final result is complemented to obtain the checksum At the receiver Divide header into 16-bit words, adds them, and complement’s the results All zero’s => accept datagram, else reject CPSC 441: Checksum
3
Binary Checksum Example
001 0001 1 Carry from 16th column Carry from 13th column Carry from 12th column Carry from 5th column Carry from 4th column Carry from 3rd column Carry from 2nd column Carry from 1st column The UDP checksum technique provides weak error detection – why? As an example, suppose that one bit is flipped from a 1 to 0 in a 16-byte segment, while another bit is flipped from a 0 to 1 in the next 16-byte segment (and that these errors align). Doesn’t detect error. Why used? Easier to implement in software. Also, we hope that other stronger error correction techniques are used at lower layers. CPSC 441: Checksum
4
UDP Checksum The pseudo-header Add pseudo-header
32-bit source IP address 32-bit destination IP address The pseudo-header 0’s protocol length Add pseudo-header Fill checksum with 0’s Divide into 16-bit words (adding padding if required) Add words using 1’s complement arithmetic Complement the result and put in checksum field Drop pseudo-header and padding Deliver UDP segment to IP source port # dest port # length checksum data (add padding to make data a multiple of 16 bits) 32 bits CPSC 441: Checksum
5
Checksum calculation at Receiver
Add pseudo-header to the UDP segment Add padding, if needed Divide into 16-bit words and add words using 1’s complement arithmetic Complement result If result is all 0’s Drop pseudo-header and padding (if any) Accept segment Else drop segment CPSC 441: Checksum
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.