Advanced Networking with IPv6Unit 210 min read
IPv6: Addressing, Header, Transition & Real-World Use
Unit 2 of Advanced Networking with IPv6 explores IPv6’s 128-bit addressing, simplified header, Neighbor Discovery Protocol (NDP), and transition mechanisms (tunneling, dual-stack) compared to IPv4, with real-world examples from Nepalese tech (e.g., Ncell’s 5G, eSewa’s payment routing) and global networks (Google’s DNS,
IPv6 Addressing: Beyond 32 Bits
Why IPv6?
IPv4’s 32-bit address space (≈4.3 billion addresses) is exhausted. IPv6 uses 128-bit addresses (≈3.4×10³⁸ addresses), enabling:
- Global uniqueness via hierarchical addressing (ISP → Subnet → Interface).
- No NAT (Network Address Translation) needed, simplifying end-to-end communication.
IPv6 Address Formats
classDiagram
class IPv6Address {
+128 bits = 8 hextets (16 bits each)
+Format: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
+Types:
- Global Unicast (2000::/3)
- Link-Local (fe80::/10)
- Unique Local (fc00::/7)
- Multicast (ff00::/8)
}
class IPv4Mapped {
+Format: ::ffff:IPv4_address
+Used for IPv4/IPv6 transition
}
IPv6Address --> IPv4Mapped : "Subset"Key Address Types (with real-world ties):
| Type | Prefix | Example | Used by |
|---|---|---|---|
| Global Unicast | 2000::/3 | 2001:db8::1 | Ncell’s 5G subscribers (2001:6xx::/48) |
| Link-Local | fe80::/10 | fe80::1%eth0 | Neighbor Discovery (NDP) in LANs |
| Unique Local | fc00::/7 | fd12:3456::/48 | eSewa’s internal payment routing |
| Multicast | ff00::/8 | ff02::1 (all nodes) | YouTube’s live streams (IGMPv3) |
Worked Example: Ncell’s 5G IPv6 Allocation
Ncell’s ISP allocates /48 blocks to enterprises. For a company with 1000 devices:
- Prefix:
2001:6xx:yyyy::/48 - Subnet ID:
zzzz(assigned by Ncell) - Interface ID: Last 64 bits (EUI-64 or random).
Result: Each device gets a unique
2001:6xx:yyyy:0:0:zzzz:abcd:efgh.
A labeled diagram showing the 40-byte IPv6 header with fields: Version (6), Traffic Class, Flow Label, Payload Length, Next Header, Hop Limit, Source/Destination Addresses. (Image: Mro, CC BY-SA 3.0, via Wikimedia Commons)
IPv6 Header: Simpler and More Efficient
IPv4’s header has 12 fields + options. IPv6 reduces this to 8 fixed fields (40 bytes vs. IPv4’s 20–60 bytes), improving speed and predictability.
Key Header Fields
| Field | Size (bits) | Purpose | IPv4 Comparison |
|---|---|---|---|
| Version | 4 | Always 6 (no version negotiation). |
4 bits (4 for IPv4) |
| Traffic Class | 8 | Replaces ToS (Type of Service); used for QoS (e.g., VoIP prioritization). | ToS field (8 bits) |
| Flow Label | 20 | Real-time traffic labeling (e.g., online gaming). | No equivalent |
| Payload Length | 16 | Length of data (excluding header). | Total Length (16 bits) |
| Next Header | 8 | Identifies upper-layer protocol (TCP=6, UDP=17, ICMPv6=58). | Protocol (8 bits) |
| Hop Limit | 8 | Replaces TTL (Time to Live); decremented per hop. | TTL (8 bits) |
| Source/Dest Address | 128 each | 128-bit addresses (8 hextets). | 32-bit addresses |
Why This Matters:
- No fragmentation: IPv6 sends "Packet Too Big" (PTB) messages if MTU < payload size. IPv4 fragments at routers.
- Extension Headers: Optional headers (e.g., Authentication, Routing) are placed after the main header, not inline.
Neighbor Discovery Protocol (NDP): Replacing ARP
IPv4 uses ARP to map IP → MAC. IPv6 replaces this with NDP, which handles:
- Address Resolution:
NS(Neighbor Solicitation) →NA(Neighbor Advertisement). - Router Discovery: Hosts learn default gateways via
RA(Router Advertisement). - Parameter Configuration: Hosts get prefix/MTU from routers.
- Duplicate Address Detection (DAD): Prevents duplicate IPv6 addresses.
NDP Message Exchange (Sequence Diagram)
sequenceDiagram
participant Host as Host (fe80::1)
participant Router as Router (2001:db8::1)
Host->>Router: NS (Who has fe80::1?)
Router-->>Host: NA (Here I am, fe80::1)
Router->>Host: RA (Prefix: 2001:db8::/64, MTU: 1500)
Host->>Router: DAD Check (Is fe80::1 free?)
Router-->>Host: No response (Address is unique)Real-World Example: eSewa’s Payment Routing When you pay via eSewa:
- Your phone (IPv6:
fe80::1%wlan0) sends anNSto the local router (NTC’s gateway). - The router replies with
NA, confirming the link-local address. - eSewa’s server (global unicast:
2001:db8:123::1) uses this to route payment requests via NDP-configured paths.
IPv6 Transition Mechanisms: Bridging IPv4 and IPv6
Since IPv4 isn’t disappearing overnight, networks use transition methods:
1. Dual-Stack
- How it works: Devices run both IPv4 and IPv6 stacks simultaneously.
- Example: Google’s DNS (
8.8.8.8for IPv4,2001:4860:4860::8888for IPv6). - Diagram:
flowchart TD A["Host (Dual-Stack)"] -->|"IPv4"| B["IPv4 Router"] A -->|"IPv6"| C["IPv6 Router"] B --> D["Legacy IPv4 Internet"] C --> D
2. Tunneling
- 6to4: Encapsulates IPv6 in IPv4 (uses anycast relay routers).
- Example:
192.88.99.1(anycast relay) tunnels IPv6 over IPv4.
- Example:
- Teredo: For NAT traversal (used by Xbox Live).
- Configured Tunnel: Manual setup (e.g., ISP-provided tunnel endpoints).
3. NAT64/DNS64
- NAT64: Translates IPv6 → IPv4 at the edge (e.g., accessing IPv4-only websites).
- DNS64: Returns IPv6 addresses for IPv4-only services (e.g.,
http://[2607:f8b0:4009:80e::200e]for google.com). - Example: Your phone (IPv6-only) uses DNS64 to resolve
facebook.com(IPv4) via NAT64.
IPv6 vs. IPv4: Comparison Table
| Feature | IPv4 | IPv6 | Impact |
|---|---|---|---|
| Address Space | 32-bit (~4.3B addresses) | 128-bit (~3.4×10³⁸ addresses) | No address exhaustion |
| Header Size | 20–60 bytes (variable) | Fixed 40 bytes | Faster processing |
| Fragmentation | Routers fragment packets | "Packet Too Big" (PTB) messages | End-to-end path MTU discovery |
| Security | IPSec optional | IPSec mandatory (AH/ESP headers) | Built-in security |
| NAT | Required for public IPs | Not needed (end-to-end) | Simpler routing |
| Multicast | Limited (IGMPv2) | Native support (IGMPv3) | Better for video streaming (YouTube) |
| Transition Mechanisms | NAT, PAT, CGNAT | Dual-stack, tunneling, NAT64 | Smoother migration |
In the Real World
Ncell’s 5G Network (Nepal)
- Uses IPv6 for subscriber IPs (e.g.,
2001:6xx::/48blocks). - Why? Supports 1000x more devices than IPv4; enables IoT (e.g., smart meters).
- NDP in Action: Your phone (IPv6:
fe80::1%wwan) discovers the 5G gateway viaRAmessages.
- Uses IPv6 for subscriber IPs (e.g.,
eSewa’s Payment Routing
- Uses IPv6 multicast (
ff02::1) for load balancing across payment servers. - Dual-stack: Supports both IPv4 (legacy) and IPv6 (new users).
- Uses IPv6 multicast (
YouTube’s CDN (Global)
- Anycast DNS: Resolves to the nearest IPv6-enabled server (e.g.,
2607:f8b0:4009:80e::200e). - Multicast: Reduces bandwidth for live streams (IPv6’s native support).
- Anycast DNS: Resolves to the nearest IPv6-enabled server (e.g.,
Google’s DNS (8.8.8.8)
- Dual-stack:
8.8.8.8(IPv4) and2001:4860:4860::8888(IPv6). - Transition: Uses NAT64 for IPv6-only devices querying IPv4 sites.
- Dual-stack:
Worked Example: Calculating IPv6 Subnets
Scenario: NTC allocates a /48 block (2001:db8:123::/48) to a university. Subnet for the Computer Science department (needs 500 hosts).
Subnet the
/48:- Split into
/64subnets (standard for interfaces). - Subnet ID:
0001(binary00000000000000000000000000000001). - Resulting Subnet:
2001:db8:123:1::/64.
- Split into
Assign Hosts:
- Interface ID: Last 64 bits (EUI-64 or random).
- Example:
2001:db8:123:1::1(gateway),2001:db8:123:1::2to2001:db8:123:1::1ff.
Visual:
classDiagram
class /48Block {
+Prefix: 2001:db8:123::/48
+Subnets: 65536 (/64 each)
}
class /64Subnet {
+Prefix: 2001:db8:123:1::/64
+Hosts: 18 quintillion (theoretical)
+Used by: CS Department
}
/48Block --> /64Subnet : "Contains"Exam Tip
Addressing is Critical:
- Memorize prefixes (e.g.,
2000::/3for global unicast). - Practice converting hexadecimal to binary (e.g.,
2001:db8::1→ binary). - Exam Question: "Given a
/64subnet, write 3 valid host addresses." (Use::and EUI-64.)
- Memorize prefixes (e.g.,
Header Fields:
- Know the 8 fixed fields and their sizes (e.g.,
Flow Labelis 20 bits). - Common Mistake: Confusing
Traffic Class(QoS) withFlow Label(real-time traffic).
- Know the 8 fixed fields and their sizes (e.g.,
Transition Mechanisms:
- Dual-stack = both protocols running.
- Tunneling = IPv6 inside IPv4 (e.g., 6to4).
- NAT64/DNS64 = IPv6 → IPv4 translation.
- Exam Question: "How would a pure IPv6 host access an IPv4-only website?" (Answer: NAT64 + DNS64.)
NDP Over ARP:
- ARP = IPv4 (IP → MAC).
- NDP = IPv6 (NS/NA for MAC resolution, RA for router discovery).
- Exam Question: "What message does a host send to discover its default gateway in IPv6?" (Answer:
Router Solicitation→Router Advertisement.)
Real-World Scenarios:
- Ncell 5G: IPv6
/48allocation, NDP for gateway discovery. - eSewa: Dual-stack for backward compatibility.
- YouTube: Anycast DNS + multicast streaming.
- Exam Question: "Explain how IPv6 improves traffic routing in Kathmandu’s congested internet." (Answer: No NAT → end-to-end paths; multicast for live streams.)
- Ncell 5G: IPv6
Diagrams:
- Draw:
- IPv6 header fields.
- NDP message exchange (NS/NA/RA).
- Dual-stack or tunneling topology.
- Label: Every field/arrow with its purpose.
- Draw:
Pro Tip: For numerical questions (e.g., subnet calculation), always:
- Write the binary prefix (e.g.,
/64=1111111111111111111111111111111100000000000000000000000000000000). - Show one valid host address (e.g.,
2001:db8::1). - Mention real-world use (e.g., "This subnet serves Pathao’s ride-hailing servers in Lalitpur").
Based on the TU BSc CSIT syllabus for Advanced Networking with IPv6, unit 2.
Discussion
Loading…