Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 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.

Similar presentations


Presentation on theme: "1 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."— Presentation transcript:

1 1 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

2 2 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

3 3 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

4 4 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 "1 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."

Similar presentations


Ads by Google