Configuration Guide Vol. 3


27.1.3 Routing algorithm

OSPFv3 uses the SPF (Shortest Path First) algorithm for route selection. Each router has a database of all routers on which OSPFv3 is running, and all routers-to-routers and router-to-network connectivity. From this database, you configure a topology that has routers and networks as its vertices and a connection between routers and routers and networks as its edges. By applying the SPF algorithm to this topology, the OSPFv3 protocol computes a shortest-path tree that it uses to determine the routes to each vertex and address.

The following figure shows an example network configuration.

Figure 27-1: Example of network configuration

[Figure Data]

The following figure shows an example of setting a topology and assigning costs when OSPFv3 is used on the network shown above.

Figure 27-2: Example of configuring topology and cost

[Figure Data]

The cost value can be different according to packet transmission direction. In Figure 27-2: Example of configuring topology and cost, a point-to-point connection between Router 2 and Router 4 has a cost of 9 for Router 2 to Router 4 and a cost of 8 for Router 4 to Router 2. For a router-to-network connection, you can configure the cost of only the connection from the router to the network. Paths leading from networks to routers always have a cost of zero.

The following figure shows the shortest route tree generated using Router 1 as the root based on the topology shown in Figure 27-2: Example of topology and cost configuration. The cost to a given destination reflects the total transmission cost of the interfaces that the route traverses. For example, the cost of the route from Router 1 to Network 2 is 6 (Router 1-Network 1) + 0 (Network 1-Router 3) + 2 (Router 3-Network 2) = 8.

Figure 27-3: Shortest tree with root at router 1

[Figure Data]