4.3.11Computer Networks

IPv6 — address format, why needed, key differences

1,728 words8 min readdifficulty · medium1 backlinks

WHY do we need IPv6?

WHY is 2322^{32} the count? Each bit is an independent on/off choice. With nn independent binary choices you get 2n2^n combinations (multiplication principle). So 32 bits ⇒ 2322^{32}.

232=4,294,967,2964.3×1092^{32} = 4{,}294{,}967{,}296 \approx 4.3 \times 10^9

That sounds huge, but:

  • Many ranges are reserved (private, loopback, multicast), so usable count is smaller.
  • Every internet-connected device wants one. Phones, laptops, cameras, fridges, cars (IoT) ⇒ tens of billions of devices.

WHAT does an IPv6 address look like?

8 groups×16 bits4 hex digits=128 bits\underbrace{8 \text{ groups}}_{} \times \underbrace{16 \text{ bits}}_{4 \text{ hex digits}} = 128 \text{ bits}

WHY hexadecimal? One hex digit encodes exactly 4 bits (16=2416 = 2^4). So 128/4=32128/4 = 32 hex digits total — compact and bit-aligned.

Full example:

2001:0db8:0000:0000:0000:ff00:0042:8329

Compression rules (HOW to shorten)

Applying both to the example:

2001:db8::ff00:42:8329

Structure of the address (network vs interface)

network prefix64 bits    interface ID64 bits=128 bits\underbrace{\text{network prefix}}_{64\text{ bits}}\;\big|\;\underbrace{\text{interface ID}}_{64\text{ bits}} = 128 \text{ bits}

WHY 64/64? The 64-bit interface ID is large enough to be derived from the 48-bit MAC address (EUI-64) and to make autoconfiguration (SLAAC) work without a DHCP server.

Figure — IPv6 — address format, why needed, key differences

KEY DIFFERENCES vs IPv4

Feature IPv4 IPv6
Address size 32 bits 128 bits
Notation dotted decimal 192.168.0.1 colon-hex 2001:db8::1
Address count 2322^{32} 21282^{128}
Header size variable (20–60 B) fixed 40 bytes
Broadcast yes no (uses multicast/anycast)
Address config manual / DHCP SLAAC (auto) + DHCPv6
Fragmentation router or host only the sending host
Checksum in header yes removed (relies on L2/L4)
Security (IPSec) optional designed-in (originally mandatory)
NAT needed? usually yes usually no

Worked compression examples


Recall Feynman: explain it to a 12-year-old

Imagine phone numbers were only 4 digits long — soon there's no number left for new people. IPv6 makes the "numbers" way longer (so long we'll basically never run out) and writes them with letters-and-numbers (hex) and colons. It also throws away some old habits — like shouting to everyone in the building (broadcast) — and instead only talks to the people who actually want to listen.


Flashcards

How many bits is an IPv6 address?
128 bits.
How many total IPv6 addresses exist?
21283.4×10382^{128} \approx 3.4\times10^{38}.
How many times more addresses than IPv4?
2962^{96} times (2128/2322^{128}/2^{32}).
How is an IPv6 address written?
8 groups of 4 hexadecimal digits separated by colons.
Why hexadecimal in IPv6?
1 hex digit = 4 bits, so 32 hex digits = 128 bits; bit-aligned and compact.
What does :: mean and how often can it appear?
Replaces one run of consecutive all-zero groups; allowed only once (else ambiguous).
What is the size of the IPv6 main header?
Fixed 40 bytes.
Does IPv6 have broadcast?
No — it uses multicast and anycast instead.
What replaced IPv4's manual/DHCP config in IPv6?
SLAAC (stateless address autoconfiguration), plus DHCPv6.
Who can fragment in IPv6?
Only the sending host (routers cannot).
Why was the header checksum removed in IPv6?
To speed up routing; integrity is handled by L2 (link) and L4 (TCP/UDP).
What is the typical IPv6 prefix/interface split?
64-bit network prefix + 64-bit interface ID.
What is the IPv6 loopback address?
::1.
What does the fe80::/10 range mean?
Link-local addresses (auto, non-routable).
Why is 2322^{32} the IPv4 count?
32 independent binary choices give 2322^{32} combinations.

Connections

Concept Map

allows

too few for

motivates

gives

ratio 2^96 over

written as

uses

shortened by

shortened by

misuse causes

splits into

IPv4 32-bit

2^32 approx 4.3 billion

IoT device explosion

IPv6 128-bit

2^128 approx 3.4e38

8 hextets of 16 bits

Hexadecimal 4 bits per digit

Leading-zero rule

Double-colon rule once

Ambiguous illegal address

64-bit prefix plus 64-bit interface ID

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, IPv4 sirf 32-bit ka address use karta hai, matlab total sirf 2322^{32} yaani lagbhag 4.3 billion addresses. Aaj ke time mein har banda ke paas phone, laptop, smartwatch, aur ghar mein smart TV/fridge — itne saare devices hain ki ye addresses khatam ho gaye. Isiliye IPv6 aaya jo 128-bit ka hai, yaani 21282^{128} (~3.4×10383.4\times10^{38}) addresses — itne ki kabhi khatam hi na ho. IPv6 ke paas IPv4 se 2962^{96} guna zyada addresses hain.

Format yaad rakho: 8 groups, har group mein 4 hexadecimal digits, beech mein colon :. Kyunki 1 hex digit = 4 bits, toh 8×4 = 32 hex digits = 128 bits, perfect fit. Chhota karne ke liye do rule: (1) har group ke leading zeros hata do, (2) jahan continuous saare-zero groups hain, unko ek baar :: se replace kar do. Important: :: sirf ek baar use hota hai, warna parser confuse ho jaata hai ki kitne zeros bharne hain.

Sirf address bada hona hi farq nahi hai — IPv6 ne broadcast hata diya (ab multicast/anycast), header ko fixed 40 bytes kar diya (router fast process karta hai), header checksum hata diya, aur SLAAC se device khud apna address bana leta hai bina DHCP ke. Toh agla baar agar koi bole "IPv6 bas lamba IPv4 hai" — galat! Ye ek redesign hai, sirf bigger address nahi.

Go deeper — visual, from zero

Test yourself — Computer Networks

Connections