A public IP address identifies a network interface on the wider internet and is globally unique and internet-routable. A private IP address is used only within a private network, such as a home or school LAN, and cannot be routed directly across the public internet.
How the Two Address Types Work
Public IP addresses allow data packets to travel between networks over the internet. They are normally allocated through an internet service provider (ISP) from address space coordinated by regional internet registries.
Private IPv4 addresses come from reserved ranges:
| Private IPv4 range | Typical prefix |
|---|---|
10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 |
172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 |
192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 |
The same private address can appear in many separate networks because it needs to be unique only within its own local network. For example, a laptop in one home and a printer in another could both use 192.168.1.10 without conflict.
| Feature | Public IP address | Private IP address |
|---|---|---|
| Scope | Internet | Local network |
| Uniqueness | Globally unique | Unique only within its local network |
| Internet routing | Routable | Not directly routable |
| Typical assignment | ISP or hosting provider | Router's DHCP server or network administrator |
| Example | 203.0.113.25 | 192.168.1.25 |
A router commonly uses network address translation (NAT) to replace a device's private source address with the router's public address when packets leave the LAN. It records the connection, often using port numbers, so returning data can be forwarded to the correct private device.
A common misconception is that a private IP address automatically provides complete security. Private addresses reduce direct internet reachability, but security still requires measures such as firewalls and access controls.
Exam Technique
For an IB Computer Science A2.3 response, define both address types, compare their routing scope and uniqueness, and explain NAT. Do not confuse public versus private with static versus dynamic: either type may be assigned statically or dynamically.