The problem with sharing addresses
IPv4 addresses are scarce, so most operators put many subscribers behind each public address using carrier-grade NAT. The moment you do that, a public address on its own no longer identifies anybody. You need the port as well, and you need to know which subscriber was using that port at that moment.
Approach one: log every connection
Classic CGNAT picks a free port for each new connection and writes a log line recording it. It works, but a single subscriber opens thousands of connections a day. Multiply that by your subscriber base and you are storing, indexing and searching an enormous volume of records for the sake of the few you will ever be asked about.
Approach two: make the mapping fixed
Deterministic CGNAT turns the problem around. Each subscriber is given a fixed block of ports on one public address. The rule that maps a subscriber to a block is known in advance, so there is nothing to log per connection. To answer the question, you look up which block the port falls in.
The arithmetic is simple. A public address has 65,536 ports. Leave out the first 1,024, which are reserved for well-known services, and 64,512 remain. Share one address among 64 subscribers and each gets 1,008 ports.
What you still have to keep
- The map and its history. Subscribers change plan, address and gateway. The answer for last March depends on the map that was in force last March, so each version needs a validity period.
- Session start and end times. You still need to know when the subscriber was online, which your accounting records already tell you.
- Accurate time. A lookup by time is only as good as the clocks on your gateways. Keep them synchronised.
The trade-offs
A fixed block is a ceiling. A subscriber who opens more connections than their block allows will see some applications fail, so the ratio of subscribers to addresses has to be chosen with real usage in mind, and a connection limit per subscriber should be explicit. Some customers need more: a fixed public address, or forwarded ports for a camera or a server. A sound design lets public-address customers and CGNAT customers sit on the same gateway.
How OrbEDGE BNG does it
OrbEDGE BNG uses deterministic CGNAT with between 1 and 1,024 subscribers per public address. The maps are versioned in OrbOS with their validity periods, so a public address, port and time resolves to a subscriber from the map history, and the same lookup works for a customer who has since changed plan, address or gateway.
Written by the engineering team at Tathya Technologies.