Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-18-2013 #1
- Join Date
- May 2012
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:
[root@kit temp]# ethtool --show-offload eth0 Offload parameters for eth0: rx-checksumming: on tx-checksumming: on scatter-gather: on tcp-segmentation-offload: off udp-fragmentation-offload: off generic-segmentation-offload: on generic-receive-offload: on large-receive-offload: off rx-vlan-offload: on tx-vlan-offload: on ntuple-filters: off receive-hashing: on
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?
Last edited by esolve; 03-18-2013 at 10:44 PM.
- 03-20-2013 #2
- Join Date
- Sep 2012
- Nashville, TN
I don't think UDP uses a checksum. It is a connectionless oriented protocol. TCP uses the checksum so that it can provided retransmission of packets. You will see faults as CRC errors normally.
*** NOTE ***
I actually stand corrected. After looking through cisco documentation it does use checksum but only for packet validity and to let the other host know wether or not to discard the packet.
- 03-25-2013 #3