Get started syriaproxy The first proxy made for Syria

What is CGNAT?

Carrier-grade NAT (CGNAT) is a device in the provider's network that lets many subscribers reach the internet from one public IPv4 address. It tells their connections apart by port number and keeps a table it uses to return each reply to its owner. Mobile networks rely on it heavily, because they have far more devices than addresses.

Why it exists

An IPv4 address is 32 bits long, which caps the total at about 4.3 billion. The regional registries have run out of them, and the move to IPv6 is not finished, so many sites and networks still depend on IPv4.

An operator serving millions of phones does not hold a public address for each one. The practical answer is to give every subscriber an internal address. Their connections are then translated at the network edge onto a small set of public addresses. The basics of public and private addresses are in What is an IP address.

Some operators give the phone an IPv6 address only and translate IPv4 traffic at the network edge. Either way, the public IPv4 address that websites see is shared by many people.

How it works, step by step

  1. Your phone gets an internal address from the operator, often from 100.64.0.0/10 or from the RFC 1918 private blocks.
  2. An app on the phone opens a connection to a server on port 443, from a source port the system picks.
  3. The first packet passes through the CGNAT device, which picks an unused public address and external port and records the mapping between inside and outside.
  4. The device rewrites the packet's source address and port to the external ones and sends it on.
  5. The server replies to the public address and external port. The device looks up its table and forwards the packet to your phone.
  6. When a mapping stays idle for a set time, the device deletes it and the port goes back to the pool.

Part of the mapping table for two subscribers reaching the same server at the same moment might look like this:

inside             outside            destination
100.71.4.12:51034  203.0.113.7:20112  198.51.100.20:443
100.92.8.40:40211  203.0.113.7:20113  198.51.100.20:443

The server sees one address, 203.0.113.7, with two different ports. From the packets alone it has no way to tell that these are two different subscribers.

The 100.64.0.0/10 block

RFC 6598 reserved this block in 2012 as Shared Address Space for service providers. It holds 4,194,304 addresses and is mainly used to number the links between CGNAT devices and subscribers' routers.

The RFC keeps it separate from RFC 1918 private space. Your home router may already use 192.168.1.0/24 inside, so if the provider handed it an address from the same range the two routes would collide. Packets and routes for this block must not cross the provider's network boundary.

A home network behind CGNAT is translated twice. Your router maps the private address to the provider's internal one, and the provider maps that onto the public address.

What the standard requires of CGNAT devices

RFC 6888 collects the common requirements for these devices. Three matter most to someone using the internet:

Side effects of sharing an address

RFC 6269 describes the problems that come with sharing an IPv4 address among subscribers. The main ones:

How to tell whether you are behind CGNAT

  1. Open your router's status page and find the address of the external (WAN) interface.
  2. Compare it with your public address as websites see it.
  3. If the router's address falls in 100.64.0.0/10, that is 100.64.0.0 to 100.127.255.255, you are most likely behind CGNAT.
  4. If it is in an RFC 1918 block and differs from your public address, the provider or a second router translates it again.

On mobile data it is enough to see that the address in the phone's settings differs from your public one. A traceroute also shows the internal hops:

tracert -d 9.9.9.9      # Windows
traceroute -n 9.9.9.9   # Linux, macOS

Addresses from 100.64.0.0/10 in the first few hops are a sign of the provider's internal network.

If you need incoming connections

syriaproxy and CGNAT

With syriaproxy, your traffic leaves from real mobile addresses on Syriatel's 4G network inside Syria. Many Syriatel subscribers share them at the same time behind CGNAT. The same address stays for about two hours before Syriatel changes it, and you can request a new one from your account at any time.

How these addresses differ from server addresses is covered in Mobile vs datacenter IPs.

FAQ

Does CGNAT hide my identity?

Only partly, and only from websites, which see an address you share with others. The provider knows which subscriber held each port at each moment and usually keeps those mapping records for legal purposes.

Does CGNAT slow the connection down?

The translation itself is a small step on the path. Funnelling many people's traffic through one device can add delay at peak times. The port limit can also affect apps that open a very large number of connections.

Why do I get more "are you human" checks on mobile data?

Other subscribers share the address you leave from, so a site sees more requests from it than one person would send. Some sites ask for a check when the request rate from a single address rises.

Does IPv6 remove the need for CGNAT?

For IPv6 traffic, yes, since there are enough addresses for every device. As long as many sites work over IPv4 only, the operator still has to translate IPv4 traffic.

Compare your public IP with your router's address to see whether your provider puts you behind CGNAT.