Deterministic NAT gives every subscriber behind a CGNAT a fixed public IP and port range that is calculated mathematically from their private IP address. Because the mapping is known in advance, no NAT log is written per session or per port block; when a public IP, port and timestamp arrive, the subscriber is found by calculation. The method is described in RFC 7422.
Removing the NAT log does not remove the need for records, though. You still keep the BNG and RADIUS records that show which subscriber held which private IP, and when.
Why NAT logs become a problem
Behind CGNAT, one public IP is shared by dozens of subscribers at once. To work out which subscriber sent a given flow you need the port and the time as well as the IP. There are three ways to provide that:
- Per-session logging: one record for every new connection. On a busy network that is hundreds of thousands of lines per second.
- Port block allocation (PBA): each subscriber gets a block of ports, and a log line is written only when the block is assigned and released.
- Deterministic NAT: the mapping is fixed and calculable, so no NAT log is written at all.
We covered PBA in Solving IPv4 exhaustion with CGNAT. Deterministic NAT takes the block idea one step further: blocks are not assigned dynamically but fixed in advance by the subscriber's private address.
How deterministic NAT works
Three parameters define the mapping:
- Private prefix: the range handed to subscribers (e.g. 100.64.0.0/22, 1,024 subscribers).
- Public pool: the public IPs used for translation (e.g. 203.0.113.0/28, 16 addresses).
- Sharing ratio: how many subscribers share one public IP; here 1,024 / 16 = 64.
The well-known ports (0–1023) are usually left out, leaving 64,512 ports in the 1024–65535 range. Split between 64 subscribers, each gets a fixed range of 1,008 ports. The calculation is:
- Subscriber index: n = private IP − 100.64.0.0
- Public IP: 203.0.113.0 + ⌊n / 64⌋
- First port: 1024 + (n mod 64) × 1,008
- Last port: first port + 1,007
For the subscriber at 100.64.1.5, n = 261. Since ⌊261 / 64⌋ = 4 and 261 mod 64 = 5, this subscriber uses ports 6064–7071 on 203.0.113.4. The assignment is the same every time they connect, including after a reconnect.
Tracing a request
Suppose a request reads "203.0.113.4, port 6500, 14:32:10":
- Find the index from the port: (6500 − 1024) / 1,008 = 5.4, so the integer part is 5.
- Calculate the private IP: n = 4 × 64 + 5 = 261, which is 100.64.1.5.
- Find the subscriber: look up in the BNG session records or RADIUS accounting which subscriber held 100.64.1.5 at 14:32:10.
Two details matter. First, if the request has no port, the answer does not narrow to one subscriber; all 64 subscribers sharing that public IP remain candidates. Second, the BNG, CGNAT and log servers must be synchronised with NTP; a drift of a few seconds can cause a wrong match for a subscriber who has just reconnected.
Which records you still need
Deterministic NAT removes per-session NAT logging, but the first link in the tracing chain is still a record:
- Subscriber-to-private-IP mapping with time ranges: BNG session records or RADIUS accounting (Start, Interim-Update, Stop).
- The mapping rule and its history: private prefix, public pool and sharing ratio, with the start and end time of every version.
- Dynamic extra assignments: if extra port blocks are given outside the mapping, logs of those assignments.
Data-retention rules such as Türkiye's Law 5651 require access providers to keep this information accurate, complete and confidential. Deterministic NAT shrinks the volume of records; it does not change the obligation.
Benefits and limits
| Per-session logging | PBA | Deterministic NAT | |
|---|---|---|---|
| NAT log volume | Very high | Low (block assign and release) | None (rule and history only) |
| Port efficiency | High | Medium | Low; unused ports sit idle |
| Flexibility | High | Medium; extra blocks possible | Low; the range is fixed |
| Tracing | Log search | Log search | Calculation plus BNG record |
| Subscriber-to-private-IP record | Required | Required | Required |
Limits:
- Fixed port range: a subscriber with many devices and applications can fill 1,008 ports, and new connections then fail. Choose the sharing ratio from your subscribers' peak-hour port usage.
- Pool changes need planning: adding addresses to the public pool changes the mapping. Version the rule and keep old versions for the full retention period.
- Hybrid approach: some deployments give a subscriber an extra dynamic block when the deterministic range fills, and log only those extra assignments. Logging stays light while port exhaustion is avoided.
When to choose it
Deterministic NAT suits small and mid-size networks where building and retaining a logging platform is expensive and per-subscriber port demand is predictable. Where usage varies widely, or public IPs are so scarce that a high sharing ratio is needed, PBA is more flexible. In practice both methods can run on the same CGNAT for different subscriber groups.
With CoreGate CGNAT
CoreGate CGNAT supports NAT444 and deterministic NAT side by side, with port block allocation (configurable block size and blocks per subscriber), per-subscriber session and port limits and EIM/EIF behaviour built in. CoreGate BNG, running on the same platform, records the subscriber-to-private-IP mapping with session start and stop times, so both links of the tracing chain are managed in one place. There are seven tiers from CGN-10 to CGN-800, each providing 10 million concurrent sessions and 16,000 subscribers per 10 Gbps.