I was trying to understand UDP checksum mechanism. I am using this packet. I saw an example that in summation of all field, UDP length is included twice. Why we need to include UDP length twice in the checksum ?
This is the example I saw
IP header: Source IP address c0a8
… 0291
IP header: Destination IP address c0a8
… 0101
IP header: Protocol number(zero padded on left) 0011
16 bit UDP Length 0032
UDP header: source port 0618
UDP header: destination port 0035
UDP header: length 0032
UDP Data
0001
0100
0001
0000
0000
0000
0131
0131
0331
3638
0331
3932
0769
6e2d
6164
6472
0461
7270
6100
000c
0001
- Sum all hex values 181e
- Carry 4
- Add in the carry 1822
- 1s complement = checksum! E7dd