Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We know that IP/TCP has checksum mechanism to guarantee communication reliability.

However, when a IP/TCP packet is relayed by router or NAT, the IP header may be modified, if if the router/NAT doesn't modify the IP header checksum and TCP header checksum, when the package arrives the destination node, the IP/TCP stack of that node will refuse to accept the packet.

So my question is, do router/NAT modify IP/TCP header checksum when they are relaying packets?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Yes. NATs modify both, and routers only modify the IP header checksum.

share|improve this answer
    
does each router/NAT check the IP/TCP header checksum before it relays the packet? –  misteryes May 24 '13 at 14:27
    
Routers aren't supposed to know or care about higher layers, so they only check the IP header checksum. NATs may check both, but some NAT implementations might modify the checksum without seeing if it's good first. So if the checksum were, say, off by 4, it would still be off by 4 after NAT had been done to it. –  Spiff May 24 '13 at 14:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.