Calxo Learn

Learn the concept. Understand the formula. Calculate the result.

Lesson 5 of 6 · 10 min

Public vs private IP addresses and NAT

Follow a packet from your laptop to a website. Meet private IPv4 ranges, shared public addresses, and the router’s translation table.

By Calxo AI · Updated

Your laptop and a website disagree. Both can be right.

Your Wi-Fi settings say 192.168.1.10. A website that reports your IP address shows something else. Has your laptop forgotten its own address?

No. You are looking at the connection from two different places. Inside your home, the laptop uses a private address. In a typical IPv4 home network, the router translates outgoing traffic so it can share an Internet-facing address with your phone and other devices.

Think of an office with desk extensions and a main telephone number. The extensions make sense inside the office; the outside caller sees the main number. It is a useful starting picture, though a router tracks network connections rather than telephone calls.

Picture it · Two views of one connection
Inside your home

Laptop: 192.168.1.10
Phone: 192.168.1.20

Router → Internet

LAN: 192.168.1.1
Outside: 203.0.113.9*

Website’s view

Source: 203.0.113.9*
The router keeps the map

*203.0.113.9 stands in for the public-side address. It is reserved for documentation, not an address to use on a live Internet connection. No VPN, proxy, or provider NAT is shown in this first picture.

Three private ranges, many separate networks

RFC 1918 sets aside three IPv4 blocks for private networks. Separate homes and organisations can reuse them. Your laptop and a friend’s laptop can both be 192.168.1.10 because they are on different networks. Two interfaces using that address on the same LAN would usually create a conflict.

The complete RFC 1918 private IPv4 ranges
BlockFirst addressLast address
10.0.0.0/810.0.0.010.255.255.255
172.16.0.0/12172.16.0.0172.31.255.255
192.168.0.0/16192.168.0.0192.168.255.255

The 172 range is the sneaky one: 172.16 through 172.31, not every address beginning with 172. Also, 192.168.0.0/16 is the whole reserved private block; your home might use only 192.168.1.0/24 from it. If slash notation needs a refresh, visit the CIDR lesson.

“Not private” does not automatically mean “public”

Public unicast addresses can be globally routed when properly allocated and advertised. Having one does not guarantee that a service is reachable: routing and firewall rules still decide whether traffic gets through.

There are other categories too. 127.0.0.1 is loopback, used to reach your own device. 169.254.0.0/16 is link-local. The 203.0.113.0/24 and 198.51.100.0/24 ranges in our diagrams are documentation space. These are outside RFC 1918, but they are not ordinary globally reachable public addresses.

Private addresses are not globally unique and should not be routed across the public Internet. They can still communicate across deliberately connected private networks, such as through a VPN. “Private” describes the address’s scope; it is not a promise of encryption or anonymity.

Follow one connection through NAT

NAT means Network Address Translation. The many-devices-sharing-one-address version commonly used at home also translates transport ports. It is called NAPT (Network Address Port Translation), often PAT.

A port is a numbered endpoint used by a transport protocol such as TCP or UDP. An address gets the packet to the host; the transport information helps the host identify the right conversation. Our example uses TCP and destination port 443 for HTTPS.

  1. The laptop starts a TCP connection from 192.168.1.10:51514 to our pretend website at 198.51.100.20:443.
  2. The router changes the source to 203.0.113.9:62001 and remembers the translation. The website destination stays the same.
  3. The website replies to 203.0.113.9:62001.
  4. The router finds the connection state, restores destination 192.168.1.10:51514, and sends the reply onto the home network.
Picture it · The packet’s return ticket
1 · Outbound, inside192.168.1.10:51514 → 198.51.100.20:443
2 · Outbound, outside203.0.113.9:62001 → 198.51.100.20:443
3 · Reply, outside198.51.100.20:443 → 203.0.113.9:62001
4 · Reply, inside198.51.100.20:443 → 192.168.1.10:51514
Illustrative TCP mapping. 198.51.100.20 and 203.0.113.9 are documentation addresses. Actual external ports are chosen by the NAT implementation; 62001 is an example, not a fixed rule.

But what if the phone picks the same port?

It can. A phone at 192.168.1.20 may also choose source port 51514 while talking to the same server. The router can give it a different external port:

Two simultaneous example TCP mappings to 198.51.100.20:443
DeviceInternal sourceTranslated source
Laptop192.168.1.10:51514203.0.113.9:62001
Phone192.168.1.20:51514203.0.113.9:62002

The reply to 62002 goes to the phone’s mapping. The outside IP address is shared, but the connections remain distinguishable. Real devices track protocol and connection state; mapping and filtering policies vary. This little table is a teaching model, not a complete router implementation.

Sometimes there is another translator upstream

Your provider may share a public IPv4 address across customers using carrier-grade NAT, or CGNAT. RFC 6598 reserves 100.64.0.0/10 for shared address space: 100.64.0.0 through 100.127.255.255. It is distinct from RFC 1918 private space.

Picture it · One more stop
  1. Home LAN: laptop 192.168.1.10
  2. Home router NAT: example WAN address 100.64.12.3
  3. Provider NAT: shared public-side address, represented here by 203.0.113.9
  4. Website: sees the final translated source
One possible CGNAT arrangement. 203.0.113.9 is a documentation placeholder. Not every provider uses CGNAT, and provider networks can use other addressing arrangements.

If your router’s WAN address and a website’s reported address differ, upstream NAT is one possibility. A VPN, proxy, or comparing IPv4 with IPv6 can also explain the mismatch. A 100.64/10 WAN address is a clue, not a complete diagnosis.

Translation, security, and privacy have different jobs

NAT does not encrypt your traffic. HTTPS provides encryption for the web connection. A firewall controls permitted traffic. A home router often provides NAT and a stateful firewall together, which makes their roles easy to mix up.

An unsolicited inbound connection usually needs an explicit mapping or another traversal mechanism in this setup, but do not treat NAT as a complete security policy. Port forwarding changes reachability, and provider NAT may prevent a home-router forward from working by itself.

Sharing an outside address also does not make you anonymous: websites can use accounts, cookies, and other signals. And this is an IPv4 lesson. IPv6 often uses globally scoped device addresses without this many-to-one translation; firewall policy still matters.

A small experiment, no router changes needed

Use the walkthrough below to switch between laptop and phone. Watch what changes on the outward journey, then what changes on the reply. The destination website stays put; the home router translates the home-side endpoint.

Keep three questions separate: What kind of address is it? What translation happened? What traffic is allowed? Answering one does not automatically answer the other two.

Try it · Follow the reply

NAT packet walkthrough

Choose a device, then follow one TCP connection through the router. Addresses on the Internet side are documentation placeholders.

At your device

TCP source
192.168.1.10:51514
TCP destination
198.51.100.20:443

The device starts a connection to the website. Its private source address is still present.

Teaching example: one router, no VPN or proxy, two active mappings to the same TCP server. Actual port selection, mapping behaviour, and timeouts vary. This shows header translation, not decryption of HTTPS content.

Check your understanding

Choose an answer for every question, then check your work. You can retry as often as you like.

1. Which address is inside an RFC 1918 private range?
2. Our TCP reply reaches the router at 203.0.113.9:62002. Which internal destination does the illustrated mapping select?
3. What does NAT provide by itself?

0 of 3 answered.

Sources and scope

This lesson explains IPv4 address scope and illustrative TCP NAT mappings. Documentation addresses stand in for live public endpoints. Real routing, mapping, filtering, and provider behaviour depend on the network.

How Calxo reviews its content