Network address translation
lastmod 2026-08-23created 2017-01-1323 edits
Network address translation (NAT) is a term used in computer networking for a technique that sends and receives network traffic through a router while rewriting the TCP/UDP port numbers and the source and destination IP addresses of IP packets. Because the packets change, the IP and TCP/UDP checksums must also be recalculated and rewritten. NAT is usually used so that multiple hosts on a private network can access the Internet using a single public IP address. Many network administrators regard NAT as a convenient technique and use it widely. Since NAT can increase the complexity of communication between hosts, it naturally can affect network performance.
NAT implementation classifications
Full-cone NAT
| | All requests from internal hosts are mapped to the same external IP and port. |
(Address)-restricted-cone NAT
| | The port mapped on the NAT varies with the destination address. |
Port-restricted cone NAT
| | The port mapped on the NAT varies with the destination address. |
Symmetric cone NAT
| | The port mapped on the NAT varies with the destination address and port. |
A case for TURN
When a STUN server is no longer enough, a TURN server must be used to relay media. Not every symmetric NAT needs a TURN server.
| - | ||||
Korean: 홀펀칭 (Hole punching)
See Hole punching for details.
NAT Traversal
Mapping Behavior
Filtering Behavior
Oridengi's stories about LAN communication
- Master the three tables and LAN communication is done!! - Goduck2-LAN-1.pdf
- ARP is the flower of Ethernet communication - Goduck2-LAN-2.pdf
- Ethernet switches are Plug & Play? - Goduck2-LAN-3.pdf
- How is the Routing Table related to the Router? - Goduck2-LAN-4.pdf
- What if there were no Proxy ARP? - Goduck2-LAN-5.pdf
- Gratuitous ARP is so useful, so why is it named "free" ARP? - Goduck2-LAN-6.pdf
- Subnet, subnet, Subnet Mask - Goduck2-LAN-7.pdf
- VLAN - I want to know about it. - Goduck2-LAN-8.pdf
- No tag (VLAN Tag) means it's a native (Native)? - Goduck2-LAN-9.pdf
See also
- Router
- Hole Punching
- Port address translation (PAT)
- WebRTC
- Session Traversal Utilities for NAT (STUN)
- Traversal Using Relays around NAT (TURN)
- Interactive Connectivity Establishment (ICE)
- ipcalc - IP calculator. Calculates host ranges, netmasks, and more.
- L4 Switch
- VPN (Virtual Private Network)
Favorite site
- Wikipedia (en) description of NAT
- KLDP: description of NAT
- Zetawiki: Network address translation NAT
- [Diagrams] What is WebRTC? (Understanding STUN and TURN servers) (2)
Tutorials
- L4 Switch#Network engineer Hwanyoung's tech blog: Understanding L4 switches easily - part of a recommended tutorial:
- Understanding L4 switches easily #3 (NAT) - Easy_to_understand_L4_switch_-_06.pdf (NAT)
- Understanding L4 switches easily #5 (Source IP NAT problem) - Easy_to_understand_L4_switch_-_08.pdf (NAT)
- Understanding L4 switches easily #6 (Solving the Source IP NAT problem) - Easy_to_understand_L4_switch_-_09.pdf (NAT)
- [Recommended] Understanding NAT easily 1
- Understanding Source IP NAT easily - Easy_to_understand_L4_switch_-_17.pdf (NAT)
- Understanding Destination IP NAT easily - Easy_to_understand_L4_switch_-_18.pdf (NAT)
Tutorials
- Introduction to NAT (Network Address Translation) (RFC 3022/2663)
- NAT devices should be built like this... (RFC 4787) - Part 1: Mapping Behavior
- NAT devices should be built like this... (RFC 4787) - Part 2: Filtering Behavior
- NAT devices should be built like this... (RFC 4787) - Part 3: Deterministic Properties
- Differences between STUN (RFC 3489) and STUN (RFC 5389/5780) (STUN, NAT)
- NAT Behavior Discovery using STUN (RFC 5780) (STUN, NAT)
References
-
NAT_easy_to_understand.pdf ↩
- Computer Network
- ComputerNetwork:Basic
- Hole punching
- Interactive Connectivity Establishment
- Internet Protocol
- Iptables
- NAT traversal
- Nebula Overlay Networking
- Net.bridge.bridge-nf-call-ip6tables
- Net.bridge.bridge-nf-call-iptables
- Net.ipv4.ip forward
- Network bridge
- Network Programming
- Network switch
- Port address translation
- Programming
- Router
- Session Traversal Utilities for NAT
- Subnetwork
- TCP hole punching
- Traversal Using Relays around NAT
- UDP hole punching
- Universal Plug and Play
- WebRTC