CheckSum calculation

+1 vote

Calculate the checksum for the following ICMP packet:
Type: Echo Request
Identifier: 123
Sequence number: 25
Message: HELLO
Assume that message is divided into 8-bits(1 bytes)

Checksum is of 16 bits so we have to make everything of 16 bits either by padding or by grouping So,

Type =8 and Code =0 (For ICMP packet) 0800 in hex

Similarly Identifier 7B in hex , Sequence number = 19 in hex , H & E = 4845  , L & L = 4C4C ....Now O gets left out now my doubt is while padding O with 0(zeros) we have to pad it after the Letter O or before letter O.........Somewhere I read it will be 004F but it should be 4F00 right????

asked Nov 9, 2016 in Computer Networks by hi2saifgmail-com (2,770 points)

2 Answers

0 votes
if u pad after you will change the value of the number. you should pad before so that the value does not change
answered Nov 10, 2016 by kanyal-pranjalgmail-com (2,660 points)
0 votes

A check sum is basically a value that is computed from data packet to check its integrity. Through integrity, we mean a check on whether the data received is error free or not. This is because while traveling on network a data packet can become corrupt and there has to be a way at the receiving end to know that data is corrupted or not. This is the reason the checksum field is added to the header. At the source side, the checksum is calculated and set in header as a field. At the destination side, the checksum is again calculated and crosschecked with the existing checksum value in header to see if the data packet is OK or not. This source gives you complete idea on finding IP header checksum.

 

answered Dec 3, 2016 by maxcburger (140 points)
...