Mobile Networking · How Apps Talk · Lesson 4 of 4
NAT & Your Public IP
Find out how many devices share one public IP, at home and on mobile data.
One Public Address for the Whole House
Your home router has one public IP address, given to it by your ISP. Every device in the house, from phones to the smart TV, has its own private address. The router shares the single public address among all of them using network address translation, or NAT.
Here's how it works. When your phone sends a packet from 192.168.1.23 port 51544, the router swaps in its own public address and often a new port. It writes the swap in a table. When the reply comes back, the router checks the table and passes the reply to your phone.
This is a big reason the shortage of IPv4 addresses hasn't broken the internet. A whole household needs only one public address.
NAT has a side effect. Devices outside can't start a connection to your phone, because the router has no table entry telling it where to send it. That blocks a lot of unwanted traffic, though NAT isn't a full firewall.
Websites and apps see the router's public address. They don't see your phone's private one.
Carrier-Grade NAT and Your Phone
On mobile data there's no home router, but the same idea applies on a bigger scale. Many mobile carriers use carrier-grade NAT, or CGNAT. One public IPv4 address is shared by many customers at the same time, and the carrier's equipment keeps the translation table.
The IETF set aside a special block for this, 100.64.0.0/10. If your phone or router shows an address from 100.64.x.x to 100.127.x.x, you're probably behind CGNAT.
You can check your public IP by visiting a site that shows it. On home Wi-Fi it shows your router's address. Switch to mobile data and it changes to one of your carrier's addresses.
This matters a lot in investigations. A public IP in a server log may point to many users at once. To trace it to one customer, a carrier usually needs the exact time and often the source port too, matched against its NAT logs. Without those details, an IP address alone may not identify anyone.
Can you answer these?
- What is the three-letter name for the technique a router uses to share one public IP among many devices?
- Why might a carrier need the source port and exact time to identify who used a public IP?
Answer them in the app to earn 70 XP.
Answer in the app