how is tcp/udp checksum working?
I used raw socket to create some udp packets
and then send them to a udp server
I notice that when I put a wrong udp checksum number
the udp server doesn't accept it
but if I put all 0 on the checksum, the udp server accept it?
besides, I notice a pheonomenum: checksum offloading
I checked my machine:
it seems there is checksum offloading on my machine
[root@kit temp]# ethtool --show-offload eth0
Offload parameters for eth0:
when the checksum is 0, why the NIC doesn't modify the checksum of the outgoing packet?
finally, packets may get modified when they are in transmission
for example, TTL will decrease by number of hops
NAT may also modify the source ip addresses,
then the checksum will be obsolete,
in these cases, how checksum works?
the router will modify the checksum accordingly?
or the destination machine can smartly detect these and calculate the checksum accordingly?