optional · CSS study notes
IPv6
🧭
On this page — click any heading below to jump straight to it. ⬅️ Back to P-II.II. Computer Communications & Networks
OSI Layer: Network Layer (L3)
Definition
IPv6 is the successor addressing scheme to IPv4, using 128-bit addresses (versus IPv4's 32 bits) to solve IPv4 address exhaustion, simplify its base header and support address autoconfiguration. Both IPv4 and IPv6 can use IPsec; IPv6 does not automatically secure every packet.
Address Format
- Written as 8 groups of 4 hexadecimal digits, separated by colons, e.g.
2001:0db8:85a3:0000:0000:8a2e:0370:7334. - Zero compression: consecutive groups of all-zero can be compressed once per address using
::(e.g., the above becomes2001:db8:85a3::8a2e:370:7334). - Leading-zero suppression: leading zeros within a group can be dropped (
0db8→db8). - Address space ≈ 3.4 × 10³⁸ addresses — vastly larger than IPv4's ≈ 4.3 × 10⁹, effectively permanent for the foreseeable future.
Types of IPv6 Addresses
- Unicast — identifies a single interface; a packet sent to a unicast address is delivered to exactly that one interface.
- Global Unicast Address (GUA) — publicly routable on the Internet, analogous to a public IPv4 address.
- Link-Local Address — automatically assigned (prefix
fe80::/10), valid only on the local link, used for neighbour discovery and auto-configuration; never routed. - Unique Local Address (ULA) — private addressing analogous to IPv4's RFC 1918 ranges (prefix
fc00::/7), for use inside an organisation, not routed on the public Internet.
- Multicast — identifies a group of interfaces (prefix
ff00::/8); a packet is delivered to all members of the group. Used for things like all-routers or all-nodes signalling. - Anycast — identifies a group of interfaces, but a packet is delivered to only the nearest (in routing-distance terms) member of the group — used for services replicated at many locations, e.g., root DNS servers, so a query is automatically answered by the closest instance.
- Notably, IPv6 has no broadcast address type at all — its role is entirely subsumed by multicast, which is more efficient and controllable.
Key Improvements Over IPv4
- Simplified, fixed 40-byte header — several rarely-used IPv4 header fields were dropped or moved into optional extension headers, speeding up router processing.
- No router-level fragmentation — only the source host fragments a packet (via Path MTU Discovery); routers simply drop oversized packets and signal back, reducing router workload.
- IPsec compatibility — both IPv4 and IPv6 support IPsec; encryption and authentication require configuration and are not automatic consequences of using IPv6.
- Stateless Address Autoconfiguration (SLAAC) — a host can generate its own address from the network prefix and its interface identifier without needing DHCP.
- No need for NAT — the vast address space means every device can have a unique global address, restoring true end-to-end connectivity that NAT breaks.
- Native, efficient multicast replacing IPv4's broadcast for many signalling tasks (e.g., Neighbor Discovery Protocol replaces ARP).
IPv4-to-IPv6 Transition Mechanisms
- Dual Stack — a host or router runs both IPv4 and IPv6 simultaneously, using whichever the destination supports; the most straightforward but requires maintaining two full stacks during the (long) transition period.
- Tunneling — IPv6 packets are encapsulated inside IPv4 packets to cross IPv4-only infrastructure (e.g., 6to4, Teredo), letting isolated IPv6 "islands" reach each other over the existing IPv4 Internet.
- Translation (NAT64/DNS64) — actively converts between IPv6 and IPv4 packet headers at a gateway, commonly allowing an IPv6-only client to reach an IPv4-only server. Reverse initiation requires appropriate mappings and additional configuration; it is not automatically symmetric.
Comparison: IPv4 vs IPv6
| Basis | IPv4 | IPv6 |
|---|---|---|
| Address length | 32-bit | 128-bit |
| Notation | Dotted decimal | Hexadecimal, colon-separated |
| Address space | ~4.3 billion | ~3.4 × 10^38 |
| Header | 20–60 bytes, variable, checksum present | Fixed 40 bytes, no checksum (relies on lower/upper layers) |
| Fragmentation | Routers and source both fragment | Source only (Path MTU Discovery) |
| Security | Can use IPsec | Can use IPsec; traffic is not automatically encrypted |
| Broadcast | Supported | Not supported (multicast/anycast instead) |
| Address config | Manual or DHCP | SLAAC or DHCPv6 |
| NAT dependency | Common necessity | Not needed |
Numericals
Q1 — Address space comparison
- IPv4: 2³² = 4,294,967,296 addresses
- IPv6: 2¹²⁸ ≈ 3.4 × 10³⁸ addresses
- Ratio: IPv6 has roughly 2⁹⁶ (≈ 7.9 × 10²⁸) times more addresses than IPv4 — illustrating why exhaustion is not a practical concern for IPv6.
Q2 — Header overhead comparison
For a 1,000-byte payload:
- IPv4 minimum header = 20 bytes → overhead = 20 ÷ 1,020 ≈ 1.96%
- IPv6 fixed header = 40 bytes → overhead = 40 ÷ 1,040 ≈ 3.85%
- IPv6's larger header trades a small overhead increase for simpler, faster router processing (fewer fields to evaluate per packet).
CSS Exam Angle
- Expect a direct "why was IPv6 introduced and how does it differ from IPv4" question — structure the answer as the comparison table above (address length, header, security, NAT dependency).
- Know all three IPv6 address types (unicast, multicast, anycast) with one example each — a common enumeration sub-question.
- The "no broadcast, replaced by multicast" fact is a favourite trick-question detail.
- Mention transition mechanisms (dual stack, tunneling, translation) if the question asks about deployment, not just addressing theory.
Example
Major ISPs and mobile operators are gradually rolling out IPv6 dual-stack support as IPv4 addresses under regional registries (APNIC, which covers Pakistan) have been exhausted for new allocations, making IPv6 and CGNAT (carrier-grade NAT) the two practical paths forward for growing subscriber bases.
Likely Questions
- Discuss the need for IPv6 and compare it with IPv4.
- Explain the three types of IPv6 addresses with examples.
- What transition mechanisms allow IPv4 and IPv6 networks to interoperate?
- Why does IPv6 not require NAT, unlike IPv4?
📜 Past-Paper Questions & Structured Answers
Questions are paraphrased; answer focus is suggested guidance, not an official marking scheme.
2019 · Paper-II · Q3(a) · 8 marks
Question (paraphrased): Compare IPv4 and IPv6 headers field by field.
Answer focus: Use field correspondence, sizes and the consequences of changed fields.
| IPv4 field / property | IPv6 counterpart / change |
|---|---|
| Version = 4 | Version = 6 |
| IHL; 20–60-byte header | No IHL; fixed 40-byte base header |
| DSCP/ECN (historically ToS) | Traffic Class |
| No flow-label field | 20-bit Flow Label |
| Total Length includes header | Payload Length excludes the 40-byte base header but includes extension headers |
| Identification, Flags, Fragment Offset | Absent from base header; source fragmentation uses a Fragment extension header |
| Time To Live | Hop Limit |
| Protocol | Next Header, identifying an extension header or upper-layer protocol |
| Header Checksum | No IPv6 base-header checksum |
| 32-bit source and destination | 128-bit source and destination |
| Options and padding in variable header | Extension-header mechanism |
Consequences: a much larger address space reduces address scarcity; the fixed base header and removal of its checksum simplify common forwarding work. IPv6 routers do not fragment packets: they report an excessive packet size, allowing the source to adapt. Both versions can use IPsec; IPv6 does not automatically encrypt or authenticate all traffic. IPv6 multicast replaces broadcast for many functions.
2020 · Paper-II · Q4(a) · 8 marks
Question (paraphrased): Compare the IP headers and explain NAT’s response to IPv4 scarcity.
Answer focus: Combined question: spend roughly five marks’ effort on headers and three on NAT; this is suggested emphasis.
Header comparison: IPv4 uses 32-bit addresses and a variable 20–60-byte header; IPv6 uses 128-bit addresses and a fixed 40-byte base header. IPv4 Total Length includes its header; IPv6 Payload Length excludes its base header. TTL maps to Hop Limit, Protocol to Next Header and ToS/DSCP to Traffic Class. IPv6 adds Flow Label, removes the base-header checksum and carries optional functions in extension headers. IPv4 routers may fragment when allowed; IPv6 fragmentation is done only by the source.
NAT: private IPv4 hosts share a smaller pool of public addresses. With port translation (PAT/NAPT), a router might map 192.168.1.10:50000 to 203.0.113.5:40001 and 192.168.1.11:50000 to the same public IP at port 40002. It records these mappings and reverses them for replies.
Why it helps: many simultaneous internal clients can use one public IPv4 address, postponing exhaustion. However, translation adds state and complicates unsolicited inbound connections and some applications. NAT conserves addresses; it does not expand the IPv4 address space. See Network Address Translation (NAT) for the six-mark mechanism answer.