11 OSPF

11.0 Chapter Introduction

11.0.1 Chapter Introduction

Page 1:
Open Shortest Path First (OSPF ) is a link-state routing protocol that was developed as a replacement for the distance vector routing protocol RIP. RIP was an acceptable routing protocol in the early days of networking and the Internet, but its reliance on hop count as the only measure for choosing the best route quickly became unacceptable in larger networks that needed a more robust routing solution. OSPF is a classless routing protocol that uses the concept of areas for scalability. RFC 2328 defines the OSPF metric as an arbitrary value called cost. The Cisco IOS uses bandwidth as the OSPF cost metric.

OSPF's major advantages over RIP are its fast convergence and its scalability to much larger network implementations. In this final chapter of the Routing Protocols and Concepts course, you will learn basic, single-area OSPF implementations and configurations. More complex OSPF configurations and concepts are reserved for CCNP-level courses.


11.0.1 - Chapter Introduction
The diagram depicts a matrix that classifies routing protocols with the Open Shortest Path First version 2 (OSPF v2) link-state protocol highlighted. OSPF is a classless interior gateway routing protocol.

In this chapter, you learn to:
- Describe the background and basic features of OSPF.
- Identify and apply the basic OSPF configuration commands.
- Describe, modify, and calculate the metric used by OSPF.
- Describe the designated router and backup designated router (DR/BDR) election process in multi-access networks.
- Employ the default-information originate command to configure and propagate a default route in OSPF.


11.1 Introduction to OSPF

11.1.1 Background of OSPF

Page 1:
The initial development of OSPF began in 1987 by the Internet Engineering Task Force (IETF) OSPF Working Group. At that time the Internet was largely an academic and research network funded by the U.S. government.

Roll over the dates in the OSPF Development Timeline figure to see related events.

In 1989, the specification for OSPFv1 was published in RFC 1131. There were two implementations written: one to run on routers and the other to run on UNIX workstations. The latter implementation later became a widespread UNIX process known as GATED. OSPFv1 was an experimental routing protocol and never deployed.

In 1991, OSPFv2 was introduced in RFC 1247 by John Moy. OSPFv2 offered significant technical improvements over OSPFv1. At the same time, ISO was working on a link-state routing protocol of their own, Intermediate System-to-Intermediate System (IS-IS). Not surprisingly, IETF chose OSPF as their recommended IGP (Interior Gateway Protocol).

In 1998, the OSPFv2 specification was updated in RFC 2328 and is the current RFC for OSPF.

Note: In 1999 OSPFv3 for IPv6 was published in RFC 2740. RFC 2740 was written by John Moy, Rob Coltun, and Dennis Ferguson. OSPFv3 is discussed in CCNP.

Links

"OSPF Version 2," http://www.ietf.org/rfc/rfc2328.txt


11.1.1 - Background of OSPF
The diagram depicts the OSPF development timeline.

1987 - IETF OSPF Working Group formed
1991 - OSPF v2 published in RFC 1247
1998 - Current specification for OSPF v2 was published in RFC 2328
1999 - OSPF v3 for IPv6 was published in RFC 2740


11.1.2 OSPF Message Encapsulation

Page 1:
The data portion of an OSPF message is encapsulated in a packet. This data field can include one of five OSPF packet types. Each packet type is briefly discussed in the next topic.

Roll over the fields in the Encapsulated OSPF Message figure to see the encapsulation process.

The OSPF packet header is included with every OSPF packet, regardless of its type. The OSPF packet header and packet type-specific data are then encapsulated in an IP packet. In the IP packet header, the protocol field is set to 89 to indicate OSPF, and the destination address is set to one of two multicast addresses: 224.0.0.5 or 224.0.0.6. If the OSPF packet is encapsulated in an Ethernet frame, the destination MAC address is also a multicast address: 01-00-5E-00-00-05 or 01-00-5E-00-00-06.


11.1.2 - OSPF Message Encapsulation
The diagram depicts an encapsulated OSPF message with the key fields identified.

Data Link Frame (Ethernet Fields shown here)
- MAC Destination Address = Multicast: 01-00-5E-00-00-05 or 01-00-5E-00-00-06
- MAC Source Address = Address of sending interface

IP Packet
- IP Source Address = Address of sending interface
- IP Destination Address = Multicast: 224.0.0.5 or 224.0.0.6
- Protocol field = 89 for OSPF

OSPF Packet Header
- Type Code for OSPF Packet Type
- Router ID and Area ID

OSPF Packet Types
- 0x01 Hello
- 0x02 Database Description (DD)
- 0x03 Link State Request
- 0x04 Link State Update
- 0x05 Link State Acknowledgment


11.1.3 OSPF Packet Types

Page 1:
In the previous chapter, we introduced Link-State Packets (LSPs). The figure shows the five different types of OSPF LSPs. Each packet serves a specific purpose in the OSPF routing process:

1. Hello - Hello packets are used to establish and maintain adjacency with other OSPF routers. The hello protocol is discussed in detail in the next topic.

2. DBD - The Database Description (DBD) packet contains an abbreviated list of the sending router's link-state database and is used by receiving routers to check against the local link-state database.

3. LSR - Receiving routers can then request more information about any entry in the DBD by sending a Link-State Request (LSR).

4. LSU - Link-State Update (LSU) packets are used to reply to LSRs as well as to announce new information. LSUs contain seven different types of Link-State Advertisements (LSAs). LSUs and LSAs are briefly discussed in a later topic.

5. LSAck - When an LSU is received, the router sends a Link-State Acknowledgement (LSAck) to confirm receipt of the LSU.


11.1.3 - OSPF Packet Types
The diagram depicts OSPF packet types.

Type: 1
Packet Name: Hello
Description: Discovers neighbors and builds adjacencies between them.

Type: 2
Packet Name: Database Description (DBD)
Description: Checks for database synchronization between routers.

Type: 3
Packet Name: Link-State Request (LSR)
Description: Requests specific link-state records from router to router.

Type: 4
Packet Name: Link-State Update (LSU)
Description: Sends specifically requested link-state records.

Type: 5
Packet Name: Link-State Acknowledgement (LSAck)
Description: Acknowledges the other packet types.


11.1.4 Hello Protocol

Page 1:
The figure shows the OSPF packet header and Hello packet. The blue-shaded fields will be discussed in more detail later in the chapter. For now, let's focus on the uses of the Hello packet.

OSPF packet Type 1 is the OSPF Hello packet. Hello packets are used to:
Important fields shown in the figure include:
  • Type: OSPF Packet Type: Hello (1), DD (2), LS Request (3), LS Update (4), LS ACK (5)
  • Router ID: ID of the originating router
  • Area ID: area from which the packet originated
  • Network Mask: Subnet mask associated with the sending interface
  • Hello Interval: number of seconds between the sending router's hellos
  • Router Priority: Used in DR/BDR election (discussed later)
  • Designated Router (DR): Router ID of the DR, if any
  • Backup Designated Router (BDR): Router ID of the BDR, if any
  • List of Neighbors: lists the OSPF Router ID of the neighboring router(s)


11.1.4 - Hello Protocol
The diagram depicts the OSPF message format. The fields in the OSPF packet header and a Hello packet are shown in the following sequence.

The fields highlighted in the OSPF packet header are:
- Type=1
- Router ID
- Area ID

The fields highlighted in the OSPF Hello packet are:
- Network Mask
- Hello Interval
- Router Priority
- Router Dead Interval
- Designated Router (DR)
- Backup Designated Router (BDR)
- List of Neighbors


Page 2:
Neighbor Establishment

Before an OSPF router can flood its link-states to other routers, it must first determine if there are any other OSPF neighbors on any of its links. In the figure, the OSPF routers are sending Hello packets on all OSPF-enabled interfaces to determine if there are any neighbors on those links. The information in the OSPF Hello includes the OSPF Router ID of the router sending the Hello packet (Router ID is discussed later in the chapter). Receiving an OSPF Hello packet on an interface confirms for a router that there is another OSPF router on this link. OSPF then establishes adjacency with the neighbor. For example, in the figure, R1will establish adjacencies with R2 and R3.

OSPF Hello and Dead Intervals

Before two routers can form an OSPF neighbor adjacency, they must agree on three values: Hello interval, Dead interval, and network type. The OSPF Hello interval indicates how often an OSPF router transmits its Hello packets. By default, OSPF Hello packets are sent every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on non-broadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM).

In most cases, OSPF Hello packets are sent as multicast to an address reserved for ALLSPFRouters at 224.0.0.5. Using a multicast address allows a device to ignore the packet if its interface is not enabled to accept OSPF packets. This saves CPU processing time on non-OSPF devices.

The Dead interval is the period, expressed in seconds, that the router will wait to receive a Hello packet before declaring the neighbor "down." Cisco uses a default of four times the Hello interval. For multiaccess and point-to-point segments, this period is 40 seconds. For NBMA networks, the Dead interval is 120 seconds.

If the Dead interval expires before the routers receive a Hello packet, OSPF will remove that neighbor from its link-state database. The router floods the link-state information about the "down" neighbor out all OSPF enabled interfaces.

Network types are discussed later in the chapter.

Electing a DR and BDR

To reduce the amount of OSPF traffic on multiaccess networks, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR). The DR is responsible for updating all other OSPF routers (called DROthers) when a change occurs in the multiaccess network. The BDR monitors the DR and takes over as DR if the current DR fails.

In the figure, R1, R2, and R3 are connected through point-to-point links. Therefore, no DR/BDR election occurs. The DR/BDR election and processes will be discussed in a later topic and the topology will be changed to a multiaccess network.

Note: The Hello packet is discussed in more detail in CCNP along with the other types of OSPF packets.


11.1.4 - Hello Protocol
The diagram depicts the operation of the OSPF Hello protocol. OSPF Hello packets are sent every 10 seconds on multi-access networks and point-to-point serial links.

The diagram is based on the following network topology.

Network Topology:
There are three routers, R1, R2, and R3. Each router has a LAN attached and is connected to the other two routers via a WAN link.

R1 FA0/0 is connected to the R1 LAN.
R1 S0/0/0 (DCE) is connected to R2 S0/0/0.
R1 S0/0/1 is connected to R3 S0/0/0.

R2 FA0/0 is connected to the R2 LAN.
R2 S0/0/0 is connected to R1 S0/0/0.
R2 S0/0/1 (DCE) is connected to R3 S0/0/1.

R3 FA0/0 is connected to the R3 LAN.
R3 S0/0/0 is connected to R1 S0/0/1.
R3 S0/0/1 is connected to R2 S0/0/1.


Router R1 says: Hello, I am Router ID 10.1.1.1
Router R2 says: Hello, I am Router ID 10.2.2.2
Router R3 says: Hello, I am Router ID 10.3.3.3

The following interface values must match for two routers to form an adjacency:
- Hello Interval
- Dead Interval
- Network Type


11.1.5 OSPF Link-state Updates

Page 1:
Link-state updates (LSUs) are the packets used for OSPF routing updates. An LSU packet can contain 11 different types of Link-State Advertisements (LSAs), as shown in the figure. The difference between the terms Link-State Update (LSU) and Link-State Advertisement (LSA) can sometimes be confusing. At times, these terms are used interchangeably. An LSU contains one or more LSAs and either term can be used to refer to link-state information propagated by OSPF routers.

Note: The different types of LSAs are discussed in CCNP.


11.1.5 - OSPF Link-state Updates
The diagram depicts the various OSPF packet types. The LSU packet contains Link-State Advertisements (LSA's). Various types of LSA's are listed and described.

OSPF Packet Type: 1
Packet Name: Hello
Description: Discovers neighbors and builds adjacencies between them.

OSPF Packet Type: 2
Packet Name: DBD
Description: Checks for database synchronization between routers.

OSPF Packet Type: 3
Packet Name: LSR
Description: Requests specific link-state records from router to router.

OSPF Packet Type: 4
Packet Name: LSU
Description: Sends specifically requested link-state records.

OSPF Packet Type: 5
Packet Name: LSAck
Description: Acknowledges the other packet types.

Other notes about LSU's and LSA's.
- The terms LSA and LSU are often used interchangeably.
- An LSU contains one or more LSA's.
- LSA's contain route information for destination networks.
- LSA specifics are discussed in CCNP.

Types of LSA's:

LSA Type: 1
Description: Router LSA's

LSA Type: 2
Description: Network LSA's

LSA Type: 3 or 4
Description: Summary LSA's

LSA Type: 5
Description: Autonomous System External LSA's

LSA Type: 6
Description: Multicast OSPF LSA's

LSA Type: 7
Description: Defined for Not-So-Stubby Areas

LSA Type: 8
Description: External Attributes LSA for Border Gateway Protocol (BGP)

LSA Type: 9, 10, 11
Description: Opaque LSA's


11.1.6 OSPF Algorithm

Page 1:
Each OSPF router maintains a link-state database containing the LSAs received from all other routers. Once a router has received all of LSAs and built its local link-state database, OSPF uses Dijkstra's shortest path first (SPF) algorithm to create an SPF tree. The SPF tree is then used to populate the IP routing table with the best paths to each network.


11.1.6 - OSPF Algorithm
The diagram depicts the OSPF use of Dijkstra's SPF algorithm to create routing table entries. Each router has a link-state database and runs the SPF algorithm against this database to create an SPF tree. The SPF tree is then used to populate the IP routing table with the best paths to each network.

The diagram is based on the network topology described in 11.1.4 diagram 2.


11.1.7 Administrative Distance

Page 1:
As you know from Chapter 3, "Introduction to Dynamic Routing," administrative distance (AD) is the trustworthiness (or preference) of the route source. OSPF has a default administrative distance of 110. As you can see from the figure, when compared to other interior gateway protocols (IGPs), OSPF is preferred over IS-IS and RIP.


11.1.7 - Administrative Distance
The diagram depicts the default administrative distance (A D) for various route sources and routing protocols.
Route Source: Connected
Administrative Distance: 0

Route Source: Static
Administrative Distance: 1

Route Source: EIGRP summary route
Administrative Distance: 5

Route Source: External BGP
Administrative Distance: 20

Route Source: Internal EIGRP
Administrative Distance: 90

Route Source: IGRP
Administrative Distance: 100

Route Source: OSPF
Administrative Distance: 110

Route Source: I S-I S
Administrative Distance: 115

Route Source: RIP
Administrative Distance: 120

Route Source: External EIGRP
Administrative Distance: 170

Route Source: Internal BGP
Administrative Distance: 200


11.1.8 Authentication

Page 1:
As stated in previous chapters, configuring routing protocols to use authentication will be discussed in a later course. Like other routing protocols, OSPF can be configured for authentication.

It is good practice to authenticate transmitted routing information. RIPv2, EIGRP, OSPF, IS-IS, and BGP can all be configured to encrypt and authenticate their routing information. This practice ensures that routers will only accept routing information from other routers that have been configured with the same password or authentication information.

Note: Authentication does not encrypt the router's routing table.


11.1.8 - Authentication
The diagram depicts OSPF authentication with a lock on each router. With OSPF authentication, the OSPF packets are encrypted.

The diagram is based on the network topology described in 11.1.4 diagram 2, but without interface designations.


11.2 Basic OSPF Configuration

11.2.1 Lab Topology

Page 1:
The figure shows the topology for this chapter. Notice that the addressing scheme is discontiguous. OSPF is a classless routing protocol. Therefore, we will configure the mask as part of our OSPF configuration. As you know, doing this overcomes the problem with discontiguous addressing. Also notice in this topology that there are three serial links that can have various bandwidths and that each router has multiple paths to each remote network. Currently, all serial links are set to default bandwidth 1544kbps.

Click Addressing to review the IP addresses.
Click R1, R2, and R3 to review each router's starting configuration.


11.2.1 - Lab Topology
The diagram depicts the basic lab topology for this chapter. A device interface address table is provided. The show running-config command for each router lists the commands used to configure each interface.

The diagram is based on the following network topology.

Network Topology:
There are three routers, R1, R2, and R3. Each router has a LAN attached and is connected to the other two routers via a WAN link.

Addressing table:
Device R1 interface addresses:
FA0/0 IP Address 172.16.1.17, subnet mask: 255.255.255.240
S0/0/0 IP Address192.168.10.1 subnet mask 255.255.255.252
S0/0/1 IP Address 192.168.10.5 subnet mask 255.255.255.252

Device R2 interface addresses:
FA0/0 IP Address 10.10.10.1, subnet mask: 255.255.255.0
S0/0/0 IP Address192.168.10.2 subnet mask 255.255.255.252
S0/0/1 IP Address 192.168.10.9 subnet mask 255.255.255.252

Device R3 interface addresses:
FA0/0 IP Address 172.16.1.33, subnet mask: 255.255.255.248
S0/0/0 IP Address192.168.10.6 subnet mask 255.255.255.252
S0/0/1 IP Address 192.168.10.10 subnet mask 255.255.255.252


11.2.2 The router ospf Command

Page 1:
OSPF is enabled with the router ospf process-id global configuration command. The process-id is a number between 1 and 65535 and is chosen by the network administrator. The process-id is locally significant, which means that it does not have to match other OSPF routers in order to establish adjacencies with those neighbors. This differs from EIGRP. The EIGRP process ID or autonomous system number does need to match for two EIGRP neighbors to become adjacent.

In our topology, we will enable OSPF on all three routers using the same process ID of 1. We are using the same process ID simply for consistency.

R1(config)#router ospf 1
R1(config-router)#



11.2.2 - The router o s p f Command
The diagram depicts enabling OSPF routing. The router o s p f 1 command is shown below for R1 and is the same command used for routers R2 and R3.

R1(config)#router o s p f 1
R1(config-router)#

The diagram is based on the network topology described in 11.2.1 diagram 1.


11.2.3 The network Command

Page 1:
The network command used with OSPF has the same function as when used with other IGP routing protocols:
  • Any interfaces on a router that match the network address in the network command will be enabled to send and receive OSPF packets.
  • This network (or subnet) will be included in OSPF routing updates.
The network command is used in router configuration mode.

Router(config-router)#network network-address wildcard-mask area area-id

The OSPF network command uses a combination of network-address and wildcard-mask similar to that which can be used by EIGRP. Unlike EIGRP, however, OSPF requires the wildcard mask. The network address along with the wildcard mask is used to specify the interface or range of interfaces that will be enabled for OSPF using this network command.

As with EIGRP, the wildcard mask can be configured as the inverse of a subnet mask. For example, R1's FastEthernet 0/0 interface is on the 172.16.1.16/28 network. The subnet mask for this interface is /28 or 255.255.255.240. The inverse of the subnet mask results in the wildcard mask.

Note: Like EIGRP, some IOS versions allow you to simply enter the subnet mask instead of the wildcard mask. The IOS then converts the subnet mask to the wildcard mask format.

255.255.255.255

- 255.255.255.240 Subtract the subnet mask
--------------------
0. 0. 0. 15 Wildcard mask


The area area-id refers to the OSPF area. An OSPF area is a group of routers that share link-state information. All OSPF routers in the same area must have the same link-state information in their link-state databases. This is accomplished by routers flooding their individual link-states to all other routers in the area. In this chapter, we will configure all of the OSPF routers within a single area. This is known as single-area OSPF.

An OSPF network can also be configured as multiple areas. There are several advantages to configuring large OSPF networks as multiple areas, including smaller link-state databases and the ability to isolate unstable network problems within an area. Multi-area OSPF is covered in CCNP.

When all of the routers are within the same OSPF area, the network commands must be configured with the same area-id on all routers. Although any area-id can be used, it is good practice to use an area-id of 0 with single-area OSPF. This convention makes it easier if the network is later configured as multiple OSPF areas where area 0 becomes the backbone area.

The figure shows the network commands for all three routers, enabling OSPF on all interfaces. At this point all routers should be able to ping all networks.


11.2.3 - The network Command
The diagram depicts configuring OSPF subnetworks. The following commands are used for routers R1, R2, and R3.

R1(config)#router o s p f 1
R1(config-router)#network 172.16.1.16 0.0.0.15 area 0
R1(config-router)#network 192.168.10.0 0.0.0.3 area 0
R1(config-router)#network 192.168.10.4 0.0.0.3 area 0

R2(config)#router o s p f 1
R2(config-router)#network 10.10.10.0 0.0.0.255 area 0
R2(config-router)#network 192.168.10.0 0.0.0.3 area 0
R2(config-router)#network 192.168.10.8 0.0.0.3 area 0

R3(config)#router o s p f 1
R3(config-router)#network 172.16.1.32 0.0.0.7 area 0
R3(config-router)#network 192.168.10.4 0.0.0.3 area 0
R3(config-router)#network 192.168.10.8 0.0.0.3 area 0

The diagram is based on the network topology described in 11.2.1 diagram 1.


11.2.4 OSPF Router ID

Page 1:
Determining the Router ID

The OSPF router ID is used to uniquely identify each router in the OSPF routing domain. A router ID is simply an IP address. Cisco routers derive the router ID based on three criteria and with the following precedence:

1. Use the IP address configured with the OSPF router-id command.

2. If the router-id is not configured, the router chooses highest IP address of any of its loopback interfaces.

3. If no loopback interfaces are configured, the router chooses highest active IP address of any of its physical interfaces.

Highest Active IP Address

If an OSPF router is not configured with an OSPF router-id command and there are no loopback interfaces configured, the OSPF router ID will be the highest active IP address on any of its interfaces. The interface does not need to be enabled for OSPF, meaning that it does not need to be included in one of the OSPF network commands. However, the interface must be active - it must be in the up state.

Click the Topology button in the figure.

Using the criteria described above, can you determine the router IDs for R1, R2, and R3? The answer is on the next page.


11.2.4 - OSPF Router ID
The diagram depicts determining the router ID.

The router ID is determined in the following order:
1. Use the IP address configured with the OSPF router-i d command.
2. If the router ID is not configured, the router chooses the highest IP address of all of its loopback interfaces.
3. If no loopback interface is configured, the router chooses the highest active IP address of all of its physical interfaces.

The diagram is based on the network topology described in 11.2.1 diagram 1.


Page 2:
Verifying the Router ID

Because we have not configured router IDs or loopback interfaces on our three routers, the router ID for each router is determined by the number three criterion in the list: the highest active IP address on any of the router's physical interfaces. As shown in the figure, the router ID for each router is:

R1: 192.168.10.5, which is higher than either 172.16.1.17 or 192.168.10.1

R2: 192.168.10.9, which is higher than either 10.10.10.1 or 192.168.10.2

R3: 192.168.10.10, which is higher than either 172.16.1.33 or 192.168.10.6

One command you can use to verify the current router ID is show ip protocols. Some IOS versions do not display the router ID as shown in the figure. In those cases, use the show ip ospf or show ip ospf interface commands to verify the router ID.


11.2.4 - OSPF Router ID
The diagram depicts verifying the router ID using the show i p protocols command. The router ID for each router is the highest active IP address of all of its physical interfaces.

The R1 router ID is 192.168.10.5
The R2 router ID is 192.168.10.9
The R3 router ID is 192.168.10.10

The diagram is based on the network topology described in 11.2.1 diagram 1.


Page 3:
Loopback Address

If the OSPF router-id command is not used and loopback interfaces are configured, OSPF will choose highest IP address of any of its loopback interfaces. A loopback address is a virtual interface and is automatically in the up state when configured. You already know the commands to configure a loopback interface:

Router(config)#interface loopback number
Router(config-if)#ip address ip-address subnet-mask


Click the Topology button in the figure.

In this topology, all three routers have been configured with loopback addresses to represent the OSPF router IDs. The advantage of using a loopback interface is that - unlike physical interfaces - it cannot fail. There are no actual cables or adjacent devices on which the loopback interface depends for being in the up state. Therefore, using a loopback address for the router ID provides stability to the OSPF process. Because the OSPF router-id command, which is discussed next, is a fairly recent addition to IOS, it is more common to find loopback addresses used for configuring OSPF router IDs.

The OSPF router-id command

The OSPF router-id command was introduced in IOS 12.0(T) and takes precedence over loopback and physical interface IP addresses for determining the router ID. The command syntax is:

Router(config)#router ospf process-id
Router(config-router)#router-id ip-address


Modifying the Router ID

The router ID is selected when OSPF is configured with its first OSPF network command. If the OSPF router-id command or the loopback address is configured after the OSPF network command, the router ID will be derived from the interface with the highest active IP address.

The router ID can be modified with the IP address from a subsequent OSPF router-id command by reloading the router or by using the following command:

Router#clear ip ospf process

Note: Modifying a router ID with a new loopback or physical interface IP address may require reloading the router.

Duplicate Router IDs

When two routers have the same router ID in an OSPF domain, routing may not function properly. If the router ID is the same on two neighboring routers, the neighbor establishment may not occur. When duplicate OSPF router IDs occur, IOS will display a message similar to:

%OSPF-4-DUP_RTRID1: Detected router with duplicate router ID

To correct this problem, configure all routers so that they have unique OSPF router IDs.

Click New Router IDs in the figure.

Because some IOS versions do not support the router-id command, we will use the loopback address method for assigning router IDs. An IP address from a loopback interface will usually only replace a current OSPF router ID by reloading the router. In the figure, the routers have been reloaded. The show ip protocols command is used to verify that each router is now using the loopback address for the router ID.


11.2.4 - OSPF Router ID
The diagram depicts configuring loopback interfaces as the router ID.

The diagram is based on the network topology described in 11.2.1 diagram 1, with loopback addresses added for each router.

The commands to add loopback addresses to R1, R2, and R3 are shown.

R1(config)#interface loopback 0
R1(config-i f)#i p address 10.1.1.1 255.255.255.255

R2(config)#interface loopback 0
R2(config-i f)#i p address 10.2.2.2 255.255.255.255

R3(config)#interface loopback 0
R3(config-i f)#i p address 10.3.3.3 255.255.255.255

Using the show i p protocols command, the router ID is verified displaying the loopback interface previously added.


11.2.5 Verifying OSPF

Page 1:
The show ip ospf neighbor command can be used to verify and troubleshoot OSPF neighbor relationships. For each neighbor, this command displays the following output:
  • Neighbor ID - The router ID of the neighboring router.
  • Pri - The OSPF priority of the interface. This is discussed in a later section.
  • State - The OSPF state of the interface. FULL state means that the router and its neighbor have identical OSPF link-state databases. OSPF states are discussed in CCNP.
  • Dead Time - The amount of time remaining that the router will wait to receive an OSPF Hello packet from the neighbor before declaring the neighbor down. This value is reset when the interface receives a Hello packet.
  • Address - The IP address of the neighbor's interface to which this router is directly connected.
  • Interface - The interface on which this router has formed adjacency with the neighbor.
When troubleshooting OSPF networks, the show ip ospf neighbor command can be used to verify that the router has formed an adjacency with its neighboring routers. If the router ID of the neighboring router is not displayed, or if it does not show as a state of FULL, the two routers have not formed an OSPF adjacency. If two routers do not establish adjacency, link-state information will not be exchanged. Incomplete link-state databases can cause inaccurate SPF trees and routing tables. Routes to destination networks may either not exist or may not be the most optimum path.

Note: On multiaccess networks such as Ethernet, two routers that are adjacent may have their states displayed as 2WAY. This will be discussed in a later section.

Two routers may not form an OSPF adjacency if:
  • The subnet masks do not match, causing the routers to be on separate networks.
  • OSPF Hello or Dead Timers do not match.
  • OSPF Network Types do not match.
  • There is a missing or incorrect OSPF network command.


11.2.5 - Verifying OSPF
The diagram depicts verifying OSPF neighbor adjacency using the show i p o s p f neighbor command.

The diagram is based on the network topology described in 11.2.4 diagram 3.

R1#show i p o s p f neighbor

Neighbor ID: 10.3.3.3
Priority: 1
State: FULL/
Dead Time: 00:00:30
Address: 192.168.10.6
Interface: Serial0/0/1

Neighbor ID: 10.2.2.2
Priority: 1
State: FULL/
Dead Time: 00:00:33
Address: 192.168.10.2
Interface: Serial0/0/0

R2#show i p o s p f neighbor

Neighbor ID: 10.3.3.3
Priority: 1
State: FULL/
Dead Time: 00:00:36
Address: 192.168.10.10
Interface: Serial0/0/1

Neighbor ID: 10.1.1.1
Priority: 1
State: FULL/
Dead Time: 00:00:37
Address: 192.168.10.1
Interface: Serial0/0/0

R3#show i p o s p f neighbor

Neighbor ID: 10.2.2.2
Priority: 1
State: FULL/
Dead Time: 00:00:34
Address: 192.168.10.9
Interface: Serial0/0/1

Neighbor ID: 10.1.1.1
Priority: 1
State: FULL/
Dead Time: 00:00:38
Address: 192.168.10.5
Interface: Serial0/0/0


Page 2:
Other powerful OSPF troubleshooting commands include:

show ip protocols
show ip ospf
show ip ospf interface


As shown in the figure, the show ip protocols command is a quick way to verify vital OSPF configuration information, including the OSPF process ID, the router ID, networks the router is advertising, the neighbors the router is receiving updates from, and the default administrative distance, which is 110 for OSPF.

Click show ip ospf in the figure.

The show ip ospf command can also be used to examine the OSPF process ID and router ID. Additionally, this command displays the OSPF area information as well as the last time the SPF algorithm was calculated. As you can see from the sample output, OSPF is a very stable routing protocol. The only OSPF-related event that R1 has participated in during the past 11 and a half hours is to send small Hello packets to its neighbors.

Note: Additional information displayed by the show ip ospf command is discussed in CCNP courses.

The command output includes important SPF algorithm information which includes the SPF schedule delay:

Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs


Any time a router receives new information about the topology (addition, deletion, or modification of a link), the router must rerun the SPF algorithm, create a new SPF tree, and update the routing table. The SPF algorithm is CPU-intensive and the time it takes for calculation depends on the size of the area. The size of an area is measured by the number of routers and the size of the link-state database.

A network that cycles between an up state and a down state is referred to as a flapping link. A flapping link can cause OSPF routers in an area to constantly recalculate the SPF algorithm, preventing proper convergence. To minimize this problem, the router waits 5 seconds (5000 msecs) after receiving an LSU before running the SPF algorithm. This is known as the SPF schedule delay. In order to prevent a router from constantly running the SPF algorithm, there is an additional Hold Time of 10 seconds (10000 msecs). The router waits 10 seconds after running the SPF algorithm before rerunning the algorithm again.

Click show ip ospf interface in the figure.

The quickest way to verify Hello and Dead intervals is to use the show ip ospf interface command. As shown in the figure, adding the interface name and number to the command displays output for a specific interface. These intervals are included in the OSPF Hello packets sent between neighbors. OSPF may have different Hello and Dead intervals on various interfaces, but for OSPF routers to become neighbors, their OSPF Hello and Dead intervals must be identical. For example, in the figure, R1 is using a Hello interval of 10 and a Dead interval of 40 on the Serial 0/0/0 interface. R2 must also use the same intervals on its Serial 0/0/0 interface or the two routers will not form an adjacency.


11.2.5 - Verifying OSPF
The diagram depicts using the show i p protocols, show i p o s p f, and show i p o s p f interface commands to view OSFP configuration information. The diagram is based on the network topology described in 11.2.4 diagram 3.

In the output of the show i p protocols command, the following information is highlighted.

o s p f 1

Router ID 10.1.1.1

172.16.1.16 0.0.0.15 area 0
192.168.10.0 0.0.0.3 area 0
192.168.10.4 0.0.0.3 area 0

Gateway: 10.2.2.2
Distance: 110
Last Update: 11:29:29

Gateway: 10.3.3.3
Distance: 110
Last Update: 11:29:29

Distance: (default is 110)

In the output of the show i p o s p f command, the following information is highlighted.

o s p f 1

10.1.1.1

Initial SPF schedule delay 5000 microseconds
Maximum hold time between two consecutive SPF's 10000 microseconds
Maximum wait time between two consecutive SPF's 10000 microseconds

Area BACKBONE (0)
Number of interfaces in this area is 3
SPF algorithm last executed 11:30:31.628 ago

In the output of the show i p o s p f interface command, the following information is highlighted.

Hello 10, Dead 40


11.2.6 Examining the Routing Table

Page 1:
As you know, the quickest way to verify OSPF convergence is to look at the routing table for each router in the topology.

Click R1, R2, and R3 in the figure to see show ip route output.

The show ip route command can be used to verify that OSPF is sending and receiving routes via OSPF. The O at the beginning of each route indicates that the route source is OSPF. The routing table and OSPF will be examined more closely in the following section. However, you should immediately notice two distinct differences in the OSPF routing table compared to routing tables you have seen in previous chapters. First, notice that each router has four directly connected networks because the loopback interface counts as the fourth network. These loopback interfaces are not advertised in OSPF. Therefore, each router lists seven known networks. Second, unlike RIPv2 and EIGRP, OSPF does not automatically summarize at major network boundaries. OSPF is inherently classless.


11.2.6 - Examining the Routing Table
The diagram depicts the contents of the R1, R2, and R3 routing tables using the show i p route command. The diagram is based on the network topology described in 11.2.4 diagram 3.

The following is the output from R1.

R1#show i p route

Codes: output omitted
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

192.168.10.0/30 is subnetted, 3 subnets
C 192.168.10.0 is directly connected, Serial0/0/0
C 192.168.10.4 is directly connected, Serial0/0/1
O 192.168.10.8 [110/128] via 192.168.10.2, 14:27:57, Serial0/0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O 172.16.1.32/29 [110/65] via 192.168.10.6, 14:27:57, Serial0/0/1
C 172.16.1.16/28 is directly connected, FastEthernet0/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.10.10.0/24 [110/65] via 192.168.10.2, 14:27:57, Serial0/0/0
C 10.1.1.1/32 is directly connected, Loopback0

The following is the output from R2.

R2#show i p route

Codes: output omitted
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

192.168.10.0/30 is subnetted, 3 subnets
C 192.168.10.0 is directly connected, Serial0/0/0
O 192.168.10.4 [110/128] Via 192.168.10.1, 14:31:18, Serial0/0/0
C 192.168.10.8 is directly connected, Serial0/0/1
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O 172.16.1.32/29 [110/65] via 192.168.10.10, 14:31:18, Serial0/0/1
O 172.16.1.16/28 [110/65] via 192.168.10.1, 14:31:18, Serial0/0/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.2.2.2/32 is directly connected, Loopback0
C 10.10.10.0/24 is directly connected, FastEthernet0/0

The following is the output from R2.

R3#show i p route

Codes: output omitted
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

192.168.10.0/30 is subnetted, 3 subnets
O 192.168.10.0 [110/845] via 192.168.10.9, 14:31:52, Serial0/0/1
[110/845] via 192.168.10.5, 14:31:52, Serial0/0/0
C 192.168.10.4 is directly connected, Serial0/0/0
C 192.168.10.8 is directly connected, Serial0/0/1
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.32/29 directly connected, FastEthernet0/0
O 172.16.1.16/28 [110/65] via 192.168.10.5, 14:31:52, Serial0/0/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.3.3.3/32 is directly connected, Loopback0
O 10.10.10.0/24 [110/782] via 192.168.10.9, 14:31:52, Serial0/0/1


Page 2:
Use the Packet Tracer Activity to configure and verify basic OSPF routing.

Click the Packet Tracer icon for more details.


11.2.6 - Examining the Routing Table
Link to Packet Tracer Exploration: Configure and Verify OSPF Routing

Use the Packet Tracer Activity to configure and verify basic OSPF routing.


11.3 The OSPF Metric

11.3.1 OSPF Metric

Page 1:
The OSPF metric is called cost. From RFC 2328: "A cost is associated with the output side of each router interface. This cost is configurable by the system administrator. The lower the cost, the more likely the interface is to be used to forward data traffic."

Notice that RFC 2328 does not specify which values should be used to determine the cost.

The Cisco IOS uses the cumulative bandwidths of the outgoing interfaces from the router to the destination network as the cost value. At each router, the cost for an interface is calculated as 10 to the 8th power divided by bandwidth in bps. This is known as the reference bandwidth. Dividing 10 to the 8th power by the interface bandwidth is done so that interfaces with the higher bandwidth values will have a lower calculated cost. Remember, in routing metrics, the lowest cost route is the preferred route (for example, with RIP, 3 hops is better than 10 hops). The figure shows the default OSPF costs for several types of interfaces.

Reference Bandwidth

The reference bandwidth defaults to 10 to the 8th power, 100,000,000 bps or 100 Mbps. This results in interfaces with a bandwidth of 100 Mbps and higher having the same OSPF cost of 1. The reference bandwidth can be modified to accommodate networks with links faster than 100,000,000 bps (100 Mbps) using the OSPF command auto-cost reference-bandwidth. When this command is necessary, it is recommended that it is used on all routers so the OSPF routing metric remains consistent.


11.3.1 - OSPF Metric
The diagram depicts Cisco OSPF cost values for various interface or link types. The cost for a link is calculated by taking 10 to the eighth power (100,000,000) and dividing it by the number of bits per second for the interface type.

Interface Type: Fast Ethernet and faster
Cost = 10 to the eighth power divided by 100,000,000 bits per second = 1.

Interface Type: Ethernet
Cost = 10 to the eighth power divided by 10,000,000 bits per second = 10.

Interface Type: E1
Cost = 10 to the eighth power divided by 2,048,000 bits per second = 48.

Interface Type: T1
Cost = 10 to the eighth power divided by 1,544,000 bits per second = 64.

Interface Type: 128 kbps
Cost = 10 to the eighth power divided by 128,000 bits per second = 781.

Interface Type: 64 kbps
Cost = 10 to the eighth power divided by 64,000 bits per second = 1562.

Interface Type: 56 kbps
Cost = 10 to the eighth power divided by 56,000 bits per second = 1785.


Page 2:
OSPF Accumulates Costs

The cost of an OSPF route is the accumulated value from one router to the destination network. For example, in the figure, the routing table on R1 shows a cost of 65 to reach the 10.10.10.0/24 network on R2. Because 10.10.10.0/24 is attached to a FastEthernet interface, R2 assigns the value 1 as the cost for 10.10.10.0/24. R1 then adds the additional cost value of 64 to send data across the default T1 link between R1 and R2.


11.3.1 - OSPF Metric
The diagram depicts how OSPF accumulates cost from R1 to the R2 LAN. The link from R1 to R2 is a T1 with 1.544 megabit per second bandwidth. The cost of this link is 64. The R2 link to its LAN is Fast Ethernet and is 100 million bits per second. The cost of this link is 1. The combined cost of the path from R1 to the R2 LAN is 65. The output of the show i p route command confirms this. The accumulated route cost from R2 to the R2 LAN is 65, as seen in the following output.

R1#show i p route
Codes: some code output omitted
D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area

output omitted
O 10.10.10.0/24 [110/65] via 192.168.10.2, 14:27:57, Serial0/0/0

The diagram is based on the network topology described in 11.2.4 diagram 3.


Page 3:
Default Bandwidth on Serial Interfaces

You may recall from Chapter 9, "EIGRP," that you can use the show interface command to view the bandwidth value used for an interface. On Cisco routers, the bandwidth value on many serial interfaces defaults to T1 (1.544 Mbps). However, some serial interfaces may default to 128 kbps. Therefore, never assume that OSPF is using any particular bandwidth value. Always check the default value with the show interface command.

Remember, this bandwidth value does not actually affect the speed of the link; it is used by some routing protocols to compute the routing metric. Most likely, on serial interfaces the actual speed of the link is different than the default bandwidth. It is important that the bandwidth value reflect the actual speed of the link so that the routing table has accurate best path information. For example, you may only be paying for a fractional T1 connection from your service provider, one fourth of a full T1 connection (384 kbps). However, for routing protocol purposes, the IOS assumes a T1 bandwidth value even though the interface is actually only sending and receiving one fourth of a full T1 connection (384 kbps).

The figure shows the output for the Serial 0/0/0 interface on R1. The topology also now reflects the actual bandwidth of the link between the routers. Notice that the default bandwidth value in the command output for R1 is 1544 kbps. However, the actual bandwidth of this link is 64 kbps. This means that the router has routing information that does not accurately reflect the network topology.

Click show ip route in the figure.

The figure displays the routing table for R1. R1 believes that both of its serial interfaces are connected to T1 links, although one of the links is a 64 kbps link and the other one is a 256 kbps link. This results in R1's routing table having two equal-cost paths to the 192.168.8.0/30 network, when Serial 0/0/1 is actually the better path.

O 192.168.10.8 [110/128] via 192.168.10.6, 00:03:41, Serial0/0/1
[110/128] via 192.168.10.2, 00:03:41, Serial0/0/0


Click show ip ospf interface in the figure.

The calculated OSPF cost of an interface can be verified with the show ip ospf interface command. In the figure, we can verify that R1 is indeed assigning a cost of 64 to the Serial 0/0/0 interface. Although you might think that this is the correct cost because this interface is attached to a 64 kbps link, remember that cost is derived from the cost formula. The cost of a 64 kbps link is 1562 (100,000,000/64,000). The value of 64 displayed corresponds to the cost of a T1 link. In the next topic, you will learn how to modify the cost of all the links in the topology.


11.3.1 - OSPF Metric
The diagram depicts differences between default and actual bandwidth. The diagram is based on the network topology described in 11.2.4 diagram 3, with the addition of WAN link bandwidth. The bandwidth for the link from R1 to R2 is 64 kbps. The bandwidth for the link from R2 to R3 is 128 kbps. The bandwidth for the link from R1 to R3 is 256 kbps.

The following output from the show interface serial 0/0/0 command on R1 is highlighted.

BW 1544 Kbit

This is the default bandwidth. The default bandwidth for serial0/0/1 is the same.

The following output from the show i p route command on R1 is highlighted. R1 assumes that the cost to 192.168.10.8 is equal through R2 or R3. This is the default bandwidth.

O 192.168.10.8 [110/128] via 192.168.10.6, 14:27:57, Serial0/0/1
[110/128] via 192.168.10.2, 14:27:57, Serial0/0/0

The following output from the show i p o s p f interface command on R1 is highlighted.

Cost: 64

The OSPF cost value of 64 is not the same as 64 kilobits per second. The OSPF cost value of a 64 kilobits per second link is 1562. The link from R1 to R2 is significantly slower than the link from R1 to R3, however, the default bandwidth value appears in both links as 1544 Kbit.


11.3.2 Modifying the Cost of the Link

Page 1:
When the serial interface is not actually operating at the default T1 speed, the interface requires manual modification. Both sides of the link should be configured to have the same value. Both the bandwidth interface command or the ip ospf cost interface command achieve this purpose - an accurate value for use by OSPF in determining the best route.

The bandwidth Command

The bandwidth command is used to modify the bandwidth value used by the IOS in calculating the OSPF cost metric. The interface command syntax is the same syntax that you learned in Chapter 9, "EIGRP":

Router(config-if)#bandwidth bandwidth-kbps

The figure shows the bandwidth commands used to modify the costs of all the serial interfaces in the topology. For R1, the show ip ospf interface command shows that the cost of the Serial 0/0/0 link is now 1562, the result of the Cisco OSPF cost calculation 100,000,000/64,000.


11.3.2 - Modifying the Cost of the Link
The diagram depicts using the bandwidth command to adjust the default serial link bandwidth to the proper value necessary for OSPF cost calculation. The diagram is based on the network topology described in 11.3.1 diagram 3.

Using the bandwidth 64 command on R1 S0/0/0 changes the cost in the output of the show i p o s p f interface command to 1562.

The bandwidth is changed on each router's interfaces to reflect the actual bandwidth of the link.


Page 2:
The ip ospf cost Command

An alternative method to using the bandwidth command is to use the ip ospf cost command, which allows you to directly specify the cost of an interface. For example, on R1 we could configure Serial 0/0/0 with the following command:

R1(config)#interface serial 0/0/0
R1(config-if)#ip ospf cost 1562


Obviously, this would not change the output of the show ip ospf interface command, which still shows the cost as 1562. This is the same cost calculated by the IOS when we configured the bandwidth as 64.


11.3.2 - Modifying the Cost of the Link
The diagram depicts using the i p o s p f cost command as an alternative method to using the bandwidth command. The i p o s p f cost command allows you to directly specify the cost of an interface.

The diagram is based on the network topology described in 11.3.1 diagram 3.

An example is shown for R1 S0/0/0.

R1(config)#interface serial 0/0/0
R1(config-i f)#i p o s p f cost 1562

No calculation is needed. The OSPF cost is set to 1562, regardless of bandwidth, as shown in the output of the show i p o s p f interface command.


Page 3:
The bandwidth Command vs. the ip ospf cost Command

The ip ospf cost command is useful in multi-vendor environments where non-Cisco routers use a metric other than bandwidth to calculate the OSPF costs. The main difference between the two commands is that the bandwidth command uses the result of the cost calculation to determine the cost of the link. The ip ospf cost command bypasses this calculation by directly setting the cost of the link to a specific value.

The figure shows the two alternatives that can be used in modifying the costs of the serial links in the topology. The right side of the figure shows the ip ospf cost command equivalents of the bandwidth commands on the left.


11.3.2 - Modifying the Cost of the Link
The diagram depicts the equivalent i p o s p f cost command for a given bandwidth command.

Bandwidth commands:

Router R1
R1(config)#interface serial 0/0/0
R1(config-i f)#bandwidth 64

R1(config)#interface serial 0/0/1
R1(config-i f)#bandwidth 256

Router R2
R2(config)#interface serial 0/0/0
R2(config-i f)#bandwidth 64

R2(config)#interface serial 0/0/1
R2(config-i f)#bandwidth 128

Router R3
R3(config)#interface serial 0/0/0
R3(config-i f)#bandwidth 256

R3(config)#interface serial 0/0/1
R3(config-i f)#bandwidth 128

i p o s p f cost commands:

Router R1
R1(config)#interface serial 0/0/0
R1(config-i f)#i p o s p f cost 1562

R1(config)#interface serial 0/0/1
R1(config-i f)#i p o s p f cost 390

Router R2
R2(config)#interface serial 0/0/0
R2(config-i f)#i p o s p f cost 1562

R2(config)#interface serial 0/0/1
R2(config-i f)#i p o s p f cost 781

Router R3
R3(config)#interface serial 0/0/0
R3(config-i f)#i p o s p f cost 390

R3(config)#interface serial 0/0/1
R3(config-i f)#i p o s p f cost 781


Page 4:
Use the Packet Tracer Activity to modify the cost values for OSPF.

Click the Packet Tracer icon for more details.


11.3.2 - Modifying the Cost of the Link
Link to Packet Tracer Exploration: Modifying the Cost of a Link

Use the Packet Tracer Activity to modify the cost values for OSPF.


11.4 OSPF and Multiaccess Networks

11.4.1 Challenges in Multiaccess Networks

Page 1:
A multiaccess network is a network with more than two devices on the same shared media. In the top portion of the figure, the Ethernet LAN attached to R1 is extended to show possible devices that might be attached to the 172.16.1.16/28 network. Ethernet LANs are an example of a broadcast multiaccess network. They are broadcast networks because all devices on the network see all broadcast frames. They are multiaccess networks because there may be numerous hosts, printers, routers, and other devices that are all members of the same network.

In contrast, on a point-to-point network there are only two devices on the network, one at each end. The WAN link between R1 and R3 is an example of a point-to-point link. The bottom portion of the figure shows the point-to-point link between R1 and R3.


11.4.1 - Challenges in Multi-access Networks
The diagram compares multi-access and point-to-point networks. A switched Ethernet LAN is shown as an example of a broadcast multi-access network. A WAN link between two routes is shown as an example of a point-to-point network.


Page 2:
OSPF defines five network types:
  • Point-to-point
  • Broadcast Multiaccess
  • Nonbroadcast Multiaccess (NBMA)
  • Point-to-multipoint
  • Virtual links
NBMA and point-to-multi-point networks include Frame Relay, ATM, and X.25 networks. NBMA networks are discussed in another CCNA course. Point-to-multipoint networks are discussed in CCNP. Virtual links are a special type of link that can be used in multi-area OSPF. OSPF virtual links are discussed in CCNP.

Click Play to view the animation.

The animation shows that the topology uses both point-to-point and broadcast networks.


11.4.1 - Challenges in Multi-access Networks
The animation depicts OSPF network types used in the chapter topology. The diagram is based on the network topology described in 11.3.1 diagram 3.

The WAN links between the three routers are identified as point-to-point networks, and the LAN's on each router are identified as broadcast networks.


Page 3:
Multiaccess networks can create two challenges for OSPF regarding the flooding of LSAs:

1. Creation of multiple adjacencies, one adjacency for every pair of routers.

2. Extensive flooding of LSAs (Link-State Advertisements).

Multiple Adjacencies

The creation of an adjacency between every pair of routers in a network would create an unnecessary number of adjacencies. This would lead to an excessive number of LSAs passing between routers on the same network.

To understand the problem with multiple adjacencies, we need to study a formula. For any number of routers (designated as n) on a multiaccess network, there will be n ( n - 1 ) / 2 adjacencies. The figure shows a simple topology of five routers, all of which are attached to the same multiaccess Ethernet network. Without some type of mechanism to reduce the number of adjacencies, collectively these routers would form 10 adjacencies: 5 ( 5 - 1 ) / 2 = 10. This may not seem like much, but as routers are added to the network, the number of adjacencies increases dramatically. Although the 5 routers in the figure will only need 10 adjacencies, you can see that 10 routers would require 45 adjacencies. Twenty routers would require 190 adjacencies!


11.4.1 - Challenges in Multi-access Networks
The diagram depicts how the number of adjacencies grows exponentially with the number of routers. For n number of routers, the number of adjacencies is calculated as n times (n minus 1) divided by 2. Examples are given for n number of routers and the number of adjacencies required.

The diagram is based on the following network topology.

Network Topology:
Five routers are connected to a central switch.

Example: 5 routers times (5 minus 1) divided by 2 = 10 adjacencies

Routers: 10
Adjacencies: 45

Routers: 20
Adjacencies: 190

Routers: 100
Adjacencies: 4,950


Page 4:
Flooding of LSAs

Remember from Chapter 10, "Link-State Routing Protocols," that link-state routers flood their link-state packets when OSPF is initialized or when there is a change in the topology.

Click Play to see the animation of a scenario of LSA flooding.

In a multiaccess network this flooding can become excessive. In the animation, R2 sends out an LSA. This event triggers every other router to also send out an LSA. Not shown in the animation are the required acknowledgements sent for every LSA received. If every router in a multiaccess network had to flood and acknowledge all received LSAs to all other routers on that same multiaccess network, the network traffic would become quite chaotic.

To illustrate this point, imagine that you are in a room with a large number of people. What if everyone had to introduce themselves individually to everyone else? Not only would each person have to tell everyone their name, but whenever one person learned another person's name, that person would then have to tell everyone else in the room, one person at a time. As you can see, this process leads to chaos!


11.4.1 - Challenges in Multi-access Networks
The animation depicts an LSA flooding scenario on a multi-access network. In the animation, R2 sends out an LSA to all other routers, R1, R3, R4, and R5. When the LSA is received, this event triggers R1, R3, R4, and R5 to send out an LSA to each router in the multi-access network.

The animation is based on the network topology described in 11.4.1 diagram 3.


Page 5:
Solution: Designated Router

The solution to managing the number of adjacencies and the flooding of LSAs on a multiaccess network is the Designated Router (DR). Continuing our previous example, this solution is analogous to electing someone in the room to go around and learn everyone's names and then announce these names to everyone in the room at once.

On multiaccess networks, OSPF elects a Designated Router (DR) to be the collection and distribution point for LSAs sent and received. A Backup Designated Router (BDR) is also elected in case the Designated Router fails. All other routers become DROthers (this indicates a router that is neither the DR or the BDR).

Click Play to see the animation of the role of DR.

Routers on a multiaccess network elect a DR and BDR. DROthers only form full adjacencies with the DR and BDR in the network. This means that instead of flooding LSAs to all routers in the network, DROthers only send their LSAs to the DR and BDR using the multicast address 224.0.0.6 (ALLDRouters - All DR routers). In the animation, R1 sends LSAs to the DR. The BDR listens as well. The DR is responsible for forwarding the LSAs from R1 to all other routers. The DR uses the multicast address 224.0.0.5 (AllSPFRouters - All OSPF routers). The end result is that there is only one router doing all of the flooding of all LSAs in the multiaccess network.


11.4.1 - Challenges in Multi-access Networks
The animation depicts a DR and BDR in a multi-access network. Adjacencies are formed with the DR and BDR only. Router R1 (router ID 10.1.1.1) sends out LSA's to the DR router R2 and the BDR, router R3. The DR forwards R1's LSA's to the other routers.

The animation is based on the network topology described in 11.4.1 diagram 3.


11.4.2 DR/BDR Election Process

Page 1:
Topology Change

DR/BDR elections do not occur in point-to-point networks. Therefore, in a standard three-router topology, R1, R2, and R3 do not need to elect a DR and BDR, because the links between these routers are not multiaccess networks.

Click Multiaccess Topology in the figure.

For the rest of the discussion on DR and BDR, we will use the multiaccess topology shown in the figure. The names of the routers are different, solely to emphasize that this topology is not the same three-router topology we have been using up to this point. We will return to our chapter topology after the discussion of the DR/BDR election process. In this new topology, we have three routers sharing a common Ethernet multiaccess network, 192.168.1.0/24. Each router is configured with an IP address on the Fast Ethernet interface and a loopback address for the router ID.


11.4.2 - DR/BDR Election Process
The diagram depicts a point-to-point, three-router topology and a three-router multi-access topology. In the point-to-point topology, the routers are communicating via WAN interfaces. In the multi-access topology, the routers are communicating via LAN interfaces.

The diagram is based on the following network topology.

Multi-access Network Topology:
Three routers are connected to a central switch.

RouterA FA0/0 IP address is 192.168.1.1/24
RouterA L o 0 IP address is 192.168.31.11/32

RouterB FA0/0 IP address is 192.168.1.2/24
RouterB L o 0 IP address is 192.168.31.22/32

RouterC FA0/0 IP address is 192.168.1.3/24
RouterC L o 0 IP address is 192.168.31.33/32


Page 2:
DR/BDR Election

How do the DR and BDR get elected? The following criteria are applied:

1. DR: Router with the highest OSPF interface priority.

2. BDR: Router with the second highest OSPF interface priority.

3. If OSPF interface priorities are equal, the highest router ID is used to break the tie.

In this example, the default OSPF interface priority is 1. As a result, based on the selection criteria listed above, the OSPF router ID is used to elect the DR and BDR. As you can see, RouterC becomes the DR and RouterB, with the second highest router ID, becomes the BDR. Because RouterA is not elected as either the DR or BDR, it becomes the DROther.

DROthers only form FULL adjacencies with the DR and BDR, but will still form a neighbor adjacency with any DROthers that join the network. This means that all DROther routers in the multiaccess network still receive Hello packets from all other DROther routers. In this way, they are aware of all routers in the network. When two DROther routers form a neighbor adjacency, the neighbor state is displayed as 2WAY. The different neighbor states are discussed in CCNP.

Click show ip ospf neighbor in the figure.

The command output in the figure displays the neighbor adjacency of each router on the multiaccess network. Notice for RouterA that it shows that the DR is RouterC with the router ID of 192.168.31.33 and that the BDR is RouterB with the router ID of 192.168.31.22.

Click show ip ospf interface in the figure.

Because RouterA shows both its neighbors as the DR and BDR, RouterA is a DROther. This can be verified using the show ip ospf interface fastethernet 0/0 command on RouterA, as shown in the figure. This command will show the DR, BDR, or DROTHER state of this router, along with the router ID of the DR and BDR on this multiaccess network.


11.4.2 - DR/BDR Election Process
The diagram depicts the output of the show i p o s p f neighbor command after an election has occurred in a multi-access topology network. The output of the show i p o s p f neighbor verifies that all interfaces have the same default priority value of 1. The router with the highest loopback interface IP address becomes the DR, and the second highest is the DBR.

The diagram is based on the network topology described in 11.4.2 diagram 1.

RouterC has the highest ID of 192.168.31.33 and becomes the DR. RouterB has the next highest ID of 192.168.31.22 and becomes the BDR. RouterA has the lowest ID of 192.168.31.11 and becomes a DROTHER.

The output of the show i p o s p f interface FA0/0 command on Router A verifies this.

State DROTHER,
Designated Router (ID) 192.168.31.33,
Backup Designated router (ID) 192.168.31.22,


Page 3:
Timing of DR/BDR Election

The DR and BDR election process takes place as soon as the first router with an OSPF enabled interface is active on the multiaccess network. This can happen when the routers are powered-on or when the OSPF network command for that interface is configured. The election process only takes a few seconds. If all of the routers on the multiaccess network have not finished booting, it is possible that a router with a lower router ID will become the DR. This could be a lower-end router that took less time to boot.

When the DR is elected, it remains the DR until one of the following conditions occurs:
  • The DR fails.
  • The OSPF process on the DR fails.
  • The multiaccess interface on the DR fails.
In the figure, a red X indicates one or more of these failures.

Click DR Fails in the figure.

If the DR fails, the BDR assumes the role of DR and an election is held to choose a new BDR. In the figure, RouterC fails and the former BDR, RouterB, becomes DR. The only other router available to be BDR is RouterA.

Click New Router in the figure.

RouterD joins the network. If a new router enters the network after the DR and BDR have been elected, it will not become the DR or the BDR even if it has a higher OSPF interface priority or router ID than the current DR or BDR. The new router can be elected the BDR if the current DR or BDR fails. If the current DR fails, the BDR will become the DR, and the new router can be elected the new BDR. After the new router becomes the BDR, if the DR fails, then the new router will become the DR. The current DR and BDR must both fail before the new router can be elected DR or BDR.

Click Old DR Returns in the figure.

A previous DR does not regain DR status if it returns to the network. In the figure, RouterC has finished a reboot and becomes a DROther even though its router ID, 192.168.31.33, is higher than the current DR and BDR.

Click BDR Fails in the figure.

If the BDR fails, an election is held among the DRothers to see which router will be the new BDR. In the figure, the BDR router fails. An election is held between RouterC and RouterD. RouterD wins the election with the higher router ID.

Click New DR Fails in the figure.

In the figure, RouterB fails. Because RouterD is the current BDR, it is promoted to DR. RouterC becomes the BDR.

So, how do you make sure that the routers you want to be DR and BDR win the election? Without further configurations, the solution is to either:
  • Boot up the DR first, followed by the BDR, and then boot all other routers, or
  • Shut down the interface on all routers, followed by a no shutdown on the DR, then the BDR, and then all other routers.
However, as you may have already guessed, we can change the OSPF interface priority to better control our DR/BDR elections.


11.4.2 - DR/BDR Election Process
The diagram depicts DR/BDR election scenarios. The diagram is based on the network topology described in 11.4.2 diagram 1, with Router D added.

RouterD FA0/0 IP address is 192.168.1.4/24
RouterD L o 0 IP address is 192.168.31.44/32

In the diagram, the DR RouterC fails, and RouterB becomes the DR. A new router is added with a higher ID. RouterB remains the DR, even when the new router is added. If the old DR returns, RouterB remains the DR, even when the former DR returns. If the BDR fails, the highest router ID among the DROTHERs becomes the new BDR. If both the DR and BDR fail, the highest router ID's become the new DR and BDR.


11.4.3 OSPF Interface Priority

Page 1:
Because the DR becomes the focal point for the collection and distribution of LSAs, it is important for this router to have sufficient CPU and memory capacity to handle the responsibility. Instead of relying on the router ID to decide which routers are elected the DR and BDR, it is better to control the election of these routers with the ip ospf priority interface command.

Router(config-if)#ip ospf priority {0 - 255}

In our previous discussion, the OSPF priority was equal. This is because the priority value defaults to 1 for all router interfaces. Therefore, router ID determined the DR and BDR. But if you change the default value from 1 to a higher value, the router with the highest priority will become the DR and the router with the next highest priority will become the BDR. A value of 0 makes the router ineligible to become a DR or BDR.

Because priorities are an interface-specific value, they provide better control of the OSPF multiaccess networks. They also allow a router to be the DR in one network and a DROther in another.

Click show ip ospf interface in the figure.

To simplify our discussion, we removed RouterD from the topology. The OSPF interface priority can be viewed using show ip ospf interface command. In the figure, we can verify that the priority on RouterA is at the default value of 1.

Click Modify Priority in the figure.

The figure shows the OSPF interface priorities of RouterA and RouterB modified so that RouterA with the highest priority becomes the DR and RouterB becomes the BDR. The OSPF interface priority of RouterC remains at the default value of 1.

Click Force Election in the figure.

After doing a shutdown and a no shutdown on the FastEthernet 0/0 interfaces of all three routers, we see the result of the change of OSPF interface priorities. The show ip ospf neighbor command on RouterC now shows that RouterA (Router ID 192.168.31.11) is the DR with the highest OSPF interface priority of 200 and that RouterB (Router ID 192.168.31.22) is still the BDR with the next highest OSPF interface priority of 100. Notice from RouterA's output of show ip ospf neighbor that it does not show a DR, because RouterA is the actual DR on this network.


11.4.3 - OSPF Interface Priority
The diagram depicts the process of changing the default OSPF interface priority of 1 to control which router is elected as the DR and BDR.

All routers currently show the default OSPF interface priority of 1. The following output from the show i p o s p f interface FA0/0 command on RouterA is highlighted.

Priority 1.

The following commands modify the priority so that RouterA becomes the DR, and RouterB becomes the BDR.

RouterA(config)#interface FA0/0
RouterA(config-i f)#i p o s p f priority 200

RouterB(config)#interface FA0/0
RouterB(config-i f)#i p o s p f priority 100

The commands force an election by shutting down the FA0/0 interface on all three routers so that the DR and BDR roles change.

The diagram is based on the network topology described in 11.4.2 diagram 1, with RouterD added.


Page 2:
Use this Packet Tracer Activity to examine current DR and BDR roles, watch the roles change, and then force new roles by changing priority.

Click the Packet Tracer icon for more details.


11.4.3 - OSPF Interface Priority
Link to Packet Tracer Exploration: Determining the DR and BDR

Use this Packet Tracer Activity to examine current DR and BDR roles, watch the roles change, and then force new roles by changing priority.


11.5 More OSPF Configuration

11.5.1 Redistributing an OSPF Default Route

Page 1:
Topology

Let's return to the earlier topology, which now includes a new link to ISP. As with RIP and EIGRP, the router connected to the Internet is used to propagate a default route to other routers in the OSPF routing domain. This router is sometimes called the edge, entrance or gateway router. However, in OSPF terminology, the router located between an OSPF routing domain and a non-OSPF network is called the Autonomous System Boundary Router (ASBR). In this topology, the Loopback1 (Lo1) represents a link to a non-OSPF network. We will not configure the 172.30.1.1/30 network as part of the OSPF routing process.

Click R1 Static Default Configuration in the figure.

The figure shows the ASBR (R1) configured with the Loopback1 IP address and static default route forwarding traffic toward the ISP router:

R1(config)#ip route 0.0.0.0 0.0.0.0 loopback 1

Note: The static default route is using the loopback as an exit interface because the ISP router in this topology does not physically exist. By using a loopback interface, we can simulate the connection to another router.

Like RIP, OSPF requires the use of the default-information originate command to advertise the 0.0.0.0/0 static default route to the other routers in the area. If the default-information originate command is not used, the default "quad-zero" route will not be propagated to other routers in the OSPF area.

The command syntax is:

R1(config-router)#default-information originate

Click R1, R2, and R3 in the figure.

R1, R2, and R3 now have a "gateway of last resort" set in the routing table. Notice the default route in R2 and R3 with the routing source OSPF, but with the additional code, E2. For R2, the route is:

O*E2 0.0.0.0/0 [110/1] via 192.168.10.10, 00:05:34, Serial0/0/1

E2 denotes that this route is an OSPF External Type 2 route.

OSPF external routes fall in one of two categories: External Type 1 (E1) or External Type 2 (E2). The difference between the two is in the way the OSPF cost of the route is calculated at each router. OSPF accumulates cost for an E1 route as the route is being propagated throughout the OSPF area. This process is identical to cost calculations for normal OSPF internal routes. However, the cost of an E2 route is always the external cost, irrespective of the interior cost to reach that route. In this topology, because the default route has an external cost of 1 on the R1 router, R2 and R3 also show a cost of 1 for the default E2 route. E2 routes at a cost of 1 are the default OSPF configuration. Changing these defaults, as well as more external route information, is discussed in CCNP.


11.5.1 - Redistributing an OSPF Default Route
The diagram depicts static default route configuration on the R1 edge router to provide access to the simulated ISP (Loopback 1 on R1) for the internal OSPF network routers. The following commands are used.

R1(config)#interface loopback 1
R1(config-i f)#i p address 172.30.1.1 255.255.255.252
R1(config-i f)#exit
R1(config)#i p route 0.0.0.0 0.0.0.0 loopback 1
R1(config)#router o s p f 1
R1(config-router)#default-information originate

The following output from the show i p router command on R1, R2, and R3 is highlighted.

R1 output:
Gateway of last resort is 0.0.0.0 to network 0.0.0.0

R2: output:
Gateway of last resort is 192.168.10.10 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 192.168.10.10, 00:05:34, Serial0/0/1

R3 output:
Gateway of last resort is 192.168.10.5 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 192.168.10.5, 00:05:34, Serial0/0/0

The diagram is based on the network topology described in 11.2.4 diagram 3, except a simulated ISP router is present that is represented by the logical interface Loopback 1 (L o 1) on R1.


11.5.2 Fine-tuning OSPF

Page 1:
Reference Bandwidth

As you remember, Cisco OSPF cost uses accumulated bandwidth. The bandwidth value of each interface is calculated using 100,000,000/bandwidth. 100,000,000 or 10 to the 8th is known as the reference bandwidth.

Therefore, 100,000,000 is the default bandwidth referenced when the actual bandwidth is converted into a cost metric. As you know from previous studies, we now have link speeds that are much faster than Fast Ethernet speeds, including Gigabit Ethernet and 10GigE. Using a reference bandwidth of 100,000,000 results in interfaces with bandwidth values of 100 Mbps and higher having the same OSPF cost of 1.

In order to obtain more accurate cost calculations, it may be necessary to adjust the reference bandwidth value. The reference bandwidth can be modified to accommodate these faster links by using the OSPF command auto-cost reference-bandwidth. When this command is necessary, use it on all routers so that the OSPF routing metric remains consistent.

R1(config-router)#auto-cost reference-bandwidth ?
1-4294967 The reference bandwidth in terms of Mbits per second


Notice that the value is expressed in Mbps. Therefore, the default value is equivalent to 100. To increase it to 10GigE speeds, you would need to change the reference bandwidth to 10000.

R1(config-router)#auto-cost reference-bandwidth 10000

Again, make sure you configure this command on all routers in the OSPF routing domain. The IOS may also remind you, as shown in the figure.

Click R1 Before and R1 After in the figure.

The routing table for R1 shows the change in the OSPF cost metric. Notice that the values are much larger cost values for OSPF routes. For example, in R1 Before, the cost to 10.10.10.0/24 is 1172. After configuring a new reference bandwidth, the cost for the same route is now 117287.


11.5.2 - Fine-tuning OSPF
The diagram depicts adjusting the reference bandwidth value to accommodate links that are faster than Fast Ethernet (100,000,000 bits per second). The OSPF auto-cost reference-bandwidth command accomplishes this.

R1(config-i f)#router o s p f 1
R1(config-router)#auto-cost reference-bandwidth ?
1-429467 The reference bandwidth in terms of Mbits per second

R1(config-router)#auto-cost reference-bandwidth 10000
% OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers

The routing table for R1 shows the change in the OSPF cost metric. The values are much larger cost values for OSPF routes. For example, in the output for R1 before, the cost to 10.10.10.0/24 was 1172. After configuring a new reference bandwidth, the cost for the same route is now 117287.

The diagram is based on the network topology described in 11.5.1 diagram 1.


Page 2:
Modifying OSPF Intervals

Click R1 Neighbors 1 in the figure.

The show ip ospf neighbor command on R1 verifies that R1 is adjacent to R2 and R3. Notice in the output that the Dead Time is counting down from 40 seconds. By default, this value is refreshed every 10 seconds when R1 receives a Hello from the neighbor.

It may be desirable to change the OSPF timers so that routers will detect network failures in less time. Doing this will increase traffic, but sometimes there is a need for quick convergence that outweighs the extra traffic.

OSPF Hello and Dead intervals can be modified manually using the following interface commands:

Router(config-if)#ip ospf hello-interval seconds
Router(config-if)#ip ospf dead-interval seconds


Click Modify R1 Timers in the figure.

The figure shows the Hello and Dead intervals modified to 5 seconds and 20 seconds, respectively, on the Serial 0/0/0 interface for R1. Immediately after changing the Hello interval, Cisco IOS automatically modifies the Dead interval to four times the Hello interval. However, it is always good practice to explicitly modify the timer instead of relying on an automatic IOS feature so that modifications are documented in the configuration.

After 20 seconds, the Dead Timer on R1 expires. R1 and R2 lose adjacency. We only modified the values on one side of the serial link between R1 and R2.

%OSPF-5-ADJCHG: Process 1, Nbr 10.2.2.2 on Serial0/0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

Click R1 Neighbors 2 in the figure.

Remember, OSPF Hello and Dead intervals must be equivalent between neighbors. You can verify the loss of adjacency with the show ip ospf neighbor command on R1. Notice that the 10.2.2.2 neighbor is no longer present. However, 10.3.3.3 or R3 is still a neighbor. The timers set on Serial 0/0/0 do not affect the neighbor adjacency with R3.

Click R2 Timers in the figure.

The mismatching Hello and Dead intervals can be verified on R2 using show ip ospf interface serial 0/0/0 command. The interval values on R2, Router ID 10.2.2.2, are still set with a Hello interval of 10 seconds and Dead interval of 40 seconds.

Click Modify R2 Timers in the figure.

To restore adjacency between R1 and R2, modify the Hello and Dead intervals on the Serial 0/0/0 interface on R2 to match the intervals on the Serial 0/0/0 interface on R1. The IOS displays a message that adjacency has been established with a state of FULL.

14:22:27: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.1 on Serial0/0 from LOADING to FULL, Loading Done

Click R1 Neighbors 3 in the figure.

Verify that neighbor adjacency is restored with the show ip ospf neighbor command on R1. Notice that the Dead Time for Serial 0/0/0 is now much lower because it is counting down from 20 seconds instead of the default 40 seconds. Serial 0/0/1 is still operating with default timers.

Note: OSPF requires that the Hello and Dead intervals match between two routers for them to become adjacent. This differs from EIGRP where the Hello and Holddown timers do not need to match for two routers to form an EIGRP adjacency.



11.5.2 - Fine-tuning OSPF
The diagram depicts modifying the OSPF timers, hello interval and dead interval. This is the initial output from the show i p o s p f neighbor command.

R1#show i p o s p f neighbor

Neighbor ID: 10.3.3.3
Priority: 0
State: FULL/
Dead Time: 00:00:35
Address: 192.168.10.6
Interface: Serial0/0/1

Neighbor ID: 10.2.2.2
Priority: 0
State: FULL/
Dead Time: 00:00:36
Address: 192.168.10.2
Interface: Serial0/0/0

Modify R1 Timers:
R1(config)#interface serial 0/0/0
R1(config-i f)#i p o s p f hello-interval 5
R1(config-i f)#i p o s p f dead-interval 20
R1(config-i f)#end

Wait 20 seconds for I O S message

% OSPF-5-ADJCHG: Process 1, Nbr. 10.2.2.2 on Serial0/0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

R1 and R2 lose adjacency. The OSPF hello and dead intervals must be equivalent between neighbors. When the OSPF hello and dead intervals on R2 are set to match those on R1, they reestablish adjacency.

The diagram is based on the network topology described in 11.5.1 diagram 1.


Page 3:
Use the Packet Tracer Activity to configure a default route and propagate it within the OSPF routing process. Also, practice changing the reference bandwidth as well as the Hello and Dead intervals.

Click the Packet Tracer icon for more details.


11.5.2 - Fine-tuning OSPF
Link to Packet Tracer Exploration: Default Routing and Fine-tuning OSPF

Use the Packet Tracer Activity to configure a default route and propagate it within the OSPF routing process. Also, practice changing the reference bandwidth as well as the hello and dead intervals.


11.6 OSPF Configuration Labs

11.6.1 Basic OSPF Configuration Lab

Page 1:
In this lab activity, there are two separate scenarios. In the first scenario, you will learn how to configure the routing protocol OSPF using the network shown in the Topology Diagram in Scenario A. The segments of the network have been subnetted using VLSM. OSPF is a classless routing protocol that can be used to provide subnet mask information in the routing updates. This will allow VLSM subnet information to be propagated throughout the network.

In the second scenario, you will learn to configure OSPF on a multi-access network. You will also learn to use the OSPF election process to determine the designated router (DR), backup designated router (BDR), and DRother states.

Click the lab icon for more details.


11.6.1 - Basic OSPF Configuration Lab
Link to Hands-on Lab: Basic OSPF Configuration Lab

This lab activity has two separate scenarios. In the first scenario, you learn how to configure the routing protocol OSPF using the network shown in the topology diagram in Scenario A. The segments of the network have been subnetted using VLSM. OSPF is a classless routing protocol that can be used to provide subnet mask information in the routing updates. This allows VLSM subnet information to be propagated throughout the network.

In the second scenario, you learn to configure OSPF on a multi-access network. You also learn to use the OSPF election process to determine the designated router (DR), backup designated router (BDR), and DRother states.


Page 2:
Use this Packet Tracer Activity to repeat a simulation of Lab 11.6.1. Remember, however, that Packet Tracer is not a substitute for a hands-on lab experience with real equipment.

A summary of the instructions is provided within the activity. Use the Lab PDF for more details.

Clicking the Packet Tracer icon will launch Scenario A. All scenarios for this simulation of the hands-on lab can be launched from the links below.

Scenario A

Scenario B

Click the Packet Tracer icon for more details.


11.6.1 - Basic OSPF Configuration Lab
Link to Packet Tracer Exploration: Basic OSPF Configuration Lab

Use this Packet Tracer Activity to repeat a simulation of Lab 11.6.1


11.6.2 Challenge OSPF Configuration Lab

Page 1:
In this lab activity, you will be given a network address that must be subnetted using VLSM to complete the addressing of the network shown in the Topology Diagram. A combination OSPF routing and static routing will be required so that hosts on networks that are not directly connected will be able to communicate with each other. OSPF area ID of 0 and process ID of 1 will be used in all OSPF configurations.

Click the lab icon for more details.


11.6.2 - Challenge OSPF Configuration Lab
Link to Hands-on Lab: Challenge OSPF Configuration Lab

In this lab activity, you are given a network address that must be subnetted using VLSM to complete the addressing of the network shown in the topology diagram. A combination of OSPF routing and static routing is required so that hosts on the networks that are not directly connected can communicate with each other. OSPF area ID 0 and process ID 1 are used in all OSPF configurations.


Page 2:
Use this Packet Tracer Activity to repeat a simulation of Lab 11.6.2. Remember, however, that Packet Tracer is not a substitute for a hands-on lab experience with real equipment.

A summary of the instructions is provided within the activity. Use the Lab PDF for more details.

Click the Packet Tracer icon for more details.


11.6.2 - Challenge OSPF Configuration Lab
Link to Packet Tracer Exploration: Challenge OSPF Configuration Lab

Use this Packet Tracer Activity to repeat a simulation of Lab 11.6.2


11.6.3 Troubleshooting OSPF Configuration Lab

Page 1:
In this lab, you will begin by loading configuration scripts on each of the routers. These scripts contain errors that will prevent end-to-end communication across the network.

You will need to troubleshoot each router to determine the configuration errors, and then use the appropriate commands to correct the configurations.

When you have corrected all of the configuration errors, all of the hosts on the network should be able to communicate with each other.

Click the lab icon for more details.


11.6.3 - Troubleshooting the OSPF Configuration Lab
Link to Hands-on Lab: OSPF Troubleshooting Lab

In this lab, you begin by loading configuration scripts on each of the routers. These scripts contain errors that prevent end-to-end communication across the network.

You need to troubleshoot each router to determine the configuration errors, and then use the appropriate commands to correct the configurations.

When you have corrected all the configuration errors, all hosts on the network should be able to communicate with each other.


Page 2:
Use this Packet Tracer Activity to repeat a simulation of Lab 11.6.3. Remember, however, that Packet Tracer is not a substitute for a hands-on lab experience with real equipment.

A summary of the instructions is provided within the activity. Use the Lab PDF for more details.

Click the Packet Tracer icon for more details.


11.6.3 - Troubleshooting the OSPF Configuration Lab
Link to Packet Tracer Exploration: OSPF Troubleshooting Lab

Use this Packet Tracer Activity to repeat a simulation of Lab 11.6.3


11.7 Chapter Summary

11.7.1 Summary and Review

Page 1:
Summary

OSPF (Open Shortest Path First) is a classless, link-state routing protocol. The current version of OSPF for IPv4 is OSPFv2 introduced in RFC 1247 and updated in RFC 2328 by John Moy. In 1999, OSPFv3 for IPv6 was published in RFC 2740.

OSPF has a default administrative distance of 110, and is denoted in the routing table with a route source code of O. OSPF is enabled with the router ospf process-id global configuration command. The process-id is locally significant, which means that it does not have to match other OSPF routers in order to establish adjacencies with those neighbors.

The network command used with OSPF has the same function as when used with other IGP routing protocols, but with slightly different syntax.

Router(config-router)#network network-address wildcard-mask area area-id

The wildcard-mask is the inverse of the subnet mask, and the area-id should be set to 0.

OSPF does not use a Transport layer protocol, as OSPF packets are sent directly over IP. The OSPF Hello packet is used by OSPF to establish neighbor adjacencies. By default, OSPF Hello packets are sent every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on non-broadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM). The Dead interval is the period of time an OSPF router will wait before terminating adjacency with a neighbor. The Dead interval is four times the Hello interval, by default. For multiaccess and point-to-point segments, this period is 40 seconds. For NBMA networks, the Dead interval is 120 seconds.

For routers to become adjacent, their Hello interval, Dead interval, network types and subnet masks must match. The show ip ospf neighbors command can be used to verify OSPF adjacencies.

The OSPF router ID is used to uniquely identify each router in the OSPF routing domain. Cisco routers derive the router ID based on three criteria and with the following precedence:

1. Use the IP address configured with the OSPF router-id command.

2. If the router-id is not configured, the router chooses highest IP address of any of its loopback interfaces.

3. If no loopback interfaces are configured, the router chooses highest active IP address of any of its physical interfaces.

RFC 2328 does not specify which values should be used to determine the cost. Cisco IOS uses the cumulative bandwidths of the outgoing interfaces from the router to the destination network as the cost value.

Multiaccess networks can create two challenges for OSPF regarding the flooding of LSAs, including the creation of multiple adjacencies - one adjacency for every pair of routers, and extensive flooding of LSAs (Link-State Advertisements). OSPF elects a DR (Designated Router) to act as collection and distribution point for LSAs sent and received in the multiaccess network. A BDR (Backup Designated Router) is elected to take over the role of the DR should the DR fail. All other routers are known as DROthers. All routers send their LSAs to the DR, which then floods the LSA to all other routers in the multiaccess network.

The router with the highest router ID is the DR, and the router with the second highest router ID is the BDR. This can be superseded by the ip ospf priority command on that interface. By default, the ip ospf priority is "1" on all multiaccess interfaces. If a router is configured with a new priority value, the router with the highest priority value is the DR, and next-highest the BDR. A priority value of "0" means the router is ineligible to become the DR or BDR.

A default route is propagated in OSPF similar to that of RIP. The OSPF router mode command, default-information originate is used to propagate a static default route.

The show ip protocols command is used to verify important OSPF configuration information, including the OSPF process ID, the router ID and the networks the router is advertising.


11.7.1 - Summary and Review
In this chapter, you learned to:
- Describe the background and basic features of OSPF.
- Identify and apply the basic OSPF configuration commands.
- Describe, modify, and calculate the metric used by OSPF.
- Describe the designated router and backup designated router (DR/BDR) election process in multi-access networks.
- Employ the default-information originate command to configure and propagate a default route in OSPF.


Page 2:


11.7.1 - Summary and Review
This is a review and is not a quiz. Questions and answers are provided.
Question 1. In the router o s p f command, does the process ID need to match on all routers?
Answer: No, unlike EIGRP, the OSPF is locally significant and does not need to match other OSPF routers.

Question 2. Given the following configuration, what is the OSPF router ID of RouterA?

RouterA(config)#interface serial 0/0/0
RouterA(config-i f)#i p address 192.168.2.1 255.255.255.252
RouterA(config)#interface loopback 0
RouterA(config-i f)#i p address 10.1.1.1 255.255.255.255
RouterA(config)#router o s p f 1
RouterA(config-i f)#network 192.168.2.0 0.0.0.3 area 0

Answer: The OSPF router ID is 10.1.1.1, the highest loopback address in the absence of the OSPF router-i d command.

Question 3. What command can be used to verify or determine the bandwidth value of an interface used by the OSPF metric?
Answer: show interface

Question 4. What command can be used to modify the OSPF cost of an interface without modifying the bandwidth value of that interface?
Answer: The interface command, i p o s p f cost.

Question 5. What is the default hello interval on Ethernet networks and serial point-to-point networks? What is the default hello interval on non-broadcast multi-access (NBMA) networks?
Answer: By default, OSPF Hello packets are sent every 10 seconds on multi-access and point-to-point segments, and every 30 seconds on NBMA segments (Frame Relay, X.25, ATM).

Question 6. What values must match before two routers form an OSPF adjacency?
Answer:
- Hello interval
- Dead interval
- Network Type
- Subnet masks

Question 7. What problems does electing a DR and BDR solve?
Answer: Creation of multiple adjacencies, one adjacency of every pair of routers. Extensive flooding of LSA's (Link-State Advertisements).

Question 8. How are the DR and BDR elected?
Answer: The DR is the router with the highest OSPF interface priority, and the BDR has the second highest OSPF interface priority. If the OSPF interface priorities are equal, the highest router ID is used to break the tie.

Question 9. When the DR fails, how is the new DR determined?
Answer: The BDR becomes the new DR, and an election takes place for a new BDR.

Question 10. What happens when a router with a higher OSPF interface priority is added to a network that already has a DR and BDR?
Answer: Nothing. The DR and BDR only lose their role if the router or the multi-access interface fails.

Question 11. What significance does an OSPF interface priority of 0 have?
Answer: This router's interface is ineligible to become a DR or BDR.

Question 12. What command must be used to propagate a default route using OSPF?
Answer: The OSPF command default-information originate.


Page 3:
The Packet Tracer Skills Integration Challenge Activity integrates all the knowledge and skills you acquired in previous chapters of this course and prior courses. Skills related to this chapter's discussion of OSPF are also included.

In this activity, you build a network from the ground up. Starting with an addressing space and network requirements, you must implement a network design that satisfies the specifications. Next, you implement an effective OSPF routing configuration with integrated default routing. Detailed instructions are provided within the activity.

Packet Tracer Skills Integration Instructions (PDF)

Click the Packet Tracer icon for more details.


11.7.1 - Summary and Review
Link to Packet Tracer Exploration: Chapter 11 - Packet Tracer Skills Integration Challenge

The Packet Tracer Skills Integration Challenge Activity integrates all the knowledge and skills you acquired in previous chapters of this course and prior courses. Skills related to this chapter's discussion of OSPF are also included.

In this activity, you build a network from the ground up. Starting with an addressing space and network requirements, you must implement a network design that satisfies the specifications. Next, you implement an effective OSPF routing configuration with integrated default routing. Detailed instructions are provided within the activity.


Page 4:
To Learn More
RFC 2328 OSPF version 2

RFCs (Request for Comments) are a series of documents submitted to the IETF (Internet Engineering Task Force) to propose an Internet standard or convey new concepts, information or even occasionally even humor. RFC 2328 is the current RFC for OSPFv2.

RFCs can be accessed from several web sites including www.ietf.org. Read all or parts of RFC OSPF to learn more about this classless, link-state routing protocol.

Multi-area OSPF

Some of the real advantages of OSPF especially in large networks can be seen with multi-area OSPF. Multi-area OSPF is discussed in CCNP, but you may be interested in looking at some of these new concepts now.

Here are some suggested resources:
  • Routing TCP/IP, Volume I, by Jeff Doyle and Jennifer Carroll
  • OSPF, Anatomy of an Internet Routing Protocol, by John Moy


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


11.8 Chapter Quiz

11.8.1 Chapter Quiz

Page 1:


11.8.1 - Chapter Quiz
1. Which three statements are true regarding routing protocols that use the link-state routing algorithm? (Choose three.)
A. They are known collectively as SPF protocols.
B. They learn routes and send them to directly connected neighbors.
C. They maintain a complex database of the network topology.
D. They are based on the Dijkstra algorithm.
E. They are considered a good choice for small networks with low-end routers.

2. Match the OSPF term with the appropriate description. Not all options are used.
Terms:
1. LSA exchange
2. state of a link
3. SPF algorithm
4. topological database
5. hello packet

Descriptions:
A. creates and maintains neighbor adjacencies
B. triggered when a topology change has occurred
C. description of an interface and its relationship to other routers
D. calculates the best path to each destination network

3. Why would a network administrator use loopback interfaces when configuring OSPF? (Choose two.)
A. Loopbacks are logical interfaces and do not go down.
B. Only loopback addresses can be used for an OSPF router ID.
C. Loopback interfaces are used to set the OSPF metric.
D. The loopback address is used as the router ID, overriding the local IP address values.
E. OSPF error-checking is enabled by loopback addresses.
F. The loopback address overrides the configured router priority value.

4. In which two types of networks are OSPF designated routers not elected? (Choose two.)
A. point-to-point
B. point-to-multipoint
C. broadcast multi-access
D. nonbroadcast multi-access

5. A network administrator enters the router o s p f 100 command. What is the function of the number 100 in this command?
A. autonomous system number
B. metric
C. process ID
D. administrative distance

6. On a router running OSPF, what is the purpose of entering the bandwidth 56 command on a serial interface?
A. changes the cost value
B. functions only as a description
C. changes the throughput of the interface to 56kbps
D. necessary for the DUAL algorithm

7. What factor does Cisco's implementation of OSPF use to pick the best route?
A. uptime
B. reliability
C. bandwidth
D. load
E. shortest number of hops

8. Which command allows a router to advertise default static routes via OSPF?
A. redistribute static
B. network 0.0.0.0 0.0.0.0 area 0
C. default-information originate
D. Default routes are local only and cannot be advertised using OSPF.

9. During an OSPF DR/BDR election, what is used to determine the DR or BDR when participating OSPF routers have identical interface priorities?
A. highest OSPF process ID
B. lowest interface IP address
C. lowest interface cost
D. router ID

10. Which packet type is invalid for OSPF?
A. Hello
B. LRU
C. LSR
D. LSAck
E. DBD

0 comments:

Post a Comment