Contents
Open Shortest Path First version 3 (OSPFv3) is an IPv4 and IPv6 link-state routing protocol that supports IPv6 and IPv4 unicast address families (AFs).
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
OSPFv3 is a routing protocol for IPv4 and IPv6. It is a link-state protocol, as opposed to a distance-vector protocol. Think of a link as being an interface on a networking device. A link-state protocol makes its routing decisions based on the states of the links that connect source and destination machines. The state of a link is a description of that interface and its relationship to its neighboring networking devices. The interface information includes the IPv6 prefix of the interface, the network mask, the type of network it is connected to, the devices connected to that network, and so on. This information is propagated in various type of link-state advertisements (LSAs).
A device's collection of LSA data is stored in a link-state database. The contents of the database, when subjected to the Dijkstra algorithm, result in the creation of the OSPF routing table. The difference between the database and the routing table is that the database contains a complete collection of raw data; the routing table contains a list of shortest paths to known destinations via specific device interface ports.
OSPFv3, which is described in RFC 5340, supports IPv6 and IPv4 unicast AFs.
Much of OSPF version 3 is the same as in OSPF version 2. OSPFv3, which is described in RFC 5340, expands on OSPF version 2 to provide support for IPv6 routing prefixes and the larger size of IPv6 addresses.
In OSPFv3, a routing process does not need to be explicitly created. Enabling OSPFv3 on an interface will cause a routing process, and its associated configuration, to be created.
In OSPFv3, each interface must be enabled using commands in interface configuration mode. This feature is different from OSPF version 2, in which interfaces are indirectly enabled using the device configuration mode.
When using a nonbroadcast multiaccess (NBMA) interface in OSPFv3, you must manually configure the device with the list of neighbors. Neighboring devices are identified by their device ID.
In IPv6, you can configure many address prefixes on an interface. In OSPFv3, all address prefixes on an interface are included by default. You cannot select some address prefixes to be imported into OSPFv3; either all address prefixes on an interface are imported, or no address prefixes on an interface are imported.
Unlike OSPF version 2, multiple instances of OSPFv3 can be run on a link.
OSPF automatically prefers a loopback interface over any other kind, and it chooses the highest IP address among all loopback interfaces. If no loopback interfaces are present, the highest IP address in the device is chosen. You cannot tell OSPF to use any particular interface.
The following list describes LSA types, each of which has a different purpose:
An address prefix occurs in almost all newly defined LSAs. The prefix is represented by three fields: PrefixLength, PrefixOptions, and Address Prefix. In OSPFv3, addresses for these LSAs are expressed as prefix, prefix length instead of address, mask. The default route is expressed as a prefix with length 0. Type 3 and Type 9 LSAs carry all prefix (subnet) information that, in OSPFv2, is included in router LSAs and network LSAs. The Options field in certain LSAs (router LSAs, network LSAs, interarea-router LSAs, and link LSAs) has been expanded to 24 bits to provide support for OSPFv3.
In OSPFv3, the sole function of the link-state ID in interarea-prefix LSAs, interarea-router LSAs, and autonomous-system external LSAs is to identify individual pieces of the link-state database. All addresses or router IDs that are expressed by the link-state ID in OSPF version 2 are carried in the body of the LSA in OSPFv3.
The link-state ID in network LSAs and link LSAs is always the interface ID of the originating router on the link being described. For this reason, network LSAs and link LSAs are now the only LSAs whose size cannot be limited. A network LSA must list all routers connected to the link, and a link LSA must list all of the address prefixes of a router on the link.
On NBMA networks, the designated router (DR) or backup DR (BDR) performs the LSA flooding. On point-to-point networks, flooding simply goes out an interface directly to a neighbor.
Devices that share a common segment (Layer 2 link between two interfaces) become neighbors on that segment. OSPFv3 uses the Hello protocol, periodically sending hello packets out each interface. Devices become neighbors when they see themselves listed in the neighbor's hello packet. After two devices become neighbors, they may proceed to exchange and synchronize their databases, which creates an adjacency. Not all neighboring devices have an adjacency.
On point-to-point and point-to-multipoint networks, the software floods routing updates to immediate neighbors. There is no DR or BDR; all routing information is flooded to each networking device.
On broadcast or NBMA segments only, OSPFv3 minimizes the amount of information being exchanged on a segment by choosing one router to be a DR and one router to be a BDR. Thus, the devices on the segment have a central point of contact for information exchange. Instead of each device exchanging routing updates with every other device on the segment, each device exchanges information with the DR and BDR. The DR and BDR relay the information to the other devices.
The software looks at the priority of the devices on the segment to determine which devices will be the DR and BDR. The router with the highest priority is elected the DR. If there is a tie, then the router with the higher router ID takes precedence. After the DR is elected, the BDR is elected the same way. A device with a router priority set to zero is ineligible to become the DR or BDR.
When using NBMA in OSPFv3, you cannot automatically detect neighbors. On an NBMA interface, you must configure your neighbors manually using interface configuration mode.
When a device learns multiple routes to a specific network via multiple routing processes (or routing protocols), it installs the route with the lowest administrative distance in the routing table. Sometimes the device must select a route from among many learned via the same routing process with the same administrative distance. In this case, the device chooses the path with the lowest cost (or metric) to the destination. Each routing process calculates its cost differently and the costs may need to be manipulated in order to achieve load balancing.
OSPFv3 performs load balancing automatically in the following way. If OSPFv3 finds that it can reach a destination through more than one interface and each path has the same cost, it installs each path in the routing table. The only restriction on the number of paths to the same destination is controlled by the maximum-paths command. The default maximum paths is 16, and the range is from 1 to 64.
When importing the set of addresses specified on an interface on which OSPFv3 is running into OSPFv3, you cannot select specific addresses to be imported. Either all addresses are imported, or no addresses are imported.
You can customize OSPFv3 for your network, but you likely will not need to do so. The defaults for OSPFv3 are set to meet the requirements of most customers and features. If you must change the defaults, refer to the IPv6 command reference to find the appropriate syntax.
![]() Caution |
Be careful when changing the defaults. Changing defaults will affect your OSPFv3 network, possibly adversely. |
Because cost components can change rapidly, it might be necessary to reduce the volume of changes to reduce network-wide churn. The recommended values for S2, S3, and S4 in the second table below are based on network simulations that may reduce the rate of network changes. The recommended value for S1 is 0 to eliminate this variable from the route cost calculation.
The overall link cost is computed using the formula shown in the figure below.
The table below defines the symbols used in the OSPFv3 cost calculation.
Table 1 | OSPFv3 Cost Calculation Definitions |
Cost Component |
Component Definition |
---|---|
OC |
The default OSPFv3 cost. Calculated from reference bandwidth using reference_bw / (MDR*1000), where reference_bw=10^8. |
A through D |
Various radio-specific data-based formulas that produce results in the 0 through 64,000 range. |
A |
CDR- and MDR-related formula: (2^16 * (100 - (CDR * 100 / MDR)))/100 |
B |
Resources related formula: ((100 - RESOURCES)^3 * 2^16 / 10^6) |
C |
Latency as reported by the radio, already in the 0 through 64,000 range when reported (LATENCY). |
D |
RLF-related formula: ((100 - RLF) * 2^16)/100 |
S1 through S4 |
Scalar weighting factors input from the CLI. These scalars scale down the values as computed by A through D. The value of 0 disables and the value of 100 enables full 0 through 64,000 range for one component. |
Because each network might have unique characteristics that require different settings to optimize actual network performance, these are recommended values intended as a starting point for optimizing an OSPFv3 network. The table below lists the recommended value settings for OSPFv3 cost metrics.
Table 2 | Recommended Value Settings for OSPFv3 Cost Metrics |
Setting |
Metric Description |
Default Value |
Recommended Value |
---|---|---|---|
S1 |
ipv6 ospf dynamic weight throughout |
100 |
0 |
S2 |
ipv6 ospf dynamic weight resources |
100 |
29 |
S3 |
ipv6 ospf dynamic weight latency |
100 |
29 |
S4 |
ipv6 ospf dynamic weight L2 factor |
100 |
29 |
The default path costs were calculated using this formula, as noted in the following list. If these values do not suit your network, you can use your own method of calculating path costs.
To illustrate these settings, the following example shows how OSPFv3 cost metrics might be defined for a Virtual Multipoint Interface (VMI) interface:
interface vmi1 ipv6 ospf cost dynamic weight throughput 0 ipv6 ospf cost dynamic weight resources 29 ipv6 ospf cost dynamic weight latency 29 ipv6 ospf cost dynamic weight L2-factor 29
When the process keyword is used with the clear ipv6 ospf command, the OSPFv3 database is cleared and repopulated, and then the SPF algorithm is performed. When the force-spf keyword is used with the clear ipv6 ospf command, the OSPFv3 database is not cleared before the SPF algorithm is performed.
Once you have completed step 3 and entered OSPFv3 router configuration mode, you can perform any of the subsequent steps in this task as needed to configure OSPFv3 router configuration.
This task can be performed in Cisco IOS Release 15.1(3)S and 15.2(1)T and later releases.
You can customize OSPFv3 in your network to use NBMA interfaces. OSPFv3 cannot automatically detect neighbors over NBMA interfaces. On an NBMA interface, you must configure your neighbors manually using interface configuration mode.
Before you configure NBMA interfaces, you must perform the following tasks:
This task is optional. The commands in this task are available in Cisco IOS Release 15.1(3)S and 15.2(1)T and later releases.
Router# show ospfv3 database
OSPFv3 Router with ID (172.16.4.4) (Process ID 1)
Router Link States (Area 0)
ADV Router Age Seq# Fragment ID Link count Bits
172.16.4.4 239 0x80000003 0 1 B
172.16.6.6 239 0x80000003 0 1 B
Inter Area Prefix Link States (Area 0)
ADV Router Age Seq# Prefix
172.16.4.4 249 0x80000001 FEC0:3344::/32
172.16.4.4 219 0x80000001 FEC0:3366::/32
172.16.6.6 247 0x80000001 FEC0:3366::/32
172.16.6.6 193 0x80000001 FEC0:3344::/32
172.16.6.6 82 0x80000001 FEC0::/32
Inter Area Router Link States (Area 0)
ADV Router Age Seq# Link ID Dest RtrID
172.16.4.4 219 0x80000001 50529027 172.16.3.3
172.16.6.6 193 0x80000001 50529027 172.16.3.3
Link (Type-8) Link States (Area 0)
ADV Router Age Seq# Link ID Interface
172.16.4.4 242 0x80000002 14 PO4/0
172.16.6.6 252 0x80000002 14 PO4/0
Intra Area Prefix Link States (Area 0)
ADV Router Age Seq# Link ID Ref-lstype Ref-LSID
172.16.4.4 242 0x80000002 0 0x2001 0
172.16.6.6 252 0x80000002 0 0x2001 0
Router# show ospfv3 neighbor
OSPFv3 Router with ID (42.1.1.1) (Process ID 42)
Neighbor ID Pri State Dead Time Interface ID Interface
44.4.4.4 1 FULL/ - 00:00:39 12 vm1
OSPFv3 Router with ID (1.1.1.1) (Process ID 100)
Neighbor ID Pri State Dead Time Interface ID Interface
4.4.4.4 1 FULL/ - 00:00:35 12 vm1
Related Topic | Document Title |
---|---|
IPv6 addressing and connectivity |
IPv6 Configuration Guide |
Cisco IOS commands |
|
IPv6 commands |
|
Cisco IOS IPv6 features |
Cisco IOS IPv6 Feature Mapping |
IPv6 Routing: OSPFv3 |
"Configuring OSPF" module |
Description | Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. |
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 3 | Feature Information for IPv6 Routing: OSPFv3 |
Feature Name | Releases | Feature Information |
---|---|---|
IPv6 Routing: OSPFv3 |
12.2(15)T 12.3 12.2(25)SEA 12.2(25)SG 3.2.0SG 15.0(2)SG 12.2(33)SRA 12.2(17a)SX1 |
OSPF version 3 for IPv6 expands on OSPF version 2 to provide support for IPv6 routing prefixes and the larger size of IPv6 addresses. |
OSPFv3 Dynamic Interface Cost Support |
12.4(15)T |
OSPFv3 dynamic interface cost support provides enhancements to the OSPFv3 cost metric for supporting mobile ad hoc networking. |
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.