10 Link-State Routing Protocols

10.0 Chapter Introduction

10.0.1 Chapter Introduction

Page 1:
In Chapter 3, "Introduction to Dynamic Routing Protocols," we illustrated the difference between link-state and distance vector routing with an analogy. The analogy stated that distance vector routing protocols are like using road signs to guide you on your way to a destination, only giving you information about distance and direction. However, link-state routing protocols are like using a map. With a map, you can see all of the potential routes and determine your own preferred path.

Distance vector routing protocols are like road signs because routers must make preferred path decisions based on a distance or metric to a network. Just as travelers trust a road sign to accurately state the distance to the next town, a distance vector router trusts that another router is advertising the true distance to the destination network.

Link-state routing protocols take a different approach. Link-state routing protocols are more like a road map because they create a topological map of the network and each router uses this map to determine the shortest path to each network. Just as you refer to a map to find the route to another town, link-state routers use a map to determine the preferred path to reach another destination.

Routers running a link-state routing protocol send information about the state of its links to other routers in the routing domain. The state of those links refers to its directly connected networks and includes information about the type of network and any neighboring routers on those networks-hence the name link-state routing protocol.

The ultimate objective is that every router receives all of the link-state information about all other routers in the routing area. With this link-state information, each router can create its own topological map of the network and independently calculate the shortest path to every network.

This chapter introduces the concepts of link-state routing protocols. In Chapter 11, we will apply these concepts to OSPF.


10.0.1 - Chapter Introduction
In this chapter, you learn to:
- Describe the basic features and concepts of link-state routing protocols.
- List the benefits and requirements of link-state protocols.


10.1 Link-State Routing

10.1.1 Link-State Routing Protocols

Page 1:
Link-state routing protocols are also known as shortest path first protocols and built around Edsger Dijkstra's shortest path first (SPF) algorithm. The SPF algorithm will be discussed in more detail in a later section.

The IP link-state routing protocols are shown in the figure:
  • Open Shortest Path First (OSPF)
  • Intermediate System-to-Intermediate System (IS-IS)
Link-state routing protocols have the reputation of being much more complex than their distance vector counterparts. However, the basic functionality and configuration of link-state routing protocols is not complex at all. Even the algorithm itself can be easily understood, as you will see in the next topic. Basic OSPF operations can be configured with a router ospf process-id command and a network statement, similar to other routing protocols like RIP and EIGRP.

Note: OSPF is discussed in Chapter 11, and IS-IS is discussed in CCNP. There are also link-state routing protocols for non-IP networks. These include DEC's DNA Phase V and Novell's NetWare Link Services Protocol (NLSP), which are not part of CCNA or CCNP curriculum.


10.1.1 - Link-State Routing Protocols
The diagram depicts a matrix classifying routing protocols, with the OSPF v2 and I S-I S link-state protocols highlighted. These are classless interior gateway routing protocols and the focus of this chapter.


10.1.2 Introduction to the SPF Algorithm

Page 1:
Dijkstra's algorithm is commonly referred to as the shortest path first (SPF) algorithm. This algorithm accumulates costs along each path, from source to destination. Although, Dijkstra's algorithm is known as the shortest path first algorithm, this is in fact the purpose of every routing algorithm.

In the figure, each path is labeled with an arbitrary value for cost. The cost of the shortest path for R2 to send packets to the LAN attached to R3 is 27. Notice that this cost is not 27 for all routers to reach the LAN attached to R3. Each router determines its own cost to each destination in the topology. In other words, each router calculates the SPF algorithm and determines the cost from its own perspective. This will become more evident later in this chapter.


10.1.2 - Introduction to the SPF Algorithm
The diagram depicts Dijkstra's Shortest Path First (SPF) algorithm. The diagram is based on the following network topology.

Network Topology:
There are five routers, R1, R2, R3 R4, and R5. Each router has a LAN attached and is connected to two or more routers. The cost for each link is shown.

R1 is connected to R2 with a link cost of 20.
R1 is connected to R3 with a link cost of 5.
R1 is connected to R4 with a link cost of 20.
R2 is connected to R5 with a link cost of 10.
R4 is connected to R3 with a link cost of 10.
R4 is connected to R5 with a link cost of 10.
The link cost from each router to its LAN is 2.

The shortest path for a host on the R2 LAN to reach a host on the R3 LAN is R2 to R1 (20) + R1 to R3 (5) + R3 to LAN (2) = 27.


Page 2:
Click R1 in the figure.

For R1, the shortest path to each LAN - along with the cost - is shown in the table. The shortest path is not necessarily the path with the least number of hops. For example, look at the path to the R5 LAN. You might think that R1 would send directly to R4 instead of to R3. However, the cost to reach R4 directly (22) is higher than the cost to reach R4 through R3 (17).

Continue to click R2 through R5 in the figure.

Observe the shortest path for each router to reach each of the LANs, as shown in the tables.


10.1.2 - Introduction to the SPF Algorithm
The diagram depicts the shortest path for each router to reach each LAN in the diagram. The diagram is based on the network topology described in 10.1.2 diagram 1.

Router R1 SPF paths to LAN's:
Shortest path to the R2 LAN is R1 to R2 with a cost of 22.
Shortest path to the R3 LAN is R1 to R3 with a cost of 7.
Shortest path to the R4 LAN is R1 to R3 to R4 with a cost of 17.
Shortest path to the R5 LAN is R1 to R3 to R4 to R5 with a cost of 27.

Router R2 SPF paths to LAN's:
Shortest Path to the R1 LAN is R2 to R1 with a cost 22.
Shortest Path to the R3 LAN is R2 to R1 to R3 with a cost of 27.
Shortest Path to the R4 LAN is R2 to R5 to R4 with a cost of 22.
Shortest Path to the R5 LAN is R2 to R5 with a cost of 12.

Router R3 SPF paths to LAN's:
Shortest Path to the R1 LAN is R3 to R1 with a cost of 7.
Shortest Path to the R2 LAN is R3 to R1 to R2 with a cost of 27.
Shortest Path to the R4 LAN is R3 to R4 with a cost of 12.
Shortest Path to the R5 LAN is R3 to R4 to R5 with a cost of 22.

Router R4 SPF paths to LAN's:
Shortest Path to the R1 LAN is R4 to R3 to R1 with a cost of 17.
Shortest Path to the R2 LAN is R4 to R5 to R2 with a cost of 22.
Shortest Path to the R3 LAN is R4 to R3 with a cost of 12.
Shortest Path to the R5 LAN is R4 to R5 with a cost of 12.

Router R5 SPF paths to LAN's:
Shortest Path to the R1 LAN is R5 to R4 to R3 to R1 with a cost of 27.
Shortest Path to the R2 LAN is R5 to R2 with a cost of 12.
Shortest Path to the R3 LAN is R5 to R4 to R3 with a cost of 22.
Shortest Path to the R4 LAN is R5 to R4 with a cost of 12.


10.1.3 Link-State Routing Process

Page 1:
So exactly how does a link-state routing protocol work? All routers in our topology will complete the following generic link-state routing process to reach a state of convergence:

1. Each router learns about its own links, its own directly connected networks. This is done by detecting that an interface is in the up state.

2. Each router is responsible for meeting its neighbors on directly connected networks. Similar to EIGRP, link state routers do this by exchanging Hello packets with other link-state routers on directly connected networks.

3. Each router builds a Link-State Packet (LSP) containing the state of each directly connected link. This is done by recording all the pertinent information about each neighbor, including neighbor ID, link type, and bandwidth.

4. Each router floods the LSP to all neighbors, who then store all LSPs received in a database. Neighbors then flood the LSPs to their neighbors until all routers in the area have received the LSPs. Each router stores a copy of each LSP received from its neighbors in a local database.

5. Each router uses the database to construct a complete map of the topology and computes the best path to each destination network. Like having a road map, the router now has a complete map of all destinations in the topology and the routes to reach them. The SPF algorithm is used to construct the map of the topology and to determine the best path to each network.

We will discuss this process in more detail in the following topics.


10.1.3 - Link-State Routing Process
The diagram depicts the link-state routing process.
1. Each router learns about each of its own directly connected networks.
2. Each router is responsible for "saying hello" to its neighbors on directly connected networks.
3. Each router builds a Link State Packet (LSP) containing the state of each directly connected link.
4. Each router floods the LSP to all neighbors, who then store all LSP's received in a database.
5. Each router uses the database to construct a complete map of the topology and computes the best path to each destination network.


10.1.4 Learning about Directly Connected Networks

Page 1:
Click Link-State Routing Process in the figure.

The topology now shows the network addresses for each link. Each router learns about its own links, its own directly connected networks in the same way as was discussed in Chapter 1, "Introduction to Routing and Packet Forwarding." When a router interface is configured with an IP address and subnet mask, the interface becomes part of that network.

Click R1 in the figure.

When you correctly configure and activate the interfaces, the router learns about its own directly connected networks. Regardless of the routing protocols used, these directly connected networks are now part of the routing table. For purposes of our discussion, we will focus on the link-state routing process from the perspective of R1.



10.1.4 - Learning about Directly Connected Networks
The diagram depicts the link-state routing process and focuses on Step 1 of the link-state routing process. Each router learns about its own directly connected networks.

Link-State Routing Process:

1. Each router learns about each of its own directly connected networks.
2. Each router is responsible for "saying hello" to its neighbors on directly connected networks.
3. Each router builds a Link State Packet (LSP) containing the state of each directly connected link.
4. Each router floods the LSP to all neighbors, who then store all LSP's received in a database.
5. Each router uses the database to construct a complete map of the topology and computes the best path to each destination network.

The diagram is based on the network topology described in 10.1.2 diagram 1, except that the focus is on router R1. The interfaces and network numbers are identified.

R1 interfaces and networks:
Interface FA0/0 IP address is 10.1.0.1, and the network number is 10.1.0.0/16.
Interface S0/0/0 IP address is 10.2.0.1, and the network number is 10.2.0.0/16.
Interface S0/0/1 IP address is 10.3.0.1, and the network number is 10.3.0.0/16.
Interface S0/0/2 IP address is 10.4.0.1, and the network number is 10.4.0.0/16.


Page 2:
Link

With link-state routing protocols, a link is an interface on a router. As with distance vector protocols and static routes, the interface must be properly configured with an IP address and subnet mask and the link must be in the up state before the link-state routing protocol can learn about a link. Also like distance vector protocols, the interface must be included in one of the network statements before it can participate in the link-state routing process.

The figure shows R1 linked to four directly connected networks:
  • FastEthernet 0/0 interface on the 10.1.0.0/16 network
  • Serial 0/0/0 network on the 10.2.0.0/16 network
  • Serial 0/0/1 network on the 10.3.0.0/16 network
  • Serial 0/0/2 network on the 10.4.0.0/16 network
Link-State

Information about the state of those links is known as link-states. As you can see in the figure, this information includes:
  • The interface's IP address and subnet mask.
  • The type of network, such as Ethernet (broadcast) or Serial point-to-point link.
  • The cost of that link.
  • Any neighbor routers on that link.
Note: We will see that Cisco's implementation of OSPF specifies the cost of the link, the OSPF routing metric, as the bandwidth of the outgoing interface. But for the purposes of this chapter, we are using arbitrary cost values to simplify our demonstration.


10.1.4 - Learning about Directly Connected Networks
The diagram depicts link-state information for router R1. The diagram is based on the network topology described in the R1 portion of 10.1.4 diagram 1, with the focus on each link.

Link 1 (FA0/0):
- Network 10.1.0.0/16
- IP address 10.1.0.1
- Type of network: Ethernet
- Cost of that link: 2
- Neighbors: none

Link 2 (S0/0/0):
- Network 10.2.0.0/16
- IP address 10.2.0.1
- Type of network: Serial
- Cost of that link: 20
- Neighbors: R2

Link 3 (S0/0/1):
- Network 10.3.0.0/16
- IP address 10.3.0.1
- Type of network: Serial
- Cost of that link: 5
- Neighbors: R3

Link 4 (S0/0/2):
- Network 10.4.0.0/16
- IP address 10.4.0.1
- Type of network: Serial
- Cost of that link: 20
- Neighbors: R4


10.1.5 Sending Hello Packets to Neighbors

Page 1:
The second step in the link-state routing process is:

Each router is responsible for meeting its neighbors on directly connected networks.

Routers with link-state routing protocols use a Hello protocol to discover any neighbors on its links. A neighbor is any other router that is enabled with the same link-state routing protocol.


10.1.5 - Sending Hello Packets to Neighbors
The diagram depicts Step 2 of the link-state routing process which states, "each router is responsible for "saying hello" to its neighbors on directly connected networks." The diagram is based on the network topology described in 10.1.2 diagram 1, with the network numbers and link costs identified.


Page 2:
Click Play to view the animation.

R1 sends Hello packets out its links (interfaces) to discover if there are any neighbors. R2, R3, and R4 reply to the Hello packet with their own Hello packets because these routers are configured with the same link-state routing protocol. There are no neighbors out the FastEthernet 0/0 interface. Because R1 does not receive a Hello on this interface, it will not continue with the link-state routing process steps for the FastEthernet 0/0 link.

Similar to EIGRP's Hello packets, when two link-state routers learn that they are neighbors, they form an adjacency. These small Hello packets continue to be exchanged between two adjacent neighbors which serve as a "keepalive" function to monitor the state of the neighbor. If a router stops receiving Hello packets from a neighbor, that neighbor is considered unreachable and the adjacency is broken. In the figure, R1 forms an adjacency with all three routers.


10.1.5 - Sending Hello Packets to Neighbors
The animation depicts neighbor discovery using hello packets. The diagram is based on the network topology described in 10.1.2 diagram 1, but only includes R1, R2, R3, and R4. The interfaces and network numbers for R1 are identified.

As the animation progresses, R1 sends a hello packet to R2, R3, and R4. Each of these routers responds with its router ID.


10.1.6 Building the Link-State Packet

Page 1:
Click Link-State Routing Process in the figure.

We are now at the third step in the link-state routing process:

Each router builds a Link-State Packet (LSP) containing the state of each directly connected link.

Click R1 in the figure.

Once a router has established its adjacencies, it can build its link-state packets (LSPs) that contain the link-state information about its links. A simplified version of the LSPs from R1 is:

1. R1; Ethernet network 10.1.0.0/16; Cost 2

2. R1 -> R2; Serial point-to-point network; 10.2.0.0/16; Cost 20

3. R1 -> R3; Serial point-to-point network; 10.3.0.0/16; Cost 5

4. R1 -> R4; Serial point-to-point network; 10.4.0.0/16; Cost 20


10.1.6 - Building the Link-State Packet
The diagram depicts Step 3 of the link-state routing process which states, "each router builds a Link State Packet (LSP) containing the state of each directly connected link."

A simplified version of the LSP's from R1 is as follows:
1. R1; Ethernet network 10.1.0.0/16; Cost 2
2. R1 to R2; Serial point-to-point network; 10.2.0.0/16; Cost 20
3. R1 to R3; Serial point-to-point network; 10.3.0.0/16; Cost 5
4. R1 to R4; Serial point-to-point network; 10.4.0.0/16; Cost 20

The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers and link costs identified.


10.1.7 Flooding Link-State Packets to Neighbors

Page 1:
As shown in the figure, the fourth step in the link-state routing process is:

Each router floods the LSP to all neighbors, who then store all LSPs received in a database.

Each router floods its link-state information to all other link-state routers in the routing area. Whenever a router receives an LSP from a neighboring router, it immediately sends that LSP out all other interfaces except the interface that received the LSP. This process creates a flooding effect of LSPs from all routers throughout the routing area.


10.1.7 - Flooding Link-State Packets to Neighbors
The diagram depicts Step 4 of the link-state routing process which states, "each router floods the LSP to all neighbors, who then store all the LSP's received in a database." The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers and link costs identified.


Page 2:
Click Play to view the animation.

As you can see in the animation, LSPs are flooded almost immediately after being received, without any intermediate calculations. Unlike distance vector routing protocols that must first run the Bellman-Ford algorithm to process routing updates before sending them to other routers, link-state routing protocols calculate the SPF algorithm after the flooding is complete. As a result, link-state routing protocols reach convergence much faster than distance vector routing protocols.

Remember that LSPs do not need to be sent periodically. An LSP only needs to be sent:
  • During initial startup of the router or of the routing protocol process on that router
  • Whenever there is a change in the topology, including a link going down or coming up, or a neighbor adjacency being established or broken
In addition to the link-state information, other information is included in the LSP - such as sequence numbers and aging information - to help manage the flooding process. This information is used by each router to determine if it has already received the LSP from another router or if the LSP has newer information than what is already contained in the link-state database. This process allows a router to keep only the most current information in its link-state database.

Note: How these sequence numbers and aging information is used is beyond the scope of this curriculum. Additional information can be found in Routing TCP/IP by Jeff Doyle.


10.1.7 - Flooding Link-State Packets to Neighbors
The animation depicts flooding of the R1 LSP from one router to the next until all routers in the network have seen it.

The R1 link-state contents include:
- R1; Ethernet network; 10.1.0.0/16; Cost 2
- R1 to R2; Serial point-to-point network; 10.2.0.0/16; Cost 20
- R1 to R3; Serial point-to-point network; 10.3.0.0/16; Cost 5
- R1 to R4; Serial point-to-point network; 10.4.0.0/16; Cost 20

The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers and link costs identified.


10.1.8 Constructing a Link-State Database

Page 1:
The final step in the link-state routing process is:

Each router uses the database to construct a complete map of the topology and computes the best path to each destination network.

After each router has propagated its own LSPs using the link-state flooding process, each router will then have an LSP from every link-state router in the routing area. These LSPs are stored in the link-state database. Each router in the routing area can now use the SPF algorithm to construct the SPF trees that you saw earlier.


10.1.8 - Constructing a Link-State Database
The diagram depicts Step 5 of the link-state routing process which states, "each router uses the database to construct a complete map of the topology and computes the best path to each destination network." The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers and link costs identified.


Page 2:
Let's take a look at the link-state database for R1 as well as the SPF tree that results from the calculation of the SPF algorithm.

Click R1 Link-State Database in the figure.

As a result of the flooding process, router R1 has learned the link-state information for each router in its routing area. The figure shows the link-state information that R1 has received and stored in its link-state database. Notice that R1 also includes its own link-state information in the link-state database.

Click R1 SPF Tree in the figure.

With a complete link-state database, R1 can now use the database and the shortest path first (SPF) algorithm to calculate the preferred path or shortest path to each network. In the figure, notice that R1 does not use the path between itself and R4 to reach any LAN in the topology, including the LAN attached to R4. The path through R3 has a lower cost. Also, R1 does not use the path between R2 and R5 to reach R5. The path through R3 has a lower cost. Each router in the topology determines the shortest path from its own perspective.

Note: The link-state database and the SPF tree would still include those directly connected networks, those links which have been shaded in the graphic.


10.1.8 - Constructing a Link-State Database
The diagram depicts R1's link-state database, which is built from directly connected networks and LSP's from R2, R3, R4, and R5.

R1 Link-State Database:
R1 link-states:
- Connected to neighbor R2 on network 10.2.0.0/16, cost of 20
- Connected to neighbor R3 on network 10.3.0.0/16, cost of 5
- Connected to neighbor R4 on network 10.4.0.0/16, cost of 20
- Has a network 10.1.0.0/16, cost of 2
LSP's from R2:
- Connected to neighbor R1 on network 10.2.0.0/16, cost of 20
- Connected to neighbor R5 on network 10.9.0.0/16, cost of 10
- Has a network 10.5.0.0/16, cost of 2
LSP's from R3:
- Connected to neighbor R1 on network 10.3.0.0/16, cost of 5
- Connected to neighbor R4 on network 10.7.0.0/16, cost of 10
- Has a network 10.6.0.0/16, cost of 2
LSP's from R4:
- Connected to neighbor R1 on network 10.4.0.0/16, cost of 20
- Connected to neighbor R3 on network 10.7.0.0/16, cost of 10
- Connected to neighbor R5 on network 10.10.0.0/16, cost of 10
- Has a network 10.8.0.0/16, cost of 2
LSP's from R5:
- Connected to neighbor R2 on network 10.9.0.0/16, cost of 10
- Connected to neighbor R4 on network 10.10.0.0/16, cost of 10
- Has a network 10.11.0.0/16, cost of 2

R1 SPF Tree:
Destination: R2 LAN
Shortest Path: R1 to R2
Cost: 22

Destination: R3 LAN
Shortest Path: R1 to R3
Cost: 7

Destination: R4 LAN
Shortest Path: R1 to R3 to R4
Cost: 17

Destination: R5 LAN
Shortest Path: R1 to R3 to R4 to R5
Cost: 27

The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers but without link costs.


10.1.9 Shortest Path First (SPF) Tree

Page 1:
Building the SPF Tree

Let's examine in more detail how R1 constructs its SPF tree. R1's current topology only includes its neighbors. However, using the link-state information from all other routers, R1 can now begin to construct an SPF tree of the network with itself at the root of the tree.

Note: The process described in this section is only a conceptual form of the SPF algorithm and SPF tree to help make it more understandable.

Click R2 LSPs in the figure.

The SPF algorithm begins by processing the following LSP information from R2:

1. Connected to neighbor R1 on network 10.2.0.0/16, cost of 20

2. Connected to neighbor R5 on network 10.9.0.0/16, cost of 10

3. Has a network 10.5.0.0/16, cost of 2

R1 can ignore the first LSP, because R1 already knows that it is connected to R2 on network 10.2.0.0/16 with a cost of 20. R1 can use the second LSP and create a link from R2 to another router, R5, with the network 10.9.0.0/16 and a cost of 10. This information is added to the SPF tree. Using the third LSP, R1 has learned that R2 has a network 10.5.0.0/16 with a cost of 2 and with no neighbors. This link is added to R1's SPF tree.

Click R3 LSPs in the figure.

The SPF algorithm now processes the LSPs from R3:

1. Connected to neighbor R1 on network 10.3.0.0/16, cost of 5

2. Connected to neighbor R4 on network 10.7.0.0/16, cost of 10

3. Has a network 10.6.0.0/16, cost of 2

R1 can ignore the first LSP, because R1 already knows that it is connected to R3 on network 10.3.0.0/16 with a cost of 5. R1 can use the second LSP and create a link from R3 to the router R4, with the network 10.7.0.0/16 and a cost of 10. This information is added to the SPF tree. Using the third LSP, R1 has learned that R3 has a network 10.6.0.0/16 with a cost of 2 and with no neighbors. This link is added to R1's SPF tree.

Click R4 LSPs in the figure.

The SPF algorithm now processes the LSPs from R4:

1. Connected to neighbor R1 on network 10.4.0.0/16, cost of 20

2. Connected to neighbor R3 on network 10.7.0.0/16, cost of 10

3. Connected to neighbor R5 on network 10.10.0.0/16, cost of 10

4. Has a network 10.8.0.0/16, cost of 2

R1 can ignore the first LSP because R1 already knows that it is connected to R4 on network 10.4.0.0/16 with a cost of 20. R1 can also ignore the second LSP because SPF has already learned about the network 10.6.0.0/16 with a cost of 10 from R3.

However, R1 can use the third LSP to create a link from R4 to the router R5, with the network 10.10.0.0/16 and a cost of 10. This information is added to the SPF tree. Using the fourth LSP, R1 learns that R4 has a network 10.8.0.0/16 with a cost of 2 and with no neighbors. This link is added to R1's SPF tree.

Click R5 LSPs in the figure.

The SPF algorithm now processes the final LSPs from R5:

1. Connected to neighbor R2 on network 10.9.0.0/16, cost of 10

2. Connected to neighbor R4 on network 10.10.0.0/16, cost of 10

3. Has a network 10.11.0.0/16, cost of 2

R1 can ignore the first two LSPs (for the networks 10.9.0.0/16 and 10.10.0.0/16), because SPF has already learned about these links and added them to the SPF tree. R1 can process the third LSP learning that R5 has a network 10.11.0.0/16 with a cost of 2 and with no neighbors. This link is added to the SPF tree for R1.


10.1.9 - Shortest Path First (SPF) Tree
The diagram depicts R1's link-state database and LSP's from R2, R3, R4, and R5. Links appear in the diagram as the LSP's for each router are selected.

The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers and link costs.


Page 2:
Determining the Shortest Path

Because all LSPs have been processed using the SPF algorithm, R1 has now constructed the complete SPF tree. The 10.4.0.0/16 and 10.9.0.0/16 links are not used to reach other networks, because lower-cost or shorter paths exist. However these networks still exist as part of the SPF tree and are used to reach devices on those networks.

Note: The actual SPF algorithm determines the shortest path as it is building the SPF tree. We have done it in two steps to simplify the understanding of the algorithm.

The figure shows the SPF tree for R1. Using this tree, the SPF algorithm results indicate the shortest path to each network. Only the LANs are shown in the table, but SPF can also be used to determine the shortest path to each WAN link network. In this case, R1 determines that the shortest path for each network is:

Network 10.5.0.0/16 via R2 serial 0/0/0 at a cost of 22

Network 10.6.0.0/16 via R3 serial 0/0/1 at a cost of 7

Network 10.7.0.0/16 via R3 serial 0/0/1 at a cost of 15

Network 10.8.0.0/16 via R3 serial 0/0/1 at a cost of 17

Network 10.9.0.0/16 via R2 serial 0/0/0 at a cost of 30

Network 10.10.0.0/16 via R3 serial 0/0/1 at a cost of 25

Network 10.11.0.0/16 via R3 serial 0/0/1 at a cost of 27

Each router constructs its own SPF tree independently from all other routers. To ensure proper routing, the link-state databases used to construct those trees must be identical on all routers. In Chapter 11, "OSFP," we will examine this in more detail.


10.1.9 - Shortest Path First (SPF) Tree
The diagram depicts the SPF tree for R1.

Destination: R2 LAN
Shortest Path: R1 to R2
Cost: 22

Destination: R3 LAN
Shortest Path: R1 to R3
Cost: 7

Destination: R4 LAN
Shortest Path: R1 to R3 to R4
Cost: 17

Destination: R5 LAN
Shortest Path: R1 to R3 to R4 to R5
Cost: 27

The diagram is based on the network topology described in 10.1.5 diagram 1, with network numbers and link costs identified.


Page 3:
Generating a Routing Table from the SPF Tree

Using the shortest path information determined by the SPF algorithm, these paths can now be added to the routing table. You can see in the figure how the following routes have now been added to R1's routing table:
  • 10.5.0.0/16 via R2 Serial 0/0/0, cost = 22
  • 10.6.0.0/16 via R3 Serial 0/0/1, cost = 7
  • 10.7.0.0/16 via R3 Serial 0/0/1, cost = 15
  • 10.8.0.0/16 via R3 Serial 0/0/1, cost = 17
  • 10.9.0.0/16 via R2 Serial 0/0/0, cost = 30
  • 10.10.0.0/16 via R3 Serial 0/0/1, cost = 25
  • 10.11.0.0/16 via R3 Serial 0/0/1, cost = 27
The routing table will also include all directly connected networks and routes from any other sources, such as static routes. Packets will now be forwarded according to these entries in the routing table.


10.1.9 - Shortest Path First (SPF) Tree
The diagram depicts the R1 SPF information and routing table.

Directly connected networks include:
- 10.1.0.0/16
- 10.2.0.0/16
- 10.3.0.0/16
- 10.4.0.0/16

Remote networks include:
- 10.5.0.0/16 via R2 serial 0/0/0, cost = 22
- 10.6.0.0/16 via R3 serial 0/0/1, cost = 7
- 10.7.0.0/16 via R3 serial 0/0/1, cost = 15
- 10.8.0.0/16 via R3 serial 0/0/1, cost = 17
- 10.9.0.0/16 via R2 serial 0/0/0, cost = 30
- 10.10.0.0/16 via R3 serial 0/0/1, cost = 25
- 10.11.0.0/16 via R3 serial 0/0/1, cost = 27

The diagram is based on the network topology described in 10.1.4 diagram 1, using the R1 portion with the focus on each link.


10.2 Implementing Link-State Routing Protocols

10.2.1 Advantages of a Link-State Routing Protocol

Page 1:
There are several advantages of link-state routing protocols compared to distance vector routing protocols.

Builds a Topological Map

Link-state routing protocols create a topological map, or SPF tree of the network topology. Distance vector routing protocols do not have a topological map of the network. Routers implementing a distance vector routing protocol only have a list of networks, which includes the cost (distance) and next-hop routers (direction) to those networks. Because link-state routing protocols exchange link-states, the SPF algorithm can build an SPF tree of the network. Using the SPF tree, each router can independently determine the shortest path to every network.

Fast Convergence

When receiving a Link-state Packet (LSP), link-state routing protocols immediately flood the LSP out all interfaces except for the interface from which the LSP was received. A router using a distance vector routing protocol needs to process each routing update and update its routing table before flooding them out other interfaces, even with triggered updates. Faster convergence is achieved for link-state routing protocols. A notable exception is EIGRP.

Event-driven Updates

After the initial flooding of LSPs, link-state routing protocols only send out an LSP when there is a change in the topology. The LSP contains only the information regarding the affected link. Unlike some distance vector routing protocols, link-state routing protocols do not send periodic updates.

Note: OSPF routers do flood their own link-states every 30 minutes. This is known as a paranoid update and is discussed in the following chapter. Also, not all distance vector routing protocols send periodic updates. RIP and IGRP send periodic updates; however, EIGRP does not.

Hierarchical Design

Link-state routing protocols such as OSPF and IS-IS use the concept of areas. Multiple areas create a hierarchical design to networks, allowing for better route aggregation (summarization) and the isolation of routing issues within an area. Multi-area OSPF and IS-IS are discussed further in CCNP.


10.2.1 - Advantages of a Link-State Routing Protocol
The diagram depicts advantages of link-state routing protocols. These include the following:
- Each router builds its own topological map of the network to determine the shortest path.
- Immediate flooding of LSP's achieves faster convergence.
- LSP's are sent only when there is a change in the topology and contain only the information regarding that change.
- Hierarchical design used when implementing multiple areas.


10.2.2 Requirements of a Link-State Routing Protocol

Page 1:
Modern link-state routing protocols are designed to minimize the effects on memory, CPU, and bandwidth. The use and configuration of multiple areas can reduce the size of the link-state databases. Multiple areas can also limit the amount of link-state information flooding in a routing domain and send LSPs only to those routers that need them.

For example, when there is a change in the topology, only those routers in the affected area receive the LSP and run the SPF algorithm. This can help isolate an unstable link to a specific area in the routing domain. In the figure, there are three separate routing domains: Area 1, Area 0, and Area 51. If a network in Area 51 goes down, the LSP with the information about this downed link is only flooded to other routers in that area. Only routers in Area 51 will need to update their link-state databases, rerun the SPF algorithm, create a new SPF tree, and update their routing tables. Routers in other areas will learn that this route is down, but this will be done with a type of link-state packet that does not cause them to rerun their SPF algorithm. Routers in other areas can update their routing tables directly.

Note: Multiple areas with OSPF and IS-IS are discussed in CCNP.


10.2.2 - Requirements of a Link-State Routing Protocol
The diagram depicts the structure of a link-state network using multiple areas and describes what happens when a link goes down in one area. The diagram is based on the following network topology.

Network Topology:
There are three OSPF areas, each with a group of routers in it. Edge routers in Areas 1 and 51 connect to a router in Area 0.

If a link goes down in Area 51, LSP's are flooded only within this area, and the routers rerun the SPF algorithm. Routers in Area 1 and Area 0 do not receive the LSP's from Area 51 because they are not flooded to these areas. The SPF algorithm does not have to be rerun in these areas.


Page 2:
Memory Requirements

Link-state routing protocols typically require more memory, more CPU processing, and at times more bandwidth than distance vector routing protocols. The memory requirements are due to the use of link-state databases and the creation of the SPF tree.

Processing Requirements

Link-state protocols can also require more CPU processing than distance vector routing protocols. The SPF algorithm requires more CPU time than distance vector algorithms such as Bellman-Ford because link-state protocols build a complete map of the topology.

Bandwidth Requirements

The flooding of link-state packets can adversely affect the available bandwidth on a network. This should only occur during initial startup of routers, but can also be an issue on unstable networks.


10.2.2 - Requirements of a Link-State Routing Protocol
The diagram depicts the requirements of link-state routing protocols. These include the following:
- Memory requirements for the link-state database.
- CPU processing of the SPF algorithm.
- Bandwidth requirements for link-state flooding.


10.2.3 Comparison of Link-State Routing Protocols

Page 1:
There are two link-state routing protocols used for routing IP today:
  • Open Shortest Path First (OSPF)
  • Intermediate System-to-Intermediate System (IS-IS)
OSPF

OSPF was designed by the IETF (Internet Engineering Task Force) OSPF Working Group, which still exists today. The development of OSPF began in 1987 and there are two current versions in use:
  • OSPFv2: OSPF for IPv4 networks (RFC 1247 and RFC 2328)
  • OSPFv3: OSPF for IPv6 networks (RFC 2740)
Most of the work on OSPF was done by John Moy, author of most of the RFCs regarding OSPF. His book, OSPF, Anatomy of an Internet Routing Protocol, provides interesting insight to the development of OSPF.

Note: OSPF is discussed in the following chapter. Multiple Area OSPF and OSPFv3 are discussed in CCNP.

IS-IS

IS-IS was designed by ISO (International Organization for Standardization) and is described in ISO 10589. The first incarnation of this routing protocol was developed at DEC (Digital Equipment Corporation) and is known as DECnet Phase V. Radia Perlman was the chief designer of the IS-IS routing protocol.

IS-IS was originally designed for the OSI protocol suite and not the TCP/IP protocol suite. Later, Integrated IS-IS, or Dual IS-IS, included support for IP networks. Although IS-IS has been known as the routing protocol used mainly by ISPs and carriers, more enterprise networks are beginning to use IS-IS.

OSPF and IS-IS share many similarities and also have many differences. There are many pro-OSPF and pro-IS-IS factions who discuss and debate the advantages of one routing protocol over the other. Both routing protocols provide the necessary routing functionality needed. You can learn more about IS-IS and OSPF in CCNP and begin to make your own determination if one protocol is more advantageous than the other.


10.2.3 - Comparison of Link-State Routing Protocols
The diagram compares the OSPF and I S-I S link-state routing protocols.

OSPF:
- OSPF v2: OSPF for IPv4 networks (RFC 1247 and RFC 2328)
- OSPF v3: OSPF for IPv6 networks (RFC 2740)
- OSPF v2 discussed in chapter 11

I S-I S:
- I S O 10589
- Integrated I S-I S; Dual I S-I S supports IP networks
- Used mainly by ISP's and carriers
- Discussed in CCNP


10.3 Chapter Summary

10.3.1 Summary and Review

Page 1:
Summary

Link-state routing protocols are also known as shortest path first protocols and are built around Edsger Dijkstra's shortest path first (SPF) algorithm. There are two link-state routing protocols for IP: OSPF (Open Shortest Path First) and IS-IS (Intermediate-System-to-Intermediate-System).

The link-state process can be summarized as follows:

1. Each router learns about its own directly connected networks.

2. Each router is responsible for "saying hello" to its neighbors on directly connected networks.

3. Each router builds a Link-State Packet (LSP) containing the state of each directly connected link.

4. Each router floods the LSP to all neighbors, who then store all LSPs received in a database.

5. Each router uses the database to construct a complete map of the topology and computes the best path to each destination network.

A link is an interface on the router. A link-state is the information about that interface including its IP address and subnet mask, the type of network, the cost associated with the link, and any neighbor routers on that link.

Each router determines its own link-states and floods the information to all other routers in the area. As a result, each router builds a link-state database (LSDB) containing the link-state information from all other routers. Each router will have identical LSDBs. Using the information in the LSDB, each router will run the SPF algorithm. The SPF algorithm will create an SPF tree, with the router at the root of the tree. As each link is connected to other links, the SPF tree is created. Once the SPF tree is completed, the router can determine on its own the best path to each network in the tree. This best path information is then stored in the router's routing table.

Link-state routing protocols build a local topology map of the network that allows each router to determine the best path to a given network. A new LSP is sent only when there is a change in the topology. When a link is added, removed or modified, the router will flood the new LSP to all other routers. When a router receives the new LSP, it will update is LSDB, rerun the SPF algorithm, create a new SPF tree, and update its routing table.

Link-state routing protocols tend to have a faster convergence time than distance vector routing protocols. A notable exception is EIGRP. However, link-state routing protocols do require more memory and processing requirements. This is usually not an issue with today's newer routers.

In the next and final chapter of this course, you will learn about the link-state routing protocol, OSPF.


10.3.1 - Summary and Review
In this chapter, you learned to:
- Describe the basic features and concepts of link-state routing protocols.
- List the benefits and requirements of link-state routing protocols.


Page 2:


10.3.1 - Summary and Review
This is a review and is not a quiz. Questions and answers are provided.
Question 1. Why is a distance-vector routing protocol like a road sign?
Answer: Because routers using distance vector routing protocols only have information regarding distance (metric) of the network and which next-hop router (vector) to forward those packets to. These routers do not see the network beyond their directly connected neighbors.

Question 2. Why is a link-state routing protocol like a road map?
Answer: Routers using link-state routing protocols exchange link-state information. This allows the SPF algorithm to build an SPF tree of a topological map of the network. These routers can see the network beyond their directly connected neighbors.

Question 3. What algorithm do link-state routing protocols use?
Answer: Link-state routing protocols use the shortest path first (SPF) algorithm, which was developed by E.W. Dijkstra. This algorithm is also known as Dijkstra's algorithm.

Question 4. In link-state terminology, what is a link?
Answer: A link is an interface on a router.

Question 5. In link-state routing terminology, what is a link-state?
Answer: A link-state is the information regarding that link. This can include the router's IP address, the type of network, the cost of the link, and if there are any neighboring routers on that link.

Question 6. In link-state routing terminology, what is a neighbor and how are neighbors discovered?
Answer: A neighbor is a router that shares a link, a directly connected network with another router. Routers discover their neighbors by using the Hello packets of a specific routing protocol.

Question 7. What does the link-state flooding process do? What is the end result of this process?
Answer: Whenever a router receives an LSP from another neighbor, it immediately sends this LSP out all interfaces, except for the interface that it was received from. The result is that all routers in the routing area receive this LSP.

Question 8. Where are LSP's stored and how are they used?
Answer: Routers store LSP's in link-state databases, also known as topological databases. The SPF algorithm is run using these LSP's to create the SPF tree and determine the shortest path to each network.

Question 9. Do link-state routing protocols send out periodic updates?
Answer: No, link-state routing protocols do not send out typical periodic updates like RIP and IGRP. OSPF routers do send out their own LSP's every 30 minutes. However, this is used differently than a periodic update. Periodic updates are discussed in the chapter on OSPF. Remember, not all distance-vector routing protocols send out periodic updates. EIGRP does not send out periodic updates.

Question 10. What are the advantages of a link-state protocol compared to a distance-vector protocol?
Answer:
- Use of a topological map, and SPF tree of the network.
- Fast convergence (EIGRP is an exception).
- No periodic updates, unlike some distance-vector routing protocols.
- Specific LSP flooded only when there is a change in the topology.

Question 11. What are the requirements of using a link-state routing protocol? What can help minimize these requirements?
Answer:
- More memory for link-state database.
- More CPU processing for the SPF algorithm.
- More bandwidth for flooding of LSP's.
- Multiple areas can be used to minimize these requirements.

Question 12. What are two common link-state routing protocols used today for routing IP?
Answer:
- Open Shortest Path First (OSPF)
- Intermediate-System-to-Intermediate-System (I S-I S)


Page 3:
The Packet Tracer Skills Integration Challenge Activity for this chapter is very similar to the activity you completed at the end of Chapter 9. The scenario is slightly different, allowing you to better practice your skills.

Packet Tracer Skills Integration Instructions (PDF)

Click the Packet Tracer icon for more details.


10.3.1 - Summary and Review
Link to Packet Tracer Exploration: Chapter 10 - Packet Tracer Skills Integration Challenge.

The Packet Tracer Skills Integration Challenge Activity for this chapter is very similar to the activity you completed at the end of Chapter 9. The scenario is slightly different, allowing you to better practice your skills.


Page 4:
To Learn More

Suggested Books

Understanding the SPF algorithm is not difficult. There are several good books and online resources that explain Dijkstra's algorithm and how it is used in networking. There are several web sites devoted to explaining how these algorithms work. Seek out some of the resources and familiarize yourself with how this algorithm works.

Here are some suggested resources:
  • Interconnections, Bridges, Routers, Switches, and Internetworking Protocols, by Radia Perlman
  • Cisco IP Routing, by Alex Zinin
  • Routing the Internet, by Christian Huitema
Classroom Analogy

An exercise to help you understand the SPF algorithm can be done with a classroom of students and a set of index cards. Each student gets a set four index cards. On the first index card the student will write down their name along with the name of the student sitting to their left. If there is not a student there, have them write the word "none". On the next card the student will do the same thing but for the student on their right. The next two cards are for the students sitting in front, and sitting in back. These index cards are representative of link-state information.

For example, Teri has a set of four cards with the following information:
  • Teri ---> Jen
  • Teri ---> Pat
  • Teri ---> Rick
  • Teri ---> Allan
Once all of the students in the classroom have filled out the index cards, the instructor collects all of the index cards. This is similar to the link-state flooding process. The stack of index cards is similar to the link-state database. In a network, all routers would have this identical link-state database.

The instructor takes each card and lists the name and the neighbor student on the board with a line between them. After all of the index cards are transcribed to the board, the end result will be a map of the students in the classroom. To make it easier, the instructor should map the names similar to how students are sitting in the classroom, for example, Jen is sitting to the left of Teri. This is similar to the SPF tree that a link-state routing protocol creates.

Using this topology map on the board the instructor can see all of the paths to the various students in the class.


10.3.1 - Summary and Review
The diagram depicts a collage of people using computers and networks.


10.4 Chapter Quiz

10.4.1 Chapter Quiz

Page 1:


10.4.1 - Chapter Quiz
1. Which routing protocol is considered a link-state protocol?
A. RIP v1
B. RIP v2
C. EIGRP
D. I S-I S
E. BGP

2. Which mechanism is used by link-state routing protocols to build and maintain routing tables?
A. service network advertisements
B. hello packets
C. link-state advertisements
D. routing table broadcasts
E. shortest path first algorithm
F. Spanning Tree Protocol

3. Match the attribute to the associated protocol, either link state or distance vector.

Attributes:
Hardware intensive
Uses Bellman-Ford algorithm
Depends on neighbor routes
Fast convergence
Uses timed updates
Builds complete topology
Routes by "rumor"
Uses Dijkstra algorithm

Protocols:
Link state
Distance vector

4. What is one advantage of link-state protocols over most distance-vector protocols?
A. ability to route IPX
B. continual route checking with periodic updates
C. faster convergence
D. lower hardware requirements

5. Why do link-state protocols converge faster than most distance vector protocols?
A. Distance vector protocols compute their routing tables before sending any routing update. Link-state protocols do not.
B. Link-state protocols have lower computing requirements than distance vector protocols.
C. Link-state protocols send updates out more often than distance vector protocols.
D. Distance vector protocols receive more packets per update than link-state protocols.

6. Refer to the following topology description to answer the question. If all routers are using a link-state routing protocol, which routers does Router A send hello packets to?

Topology Description:
There are four routers, A, B, C, and D.
Router A is connected to router B and router C via WAN links.
Router B is connected to router D via a WAN link.

A. B, C
B. B, C, D
C. only the DR
D. only the BR and BDR

7. What information is contained in LSP's sent by link-state routers to their neighbors?
A. copy of the routing table
B. copy of the topology database
C. state of directly connected links
D. most current version of the SPF tree

8. What is one disadvantage of link-state protocols over distance-vector protocols?
A. slow convergence
B. flat network topology
C. periodic updates
D. higher processing requirements

9. After two OSPF routers have exchanged Hello packets and formed an adjacency, what is the next thing to occur?
A. They take turns broadcasting their entire routing table to each other.
B. They start sending link-state packets to each other.
C. They negotiate to determine who will be the root router.
D. They adjust their hello timers so they do not collide with each other.

10. How does a router learn about a directly connected network?
A. When the administrator configures a static route.
B. When the administrator configures a dynamic routing protocol.
C. When the administrator assigns an IP address and subnet mask to the interface.
D. When a broadcast address is discovered on a specific interface.

0 comments:

Post a Comment