Network Address Translation
# Network Address Translation
IPv4 addresses are only 32 bits long which provides a maximum of 4.29 billion unique IP addresses.
# Solution
Introduce NAT devices at the edge of the network, each of which would be responsible for maintaining a table mapping of local IP and port tuples to one or more globally unique (public) IP and port tuples (Figure 3-3).
# NAT Traversal
# Problems while using a NAT
- Client may not know the public IP address: if the client communicates its private IP address as part of its application data with a peer outside of its private network, then the connection will inevitably fail.
- NAT table may not have the mapping of a public IP of a packet
# Session Travel Utilities for NAT (STUN)
Helps the application obtain the public IP and port tuple of the current connection:
- Discover the IP address and port tuple for the connection
- Establish the NAT routing entry for the host application
- Keepalive pings to keep NAT entries from timing out
# Traversal Using Relays around NAT (TURN)
When STUN fails (blocked by firewall etc.), we can use a relay to transmit the data between peers.
# Interactive Connectivity Establishment (ICE)
Establishes a set of methods to find the most efficient tunnel between participants: direct connection where possible using STUN if needed and TURN if failure.