IPv4 vs IPv6
Kite Studio's router shows two kinds of address for Asha's laptop: the familiar 192.168.10.57, and something much longer, 2001:db8:4a:10::57. The first is IPv4, designed in an age when a few billion addresses sounded endless. The second is IPv6, built because the world ran out.
The rule
IPv4 is 32 bits in four decimals; IPv6 is 128 bits in eight hex groups.
IPv4 addresses are 32 bits, written as four numbers from 0 to 255 separated by dots: 192.168.10.57. Each number is one byte, called an octet. That gives , about 4.3 billion addresses — fewer than the number of phones, laptops and servers on earth. The shortage is why private addresses and NAT (the next two lessons) became universal.
IPv6 addresses are 128 bits, written as eight groups of four hex digits separated by colons. That gives , about addresses — enough to give every device its own public address with room to spare. Other differences worth knowing:
- IPv6 has no broadcast; it uses multicast to reach groups of hosts instead.
- Hosts can configure their own address from the router's advertised network prefix (SLAAC), with or without DHCPv6.
- The header is simpler and fixed at 40 bytes, and NAT is not normally needed.
- Most networks today run both side by side, called dual stack.
Writing IPv6 short. Long addresses are shortened with two rules:
- Drop leading zeros in any group:
0db8→db8,0000→0. - Replace one run of consecutive all-zero groups with
::. Only once per address, or it would be impossible to know how many zeros each::stands for.
2001:db8:: is a special prefix reserved for documentation, which is why the examples here use it.
The shortcut
Shorten in a fixed order: strip leading zeros first, then squash the longest zero run into ::. To expand, count the groups you can see and fill the :: with however many 0 groups make eight.
Start with the full form
2001:0db8:004a:0010:0000:0000:0000:0057
The trap is using :: twice, as in 2001::4a::57. Nobody could tell how many zero groups belong in each gap, so it is invalid.
Drills
Answer fast — trust the rule.
How many bits are in an IPv6 address?
Which is a valid IPv4 address?
What is the shortest correct form of 2001:0db8:0000:0000:0000:0000:0000:0001?
How many zero groups does :: stand for in fe80::1:2?
Which feature does IPv6 NOT have?
Remember
- IPv4 is 32 bits in four decimals; IPv6 is 128 bits in eight hex groups.
- Shorten IPv6: strip leading zeros, then one
::for the longest zero run. - To expand,
::fills 8 minus the visible groups.
