Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 441: Checksum1 Instructor: Carey Williamson Office: ICT 740 Class Location: MFH 164 Lectures:

Similar presentations


Presentation on theme: "CPSC 441: Checksum1 Instructor: Carey Williamson Office: ICT 740 Class Location: MFH 164 Lectures:"— Presentation transcript:

1 CPSC 441: Checksum1 Instructor: Carey Williamson Office: ICT 740 Email: carey@cpsc.ucalgary.cacarey@cpsc.ucalgary.ca Class Location: MFH 164 Lectures: TR 8:00 – 9:15 Notes derived from “ Computer Networking: A Top Down Approach Featuring the Internet”, 2005, 3 rd 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). Checksum Calculations

2 CPSC 441: Checksum2 IP Checksum Calculation At the sender r Set the value of the checksum field to 0. r Divide the header into 16-bit words m Add all segments using one’s complement arithmetic r The final result is complemented to obtain the checksum At the receiver r Divide header into 16-bit words, adds them, and complement’s the results r All zero’s => accept datagram, else reject

3 CPSC 441: Checksum3 Binary Checksum Example 001 0001 00000000001 000000000001 0000000000001 00000000000001 000000000000001 0000100010001001 1000000000010001 1001111100011111 0010011110111001 1 0010011110111010 1101100001000101 Carry from 1 st column Carry from 2 nd column Carry from 3 rd column Carry from 4 th column Carry from 5 th column Carry from 13 th column Carry from 12 th column Carry from 16 th column

4 CPSC 441: Checksum4 UDP Checksum r Add pseudo-header r Fill checksum with 0’s r Divide into 16-bit words (adding padding if required) r Add words using 1’s complement arithmetic r Complement the result and put in checksum field r Drop pseudo-header and padding r Deliver UDP segment to IP source port #dest port # 32 bits data (add padding to make data a multiple of 16 bits) length checksum 32-bit source IP address 32-bit destination IP address length protocol 0’s The pseudo-header

5 CPSC 441: Checksum5 Checksum calculation at Receiver r Add pseudo-header to the UDP segment r Add padding, if needed r Divide into 16-bit words and add words using 1’s complement arithmetic r Complement result r If result is all 0’s m Drop pseudo-header and padding (if any) m Accept segment Else drop segment


Download ppt "CPSC 441: Checksum1 Instructor: Carey Williamson Office: ICT 740 Class Location: MFH 164 Lectures:"

Similar presentations


Ads by Google