Elective Advanced Networking with IPv6

Advanced Networking with IPv6Unit 58 min read

IPv6 Routing: Protocols, Algorithms & Multicast

Unit 5 of Advanced Networking with IPv6 explores how IPv6 packets traverse networks using routing protocols (RIPng, OSPFv3, BGP-4+), multicast addressing, and hierarchical design—with real-world examples from Nepal’s NTC backbone and global CDNs.

TAKEAWAYS:

  • IPv6 routing relies on link-local, global, and multicast addresses to forward packets via static or dynamic protocols.
  • RIPng, OSPFv3, and BGP-4+ extend IPv4 routing with 128-bit address support and improved scalability.
  • Multicast (FF00::/8) enables efficient one-to-many communication, critical for IPTV and stock tickers (e.g., NEPSE feeds).
  • Hierarchical routing reduces table size via aggregation (e.g., NTC’s ISP-level prefixes).
  • Anycast (e.g., Google DNS 2001:4860:4860::8888) directs requests to the nearest server.
  • Transition mechanisms (e.g., 6to4, Teredo) integrate IPv6 into IPv4-only networks like older Daraz servers.

1. IPv6 Addressing for Routing

IPv6 routing depends on three address types:

  1. Unicast: Global (2001:db8::/32) and link-local (fe80::/10) for end-to-end delivery.
  2. Multicast: FF00::/8 for group communication (e.g., IPTV, stock updates).
  3. Anycast: Same address for multiple servers (e.g., WhatsApp’s nearest data center).
classDiagram
    class AddressType {
        + Unicast: Global (2001:db8::/32)
        + Unicast: Link-local (fe80::/10)
        + Multicast: FF00::/8
        + Anycast: Shared address (e.g., DNS)
    }
    class RoutingProtocol {
        <<abstract>>
        + Forward packets via addresses
    }
    AddressType --> RoutingProtocol : "Used by"

2. IPv6 Routing Protocols

Unlike IPv4, IPv6 uses native protocols without dual-stack hacks. Key protocols:

Protocol IPv4 Equivalent Key Feature Use Case
RIPng RIPv2 Max 15 hops, plaintext updates Small networks (e.g., campus LAN)
OSPFv3 OSPFv2 Link-state, hierarchical (areas) ISP backbones (e.g., NTC)
BGP-4+ BGP-4 Path-vector, supports anycast Global internet (e.g., Google)
Static Static IPv4 Manual entries, no dynamic updates Critical links (e.g., bank servers)

How OSPFv3 Works:

  1. Hello packets (every 10 sec) elect a Designated Router (DR) per segment.
  2. Link-State Advertisements (LSAs) flood the network to build a topology database.
  3. Shortest Path First (SPF) algorithm computes routes (like Dijkstra’s).
sequenceDiagram
    participant A as Router A
    participant B as Router B
    participant DR as Designated Router
    A->>B: Hello (OSPFv3)
    B->>DR: Elect DR via priority
    DR->>A: LSA (Link State Update)
    A->>A: Run SPF, update RIB

Worked Example: NTC’s OSPFv3 Backbone

  • NTC uses OSPFv3 areas to segment its network:
    • Area 0: Core routers in Kathmandu.
    • Area 1: Provincial ISPs (e.g., Pokhara, Biratnagar).
    • Area 2: End-user networks (e.g., Ncell’s mobile backhaul).
  • Metric: Cost = reference bandwidth (100 Mbps) / interface speed. Example: A 1 Gbps link has cost 100/1000 = 0.1.

3. Multicast Routing (FF00::/8)

Multicast avoids flooding by using Reverse Path Forwarding (RPF):

  1. Source-specific multicast (SSM): FF3x::/32 (e.g., YouTube live streams).
  2. Any-source multicast (ASM): FF0x::/16 (e.g., NEPSE stock ticks).
  3. Protocol: PIM-SM (Protocol Independent Multicast-Sparse Mode) for ASM.
graph LR
    A["Source: NEPSE Server"] -->|"IGMP Join"| B["Router R1"]
    B -->|"PIM Join"| C["RP: Regional Provider"]
    C -->|"PIM Join"| D["Router R2"]
    D -->|"IGMP Join"| E["Subscribers: Brokers"]

Worked Example: Daraz’s Flash Sales

  • During a Big Billion Day sale, Daraz uses multicast to:
    1. Send inventory updates to all regional warehouses (FF02::1 for all routers).
    2. Use PIM-SM to avoid flooding: only warehouses with stock receive updates.
  • Result: 10x faster than unicast for 10,000+ simultaneous orders.

4. Anycast and Load Balancing

Anycast assigns one IP to multiple servers (e.g., 2001:4860:4860::8888 for Google DNS).

  • How it works:
    1. BGP advertises the same prefix from all servers.
    2. Routers forward to the nearest server via BGP attributes (MED, AS_PATH).
  • Example: WhatsApp’s anycast gateways in Nepal route messages to the closest data center (e.g., Kathmandu vs. Pokhara).

5. IPv6 Routing Hierarchy

Hierarchy reduces routing table size via aggregation:

  • Global Routing Prefix (GRP): Assigned by IANA (e.g., 2001:db8::/32).
  • Subnet ID: ISP-assigned (e.g., 2001:db8:1::/48).
  • Interface ID: Host-specific (e.g., 2001:db8:1::1/64).

Example: NTC’s Address Allocation

Entity Prefix Example Subnet
NTC (IANA) 2001:648::/29 2001:648:1::/48
Ncell Backhaul 2001:648:1::/48 2001:648:1:1::/64
User Home 2001:648:1:1::/64 2001:648:1:1::1/128

Advantages:

  • Smaller routing tables: NTC advertises /29 instead of 500,000 /64s.
  • Faster lookups: Longer prefixes match first (like a trie).

6. Transition Mechanisms for Routing

Since IPv4 and IPv6 coexist, routing must handle dual-stack and tunneling:

Mechanism How It Works Example Use Case
6to4 Encapsulate IPv6 in IPv4 (41 protocol) Legacy Daraz servers
Teredo UDP-encapsulated IPv6 over NAT Home users behind IPv4 NAT
ISATAP IPv6 over IPv4 (RFC 5214) Enterprise migration
DS-Lite Lightweight IPv4-IPv6 translation ISPs like NTC

Worked Example: eSewa’s IPv6 Transition

  • eSewa’s backend uses 6to4 to:
    1. Assign a 2002::/16 address to its IPv4 server (192.0.2.1 → 2002:C000:2::1).
    2. Route payments via IPv6 to reduce latency for Kathmandu users.

7. Troubleshooting IPv6 Routes

Common issues and fixes:

  1. No route to destination:
    • Check fe80::/10 (link-local) and 2000::/3 (global) reachability.
    • Command: ping6 fe80::2%eth0 (replace 2 with neighbor’s EUI-64).
  2. Multicast not working:
    • Verify IGMPv3 is enabled on interfaces.
    • Check PIM neighbors: show ipv6 pim neighbor.
  3. Anycast misrouting:
    • Use traceroute6 to confirm the nearest server is reached.
stateDiagram-v2
    [*] --> Idle
    Idle --> Checking: "ping6 fe80::1%eth0"
    Checking --> NeighborFound: "Reply received"
    Checking --> NoRoute: "No reply"
    NeighborFound --> VerifyGlobal: "ping6 2001:db8::1"
    NoRoute --> CheckCable: "Is cable plugged?"
    VerifyGlobal --> Success: "Route working"
    VerifyGlobal --> Failure: "Check routing table"

In the real world

  1. NTC’s IPv6 Backbone

    • Uses OSPFv3 areas to route traffic between Kathmandu, Pokhara, and Biratnagar.
    • Anycast DNS (2001:4860:4860::8888) ensures low-latency responses for eSewa and Khalti users.
    • Multicast delivers NEPSE stock updates to brokers in real-time via FF02::1.
  2. Pathao’s Ride Matching

    • Pathao’s servers use BGP-4+ to advertise the nearest data center to drivers.
    • Anycast ensures ride requests hit the closest Pathao gateway (e.g., Kathmandu vs. Lalitpur).
    • Multicast (for driver clusters) reduces latency in high-demand zones.
  3. YouTube’s IPTV in Nepal

    • Uses PIM-SM multicast to stream the same video to 1,000+ users via NTC’s backbone.
    • SSM (FF3x::) ensures only subscribed channels are delivered (e.g., BBC Nepal).

Exam Tip

  1. Protocol Comparisons: Always compare IPv6 vs. IPv4 routing (e.g., OSPFv3 vs. OSPFv2).
    • Example: OSPFv3 uses link-local addresses (fe80::) for adjacency, not IPv4’s 224.0.0.5.
  2. Address Calculations:
    • Given a /64, derive the interface ID (e.g., 2001:db8::1/64 → 2001:db8::1 to 2001:db8::ffff:ffff:ffff:ffff).
  3. Multicast Questions:
    • Know SSM vs. ASM and when to use FF02::1 (all routers) vs. FF02::2 (all hosts).
  4. Real-World Scenarios:
    • Expect questions on NTC’s OSPFv3 areas, eSewa’s 6to4, or Pathao’s anycast.
  5. Troubleshooting:
    • Memorize commands:
      • ipv6 route show (Linux)
      • show ipv6 route (Cisco)
      • ping6 -I eth0 fe80::2 (link-local ping).

Based on the TU BSc CSIT syllabus for Advanced Networking with IPv6, unit 5.

Discussion

Loading…