AQA 7517, section 4.9.4.6
IP addresses are of two kinds, according to whether they can be used on the public Internet.
Public (routable) addresses
A public IP address is globally unique and is routable: routers on the Internet will forward packets to and from it. It is allocated by an ISP and the Internet registries (4.9.3.1).
- A device or server that must be reached from anywhere on the Internet, such as a web server, needs a public address.
- No two devices on the Internet can have the same public address at the same time.
- Your home router normally has one public address, given by your ISP.
Private (non-routable) addresses
A private IP address is for use inside a local network, such as a home, school or office. It is non-routable: Internet routers are set to discard packets with private addresses, so they never travel across the public Internet.
Three ranges are reserved for private use:
| Range | Addresses |
|---|---|
10.0.0.0 to 10.255.255.255 |
About 16.7 million |
172.16.0.0 to 172.31.255.255 |
About 1 million |
192.168.0.0 to 192.168.255.255 |
65 536 |
Home networks usually use 192.168.x.x, and large organisations often use 10.x.x.x.
Any address outside these reserved ranges (and other special ranges) is a public address.
There are other special addresses, such as 127.0.0.1 (loopback, which means "this computer itself") and 169.254.x.x (self-assigned when no address is available), which are also not routed on the Internet.
Why are both used?
- The shortage of IPv4 addresses. There aren't enough public addresses for every device. Many networks can reuse the same private ranges, because private addresses only have to be unique within one network. A home router uses NAT (4.9.4.8) to let many private devices share one public address.
- Security. Devices with private addresses can't be reached directly from the Internet, which protects them from outside connections.
- Flexibility. A network can use any private numbering it likes without asking anyone, and can change ISP without having to renumber every device.
Comparison
| Public address | Private address | |
|---|---|---|
| Routable on the Internet? | Yes | No |
| Unique? | Globally | Only within its own network |
| Allocated by | ISP and registries | The network administrator (or DHCP) |
| Reachable from the Internet? | Yes | No (not directly) |
| Example | 93.184.216.34 |
192.168.1.25 |
| Where used | Servers, home routers | Computers, phones and printers inside a network |
How they work together
All three devices have private addresses. When any of them contacts a website, the router replaces its private address with the router's one public address, and translates the replies back (NAT).
Worked example
Task: say whether each address is public or private: (a) 192.168.0.15, (b) 8.8.8.8, (c) 172.20.4.9, (d) 172.32.0.1.
- (a)
192.168.0.15is in192.168.0.0to192.168.255.255, so it is private. - (b)
8.8.8.8isn't in any private range, so it is public. - (c)
172.20.4.9: the second octet, 20, is between 16 and 31, so it is private. - (d)
172.32.0.1: the second octet, 32, is outside 16 to 31, so it is public.
Exam tip: describe both differences: a public address is globally unique and routable on the Internet; a private address is only unique within its own network and is non-routable. Use the words "routable" and "non-routable".
Check yourself
What is the difference between a routable and a non-routable address?
A routable (public) address can be used on the Internet, and routers will forward packets to it. A non-routable (private) address is only for use inside a local network, and Internet routers discard packets using it.
Give the three private IPv4 ranges
10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255.
Give two reasons for using private addresses
They conserve scarce public IPv4 addresses (the same private ranges can be reused in many networks), and the devices can't be reached directly from the Internet, which gives some protection.
Is 10.4.7.200 public or private?
Private, because it is in the 10.0.0.0 range.