Presentation is loading. Please wait.

Presentation is loading. Please wait.

Checksum Calculations

Similar presentations


Presentation on theme: "Checksum Calculations"— Presentation transcript:

1 Checksum Calculations
Instructor: Anirban Mahanti Office: ICT 745 Class Location: ICT 122 Lectures: MWF 12:00 – 12:50 hours Text Book: “Computer Networking: A Top Down Approach Featuring the Internet”, 3rd edition, Jim Kurose, Keith Ross Addison-Wesley, 2005. Slides are adapted from the companion web site of the book. 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


Download ppt "Checksum Calculations"

Similar presentations


Ads by Google