I want to write a program to generate udp checksum.
to validate my progra, I need some real data. I send a udp packet from one machine to another machine, the packet can be correctly received by the udp server. I captured the packet using tcp dump on both machines
from the udp client machine, the udp packet and pseudo IPV4 header bytes are(HEX format):
pseudo header
src dst ip: 8a60c948 8a60c96d
proto_num len: 0011 0016
UDP header: 83d87d000016 a79e
data: 49276d206e6f 742068657265210a
on the udp server machine(receiver):
pseudo header
src dst ip: 8a60c948 8a60c96d
proto_num and len: 0011 0016
UDP header: 83d87d000016 c2c5
data: 49276d206e6f 742068657265210a
the checksum should be calculated over
8a60c9488a60c96d0011001683d87d000016000049276d206e6f742068657265210a
where the checksum field is replaced by 0x0000
but we see that the checksum is changed from 0xa79e on the client to 0xc2c5 on the server side. why this change happens? and which is the correct udp header checksum? thanks!