More Books
Routing TCP IP Volume I CCIE Professional Development
Routing TCP/IP, Volume I (CCIE Professional Development)
Table of Contents
Copyright
About the Author
About the Reviewers
Introduction
Objectives
Audience
Organization
Conventions and Features
Foreword
Part I: Routing Basics
Chapter 1. Basic Concepts: Internetworks, Routers, and Addresses
Bicycles with Motors
Data Link Addresses
Repeaters and Bridges
Routers
Network Addresses
Looking Ahead
Recommended Reading
Review Questions
Chapter 2. TCP/IP Review
The TCP/IP Protocol Layers
The IP Packet Header
IP Addresses
ARP
ICMP
The Host-to-Host Layer
Looking Ahead
Summary Table: Chapter 2 Command Review
Recommended Reading
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 3. Static Routing
The Route Table
Configuring Static Routes
Troubleshooting Static Routes
Looking Ahead
Summary Table:Chapter 3 Command Review
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 4. Dynamic Routing Protocols
Routing Protocol Basics
Distance Vector Routing Protocols
Link State Routing Protocols
Interior and Exterior Gateway Protocols
Static or Dynamic Routing?
Looking Ahead
Recommended Reading
Review Questions
Part II: Interior Routing Protocols
Chapter 5. Routing Information Protocol (RIP)
Operation of RIP
Configuring RIP
Troubleshooting RIP
Looking Ahead
Summary Table: Chapter 5 Command Review.
Recommended Reading
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 6. Interior Gateway Routing Protocol (IGRP)
Operation of IGRP
Configuring IGRP
Troubleshooting IGRP
Looking Ahead
Summary Table: Chapter 6 Command Review
Recommended Reading
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 7. Routing Information Protocol Version 2
Operation of RIPv2
Configuring RIPv2
Troubleshooting RIPv2
Looking Ahead
Summary Table:Chapter 7 Command Review
Recommended Reading
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 8. Enhanced Interior Gateway Routing Protocol (EIGRP)
Figure 8.1. The four major components of EIGRP. RTP and neighbor discovery are lower-level protocols that enable the correct operation of DUAL. DUAL can perform route computations for multiple routed protocols.
Configuring EIGRP
Troubleshooting EIGRP
Looking Ahead
Summary Table:Chapter 8 Command Review
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 9. Open Shortest Path First
Neighbors and Adjacencies
Configuring OSPF
Troubleshooting OSPF
Looking Ahead
Summary Table: Chapter 9 Command Review
Recommended Reading
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 10. Integrated IS-IS
Operation of Integrated IS-IS
Configuring Integrated IS-IS
Troubleshooting Integrated IS-IS
Looking Ahead
Summary Table: Chapter 10 Command Review
Review Questions
Configuration Exercises
Troubleshooting Exercises
Part III: Route Control and Interoperability
Chapter 11. Route Redistribution
Principles of Redistribution
Configuring Redistribution
Looking Ahead
Summary Table: Chapter 11 Command Review
Review Questions
Configuration Exercises
Troubleshooting Exercises
Chapter 12. Default Routes and On-Demand Routing
Fundamentals of Default Routes
Fundamentals of On-Demand Routing
Configuring Default Routes and ODR
Looking Ahead
Summary Table: Chapter 12 Command Review
Review Questions
Chapter 13. Route Filtering
Configuring Route Filters
Looking Ahead
Summary Table: Chapter 13 Command Review
Configuration Exercises
Troubleshooting Exercises
Chapter 14. Route Maps
Basic Uses of Route Maps
Configuring Route Maps
Looking Ahead
Summary Table: Chapter 14 Command Review
Review Questions
Configuration Exercises
Troubleshooting Exercises
Part IV: Appendixes
Appendix A. Tutorial: Working with Binary and Hex
Working with Binary Numbers
Working with Hexadecimal Numbers
Appendix B. Tutorial: Access Lists
Access List Basics
Standard IP Access Lists
Extended IP Access Lists
Calling the Access List
Keyword Alternatives
Named Access Lists
Filter Placement Considerations
Access List Monitoring and Accounting
Appendix C. CCIE Preparation Tips
Laying the Foundations
Hands-On Experience
Intensifying the Study
The Final Six Months
Exam Day
Appendix D. Answers to Review Questions
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 14
Appendix E. Solutions to Configuration Problems
Chapter 2
Chapter 3
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 13
Chapter 14
Appendix F. Solutions to Troubleshooting Exercises
Chapter 2
Chapter 3
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 13
Chapter 14
Index
index_SYMBOL
index_A
index_B
index_C
index_D
index_E
index_F
index_G
index_H
index_I
index_K
index_L
index_M
index_N
index_O
index_P
index_Q
index_R
index_S
index_T
index_U
index_V
index_W
index_Z
 

Operation of OSPF[3]

[3] Because of the interrelationship of OSPF terms and concepts, this chapter frequently uses terms before they are fully defined. The reader is advised to read this section more than once to ensure a complete understanding of OSPF operation. It will also be useful to review the section "Link State Routing Protocols" in Chapter 4, "Dynamic Routing Protocols."

At a very high level, the operation of OSPF is easily explained:

  1. OSPF-speaking routers send Hello packets out all OSPF-enabled interfaces. If two routers sharing a common data link agree on certain parameters specified in their respective Hello packets, they will become neighbors.

  2. Adjacencies, which may be thought of as virtual point-to-point links, are formed between some neighbors. OSPF defines several network types and several router types. The establishment of an adjacency is determined by the types of routers exchanging Hellos and the type of network over which the Hellos are exchanged.

  3. Each router sends link state advertisements (LSAs) over all adjacencies. The LSAs describe all of the router's links, or interfaces, and the state of the links. These links may be to stub networks (networks with no other router attached), to other OSPF routers, to networks in other areas, or to external networks (networks learned from another routing process). Because of the varying types of link state information, OSPF defines multiple LSA types.

  4. Each router receiving an LSA from a neighbor records the LSA in its link state database and sends a copy of the LSA to all of its other neighbors.

  5. By flooding LSAs throughout an area, all routers will build identical link state databases.

  6. When the databases are complete, each router uses the SPF algorithm to calculate a loop-free graph describing the shortest (lowest cost) path to every known destination, with itself as the root. This graph is the SPF tree.

  7. Each router builds its route table from its SPF tree.[4]

    [4] This fundamental procedure of calculating routes from the link state database, rather than by exchanging routes with neighbors, has repercussions for route filtering. See Chapter 13, "Route Filtering," for more information.

When all link state information has been flooded to all routers in an area—that is, the link state databases have been synchronized—and the route tables have been built, OSPF is a quiet protocol. Hello packets are exchanged between neighbors as keepalives, and LSAs are retransmitted every 30 minutes. If the internetwork topology is stable, no other activity should occur.

Neighbors and Adjacencies

Before any LSAs can be sent, OSPF routers must discover their neighbors and establish adjacencies. The neighbors will be recorded in a neighbor table, along with the link (interface) on which each neighbor is located and other information necessary for the maintenance of the neighbor (Figure 9.1).

Figure 9-1. The neighbor table records all OSPF-speaking neighbors.

graphics/09fig01.gif

The tracking of other OSPF routers requires that each router have a R outer ID, an IP address by which the router is uniquely identified within the OSPF domain. Cisco routers derive their Router IDs by the following means:

Note

Router ID


  1. The router chooses the numerically highest IP address on any of its loopback interfaces.

  2. If no loopback interfaces are configured with IP addresses, the router chooses the numerically highest IP address on any of its physical interfaces. The interface from which the Router ID is taken does not have to be running OSPF.

Using addresses associated with loopback interfaces has two advantages:

  • The loopback interface is more stable than any physical interface. It is active when the router boots up, and it only fails if the entire router fails.

  • The network administrator has more leeway in assigning predictable or recognizable addresses as the Router IDs.

Cisco's OSPF will continue to use a Router ID learned from a physical interface even if the interface subsequently fails or is deleted (see "Case Study: Setting Router IDs with Loopback Interfaces," later in this chapter). Therefore, the stability of a loopback interface is only a minor advantage. The primary benefit is the ability to control the Router ID.

The OSPF router begins a neighbor relationship by advertising its Router ID in Hello packets.

The Hello Protocol

The Hello protocol serves several purposes:

  • It is the means by which neighbors are discovered.

  • It advertises several parameters on which two routers must agree before they can become neighbors.

  • Hello packets act as keepalives between neighbors.

  • It ensures bi-directional communication between neighbors.

  • It elects Designated Routers (DRs) and Backup Designated Routers (BDRs) on Broadcast and Nonbroadcast Multiaccess (NBMA) networks.

OSPF-speaking routers periodically send a Hello packet out each OSPF-enabled interface. This period is known as the HelloInterval and is configured on a per interface basis. Cisco uses a default HelloInterval of 10 seconds;[5] the value can be changed with the command ip ospf hello-interval. If a router has not heard a Hello from a neighbor within a period of time known as the RouterDeadInterval, it will declare the neighbor down. Cisco's default RouterDeadInterval is four times the HelloInterval and can be changed with the command ip ospf dead-interval.[6]

[5] The default is 30 seconds on NBMA interfaces.

[6] RFC 2328 does not set a required value for either the HelloInterval or the RouterDeadInterval, although it does suggest respective values of 10 seconds and 4X HelloInterval.

Each Hello packet contains the following information:

  • The Router ID of the originating router

  • The Area ID of the originating router interface

  • The address mask of the originating interface

  • The authentication type and authentication information for the originating interface

  • The HelloInterval of the originating interface

  • The RouterDeadInterval of the originating interface

  • The Router Priority

  • The DR and BDR

  • Five flag bits signifying optional capabilities

  • The Router IDs of the originating router's neighbors. This list contains only routers from which Hellos were heard on the originating interface within the last RouterDeadInterval.

This section overviews the meaning and use of most of the information listed. Subsequent sections discuss the DR, BDR, and Router Priority and illustrate the precise format of the Hello packet. When a router receives a Hello from a neighbor, it will verify that the Area ID, Authentication, Network Mask, HelloInterval, RouterDeadInterval, and Options values match the values configured on the receiving interface. If they do not, the packet is dropped and no adjacency is established.

If everything matches, the Hello packet is declared valid. If the ID of the originating router is already listed in the neighbor table for that receiving interface, the RouterDeadInterval timer is reset. If the Router ID is not listed, it is added to the neighbor table.

Whenever a router sends a Hello, it includes in the packet the Router IDs of all neighbors listed for the link on which the packet is to be transmitted. If a router receives a valid Hello in which it finds its own Router ID listed, the router knows that two-way communication has been established.

Once two-way communication has been established, adjacencies may be established. However, as mentioned earlier, not all neighbors will become adjacent. Whether an adjacency is formed or not depends on the type of network to which the two neighbors are attached. Network types also influence the way in which OSPF packets are transmitted; therefore, before discussing adjacencies, it is necessary to discuss network types.

Network Types

OSPF defines five network types:

  1. Point-to-point networks

  2. Broadcast networks

  3. Non-broadcast Multi-access (NBMA) networks

  4. Point-to-multipoint networks

  5. Virtual links

Point-to-point networks, such as a T1 or subrate link, connect a single pair of routers. Valid neighbors on point-to-point networks will always become adjacent. The destination address of OSPF packets on these networks will always be the reserved class D address 224.0.0.5, known as AllSPFRouters .[7]

[7] The exception to this rule is retransmitted LSAs, which are always unicast on all network types. This exception is covered later, in the section "Reliable Flooding: Acknowledgments."

Broadcastnetworks, such as Ethernet, Token Ring, and FDDI, might be better defined as broadcast multi-access networks to distinguish them from NBMA networks. Broadcast networks are multi-access in that they are capable of connecting more than two devices, and they are broadcast in that all attached devices can receive a single transmitted packet. OSPF routers on broadcast networks will elect a DR and a BDR, as described in the next section, "Designated Routers and Backup Designated Routers." Hello packets are multicast with the AllSPFRouters destination address 224.0.0.5, as are all OSPF packets originated by the DR and BDR. The destination Media Access Control (MAC) identifier of the frames carrying these packets is 0100.5E00.0005. All other routers will multicast link state update and link state acknowledgment packets (described later) to the reserved class D address 224.0.0.6, known as AllDRouters. The destination MAC identifier of the frames carrying these packets is 0100.5E00.0006.

NBMA networks, such as X.25, Frame Relay, and ATM, are capable of connecting more than two routers but have no broadcast capability. A packet sent by one of the attached routers would not be received by all other attached routers. As a result, extra configuration may be necessary for routers on these networks to acquire their neighbors. OSPF routers on NBMA networks elect a DR and BDR, and all OSPF packets are unicast.

Point-to-multipoint networks are a special configuration of NBMA networks in which the networks are treated as a collection of point-to-point links. Routers on these networks do not elect a DR and BDR, and because the networks are seen as point-to-point links, the OSPF packets are multicast.

Virtual links, described in a later section, are special configurations that are interpreted by the router as unnumbered point-to-point networks. OSPF packets are unicast over virtual links.

In addition to these five network types, it should be noted that all networks fall into one of two more-general types:

  1. Transit networks have two or more attached routers. They may carry packets that are "just passing through"—packets that were originated on and are destined for a network other than the transit network.

    Note

    Transit and stub networks


  2. Stub networks have only a single attached router.[8] Packets on a stub network always have either a source or a destination address belonging to that network. That is, all packets were either originated by a device on the network or are destined for a device on the network. OSPF advertises host routes (routes with a mask of 255.255.255.255) as stub networks. Loopback interfaces are also considered stub networks and are advertised as host routes.[9]

    [8] Do not confuse stub networks with stub areas, discussed later in the chapter.

    [9] Beginning with IOS 11.3, this default behavior can be changed by adding the command ip ospf network point-to-point to the loopback interface. This will cause the loopback interface's address to be advertised as a subnet route.

Designated Routers and Backup Designated Routers

Multiaccess networks present two problems for OSPF, relating to the flooding of LSAs (described in a later section):

  1. The formation of an adjacency between every attached router would create many unnecessary LSAs. If n is the number of routers on a multiaccess network, there would be n(n- 1)/2 adjacencies (Figure 9.2). Each router would flood n- 1 LSAs for its adjacent neighbors, plus one LSA for the network, resulting in n 2 LSAs originating from the network.

  2. Flooding on the network itself would be chaotic. A router would flood an LSA to all its adjacent neighbors, which in turn would flood it to all their adjacent neighbors, creating many copies of the same LSA on the same network.

Figure 9-2. Ten adjacencies would be required for each of the five routers on this OSPF network to become fully adjacent with all of its neighbors; 25 LSAs would be originated from the network.

graphics/09fig02.gif

Note

Designated Router (DR)


To prevent these problems a Designated Router is elected on multi-access networks. The DR has the following duties:

  • To represent the multi-access network and its attached routers to the rest of the internetwork

  • To manage the flooding process on the multi-access network

The concept behind the DR is that the network itself is considered a "pseudonode," or a virtual router. Each router on the network forms an adjacency with the DR (Figure 9.3), which represents the pseudonode. Only the DR will send LSAs to the rest of the internetwork. Keep in mind that a router might be a DR on one of its attached multi-access networks, and it might not be the DR on another of its attached multi-access networks. In other words, the DR is a property of a router's interface, not the entire router.

Figure 9-3. The Designated Router represents the multi-access network. Other routers on the network will form adjacencies with the DR, not with each other.

graphics/09fig03.gif

A significant problem with the DR scheme as described so far is that if the DR fails, a new DR must be elected. New adjacencies must be established, and all routers on the network must synchronize their databases with the new DR (part of the adjacency-building process). While all this is happening, the network is unavailable for transit packets.

To prevent this problem, a Backup Designated Router is elected in addition to the DR. All routers form adjacencies not only with the DR but also with the BDR. The DR and BDR also become adjacent with each other. If the DR fails, the BDR becomes the new DR. Because the other routers on the network are already adjacent with the BDR, network unavailability is minimized.

Note

Backup Designated Router (BDR)


The election of the DR and BDR is triggered by the interface state machine, which is described in a later section. For the election process to function properly, the following preconditions must exist:

  • Each multi-access interface of each router has a Router Priority, which is an 8-bit unsigned integer ranging from 0 to 255. The default priority on Cisco routers is 1 and can be changed on a per multi-access-interface basis with the command ip ospf priority. Routers with a priority of 0 are ineligible to become the DR or BDR.

  • Hello packets include fields for the originating router to specify its Router Priority and for the IP addresses of the connected interfaces of the routers it considers the DR and BDR.

  • When an interface first becomes active on a multi-access network, it sets the DR and BDR to 0.0.0.0. It also sets a wait timer with a value equal to the RouterDeadInterval.

  • Existing interfaces on a multi-access network record the addresses of the DR and the BDR in the interface data structure, described in a later section.

The election procedure of the DR and BDR is as follows:

  1. After 2-Way communication has been established with one or more neighbors, examine the Priority, DR, and BDR fields of each neighbor's Hello. List all routers eligible for election (that is, routers with priority greater than 0 and whose neighbor state is at least 2-Way); all routers declaring themselves to be the DR (their own interface address is in the DR field of the Hello packet); and all routers declaring themselves to be the BDR (their own interface address is in the BDR field of the Hello packet). The calculating router will include itself on this list unless it is ineligible.

  2. From the list of eligible routers, create a subset of all routers not claiming to be the DR (routers declaring themselves to be the DR cannot be elected BDR).

  3. If one or more neighbors in this subset include its own interface address in the BDR field, the neighbor with the highest priority will be declared the BDR. In a tie, the neighbor with the highest Router ID will be chosen.

  4. If no router in the subset claims to be the BDR, the neighbor with the highest priority will become the BDR. In a tie, the neighbor with the highest Router ID will be chosen.

  5. If one or more of the eligible routers include their own address in the DR field, the neighbor with the highest priority will be declared the DR. In a tie, the neighbor with the highest Router ID will be chosen.

  6. If no router has declared itself the DR, the newly elected BDR will become the DR.

  7. If the router performing the calculation is the newly elected DR or BDR, or if it is no longer the DR or BDR, repeat steps 2 through 6.

In simpler language, when an OSPF router becomes active and discovers its neighbors, it checks for an active DR and BDR. If a DR and BDR exist, the router accepts them. If there is no BDR, an election is held in which the router with the highest priority becomes the BDR. If more than one router has the same priority, the one with the numerically highest Router ID wins. If there is no active DR, the BDR is promoted to DR and a new election is held for the BDR.

It should be noted that the priority can influence an election, but will not override an active DR or BDR. That is, if a router with a higher priority becomes active after a DR and BDR have been elected, the new router will not replace either of them. So the first two DR-eligible routers to initialize on a multiaccess network will become the DR and BDR.

Once the DR and BDR have been elected, the other routers (known as DRothers) will establish adjacencies with the DR and BDR only. All routers continue to multicast Hellos to the AllSPFRouters address 224.0.0.5 so that they can track neighbors, but DRothers multicast update packets to the AllDRouters address 224.0.0.6. Only the DR and BDR will listen to this address; in turn, the DR will flood the updates to the DRothers on 224.0.0.5.

Note that if only one eligible router is attached to a multiaccess network, that router will become the DR and there will be no BDR. Any other routers will form adjacencies only with the DR. If none of the routers attached to a multi-access network are eligible, there will be no DR or BDR and no adjacencies will form. The neighbor states of all routers will remain 2-Way (explained later, in "The Neighbor State Machine").

The duties performed by the DR and BDR are described more fully in subsequent sections.

OSPF Interfaces

The essence of a link state protocol is that it is concerned with links and the state of those links. Before Hellos can be sent, before adjacencies can be formed, and before LSAs can be sent, an OSPF router must understand its own links. A router's interfaces are the means by which OSPF interprets links. As a result, when speaking of OSPF it is not uncommon to hear the terms interface and link used synonymously. This section examines the data structure OSPF associates with each interface and the various states of an OSPF interface.

The Interface Data Structure

An OSPF router maintains a data structure for each OSPF-enabled interface. In Figure 9.4, the command show ip ospf interface has been used to observe the components of an interface data structure.

Figure 9-4. The OSPF-specific data related to an interface can be observed with the command show ip ospf interface. In this example, the interface is attached to a point-to-point network type.

graphics/09fig04.gif

The components of the interface data structure are as follows:

IP Address and Mask. This component is the configured address and mask of the interface. OSPF packets originated from this interface will have this source address. In Figure 9.4, the address/mask pair is 192.168.21.21/30.

Area ID. The area to which the interface, and the network to which it is attached, belong. OSPF packets originated from this interface will have this Area ID. In Figure 9.4, the area ID is 7.

Process ID. This Cisco-specific feature is not part of the open standard. Cisco routers are capable of running multiple OSPF processes and use the Process ID to distinguish them. The Process ID has no significance outside the router on which it is configured. In Figure 9.4, the Process ID is 1.

Router ID. In Figure 9.4, the Router ID is 192.168.30.70.

Network Type. The type of network to which the interface is connected: broadcast, point-to-point, NBMA, point-to-multipoint, or virtual link. In Figure 9.4, the network type is point-to-point.[10]

[10] Note that this interface is attached to a Frame Relay network. But because this is a point-to-point sub-interface, the OSPF network type is point-to-point instead of NBMA.

Cost. The outgoing cost for packets transmitted from this interface. Cost is the OSPF metric, expressed as an unsigned 16-bit integer in the range of 1 to 65535. Cisco uses a default cost of 108/BW, expressed in whole numbers, where BW is the configured bandwidth of the interface and 108 is the reference bandwidth. The interface in Figure 9.4 has a configured bandwidth of 128K (not shown in the figure), so the cost is 108/128K = 781.

The cost can be changed with the command ip ospf cost. This command is especially important when configuring Cisco routers in a multivendor environment. Bay and other vendors, for example, use a default cost of 1 on all interfaces (essentially making OSPF cost reflect hop counts). If all routers do not assign costs in the same manner, OSPF can route improperly.

Note

Changing the default cost.


The reference bandwidth of 108 creates a problem for some modern media with bandwidths higher than 100M (such as OC-3 and Gigabit Ethernet). 108/100M = 1, meaning that higher bandwidths calculate to a fraction of 1, which is not allowed. Beginning with IOS 11.2, Cisco has remedied this with the command ospf auto-cost reference-band width, which allows the default reference bandwidth to be changed.

InfTransDelay. The seconds by which LSAs exiting the interface will have their age incremented. In Figure 9.4, this is displayed as Transmit Delay and is shown to be the Cisco default, 1 second. InfTransDelay can be changed with the command ip ospf transmit-delay.

State. The functional state of the interface, which is described in the following section, "The Interface State Machine."

Router Priority. This 8-bit unsigned integer in the range of 0 to 255 elects the DR and BDR. The priority is not displayed in Figure 9.4 because the network type is point-to-point; no DR or BDR is elected on this network type. Figure 9.5 shows another OSPF interface in the same router. This interface shows an attached network type of broadcast, so a DR and BDR will be elected. The priority shown is 1, the Cisco default. The command ip ospf priority is used to change the Router Priority.

Figure 9-5. This interface is attached to a broadcast network type, and the router is the DR on this network.

graphics/09fig05.gif

Designated Router. The DR for the network to which the interface is attached is recorded both by its Router ID and by the address of the interface attached to the shared network. Note that no DR is displayed in Figure 9.4; it will be displayed only for multi-access network types. In Figure 9.5, the BDR is 192.168.30.70. The address of its attached interface is 192.168.17.73. A look at the Router ID, the interface address, and the interface state show that Renoir is the DR.

Backup Designated Router. The BDR for the network to which the interface is attached is also recorded both by its Router ID and by the address of the attached interface. In Figure 9.5, the BDR is 192.168.30.80, and its interface address is 192.168.17.74.

HelloInterval. The period, in seconds, between transmissions of Hello packets on the interface. This period is advertised in Hello packets that are transmitted from the interface. Cisco uses a default of 10 seconds, which can be changed with the command ip ospf hello-interval. Figure 9.5 displays HelloInterval as Hello and shows that the default is being used.

RouterDeadInterval. The period, in seconds, that the router will wait to hear a Hello from a neighbor on the network to which the interface is connected before declaring the neighbor down. The RouterDeadInterval is advertised in Hello packets transmitted from the interface. Cisco uses a default of four times the HelloInterval; the default can be changed with the command ip ospf dead-interval. Figure 9.5 displays the RouterDeadInterval as Dead and shows that the default is being used.

Wait Timer. The length of time the router will wait for a DR and BDR to be advertised in a neighbor's Hello packet before beginning a DR and BDR selection. The period of the wait timer is the RouterDeadInterval. In Figure 9.4, the wait time is irrelevant because the interface is attached to a point-to-point network; no DR or BDR will be used.

RxmtInterval. The period, in seconds, the router will wait between retransmissions of OSPF packets that have not been acknowledged. Figure 9.5 displays this period as retransmit and shows that the Cisco default of 5 seconds is being used. An interface's RxmtInterval can be changed with the command ip ospf retransmit-interval.

Hello Timer. A timer that is set to the HelloInterval. When it expires, a Hello packet is transmitted from the interface. Figure 9.5 shows that the Hello timer will expire in three seconds.

Neighboring Routers. A list of all valid neighbors (neighbors whose Hellos have been seen within the past RouterDeadInterval) on the attached network. Figure 9.6 shows yet another interface on the same router. Here, five neighbors are known on the network, but only two are adjacent (the Router IDs of only the adjacent neighbors are displayed). As a DRother on this network, the router has established an adjacency only with the DR and the BDR, in keeping with the DR protocol.

Figure 9.6. On this network, the router sees five neighbors but has only formed adjacencies with the DR and the BDR.

graphics/09fig06.gif

AuType. Describes the type of authentication used on the network. The authentication type may be Null (no authentication), Simple Password, or Cryptographic (Message Digest). Figure 9.6 shows that Message Digest authentication is being used. If Null authentication is used, no authentication type or key information will be displayed when show ip ospf interfaceis invoked.

Authentication Key. A 64-bit password if simple authentication has been enabled for the interface or a message digest key if Cryptographic authentication is used. Figure 9.6 shows that the "youngest key ID" is 10. This alludes to the fact that Cryptographic authentication allows the configuration of multiple keys on an interface to ensure smooth and secure key changes.

Figure 9.7 shows an interface that is connected to an NBMA network. Notice that the HelloInterval is 30 seconds, the default for NBMA, and that the RouterDeadInterval is at the default of four times the HelloInterval.

Figure 9-7. This interface is attached to a NBMA Frame Relay network and is the BDR for this network.

graphics/09fig07.gif

It is worthwhile to spend some time comparing Figures 9.4 through 9.7. All four interfaces are on the same router, yet on each network the router performs a different role. In each case, the interface state dictates the role of the OSPF router on a network. The next section describes the various interface states and the interface state machine.

The Interface State Machine

An OSPF-enabled interface will transition through several states before it becomes fully functional. Those states are Down, Point-to-Point, Waiting, DR, Backup, DRother, and Loopback.

Down. This is the initial interface state. The interface is not functional, all interface parameters are set to their initial values, and no protocol traffic is transmitted or received on the interface.

Point-to-Point. This state is applicable only to interfaces connected to point-to-point, point-to-multipoint, and virtual link network types. When an interface transitions to this state, it is fully functional. It will begin sending Hello packets every HelloInterval and will attempt to establish an adjacency with the neighbor at the other end of the link.

Waiting. This state is applicable only to interfaces connected to broadcast and NBMA network types. When an interface transitions to this state, it will begin sending and receiving Hello packets and will set the wait timer. The router will attempt to identify the network's DR and BDR while in this state.

DR. In this state, the router is the DR on the attached network and will establish adjacencies with the other routers on the multi-access network.

Backup. In this state, the router is the BDR on the attached network and will establish adjacencies with the other routers on the multi-access network.

DRother. In this state, the router is neither the DR nor the BDR on the attached network. It will form adjacencies only with the DR and BDR, although it will track all neighbors on the network.

Loopback. In this state, the interface is looped back via software or hardware. Although packets cannot transit an interface in this state, the interface address is still advertised in router LSAs (described later) so that test packets can find their way to the interface.

Figure 9.8 shows the OSPF interface states and the input events that will cause a state transition. The input events are described in Table 9.1

Figure 9-8. The OSPF interface state machine; see Table 9.1 for a description of input events (IEs).

graphics/09fig08.gif

Table 9.1. Input events for the interface state machine.

Input Event

Description

IE1

Lower-level protocols indicate that the network interface is operational.

IE2

Lower-level protocols indicate that the network interface is not operational.

IE3

Network management or lower-level protocols indicate that the interface is looped up.

IE4

Network management or lower-level protocols indicate that the interface is looped down.

IE5

A Hello packet is received in which either the originating neighbor lists itself as the BDR or the originating neighbor lists itself as the DR and indicates no BDR.

IE6

The wait timer has expired.

IE7

The router is elected as the DR for this network.

IE8

The router is elected as the BDR for this network.

IE9

The router has not been elected as the DR or BDR for this network.

IE10

A change has occurred in the set of valid neighbors on this network. This change may be one of the following:

  1. The establishment of two-way communication with a neighbor

  2. The loss of two-way communication with a neighbor

  3. The receipt of a Hello in which the originating neighbor newly lists itself as the DR or BDR

  4. The receipt of a Hello from the DR in which that router is no longer listed as the DR

  5. The receipt of a Hello from the BDR in which that router is no longer listed as the BDR

  6. The expiration of the RouterDeadInterval without having received a Hello from the DR or the BDR or both

OSPF Neighbors

The preceding section discussed a router's relationship with the attached network. Although a router's interaction with other routers was discussed in the context of electing DRs and BDRs, the purpose of the DR election process is still to establish a relationship with a network. This section discusses a router's relationship with the neighbors on the network. The ultimate purpose of the neighbor relationship is the formation of adjacencies over which to pass routing information.

Note

The phases of establishing an adjacency


An adjacency is established in four general phases:

  1. Neighbor discovery.

  2. Bidirectional communication. This communication is accomplished when two neighbors list each other's Router IDs in their Hello packets.

  3. Database synchronization. Database Description, Link State Request, and Link State Update packets (described in a later section) are exchanged to ensure that both neighbors have identical information in their link state databases. For the purposes of this process, one neighbor will become the master and the other will become the slave. As the name implies, the master will control the exchange of Database Description packets.

  4. Full adjacency.

As previously discussed, neighbor relationships are established and maintained through the exchange of Hello packets. On broadcast and point-to-point network types, Hellos are multicast to AllSPFRouters (224.0.0.5). On NBMA, point-to-multipoint, and virtual link network types, Hellos are unicast to individual neighbors. The implication of unicasting is that the router must first learn of the existence of its neighbors either through manual configuration or an underlying mechanism such as Inverse ARP. The configuration of neighbors on these network types is covered in the appropriate sections.

Hellos are sent every HelloInterval on every network type, with one exception: On NBMA networks, a router will send Hellos to neighbors whose neighbor state is down every PollInterval. On Cisco routers, the default PollInterval is 60 seconds.

The Neighbor Data Structure

An OSPF router builds the Hello packets for each network using the information stored in the interface data structure of the attached interface. By sending the Hello packets containing this information, the router informs neighbors about itself. Likewise, for each neighbor the router will maintain a neighbor data structure consisting of the information learned from other routers' Hello packets. This two-way exchange of information with a neighbor can be thought of as a conversation.

In Figure 9.9, the command show ip ospf neighbor is used to observe some of the information in the neighbor data structure for a single neighbor.[11]

[11] Compare this usage with Figure 9.1.

Figure 9.9. An OSPF router describes each conversation with each neighbor by a neighbor data structure.

graphics/09fig09.gif

Actually, the data structure records more information about each neighbor than is shown in the figure. The components of the neighbor data structure are as follows:

Neighbor ID. The router ID of the neighbor. In Figure 9.9, the neighbor ID is 192.168.30.105.

Neighbor IP Address. The IP address of the neighbor's interface attached to the network. When OSPF packets are unicasted to the neighbor, this address will be the destination address. In Figure 9.9, the neighbor's IP address is 192.168.16.41.

Area ID. In order for two routers to become neighbors, the Area ID carried in a received Hello packet must match the Area ID of the receiving interface. The Area ID of the neighbor in Figure 9.9 is 0 (0.0.0.0).

Interface. The interface attached to the network on which the neighbor is located. In Figure 9.9, the neighbor is reached via S0.

Neighbor Priority. This component is the Router Priority of the neighbor, as advertised in the neighbor's Hello packets. The priority is used in the DR/BDR election process. The neighbor in Figure 9.9 has a priority of 1, the Cisco default.

State. This component is the functional state of the neighbor, as described in the following section, "The Neighbor State Machine." The state of the neighbor in Figure 9.9 is Full.

PollInterval. This value is recorded only for neighbors on NBMA networks. Because neighbors may not be automatically discovered on NBMA networks, if the neighbor state is Down, a Hello will be sent to the neighbor every PollInterval—some period longer than the HelloInterval. The neighbor in Figure 9.9 is on an NBMA network, as indicated by the default Cisco PollInterval of 60 seconds.

Neighbor Options. The optional OSPF capabilities supported by the neighbor. Options are discussed in the section describing the Hello packet format.

Inactivity Timer. A timer whose period is the RouterDeadInterval, as defined in the interface data structure. The timer is reset whenever a Hello is received from the neighbor. If the inactivity timer expires before a Hello is heard from the neighbor, the neighbor is declared Down. In Figure 9.9, the inactivity timer is shown as the Dead Timer and will expire in 100 seconds.

Components of the neighbor data structure that are not displayed by the show ip ospf neighbor command are as follows:

Designated Router. This address is included in the DR field of the neighbor's Hello packets.

Backup Designated Router. This address is included in the BDR field of the neighbor's Hello packets.

Master/Slave. The master/slave relationship, negotiated with neighbors in the ExStart state, establishes which neighbor will control the database synchronization.

DD Sequence Number. The Sequence Number of the Database Description (DD) packet currently being sent to the neighbor.

Last Received Database Description Packet. The Initialize, More, and Master bits; the options; and the sequence number of the last received database description packet are recorded. This information is used to determine whether the next DD packet is a duplicate.

Link State Retransmission List. This component is a list of LSAs that have been flooded on the adjacency, but have not yet been acknowledged. The LSAs are retransmitted every RxmtInterval, as defined in the interface data structure, until they are acknow