Similar to IPv4 nodes, typical IPv6 nodes use a local IPv6 routing table to determine how to forward packets. IPv6 routing table entries are created by default when IPv6 initializes and additional entries are added either by the receipt of Router Advertisement messages containing on-link prefixes and routes, or through manual configuration.
A routing table is present on all nodes running the IPv6 protocol for the Windows .NET Server 2003 family and Windows XP. The routing table stores information about IPv6 network prefixes and how they can be reached (either directly or indirectly). Before the IPv6 routing table is checked, the destination cache is checked for an entry matching the destination address in the IPv6 packet being forwarded. If an entry for the destination address is not in the destination cache, the routing table is used to determine:
The interface identifies the physical or logical interface that is used to forward the packet to either its destination or the next router.
For a direct delivery (in which the destination is on a local link), the next-hop address is the destination address in the packet. For an indirect delivery (in which the destination is not on a local link), the next-hop address is the address of a router.
After the next-hop interface and address are determined, the destination cache is updated. Subsequent packets forwarded to the destination use the destination cache entry, rather than having to check the routing table.
IPv6 routing table entries can be used to store the following types of routes:
These routes are network prefixes for subnets that are directly attached and typically have a 64-bit prefix length.
These routes are network prefixes for subnets that are not directly attached but are available across other routers. Remote network routes can be subnet network prefixes (typically with a 64-bit prefix length) or a prefix for an address space (typically with a prefix length less than 64).
A host route is a route to a specific IPv6 address. Host routes allow routing to occur on a per-IPv6 address basis. For host routes, the route prefix is a specific IPv6 address with a 128-bit prefix length. In contrast, both types of network routes have prefixes that have a prefix length less than 128 bits.
The default route is used when a more specific network or host route is not found. The default route prefix is ::/0.
To determine which routing table entry is used for the forwarding decision, IPv6 uses the following process:
For any given destination, the above procedure results in finding matching routes in the following order:
The result of the route determination process is the selection of a single route in the routing table. The selected route yields a next-hop interface and address. If the route determination process on the sending host fails to find a route, IPv6 assumes that the destination is locally reachable. If the route determination process on a router fails to find a route, IPv6 sends an ICMPv6 Destination Unreachable-No Route to Destination message to the sending host and discards the packet.
To view the IPv6 routing table on a computer running a member of the Windows .NET Server 2003 family or Windows XP, type netsh interface ipv6 show routes at a command prompt. Here is the display of the netsh interface ipv6 show routes command for a computer with three network adapters that is acting as a default router for two subnets configured with site-local address prefixes and that has a default route pointing to a default router on a thirdsubnet:
Publish Type Met Prefix Idx Gateway/Interface Name ------- ------- ---- --------------- --- ------------------------ yes Autoconf 8 fec0:0:0:1::/64 3 Local Area Connection yes Autoconf 8 fec0:0:0:2::/64 4 Local Area Connection 2 yes Autoconf 8 fec0:0:0:3::/64 5 Local Area Connection 3 yes Manual 256 ::/0 5 fe80::210:ffff:fed6:58c0
Each entry in the IPv6 routing table for Windows XP and the Windows .NET Server 2003 family has the following fields:
The interface indexes can be viewed from the display of the netsh interface ipv6 show interface command.
For remote network routes, a next-hop IPv6 address is listed. For directly attached network routes, the name of the interface from which the address prefix is directly reachable is listed.
Routes configured by user applications have the route type of Manual. Routes configured by the IPv6 protocol have the route type of Autoconf. The IPv6 routing table is built automatically, based on the current IPv6 configuration of your computer. A route for the link-local prefix (FE80::/64) is never present in the IPv6 routing table.
The first, second, and third routes are for the 64-bit site-local address prefixes of locally attached subnets. An Ethernet network adapter named Local Area Connection (interface index 3) is connected to the subnet FEC0:0:0:1::/64, a second Ethernet network adapter named Local Area Connection 2 (interface index 4) is connected to the subnet FEC0:0:0:2::/64, and a third Ethernet network adapter named Local Area Connection 3 (interface index 5) is connected to the subnet FEC0:0:0:3::/64.
The fourth route is the default route (prefix of ::/0). The default route matches all destinations. If the default route is the longest matching route for the destination, the packet is forwarded to the IPv6 address FE80::210:FFFF:FED6:58C0 by using the Ethernet network adapter named Local Area Connection 3 (interface index 5).
When determining the forwarding or next-hop IPv6 address from a route in the routing table:
For example, when traffic is sent to FEC0:0:0:2:2AA:FF:FE90:4D3C, the longest matching route is the route for the directly attached network FEC0:0:0:2::/64. The forwarding IP address is set to the destination address of FEC0:0:0:2:2AA:FF:FE90:4D3C and the interface is the interface that corresponds to interface index 4 (the Ethernet network adapter named Local Area Connection 2). When traffic is sent to FEC0:0:0:9:2AA:FF:FE03:21A6, the longest matching route is the default route (::/0). The forwarding IP address is set to the router address of FE80::210:FFFF:FED6:58C0 and the interface is the interface that corresponds to interface index 5 (the Ethernet network adapter named Local Area Connection 3).