IPv4 and IPv6
192.168.0.178 is a valid IP address. 192.168.0.278 is not. Nothing about them looks different — until you see how a computer stores each number. Then the rule explains itself.
1IPv4: four numbers
Why 255? Because a computer stores each of the four numbers in exactly 8 bits. Four numbers of 8 bits each makes 4 × 8 = 32 bits.
Eight bits are like eight lights, each worth a different amount: 128, 64, 32, 16, 8, 4, 2 and 1. Turn on the lights whose values add up to your number. With every light on you get 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 — the biggest number 8 bits can hold. 256 would need a ninth light, and there isn’t one.
Type an address or pick one. Each number gets eight lights. Drag sideways to turn.
Press Count up past 255 and watch the first block. At 255 every light is on. One more, and the number no longer fits.
2Spotting an invalid address
An IPv4 address is valid only if all three of these are true:
- It has exactly four numbers.
- The numbers are separated by dots.
- Every number is from 0 to 255.
Check each number on its own. One number over 255, or one number too many, and the whole address is invalid.
(A) 122.94.96.212 (B) 212.254.258.210 (C) 210.10.12.156.209 (D) 122.294.56.68CBSE compartment exam 2025
▶Show the answer
(A) 122.94.96.212
- (A) 122.94.96.212 — Valid: four numbers, each from 0 to 255.
- (B) 212.254.258.210 — Not valid: “258” is more than 255.
- (C) 210.10.12.156.209 — It has 5 parts between the dots. An IPv4 address has exactly 4 numbers.
- (D) 122.294.56.68 — Not valid: “294” is more than 255.
3Running out of addresses
32 bits can make 232 = 4,294,967,296 different addresses — about 4.3 billion. That sounded like plenty when IPv4 was designed. But today phones, laptops, TVs, watches, cameras and even light bulbs join the Internet, and there are more of them than IPv4 has addresses.
4IPv6
Hexadecimal digits are 0–9 and A–F, the same digits a MAC address uses. Each group has four of them. 128 bits give 2128 addresses: a number 39 digits long, about 3.4 × 1038. That is enough to give every device on Earth its own address many, many times over.
| IPv4 | IPv6 | |
|---|---|---|
| Length | 32 bits | 128 bits |
| Written as | 4 decimal numbers (0–255) | 8 groups of 4 hexadecimal digits |
| Separated by | Dots ( . ) | Colons ( : ) |
| Example | 192.168.0.178 | 2001:CDBA:0000:0000:0000:0000:3257:9652 |
| How many addresses | 2³² — about 4.3 billion | 2¹²⁸ — about 3.4 × 10³⁸ |
5Check yourself
Which of these IP addresses is NOT valid?
How many bits long is an IPv4 address?
Why was IPv6 introduced?