NAT & Port Forwarding
Read this concept as one more decision made about a packet in flight. The widget below lets you change the inputs and watch the consequence instead of memorising the rule.
Why it matters
Private addresses cannot be routed on the public Internet, so NAT rewrites headers at the boundary and keeps state to map replies back. That rewriting makes the connection look different at each end.
On the wire
An outbound packet has its source address and often source port replaced, with the mapping stored in a translation table keyed by protocol, internal endpoint, and external port. Reply packets arriving on the external endpoint are rewritten back to the internal address and port.
When it breaks
An expired mapping drops an incoming reply, so a long-idle connection fails while the application thinks it is still open. Two internal hosts choosing the same external port collide unless the NAT assigns a different one, and protocols that embed addresses in payload need special handling.
Header inspector
Click a field to read what it controls, then change the values that a router or receiver would see.