PadhaikoAll subjects

Routing with IPv6

Next Generation Networking with IPv6 (ENCT 387)

Open in the Padhaiko app

4.1 Routing in the internet and CIDR

IPv6 routing preserves the fundamental principles of IPv4 Classless Inter-Domain Routing (CIDR): routers forward packets hop-by-hop based on the destination prefix using Longest Prefix Match (LPM), while hierarchical address allocation keeps global backbone routing tables compact.

Definition

Longest Prefix Match and Hierarchical Aggregation

IPv6 Hierarchical Delegation Model

Because IPv6 offers 128 bits, RIRs (APNIC, ARIN, RIPE, LACNIC, AFRINIC) allocate large contiguous blocks so ISPs can summarize thousands of customers into a single BGP advertisement:


4.2 Unicast and multicast routing concepts

Unicast Routing Concepts

Unicast routing delivers a packet from one source interface to a single destination interface along a best path determined either statically or dynamically:

Multicast Routing Concepts

Multicast routing delivers a single stream from one source to multiple interested receivers simultaneously without duplicating packets at the sender or sending traffic to uninterested subnets.

Definition

Core Components of IPv6 Multicast Routing

  1. Multicast Listener Discovery (MLD): Replaces IPv4 IGMP, running inside ICMPv6 (Types 130, 131, 132, 143) so hosts inform local multicast routers which ff00::/8 groups they wish to join (MLDv1 for Any-Source Multicast; MLDv2 adds Source-Specific Multicast (S, G) filtering).
  2. Reverse Path Forwarding (RPF) Check: Before forwarding a multicast packet received on interface I from source S, the router checks its unicast routing table: if I is the exact interface used to reach S back toward the origin, the RPF check passes; otherwise the packet is dropped to prevent routing loops.
  3. Distribution Trees:
    • Source-Based Tree (S, G): Builds a shortest-path tree rooted directly at source S for group G (optimal latency, higher router memory state).
    • Shared Tree (*, G): Builds a single tree rooted at a central Rendezvous Point (RP) shared by all sources sending to group G (lower state, slightly longer path via RP).

4.3 Unidirectional link routing

Standard IP routing protocols assume all network links are bidirectional (if Router A can send packets to Router B, Router B can send replies back to Router A over the same physical link). Certain physical media violate this assumption.

Definition

Unidirectional Links and UDLR (RFC 3077)

A Unidirectional Link (UDL) carries traffic in one physical direction only—from an upstream feed router to one or more downstream receive-only routers. Classic examples include satellite broadcast downlinks (DVB-S), cable broadcast channels, and asymmetric optical/RF links.

Why Standard Protocols Fail on UDLs

How UDLR (RFC 3077) Solves the Problem

Unidirectional Link Routing (UDLR) uses a Link-Layer Tunneling Mechanism (LLTM) over an auxiliary bidirectional terrestrial path (such as a standard ISP connection):

  1. Downstream receivers open a tunnel back to the upstream feeder router across the terrestrial Internet.
  2. When a downstream router needs to send control traffic (OSPFv3 Hellos, RIPng updates, PIM Joins, or NDP messages) to the feeder, it encapsulates the packet through the reverse tunnel to the feeder.
  3. The feeder emulates a multi-access broadcast link across all receivers, forwarding multicast/unicast frames over the high-bandwidth UDL while receiving control replies via the reverse tunnel—making the UDL appear logically bidirectional to Layer 3 routing protocols.

4.4 Routing protocols: RIPng, OSPFv3 and BGP (Basic concepts for IPv6)

To support 128-bit prefixes and IPv6 link-local forwarding, traditional IPv4 routing protocols were upgraded to RIPng, OSPFv3, and MP-BGP.

1. RIPng (Routing Information Protocol Next Generation — RFC 2080)

2. OSPFv3 (Open Shortest Path First version 3 — RFC 5340)

OSPFv3 is a major redesign of OSPFv2 for IPv6 (and later multi-address-family support in RFC 5838):

3. MP-BGP (Multiprotocol BGP for IPv6 — RFC 4760 / RFC 2545)

BGP-4 is the Internet's path-vector Exterior Gateway Protocol running over TCP port 179. Multiprotocol Extensions (MP-BGP) allow a single BGP process to carry IPv6 routes cleanly:

AspectRIPng (RFC 2080)OSPFv3 (RFC 5340)
Protocol TypeDistance-Vector (Bellman-Ford)Link-State (Dijkstra SPF)
MetricHop count (1–15; 16 = infinity)Interface bandwidth-based Cost
EncapsulationUDP port 521Direct IPv6 (Next Header = 89)
Multicast Addressff02::9ff02::5 (All routers), ff02::6 (DR/BDR)
Convergence & ScaleSlow convergence; small networks onlyFast convergence; hierarchical Areas (Area 0 backbone)
AuthenticationExternal IPsec (AH/ESP)External IPsec (AH/ESP)

4.5 Multicast routing (PIM-SM overview)

Protocol Independent Multicast – Sparse Mode (PIM-SM, RFC 7761) is the standard inter- and intra-domain multicast routing protocol for IPv6. It is called "Protocol Independent" because it does not implement its own topology discovery—instead, it reads whichever unicast routing table already exists (RIPng, OSPFv3, IS-IS, or MP-BGP) to perform RPF checks and locate next hops.

Definition

PIM-SM Architecture and Operation

  1. Sparse Mode Assumption: Receivers are sparsely distributed across the network; therefore, routers do not flood multicast traffic everywhere by default. Traffic flows only to routers that explicitly Join a group.
  2. Rendezvous Point (RP): A designated router acting as the central meeting point (root of the (*, G) Shared Tree) for multicast group G.
  3. Receiver Registration ((*, G) Join): When a host sends an MLD Report to its local Designated Router (DR), the receiver's DR sends a PIM Join (*, G) hop-by-hop toward the RP, building the shared distribution tree branch.
  4. Source Registration (PIM Register): When source S begins transmitting to G, the source's first-hop DR encapsulates the initial multicast packets inside unicast PIM Register messages sent to the RP. The RP decapsulates them and forwards down the (*, G) shared tree (and optionally joins (S, G) back to the source).
  5. SPT Switchover (S, G): Once data rate exceeds a threshold, the receiver's last-hop DR sends a PIM Join (S, G) directly toward source S along the shortest unicast path (and prunes the RP shared tree), avoiding suboptimal "dog-leg" paths through the RP.

Worked Examples

Example 1

1

An ISP is allocated the IPv6 block 2001:db8:4000::/34.

  1. How many /48 enterprise customer allocations can the ISP carve from this /34 block?
  2. An enterprise customer receives 2001:db8:4120::/48. How many /64 LAN subnets can it create?
  3. Suppose a router's FIB holds four routes:
    • ::/0 via fe80::1
    • 2001:db8:4000::/34 via fe80::2
    • 2001:db8:4120::/48 via fe80::3
    • 2001:db8:4120:5::/64 via fe80::4 Which next-hop will be chosen for a packet destined to 2001:db8:4120:0005::10, and why?

1. Calculating /48 Allocations from /34: Number of subnet bits available between /34 and /48 = 48 - 34 = 14 bits. Total /48 customer blocks = 2^14 = 16,384 blocks.

2. Calculating /64 LAN Subnets from /48: Number of subnet bits available between /48 and /64 = 64 - 48 = 16 bits. Total /64 LAN subnets = 2^16 = 65,536 subnets.

3. Applying Longest Prefix Match (LPM): All four entries match the destination 2001:db8:4120:0005::10 (note 0005 compresses to 5):

  • ::/0 matches 0 bits.
  • 2001:db8:4000::/34 matches 34 bits (0x4000 = 0100 00..., 0x4120 = 0100 0001... -> first 2 bits of 3rd hextet 01 match, 32 + 2 = 34 bits).
  • 2001:db8:4120::/48 matches 48 bits.
  • 2001:db8:4120:5::/64 matches 64 bits.

By Longest Prefix Match, the router selects fe80::4 (2001:db8:4120:5::/64).

Answer:
  1. 16,384 customer /48 allocations.
  2. 65,536 LAN /64 subnets.
  3. Next-hop fe80::4 is selected because 2001:db8:4120:5::/64 has the longest matching prefix (64 bits).
Example 2

2

An enterprise owns four contiguous /48 IPv6 prefixes and wants to summarize them into a single aggregate route for MP-BGP advertisement to its upstream ISP:

Compute the exact summarized IPv6 CIDR prefix.

Comparing Common Prefix Bits Across the Four Networks: The first two hextets (2001:0db8) are identical across all four prefixes (32 bits). Inspecting the third 16-bit hextet in binary:

  • 0x0010 = 0000 0000 0001 0000
  • 0x0011 = 0000 0000 0001 0001
  • 0x0012 = 0000 0000 0001 0010
  • 0x0013 = 0000 0000 0001 0011

Counting Matching Leading Bits: Only the final 2 bits vary across 00, 01, 10, 11 (0x0010 XOR 0x0013 = 0x0003, 2 bits wide), meaning the first 14 bits of the third hextet are identical across all four blocks. Total common prefix length = 32 + 14 = 46 bits (equivalently, summarizing 4 = 2^2 blocks reduces /48 by 2 bits to /46).

Answer:

The single aggregate summary prefix is 2001:db8:10::/46.

Example 3

3

An enterprise IPv6 network runs OSPFv3 with auto-cost reference-bandwidth 10000 (10,000 Mbps = 10 Gbps). A packet travels from R1 to R4 across three links:

  1. Compute the OSPFv3 cost of each link and the total end-to-end SPF path cost from R1 to R4.
  2. State the destination IPv6 address and protocol number (Next Header) used by R1 when exchanging OSPFv3 Hellos with R2, and identify which address type R1 places in the routing table as the next hop toward R4.

1. Computing OSPFv3 Link Costs (Cost = Reference Bandwidth / Link Bandwidth):

  • R1 -> R2 (1000 Mbps): 10000 / 1000 = 10
  • R2 -> R3 (100 Mbps): 10000 / 100 = 100
  • R3 -> R4 (10000 Mbps): 10000 / 10000 = 1
  • Total SPF Path Cost: 10 + 100 + 1 = 111.

2. OSPFv3 Encapsulation, Multicast Addressing, and Next-Hop:

  • OSPFv3 runs directly inside IPv6 using Next Header = 89.
  • Hello packets on point-to-point or broadcast links are sent to the link-local AllSPFRouters multicast address ff02::5 using R1's link-local (fe80::) source address.
  • In R1's IPv6 routing table, the next-hop toward R4 is R2's link-local address (fe80::...) on the R1–R2 link.
Answer:
  1. Link costs: 10 (R1–R2), 100 (R2–R3), 1 (R3–R4); Total SPF cost = 111.
  2. OSPFv3 uses Next Header = 89, sends Hellos to ff02::5, and installs R2's link-local (fe80::) address as the next-hop.

Exercises

Practice Exercises — Routing with IPv6

Question 1

Explain the Longest Prefix Match (LPM) rule and CIDR route aggregation in IPv6. Why does IPv6 assign /48 or /56 blocks to sites and /64 to individual LANs rather than using variable subnet boundaries like /120?

LPM and Route Aggregation:

  • LPM: When multiple routing table entries match a destination IPv6 address, the router forwards using the route with the highest prefix length (most specific network bits).
  • Aggregation: RIRs assign large contiguous blocks (e.g., /32) to ISPs, who delegate /48 or /56 blocks to customers. The ISP advertises only one /32 prefix into global BGP rather than thousands of individual customer routes, keeping DFZ tables compact.

Why /64 Is the Standard LAN Boundary:

  1. SLAAC Compatibility (RFC 4291 / 4862): Stateless Address Autoconfiguration requires a 64-bit Interface ID, so subnets must be /64.
  2. NDP Cache Protection: Huge 2^64 host spaces make off-link Neighbor Discovery exhaustion scanning infeasible.
  3. Abundant Subnet Bits: With a /48 site allocation, an organization still has 16 subnet bits (65,536 /64 LANs) without ever needing cramped variable masks.
Answer:

LPM selects the matching route with the longest prefix length, while hierarchical CIDR aggregation summarizes many /48 or /56 customer allocations into a single /32 ISP route. LANs use /64 because SLAAC requires a 64-bit Interface ID and /48 sites still have 65,536 subnets available.

Question 2

Summarize the eight contiguous IPv6 prefixes from 2001:db8:0028::/48 through 2001:db8:002f::/48 (0028, 0029, 002a, 002b, 002c, 002d, 002e, 002f) into a single optimal CIDR summary prefix.

Inspecting the Third Hextet in Binary:

  • 0x0028 = 0000 0000 0010 1000
  • 0x002f = 0000 0000 0010 1111

Determining Common Prefix Length:

  • The first two hextets (2001:0db8) provide 32 common bits.
  • In the third hextet, the upper 13 bits (0000 0000 0010 1) are identical across all 8 prefixes (0x0028 XOR 0x002f = 0x0007, varying across the last 3 bits 000 to 111).
  • Total common prefix length = 32 + 13 = 45 bits (48 - 3 = 45, because 8 = 2^3).
Answer:

The optimal aggregate summary prefix is 2001:db8:28::/45.

Question 3

What is Unidirectional Link Routing (UDLR)? Explain three reasons why standard dynamic routing and multicast protocols fail over a unidirectional satellite link, and describe how RFC 3077 resolves them.

Why Standard Routing Fails Over UDLs: A unidirectional link (e.g., satellite downlink) only carries frames from the upstream feeder to downstream receivers; receivers have no reverse physical channel on that link. Consequently:

  1. Hello/Adjacency Failure: OSPFv3 cannot reach 2-Way state and RIPng cannot receive downstream advertisements back over the UDL.
  2. NDP Resolution Failure: Downstream nodes cannot send Neighbor Advertisements back to the feeder on the UDL.
  3. Multicast RPF Failure: Downstream routers' unicast route back to the source points out their terrestrial ISP link, causing RPF checks to drop incoming satellite multicast packets.

RFC 3077 (UDLR) Tunneling Solution: UDLR establishes a Link-Layer Tunneling Mechanism (LLTM) from each downstream receiver back to the feeder over a separate bidirectional terrestrial network. Control packets (NDP, OSPFv3 Hellos, PIM Joins) sent toward the feeder travel through this reverse tunnel, allowing the feeder to emulate a standard bidirectional multi-access link.

Answer:

Standard routing fails on UDLs because two-way neighbor hellos, NDP replies, and multicast RPF checks break without a reverse channel. UDLR (RFC 3077) uses reverse link-layer tunnels over a terrestrial path so receivers can send control traffic back to the feeder, making the UDL appear logically bidirectional.

Question 4

Compare RIPng, OSPFv3, and MP-BGP for IPv6 across five criteria: routing algorithm, transport/encapsulation, multicast/peer addressing, how IPv6 prefixes are carried, and authentication mechanism.

Protocol-by-Protocol Comparison:

  • RIPng (RFC 2080): Distance-vector (Bellman-Ford, max 15 hops); runs over UDP 521; uses link-local multicast ff02::9; carries 16-byte IPv6 prefixes in RTEs; relies on IPsec.
  • OSPFv3 (RFC 5340): Link-state (Dijkstra SPF, cost metric); runs directly on IPv6 (Next Header = 89); uses ff02::5 and ff02::6; separates topology LSAs (Types 1/2) from prefix LSAs (Link-LSA Type 8 & Intra-Area-Prefix-LSA Type 9); relies on IPsec.
  • MP-BGP (RFC 4760/2545): Path-vector (policy/AS-PATH); runs over TCP 179 to configured unicast peers; carries IPv6 prefixes (AFI=2, SAFI=1) in MP_REACH_NLRI and MP_UNREACH_NLRI attributes; uses TCP-AO / MD5 / IPsec.
Answer:

RIPng uses Bellman-Ford over UDP 521 (ff02::9) with IPsec; OSPFv3 uses Dijkstra SPF directly over IPv6 NH=89 (ff02::5/ff02::6) with dedicated Type 8/9 prefix LSAs and IPsec; MP-BGP uses path-vector policies over TCP 179 advertising IPv6 routes via MP_REACH_NLRI/MP_UNREACH_NLRI (AFI=2).

Question 5

Explain how PIM-SM (Protocol Independent Multicast – Sparse Mode) operates in an IPv6 network. Define the roles of MLDv2, the Rendezvous Point (RP), the (*, G) Shared Tree, RPF checks, and SPT Switchover (S, G).

PIM-SM Components and Packet Flow:

  1. MLDv2 (ICMPv6): Hosts report multicast group interest to their local Designated Router (DR).
  2. Shared Tree (*, G) & RP: The receiver's DR sends a PIM Join (*, G) toward the Rendezvous Point (RP), building a shared distribution tree only where receivers exist.
  3. Source Registration: The source's DR sends PIM Register messages to the RP so traffic reaches listeners on (*, G).
  4. RPF Check: At every hop, routers verify incoming multicast packets arrive on the unicast shortest-path interface toward the source/RP to prevent loops.
  5. SPT Switchover (S, G): To avoid suboptimal paths through the RP, the receiver's DR issues a PIM Join (S, G) directly toward the source S and prunes the RP branch.
Answer:

In IPv6 PIM-SM, hosts join groups via MLDv2, receiver DRs build a (*, G) Shared Tree toward the RP, source DRs register traffic with the RP, routers enforce loop-free forwarding via RPF checks against the unicast table, and receiver DRs trigger SPT Switchover to an optimal (S, G) tree directly to the source.

← Security and Quality of Service in IPv6IPv4/IPv6 Transition Mechanisms →