1 / 5

Checksum Calculations

Checksum Calculations. Instructor: Anirban Mahanti Office: ICT 745 Email: mahanti@cpsc.ucalgary.ca Class Location: ICT 122 Lectures: MWF 12:00 – 12:50 hours

landis
Download Presentation

Checksum Calculations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Checksum Calculations Instructor: Anirban Mahanti Office: ICT 745 Email: mahanti@cpsc.ucalgary.ca 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 Carry from 16th column 001 001 0001 0000 0000 001 0000 00000001 0000 0000 0000 1 0000 0000 000001 0000 0000 0000001 0000 1000 1000 1001 1000 0000 0001 0001 1001 1111 0001 1111 0010 0111 1011 1001 1 0010 0111 1011 1010 1101 1000 0100 0101 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 CPSC 441: Checksum

  4. UDP Checksum 32-bit source IP address 32-bit destination IP address The pseudo-header length protocol 0’s • 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 # checksum length 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

More Related