NAT (Network Address Translation)

Networking · Last updated · About 5 min read

What It Does

Network Address Translation (NAT) is a router function that rewrites the source and/or destination IP addresses (and often port numbers) of packets as they cross the router. The most common form is many-to-one NAT: a router — typically a home or office router, or a site's gateway router — gives every device behind it a private IPv4 address, then rewrites each outbound packet's private source address to the router's own single public IP address (and picks a unique port number to track the mapping), so that many internal devices can all share one public-facing address on the internet. When a reply comes back addressed to that public address and port, the router looks up its translation table and rewrites the packet back to the correct internal private address before forwarding it to the right device.

How many-to-one NAT shares one public address A dispatch PC, a RadioPro gateway and a technician laptop on 192.168.1.10, .11 and .12 each send traffic to a site router whose public address is 203.0.113.7. The router's translation table maps each inside address and port to the one public address with a different port, 40001, 40002 and 40003, so replies can be sent back to the right device. Many private addresses, one public addressThe router rewrites the source address and port on the way out, and puts them back on the way inDispatch PC192.168.1.10 : 49152RadioPro gateway192.168.1.11 : 51000Technician laptop192.168.1.12 : 49999Site routerprivate side192.168.1.1public side203.0.113.7The internetsees only203.0.113.7The translation table the router keepsInside address and portOutside address and portWhere replies go192.168.1.10 : 49152203.0.113.7 : 40001back to the dispatch PC192.168.1.11 : 51000203.0.113.7 : 40002back to the gateway192.168.1.12 : 49999203.0.113.7 : 40003back to the laptopA reply only gets in because the table already has a row for it, put there by traffic that startedinside. That is why an unsolicited connection from outside has nowhere to go — and why reaching a deviceon purpose needs port forwarding or a tunnel.
The port number is what keeps the conversations apart. One public address can carry thousands of them at once.

Why NAT Exists

Two main reasons:

This let the internet keep growing well past what a strict one-public-address-per-device model would have allowed. - A basic layer of obscurity/security. Because internal, privately-addressed devices are never directly addressable from the public internet, NAT incidentally also means an outside party generally cannot open an unsolicited connection straight to an internal device — it can only reach whatever the router's translation table happens to have mapped at that moment (typically only in response to traffic the internal device itself initiated, unless the router is explicitly configured otherwise). This isn't a substitute for a firewall, but it does add a real, if modest, layer of protection.

NAT Traversal

NAT traversal is the general problem of establishing a direct, real-time connection between two endpoints when one or both of them sit behind NAT — a common requirement for VoIP/RoIP calls, video conferencing, and other peer-to-peer style traffic. The difficulty is that NAT normally only permits inbound packets that correspond to a connection the inside device itself initiated; an outside party trying to reach into a NAT'd network unsolicited generally cannot, which breaks the simple assumption that either endpoint can just "call" the other by its address.

Common solutions:

  • STUN (Session Traversal Utilities for NAT). A lightweight protocol that lets a device behind a NAT discover what public IP address and port the NAT is actually using to represent it on the outside. If both endpoints in a call can learn their own public-facing address/port this way, and network conditions allow it, they can often connect to each other directly (peer-to-peer) without any media traffic passing through a third party.
  • TURN (Traversal Using Relays around NAT). A fallback used when a direct STUN-discovered path isn't possible (for example, because of a restrictive or symmetric NAT). A TURN server actively relays traffic between the two endpoints, at the cost of extra latency and server bandwidth, but it works in cases where direct traversal cannot.
  • Port forwarding. A static, manually-configured rule on the NAT router that always forwards a specific external port to a specific internal device/port, making that internal service permanently and predictably reachable from outside without relying on the device to have first initiated a connection. This is a common way to make a fixed piece of infrastructure — such as a RoIP gateway or dispatch console server, see RoIP (Radio over IP) — reliably reachable from outside its own private network.

Double NAT

"Double NAT" describes a network path where traffic passes through two separate layers of NAT translation rather than just one. A common example: a customer's own router performs NAT for their internal LAN, but that router is itself plugged into an ISP-provided modem/gateway that is also doing NAT — so a device's traffic gets translated twice before it ever reaches the public internet. When an ISP does this at scale across many customers sharing a much smaller pool of public addresses, it's specifically called Carrier-Grade NAT (CGNAT) — a technique ISPs use to conserve their own dwindling public IPv4 address allocations by putting many customers behind shared public addresses, rather than one public address per subscriber.

Double NAT (and CGNAT specifically) is a common, genuinely practical troubleshooting culprit for connectivity problems with:

  • Remote RoIP gateways or radio-IP gateways that need to be reached from outside a customer's network
  • Dispatch console software connecting to a gateway across the internet
  • Any real-time VoIP/RoIP link relying on NAT traversal to establish a direct or relayed media path

The reasons double NAT causes trouble:

  • STUN often can't see the true public address. STUN is designed to discover the address at the outermost NAT boundary, but with two layers of NAT stacked, a naive STUN exchange from the inner device may only learn the intermediate (still-private, ISP-side) address rather than the actual internet-facing one — leaving the endpoint unable to correctly advertise a reachable address to the other party.
  • Some NAT traversal techniques fail outright. Certain NAT behaviors common on CGNAT deployments (e.g., symmetric NAT, where the external port mapping changes per destination) can defeat STUN-based direct connection attempts entirely, forcing a fallback to TURN relay — and in some CGNAT configurations, even that can be unreliable.
  • Port forwarding generally doesn't work through CGNAT. Because the customer doesn't control the ISP-level NAT layer, they cannot configure a port-forward rule on it — bridge mode or port-forwarding changes on the customer's own router have no effect on the ISP's carrier-grade NAT layer, so a static forwarding rule that would normally make a gateway reachable from outside simply doesn't apply.

For this reason, when a remote gateway, RoIP link, or dispatch console at a customer site can't establish or hold a stable connection, checking for double NAT/CGNAT (for example, by checking whether the customer's router's own WAN-facing IP address is itself a private address, such as one in the 100.64.0.0/10 range commonly used for CGNAT, rather than a public one) is a useful, concrete diagnostic step.

References

See also: CTI product documentation

This article is part of the CTI Products Knowledge Base. Questions about RadioPro or MCN products? Call +1 (513) 595-5900 or email info@ctiproducts.com.

Informational only. This article is general background and is not engineering, safety, legal or regulatory advice. Verify requirements with the equipment manufacturer and the applicable authority before relying on it. Product names and trademarks belong to their respective owners.