AB 19 — NAT und PAT
Network Address Translation (NAT) is a method used in computer networking to remap one IP address space into another. This is commonly used to allow multiple devices on a private network to access the internet using a single public IP address.
🔧 Key Concepts of NAT:
Private vs. Public IPs
Private IPs: Used within local networks (e.g., 192.168.x.x, 10.x.x.x, 172.16.x.x – 172.31.x.x)
Public IPs: Routable on the internet
Purpose of NAT
Reduce the need for a large number of public IP addresses
Enhance security by hiding internal IP addresses
Allow internal devices to access external networks (e.g., the internet)
📦 Types of NAT:
| Type | Description |
|---|---|
| Static NAT | One-to-one mapping between private and public IP. Always the same. |
| Dynamic NAT | Maps private IPs to a pool of public IPs. Not guaranteed to be the same. |
| PAT (Port Address Translation) | Also called NAT overload; many private IPs share one public IP, differentiated by port numbers. |
🔄 How NAT Works (PAT Example)
| Private IP | Port | Public IP | Translated Port |
|---|---|---|---|
| 192.168.1.2 | 1035 | 203.0.113.5 | 49100 |
| 192.168.1.3 | 1040 | 203.0.113.5 | 49101 |
When packets return, NAT uses the port number to forward the response to the correct internal device.
🔒 Advantages of NAT
Conserves global IP address space
Hides internal network structure
Adds a layer of security
⚠️ Limitations
Can complicate peer-to-peer communications (e.g., VoIP, gaming)
NAT traversal may require extra configuration (e.g., STUN/TURN for WebRTC)