This toy NAT example shows one outbound UDP rewrite, not full NAT behavior.

highlighted = computed this step

The repaired packet verifies

After rewriting source address and source port, both repaired checksums verify to all ones.

valid fold=0xffff\text{valid fold}=0xffff
After checksums verifyThe repaired after IP header and UDP checksum input both verify.After IP verify - verifyrowindexvalueword00x4500word10x001eword20x2222word30x4000word40x4011word50xb23eword60xcb00word70x7105word80xc633word90x6435raw sum0x0003fffcfolded0xffffresult0xffffAfter UDP verify - verifyrowindexvalueword00xcb00word10x7105word20xc633word30x6435word40x0011word50x000aword60xf230word70x0035word80x000aword90x3e9cword100x6869raw sum0x0003fffcfolded0xffffresult0xffff

Checked values

The after IP checksum is 0xb23e, and the after UDP checksum is 0x3e9c.

0xb23e,0x3e9c0xb23e,0x3e9c
After checksums verifyThe repaired after IP header and UDP checksum input both verify.After IP verify - verifyrowindexvalueword00x4500word10x001eword20x2222word30x4000word40x4011word50xb23eword60xcb00word70x7105word80xc633word90x6435raw sum0x0003fffcfolded0xffffresult0xffffAfter UDP verify - verifyrowindexvalueword00xcb00word10x7105word20xc633word30x6435word40x0011word50x000aword60xf230word70x0035word80x000aword90x3e9cword100x6869raw sum0x0003fffcfolded0xffffresult0xffff

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
After checksums verifyThe repaired after IP header and UDP checksum input both verify.After IP verify - verifyrowindexvalueword00x4500word10x001eword20x2222word30x4000word40x4011word50xb23eword60xcb00word70x7105word80xc633word90x6435raw sum0x0003fffcfolded0xffffresult0xffffAfter UDP verify - verifyrowindexvalueword00xcb00word10x7105word20xc633word30x6435word40x0011word50x000aword60xf230word70x0035word80x000aword90x3e9cword100x6869raw sum0x0003fffcfolded0xffffresult0xffff

Summary

NAT changes return address fields, then repairs the checksums those fields feed.

checksums repaired=2\text{checksums repaired}=2
After checksums verifyThe repaired after IP header and UDP checksum input both verify.After IP verify - verifyrowindexvalueword00x4500word10x001eword20x2222word30x4000word40x4011word50xb23eword60xcb00word70x7105word80xc633word90x6435raw sum0x0003fffcfolded0xffffresult0xffffAfter UDP verify - verifyrowindexvalueword00xcb00word10x7105word20xc633word30x6435word40x0011word50x000aword60xf230word70x0035word80x000aword90x3e9cword100x6869raw sum0x0003fffcfolded0xffffresult0xffff