Computer Networks · Module 5 — Network Layer
Public vs private addresses, and a first look at IPv6
32 bits gives about 4.3 billion addresses. There are far more connected devices than that.
Sign in to track your score
Aisha's laptop is 192.168.1.42. So is a laptop in a hostel in Chennai, and a phone in a flat in Berlin, right now. None of them clash.
Why & what
Why private addresses exist. 32 bits gives about 4.3 billion addresses. There are far more connected devices than that.
The fix was to stop giving every device a globally unique address. Instead:
- Devices inside a network get a private address, reused freely everywhere.
- The network as a whole gets one public address that is unique on the internet.
What the ranges are. Three blocks are reserved as private. Nothing on the public internet is allowed to use them.
| Range | Written as | Typical use |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | large companies |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | mid-size networks |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | homes, hostels |
Aisha's 192.168.1.42 is private. The hostel's 103.21.58.7 is public.
What IPv6 is. The real fix, rather than the workaround. IPv6 addresses are 128 bits, written as eight groups of hex digits:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Runs of zero groups collapse to ::, so that becomes 2001:0db8:85a3::8a2e:0370:7334.
That gives roughly 340 undecillion addresses: enough that every device can have a public one, and NAT stops being necessary.
How it works
- Aisha joins HostelNet-3F and is given a private address, 192.168.1.42.
- She can reach any other device in the hostel directly using private addresses.
- When she sends something to the internet, the router swaps her private source address for the public 103.21.58.7.
- The reply comes back to 103.21.58.7, and the router works out which laptop it belongs to.
- That swap is NAT, and it gets a full topic of its own in 5.5.

Common confusion
Students think a private address means a secure or hidden address. Actually, private just means "not routable on the internet".
It offers a side effect of protection: nobody outside can send a packet directly to 192.168.1.42, because no router on the internet knows where that is. But that is a consequence of the addressing rule, not a security feature. Anyone inside HostelNet-3F can reach Aisha's laptop perfectly well. Private is about address reuse, not privacy.
Interview angle
Asked as: "Difference between public and private IP?" and "Why do we need IPv6?"
Model answer:
A public IP is globally unique and routable on the internet. A private IP comes from one of three reserved ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16: and is only valid inside a local network. The same private address is reused in millions of homes, so private addresses are never routed on the public internet. A device with a private address reaches the internet through NAT on the router, which swaps in the public address. IPv6 exists because IPv4's 32 bits only give 4.3 billion addresses, which ran out. IPv6 uses 128 bits, written as eight hex groups with :: shortening runs of zeros, and gives enough addresses that NAT is no longer needed.
- 1.
Which of these is a private address?
- 2.
How many bits is an IPv6 address?
- 3.
Why can the same private address exist in thousands of buildings?
- 4.
What does :: mean in an IPv6 address?