One of my assignment questions has me reading a wireshark packet. Within this dns UDP packet is the checksum. I need to MANUALLY calculate the checksum in binary and I'm having trouble with it.
I know in a UDP header there is the:
Pseudoheader: 32-bit source IP address
32-bit destination IP address
all 0s, 8-bit protocol(17), 16-bit UDP total length
Header: Source port address 16 bits, Destination port address 16 bits
UDP total length 16 bits, checksum 16 bits.
Data (30 bytes)
In this packet, the source IP address is: 128.238.38.160 - 10000000 11101110, 00100110 10100000
The destination IP address is: 128.238.29.23 - 10000000 11101110, 00011101 00010111
Length: 38 - 00000000 00100110
Source port: 3163 - 00001100 01011011
Destination Port: 53 - 00000000 00110101
Length: 38 - 00000000 00100110
Domain Name Data:
00000000 01101110
00000001 00000000
00000000 00000001
00000000 00000000
00000000 00000000
00000000 00000000
00000011 01110111
01110111 01110111
00000100 01101001
01100101 01110100
01100110 00000011
01101111 01110010
01100111 00000000
00000000 00000001
00000000 00000001
So how does the checksum calculation work, especially with wraparounds?