This toy NAT example shows one outbound UDP rewrite, not full NAT behavior.
The repaired packet verifies
After rewriting source address and source port, both repaired checksums verify to all ones.
valid fold = 0 x f f f f \text{valid fold}=0xffff valid fold = 0 x ffff
After checksums verify The repaired after IP header and UDP checksum input both verify. After IP verify - verify row index value word 0 0x4500 word 1 0x001e word 2 0x2222 word 3 0x4000 word 4 0x4011 word 5 0xb23e word 6 0xcb00 word 7 0x7105 word 8 0xc633 word 9 0x6435 raw sum 0x0003fffc folded 0xffff result 0xffff After UDP verify - verify row index value word 0 0xcb00 word 1 0x7105 word 2 0xc633 word 3 0x6435 word 4 0x0011 word 5 0x000a word 6 0xf230 word 7 0x0035 word 8 0x000a word 9 0x3e9c word 10 0x6869 raw sum 0x0003fffc folded 0xffff result 0xffff
Checked values
The after IP checksum is 0xb23e, and the after UDP checksum is 0x3e9c.
0 x b 23 e , 0 x 3 e 9 c 0xb23e,0x3e9c 0 x b 23 e , 0 x 3 e 9 c
After checksums verify The repaired after IP header and UDP checksum input both verify. After IP verify - verify row index value word 0 0x4500 word 1 0x001e word 2 0x2222 word 3 0x4000 word 4 0x4011 word 5 0xb23e word 6 0xcb00 word 7 0x7105 word 8 0xc633 word 9 0x6435 raw sum 0x0003fffc folded 0xffff result 0xffff After UDP verify - verify row index value word 0 0xcb00 word 1 0x7105 word 2 0xc633 word 3 0x6435 word 4 0x0011 word 5 0x000a word 6 0xf230 word 7 0x0035 word 8 0x000a word 9 0x3e9c word 10 0x6869 raw sum 0x0003fffc folded 0xffff result 0xffff
What this does not model
NOTE: toy outbound UDP NAT rewrite only; not state tables, inbound reply matching, port exhaustion, TCP NAT, firewall policy, checksum offload, IP version 6, or real capture timing.
toy rewrite = 1 \text{toy rewrite}=1 toy rewrite = 1
After checksums verify The repaired after IP header and UDP checksum input both verify. After IP verify - verify row index value word 0 0x4500 word 1 0x001e word 2 0x2222 word 3 0x4000 word 4 0x4011 word 5 0xb23e word 6 0xcb00 word 7 0x7105 word 8 0xc633 word 9 0x6435 raw sum 0x0003fffc folded 0xffff result 0xffff After UDP verify - verify row index value word 0 0xcb00 word 1 0x7105 word 2 0xc633 word 3 0x6435 word 4 0x0011 word 5 0x000a word 6 0xf230 word 7 0x0035 word 8 0x000a word 9 0x3e9c word 10 0x6869 raw sum 0x0003fffc folded 0xffff result 0xffff
Summary
NAT changes return address fields, then repairs the checksums those fields feed.
checksums repaired = 2 \text{checksums repaired}=2 checksums repaired = 2
After checksums verify The repaired after IP header and UDP checksum input both verify. After IP verify - verify row index value word 0 0x4500 word 1 0x001e word 2 0x2222 word 3 0x4000 word 4 0x4011 word 5 0xb23e word 6 0xcb00 word 7 0x7105 word 8 0xc633 word 9 0x6435 raw sum 0x0003fffc folded 0xffff result 0xffff After UDP verify - verify row index value word 0 0xcb00 word 1 0x7105 word 2 0xc633 word 3 0x6435 word 4 0x0011 word 5 0x000a word 6 0xf230 word 7 0x0035 word 8 0x000a word 9 0x3e9c word 10 0x6869 raw sum 0x0003fffc folded 0xffff result 0xffff