Carrier-Grade Network Address Translation Overview

The IPv4 Exhaustion Challenge

The explosive global growth of connected devices, mobile technologies, and cloud services has led to the complete exhaustion of unallocated IPv4 addresses. While the industry is actively transitioning to IPv6, a massive portion of the internet and legacy infrastructure remains exclusively dependent on IPv4.

Because IPv6 and IPv4 are not backward compatible, broadband service providers must maintain connectivity for both address families simultaneously. Supporting this dual-stack reality by simply acquiring more public IPv4 addresses is no longer just prohibitively expensive—due to severe market scarcity, obtaining large blocks is now often impossible.

The Solution: Carrier-Grade NAT (CGNAT)

To bridge this gap alongside ongoing IPv6 deployments, Carrier-Grade Network Address Translation (CGNAT) serves as an essential technology. CGNAT efficiently manages the necessary remaining IPv4 connections, empowering service providers to serve massive subscriber bases using a highly restricted pool of publicly routable IPv4 addresses.

By safely translating private network addresses to shared public addresses, this solution eliminates the need to acquire new IPv4 blocks. It significantly reduces operational costs, conserves existing address pools, and ensures uninterrupted legacy connectivity while the long-term migration to a fully IPv6-dominant network continues.

CGNAT Overview

Architecture: NAT444

To extend the life of IPv4, CGNAT deployments commonly utilize the NAT444 network architecture. The "444" refers to the three distinct IPv4 addressing domains involved in the traffic path:

  • The customer’s local private network.

  • The service provider’s internal private network (often utilizing the CGNAT reserved space 100.64.0.0/10).

  • The public internet.

Core Mechanics: NAPT and Port Multiplexing

CGNAT is designed around Port Address Translation (PAT), widely referred to as Network Address and Port Translation (NAPT). NAPT offers the greatest potential for IPv4 address conservation by allowing multiple internal devices to share a single public IPv4 address.

  • Port Multiplexing: By dynamically translating both the source private IPv4 address and the transport-layer port number, a single public IPv4 address can simultaneously support thousands of concurrent connections.

  • Accurate Routing: The CGNAT router translates the private IP and original port into a shared public IP and a uniquely assigned port number. This unique assignment guarantees that inbound return traffic is accurately routed back to the correct initiating device.

The following diagram illustrates how CGNAT processes outbound and inbound traffic, showing three subscribers (10.18.18.1, 10.18.18.2, and 10.18.18.3) communicating with two different public servers (82.6.4.1 and 82.6.4.2).

CGNAT Traffic

Translation Methods and Logging Efficiency

Dynamic NAT & Port Block Allocation

Dynamic NAT automatically maps internal private addresses and ports to available public addresses and ports selected from a predefined pool. When a session ends, the resources are returned to the pool.

To dramatically reduce the massive logging overhead required for legal prosecution and compliance, CGNAT does not typically log every single translation. Instead, it utilizes Port Block Allocation. Ports are assigned to a subscriber in predefined blocks (e.g., 128, 256, up to 2048 ports), which can be extended by chaining multiple blocks as a user’s session requires them.

Static NAT

Unlike Dynamic NAT, Static NAT creates a fixed, manually configured 1:1 mapping between a specific internal private IP (and optionally, a port) and a public IP. Because the private device is consistently associated with the exact same public footprint, this configuration is primarily used when external internet devices require reliable, inbound access to internal resources like web or email servers.

Indirect Security Benefits (Topology Hiding)

While CGNAT is not a dedicated security function or a replacement for a stateful firewall, it does provide a distinct, indirect security benefit for IPv4 traffic known as topology hiding. By utilizing private internal addressing behind the CGNAT gateway, the internal IPv4 network structure remains completely invisible to the external internet. It is important to note that these protections are strictly a byproduct of the translation mechanics and apply exclusively to IPv4 traffic.

Why RtBrick RBFS CGNAT?

Performance at Carrier-Grade

To deliver true carrier-grade scalability, the RBFS CGNAT solution executes IPv4 address translation directly at the forwarding plane (hardware level). By offloading packet processing from the CPU to dedicated hardware, the system achieves massive throughput and ultra-fast translation rates. This hardware-accelerated implementation ensures optimal performance, allowing service providers to manage millions of concurrent IP and port mappings with zero impact on overall network latency or CPU load.

Endpoint-Independent Mapping (Full Cone NAT)

A key feature of the RBFS solution is its use of Endpoint-Independent NAT (historically classified as Full Cone NAT, 1:1 NAT, or NAT 1). In this operational mode, once a subscriber’s internal private IPv4 address and port are mapped to a public IPv4 address and port, that mapping remains open. Any external host on the internet can successfully send packets to the internal device by targeting the mapped public IP and port, regardless of whether the internal device previously initiated communication with that specific external host. This ensures high compatibility with peer-to-peer (P2P) applications, online gaming, and VoIP protocols.

Port Block Allocation (PBA)

While standard NAPT generates logs for every single session, the RBFS solution significantly reduces logging overhead by using Port Block Allocation. Instead of logging individual connections, the system assigns a predefined block of ports to a subscriber at once. Logs are generated only when a port block is allocated or released, dramatically reducing the storage and processing burden on the logging server.

Deterministic NAT

RBFS supports a deterministic NAT mode, which provides a highly consistent, static mapping between a subscriber’s private IPv4 address and a specific public IPv4 address. In this mode, a given private IPv4 address is always translated to the exact same public IP address for the duration of the subscriber’s session.

This stability is achieved by ensuring that whenever a subscriber requires additional ports, all of their port blocks are allocated from the same assigned public IPv4 address, rather than being scattered randomly across the entire public IP pool.

Many security-sensitive applications—such as online banking, gaming, and secure enterprise portals—monitor source IPs to validate session integrity. If a single subscriber’s traffic were to arrive from multiple different public IPv4 addresses simultaneously, these applications might falsely flag the behavior as a session hijacking attempt or a coordinated attack, leading to dropped connections. Deterministic NAT prevents this by presenting a single, unified public IP for all of a user’s connections.

NAT IP Pools and Chaining

A NAT pool consists of a defined range of publicly routable IPv4 addresses. Service providers can create multiple pools and assign them to specific NAT services. To ensure continuous service availability and prevent allocation failures, the system supports Pool Chaining. This method allows administrators to link pools sequentially. By defining a "next pool name", the system will automatically seamlessly transition to the designated next pool if the active pool’s IPv4 addresses become fully exhausted.

Ageing

Ageing refers to the duration a translation entry remains active in the address translation table after its last recorded packet is received. To optimize hardware resources and prevent table exhaustion, RBFS implements robust session timeout mechanisms that enforce a finite lifespan for all active entries.

When a host initiates an outbound connection, CGNAT maps the private IP and port to a public IP and port, recording this state in the translation table. For every subsequent inbound or outbound packet, the software queries this table to verify the active session and process the translation. If a mapped session remains idle without any packet exchange for a specified duration, the system reclaims the resources by removing the stale entry. This efficiently frees up table capacity for new traffic flows.

TCP Ageing: For connection-oriented protocols like TCP, the system actively monitors connection states. Flows are typically marked for rapid removal upon the receipt of TCP teardown packets (such as FIN-ACK or RST), indicating that both sides have successfully terminated the connection. If no teardown packets are received, the session is removed only after a configurable idle aging timer expires.

UDP Ageing: Because UDP is a connectionless protocol without explicit teardown signals, the system relies exclusively on tracking traffic activity. Idle UDP flows are cleared strictly when their respective aging timers expire. To manage resource consumption effectively under heavy traffic, the UDP aging mechanism scales dynamically. As the volume of active UDP flows increases, the system polling mechanism adjusts to ensure idle flows are identified and removed proportionally faster, preventing table overflows.

Ageing Timeout for UDP-based DNS Traffic

Administrators can define a granular, protocol-specific ageing timeout to control exactly how long the system maintains state information for UDP-based DNS traffic. Because DNS is a rapid request-and-reply protocol, maintaining long session states is unnecessary and wastes valuable port resources. A shorter timeout, such as 30 seconds, is highly recommended and frequently implemented specifically for DNS.

Note: While protocol-specific traffic like DNS can be tuned for rapid aging, the global default NAT ageing timeout is 300 seconds for standard TCP and UDP traffic. Additionally, the exact real-world time required to completely flush aged-out rules from the hardware may vary slightly depending on the total volume of active NAT rules and system counters currently being processed by the forwarding plane.

NAT for ICMP Messages

The NAT-enabled RBFS devices can perform network address translation for ICMP echo request and reply messages. Subscribers can use the ping command (ICMP Echo Request, Echo Reply) to check internet connectivity to external internet addresses when NAT is enabled. This feature is enabled by default.

CGNAT Support for Traceroute

The RBFS CGNAT provides support for Traceroute and critical ICMP error handling on the Edgecore AGR420, UfiSpace S9600-72XC, and UfiSpace S9600-102XC platforms. This feature ensures that diagnostic tools can function correctly across NAT boundaries by accurately translating and forwarding "TTL Exceeded" and "Fragmentation Needed" messages.

NAT for TCP Control Messages

RBFS with NAT supports address translation for TCP control messages using ACLs. It includes the TCP control messages such as FIN, FIN-ACK, RST, RST-ACK, SYN, and SYN-ACK. This feature is enabled by default.

NAT-miss Traffic Handling in Control Plane on Q2C Platforms

RBFS supports a mechanism to handle NAT-miss packets at control plane. A NAT-miss occurs when a downstream packet arrives at a device configured for address translation, but no matching NAT rule exists for that flow. A new ACL rule is issued to detect such packets based on NAT-miss status and destination prefix match. These packets are redirected to the control plane, which performs network address translation in software and forwards them.

Support for Path MTU Discovery on CGNAT Deployments

Path MTU Discovery works in NAT environments for PPPoE and IPoE subscribers. RBFS with CGNAT-enabled can send ICMP "Fragmentation Needed" messages to the source when packet fragmentation is required, allowing the source to adjust the packet size accordingly. It allows for dynamic MTU adjustment and prevents packet drops and fragmentation-related issues.

Limitations:

  • NAT for fragmented IPv4 packets that lack TCP or UDP headers is not supported. Meaning traffic already fragmented received can’t be passed to the client because of missing TCP or UDP header.

  • Fragmentation for NAT subscriber traffic is not supported.

CGNAT N:1 with ACL-Based NAT Control

In an N:1 VLAN architecture (where multiple subscribers share a single VLAN), enabling NAT for a single subscriber automatically subjects all traffic within that VLAN to NAT processing.

If your deployment requires a mixed environment—where some subscribers in the shared VLAN use CGNAT while others are directly assigned public IPv4 addresses, you must explicitly configure an Access Control List (ACL) to bypass NAT for the public-IP subscribers. Because subscribers with public IPs will generate traffic originating from those public ranges, this bypass is most efficiently achieved by deploying a single static ACL that matches and exempts all traffic sourced from your public IPv4 address blocks. Alternatively, this can be managed using dynamic subscriber filters.

For detailed configuration steps, refer to the Selective NAT Bypass for Subscribers Using ACLs section.

Guidelines and Limitations

When deploying RBFS CGNAT, please observe the following technical limitations and operational guidelines:

  • Q2A Platform Routing Restrictions: Exclusively on Q2A platforms, you must not install IP forwarding routes that overlap with the public IPv4 address ranges allocated for the CGNAT pool. Specifically, do not create a static discard (null) route covering the NAT pool for BGP advertisement purposes. Instead, you should configure the system to redistribute the routes directly from the source protocol nat.

  • PPPoE MAC/VLAN Constraints: Operating multiple PPPoE sessions that share the exact same MAC address within the same VLAN is not supported when CGNAT is enabled.

  • VLAN Mode Bypass Requirements: As detailed above, mixing NAT and non-NAT subscribers within an N:1 VLAN mandates an explicit ACL to bypass NAT processing for public IP traffic. However, in a 1:1 VLAN model (where each subscriber operates on a dedicated VLAN), NAT policies are applied cleanly on a per-subscriber interface basis. Therefore, no ACL bypass is required for mixed subscriber types across 1:1 VLANs.

Supported Platforms

Not all features are necessarily supported on each hardware platform. Refer to the Platform Guide for the features and the sub-features that are or are not supported by each platform.