You are on page 1of 6

TheCableGuyOctober2002

UnderstandingtheIPv6RoutingTable

ByTheCableGuy
Foralistandadditionalinformationonall
TheCableGuy
columns,
clickhere
.

TopicsonthisPage

ContentsofanIPv6RoutingTable

RouteDeterminationProcess

ExampleIPv6RoutingTablesforWindowsXP

andtheWindowsServer2003Family
ForMoreInformation

Aroutingtable,whichispresentonallnodesrunningtheIPv6protocolforboththeWindowsServer2003
familyandWindowsXP,storesinformationaboutIPv6networkprefixesandhowtheyarereachedeither
directlyorindirectly.BeforetheIPv6routingtableischecked,thedestinationcacheischeckedforanentry
thatmatchesthedestinationaddressintheIPv6packetthatisbeingforwarded.Thedestinationcacheisa
tablethatismaintainedbyIPv6nodes.Itmapsadestinationaddresstoanexthopaddressandstoresthe
pathMTU.Ifanentryforthedestinationaddressisnotinthedestinationcache,theroutingtableisusedto
determine:

1.

Theinterfacetobeusedforforwarding(thenexthopinterface)
Theinterfaceidentifiesthephysicalorlogicalinterfacethatisusedtoforwardthepackettoeitherits
destinationortothenextrouter.

2.

Thenexthopaddress
Foradirectdelivery(thedestinationisonalocallink),thenexthopaddressisthedestinationaddress
inthepacket.Foranindirectdelivery(thedestinationisnotonalocallink),thenexthopaddressis
theaddressofarouter.

Afterthenexthopinterfaceandaddressaredetermined,thedestinationcacheisupdated.Subsequent
packetsthatareforwardedtothedestinationusethedestinationcacheentryinsteadofcheckingthe
routingtable.

ContentsofanIPv6RoutingTable

ThefollowingarethefieldsofatypicalIPv6routingtableentry:

DestinationPrefix
ThedestinationprefixisanIPv6addressprefixthatcanhaveaprefixlengthfrom0through128.In
theWindowsXPandWindowsServer2003familyIPv6routingtable,thiscolumnisnamedPrefix.

NextHopAddress
Theaddresstowhichthepacketisforwarded.IntheWindowsXPandWindowsServer2003family
IPv6routingtable,thiscolumnisnamedGateway/InterfaceName.

Interface
Thenetworkinterfacethatisusedtoforwardthepacket.AlltheaddressesdefinedbytheDestination
Prefixarereachableovertheinterface.IntheWindowsXPandWindowsServer2003familyIPv6
routingtable,thiscolumnisnamedIdx(anabbreviationofIndex)andstorestheinterfaceindexofthe
forwardinginterface.

Metric
Anumberthatisusedtospecifythecostoftheroute,sothatthebestroute(potentiallyamong
multipleroutestothesamedestination)canbeselected.

IPv6routingtableentriescanbeusedtostorethefollowingtypesofroutes:

Directlyattachednetworkroutes
Theseroutesarenetworkprefixesforsubnetsthataredirectlyattachedandtypicallyhaveaprefix
lengthof64.

Remotenetworkroutes
Theseroutesarenetworkprefixesforsubnetsthatarenotdirectlyattachedbutareavailablethrough
otherrouters.Remotenetworkroutescanbesubnetprefixes(typicallywithaprefixlengthof64)ora
prefixforanaddressspace(typicallywithaprefixlengthlessthan64).

Hostroutes
AhostrouteisaroutetoaspecificIPv6address.HostroutesallowroutingtooccuronaperIPv6
addressbasis.Forhostroutes,therouteprefixisaspecificIPv6addresswithaprefixlengthof128.In
contrast,bothtypesofnetworkrouteshaveprefixesthathaveaprefixlengthlessthan128.

Defaultroute
Thedefaultrouteisusedwhenamorespecificnetworkorhostrouteisnotfound.Thedefaultroute
prefixis::/0.

RouteDeterminationProcess

Todeterminewhichroutingtableentryisusedtosendorforwardapacket,IPv6usesthefollowing
process:

1.

Forasendinghost,ifthesourceaddressisspecifiedbythesendingapplication,theonlyroutesthat
arecheckedarethosethatapplytotheinterfaceassignedthesourceaddress.Forasendinghost,if
thesourceaddressisnotspecifiedbythesendingapplication,orforaforwardingrouter,alltheroutes
arechecked.Foreachroutingtableentrythatischecked,IPv6comparesthebitsinthenetworkprefix
tothoseinthedestinationaddressforthenumberofbitsspecifiedintheprefixlengthoftheroute.For

thenumberofbitsintheprefixlength,ifallthebitsinthenetworkprefixmatchallthebitsinthe
destinationIPv6address,therouteisamatchforthedestination.

2.

Thelistofmatchingroutesiscompiled.Theroutethathasthelargestprefixlength(thatis,theroute
thatmatchedthemosthighorderbitswiththedestinationaddress)ischosen.Thelongestmatching
routeisthemostspecificroutetothedestination.Ifmultipleentrieswiththelongestmatcharefound
(forexample,multipleroutestothesamenetworkprefix),therouterusesthelowestmetrictoselect
thebestroute.Ifmultipleentriesexistthatarethelongestmatchandthelowestmetric,IPv6chooses
whichroutingtableentrytouse.

Foranygivendestination,theaboveprocedureresultsinfindingmatchingroutesinthefollowingorder:

1.

Ahostroutethatmatchestheentiredestinationaddress

2.

Anetworkroutewiththelongestprefixlengththatmatchesthedestination

3.

Thedefaultroute(thenetworkprefix::/0)

Theresultoftheroutedeterminationprocessistheselectionofasinglerouteintheroutingtable.The
selectedrouteyieldsanexthopinterfaceandaddress.Thenexthopinterfaceistheinterfacethatis
specifiedinthematchingroute.Forremotetraffic,thenexthopaddressistheaddressstoredinthe
NextHopAddressfield(theaddressofaneighboringrouter).Fortraffictoneighborsonadirectlyattached
link,thenexthopaddressisthedestinationaddressofthepacket.(Inthiscase,anaddressisnotstoredin
theNextHopAddressfield.)
Iftheroutedeterminationprocessonthesendinghostfailstolocateamatchingroute,IPv6treatsthe
destinationaslocallyreachable.Iftheroutedeterminationprocessonarouterfailstolocateamatching
route,IPv6sendsanICMPv6DestinationUnreachableNoRoutetoDestinationmessagetothesendinghost
anddiscardsthepacket.

ExampleIPv6RoutingTablesforWindowsXPandtheWindowsServer2003Family

ToviewtheIPv6routingtableonacomputerthatisrunningamemberoftheWindowsServer2003family
orWindowsXP,type
netshinterfaceipv6showroutes
atacommandprompt.Toviewtheentirerouting
table,whichincludeshostroutesandmulticastroutesandadditionalinformationforeachroute,usethe
netshinterfaceipv6showrouteslevel=verbose
command.TheIPv6routingtableisbuilt
automatically,basedonyourIPv6configuration.Youcanalsoaddroutesusingthe
netshinterfaceipv6
addroute
command.Arouteforthelinklocalprefix(FE80::/64)isneverdisplayedintheIPv6routing
table.
ToshowIPv6routingbehaviorforbothasendinghostandarouter,wewillexaminetheexamplenetwork
inthefollowingfigure.


Router1iscomputerusingtheIPv6protocolforWindowsXPandtheWindowsServer2003familythatis
configuredasaforwardingandadvertisingrouter.Router1hasthreenetworkadapters,isactingasa
defaultrouterfortwosubnetsconfiguredwithsitelocaladdressprefixes(FEC0:0:0:1::/64and
FEC0:0:0:2::/64),andhasadefaultroutethatpointstoadefaultrouteronathirdsubnet
(FEC0:0:0:3::/64).FormoreinformationabouthowtoconfigureacomputerrunningWindowsXPora
memberoftheWindowsServer2003familyasanIPv6router,seeManualConfigurationforIPv6(the
September2002CableGuyarticle).
Thefollowingisthedisplayofthe
netshinterfaceipv6showroutes
commandforRouter1:

PublishTypeMetPrefixIdxGateway/InterfaceName

yesAutoconf8fec0:0:0:1::/643LocalAreaConnection
yesAutoconf8fec0:0:0:2::/644LocalAreaConnection2
yesAutoconf8fec0:0:0:3::/645LocalAreaConnection3
yesManual256::/05fe80::210:ffff:fed6:58c0
EachentryintheWindowsXPandWindowsServer2003familyIPv6routingtablehasthefollowingfields:

Publish
specifieswhethertherouteispublished(advertisedinaRoutingAdvertisementmessage).

Type
specifiesthetypeofroute.
RoutesconfiguredbyuserapplicationshavearoutetypeofManual.RoutesconfiguredbytheIPv6
protocolhavearoutetypeofAutoconf.

Met
specifiesthemetricusedtoselectbetweenmultiplerouteswiththesameprefix.
Thelowestmetricisthebestmatchingroute.

Prefix
specifiestheaddressprefix.

Idx
specifiestheinterfaceindex,whichindicatestheinterfaceoverwhichpacketsthatmatchthe
addressprefixarereachable.
Interfaceindexescanbeviewedfromthedisplayofthe
netshinterfaceipv6showinterface
command.

Gateway/InterfaceName
specifieseitheranexthopIPv6addressoraninterfacename.
Forremotenetworkroutes,anexthopIPv6addressislisted.Fordirectlyattachednetworkroutes,the
nameoftheinterfacefromwhichtheaddressprefixisdirectlyreachableislisted.

Thefirst,second,andthirdroutesareforthe64bitsitelocaladdressprefixesoflocallyattachedsubnets.
AnEthernetnetworkadapternamedLocalAreaConnection(interfaceindex3)isconnectedtothesubnet
FEC0:0:0:1::/64.AsecondEthernetnetworkadapternamedLocalAreaConnection2(interfaceindex4)is
connectedtothesubnetFEC0:0:0:2::/64.ThethirdEthernetnetworkadapternamedLocalArea
Connection3(interfaceindex5)isconnectedtothesubnetFEC0:0:0:3::/64.
Thefourthrouteisthedefaultroute(prefixof::/0),whichmatchesalldestinations.Ifthedefaultrouteis
thelongestmatchingrouteforthedestination,thepacketissenttoRouter2'slinklocaladdress
FE80::210:FFFF:FED6:58C0byusingtheEthernetnetworkadapternamedLocalAreaConnection3
(interfaceindex5).
BecauseRouter1isconfiguredasanadvertisingrouterforthethreeattachedsubnetsandthedefault
route,itsendsthefollowingrouteradvertisements:

TherouteradvertisementfortheFEC0:0:0:1::/64subnetcontainsanindicationthatRouter1isa
defaultrouter,aPrefixInformationoptionforFEC0:0:0:1::/64,aRouteInformationoptionfor
FEC0:0:0:2::/64,andaRouteInformationoptionforFEC0:0:0:3::/64.

TherouteradvertisementfortheFEC0:0:0:2::/64subnetcontainsanindicationthatRouter1isa
defaultrouter,aPrefixInformationoptionforFEC0:0:0:2::/64,aRouteInformationoptionfor
FEC0:0:0:1::/64,andaRouteInformationoptionforFEC0:0:0:3::/64.

TherouteradvertisementfortheFEC0:0:0:3::/64subnetcontainsanindicationthatRouter1isa
defaultrouter,aPrefixInformationoptionforFEC0:0:0:3::/64,aRouteInformationoptionfor
FEC0:0:0:1::/64,andaRouteInformationoptionforFEC0:0:0:2::/64.

ThePrefixInformationoption,specifiedinRFC2461,isusedtoprovideanaddressprefixfromwhich
autoconfiguredaddressesarederived.TheRouteInformationoption,specifiedintheInternetdrafttitled
DefaultRouterPreferencesandMoreSpecificRoutes,isusedtopopulatetheroutingtableofhostswith
subnetprefixesforthesubnetsattachedtotheadvertisingrouter.Thisprovidesreachabilitybetweennodes
onthesubnetsoftheadvertisingrouterevenwhenitisnotactingasadefaultrouter
Thefollowingisthedisplayofthe
netshinterfaceipv6showroutes
commandforHostA:

PublishTypeMetPrefixIdxGateway/InterfaceName

yesAutoconf8fec0:0:0:1::/643LocalAreaConnection
yesAutoconf8fec0:0:0:2::/643fe80::210:ffff:fea4:211c
yesAutoconf8fec0:0:0:3::/643fe80::210:ffff:fea4:211c
yesAutoconf256::/03fe80::210:ffff:fea4:211c
Thefirstrouteisforthelocallyattachedsubnet.Thesecondandthirdroutesarefortheothertwosubnets
attachedtoRouter1.Theseroutesareautomaticallyaddeduponreceiptoftherouteradvertisementsent
byRouter1ontheFEC0:0:0:1::/64subnet.Thefourthrouteisforthedefaultroute.
FE80::210:FFFF:FEA4:211CisthelinklocaladdressofRouter1'sinterfaceontheFEC0:0:0:1::/64subnet.
ThenexthopinterfaceforarouteintheroutingtableisspecifiedbytheinterfaceindexintheIdxcolumn.
Whendeterminingthenexthopaddressfromarouteintheroutingtable:

IftheGateway/InterfaceNamecolumnoftheroutetableentryspecifiesaninterfacename,thenthe
destinationisaneighborandthenexthopaddressissettothedestinationaddressoftheIPv6packet.

IftheGateway/InterfaceNamecolumnoftheroutetableentryspecifiesanaddress(thatis,the
addressofaneighboringrouter),thenthedestinationisremoteandthenexthopaddressissettothe
addressintheGateway/InterfaceNamecolumn.

Forexample,whenHostAsendstraffictoFEC0::1:2AA:FF:FE90:4D3C,thelongestmatchingrouteinits
routingtableistherouteforthedirectlyattachednetworkFEC0:0:0:1::/64.Thenexthopaddressissetto
thedestinationaddressofFEC0::1:2AA:FF:FE90:4D3Candtheinterfaceisinterfaceindex3,which
correspondstotheEthernetnetworkadapternamedLocalAreaConnection.
WhenHostAsendstrafficto3FFE:FFFF:2A90:17:2AA:FF:FE03:21A6,thelongestmatchingrouteinits
routingtableisthedefaultroute(::/0).ThenexthopaddressissettotheRouter1'saddressof
FE80::210:FFFF:FEA4:211Candtheinterfaceisinterfaceindex3,whichcorrespondstotheEthernet
networkadapternamedLocalAreaConnection.
WhenRouter1forwardsthepacketdestinedfor3FFE:FFFF:2A90:17:2AA:FF:FE03:21A6,thelongest
matchingrouteinitsroutingtableisthedefaultroute(::/0).ThenexthopaddressissettoRouter2's
linklocaladdressofFE80::210:FFFF:FED6:58C0ontheFEC0:0:0:3::/64subnetandtheinterfaceis
interfaceindex5,whichcorrespondstotheEthernetnetworkadapternamedLocalAreaConnection3.

You might also like