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:
- Unicast: Global (
2001:db8::/32) and link-local (fe80::/10) for end-to-end delivery. - Multicast:
FF00::/8for group communication (e.g., IPTV, stock updates). - 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:
- Hello packets (every 10 sec) elect a Designated Router (DR) per segment.
- Link-State Advertisements (LSAs) flood the network to build a topology database.
- 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 RIBWorked 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):
- Source-specific multicast (SSM):
FF3x::/32(e.g., YouTube live streams). - Any-source multicast (ASM):
FF0x::/16(e.g., NEPSE stock ticks). - 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:
- Send inventory updates to all regional warehouses (
FF02::1for all routers). - Use PIM-SM to avoid flooding: only warehouses with stock receive updates.
- Send inventory updates to all regional warehouses (
- 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:
- BGP advertises the same prefix from all servers.
- 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
/29instead 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:
- Assign a
2002::/16address to its IPv4 server (192.0.2.1→2002:C000:2::1). - Route payments via IPv6 to reduce latency for Kathmandu users.
- Assign a
7. Troubleshooting IPv6 Routes
Common issues and fixes:
- No route to destination:
- Check
fe80::/10(link-local) and2000::/3(global) reachability. - Command:
ping6 fe80::2%eth0(replace2with neighbor’s EUI-64).
- Check
- Multicast not working:
- Verify
IGMPv3is enabled on interfaces. - Check PIM neighbors:
show ipv6 pim neighbor.
- Verify
- Anycast misrouting:
- Use
traceroute6to confirm the nearest server is reached.
- Use
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
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.
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.
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
- Protocol Comparisons: Always compare IPv6 vs. IPv4 routing (e.g., OSPFv3 vs. OSPFv2).
- Example: OSPFv3 uses link-local addresses (
fe80::) for adjacency, not IPv4’s224.0.0.5.
- Example: OSPFv3 uses link-local addresses (
- Address Calculations:
- Given a
/64, derive the interface ID (e.g.,2001:db8::1/64→2001:db8::1to2001:db8::ffff:ffff:ffff:ffff).
- Given a
- Multicast Questions:
- Know SSM vs. ASM and when to use
FF02::1(all routers) vs.FF02::2(all hosts).
- Know SSM vs. ASM and when to use
- Real-World Scenarios:
- Expect questions on NTC’s OSPFv3 areas, eSewa’s 6to4, or Pathao’s anycast.
- Troubleshooting:
- Memorize commands:
ipv6 route show(Linux)show ipv6 route(Cisco)ping6 -I eth0 fe80::2(link-local ping).
- Memorize commands:
Based on the TU BSc CSIT syllabus for Advanced Networking with IPv6, unit 5.
Discussion
Loading…