Day 14. OSPF Operation

CCNA 200-301 Exam Topics

  • Determine how a router makes a forwarding decision by default

  • Configure and verify single-area OSPFv2

Key Topics

Today we review the basic operation of OSPF. OSPFv2 is used for IPv4 routing, and OSPFv3 is used for IPv6 routing. Although the two versions share the same basic operation principles, we also review how they differ. Tomorrow, we will review single-area OSPFv2 configuration.

Single-Area OSPF Operation

The Internet Engineering Task Force (IETF) chose OSPF over Intermediate System-to-Intermediate System (IS-IS) as its recommended interior gateway protocol (IGP). In 1998, the OSPFv2 specification was updated in RFC 2328, “OSPF Version 2” (see http://www.ietf.org/rfc/rfc2328). Cisco IOS Software chooses OSPF routes over RIP routes because OSPF has an administrative distance (AD) of 110 versus RIP’s AD of 120.

OSPF Message Format

The data portion of an OSPF message is encapsulated in a packet. This data field can include one of five OSPF packet types. Figure 14-1 shows an encapsulated OSPF message in an Ethernet frame.

Figure 14-1 Encapsulated OSPF Message

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 typically 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.

OSPF Packet Types

Each of the five OSPF packet types serves a specific purpose in the routing process:

  • Hello: Hello packets establish and maintain adjacency with other OSPF routers.

  • DBD: The database description (DBD) packet contains an abbreviated list of the sending router’s link-state database. Receiving routers use it to check against the local link-state database.

  • LSR: Receiving routers can request more information about any entry in the DBD by sending a link-state request (LSR).

  • LSU: Link-state update (LSU) packets reply to LSRs and announce new information. LSUs contain 11 types of link-state advertisements (LSAs).

  • LSAck: When an LSU is received, the router sends a link-state acknowledgment (LSAck) to confirm receipt of the LSU.

Neighbor Establishment

OSPF neighbors exchange hello packets to establish adjacency. Figure 14-2 shows the OSPF header and hello packet.

Figure 14-2 OSPF Packet Header and Hello Packet

Important fields shown in the figure include the following:

  • Type: OSPF packet type: Hello (Type 1), DBD (Type 2), LS Request (Type 3), LS Update (Type 4), LS ACK (Type 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

  • Designated Router (DR): Router ID of the DR, if any

  • Backup Designated Router (BDR): Router ID of the BDR, if any

  • List of Neighbors: The OSPF router ID of the neighboring router(s)

Hello packets are used to do the following:

  • Discover OSPF neighbors and establish neighbor adjacencies

  • Advertise parameters on which two routers must agree to become neighbors

  • Elect the DR and BDR on multiaccess networks such as Ethernet and Frame Relay

Receiving an OSPF hello packet on an interface confirms for a router that another OSPF router exists on this link. OSPF then establishes adjacency with the neighbor. To establish adjacency, two OSPF routers must have the following matching interface values:

  • Hello Interval

  • Dead Interval

  • Network Type

  • Area ID

Before the two routers can establish adjacency, both interfaces must be part of the same network, including the same subnet mask. Full adjacency happens after the two routers have exchanged any necessary LSUs and have identical link-state databases. By default, OSPF hello packets are sent to the multicast address 224.0.0.5 (ALLSPFRouters) every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on nonbroadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM). The default dead interval is four times the hello interval.

Link-State Advertisements

LSUs are the packets used for OSPF routing updates. An LSU packet can contain 11 types of LSAs, as Figure 14-3 shows.

Figure 14-3 LSUs Contain LSAs

OSPF DR and BDR

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

  • Creation of multiple adjacencies, with one adjacency for every pair of routers

  • Extensive flooding of LSAs

The solution to managing the number of adjacencies and the flooding of LSAs on a multiaccess network is the designated router (DR). To reduce the amount of OSPF traffic on multiaccess networks, OSPF elects a DR and a backup DR (BDR). The DR is responsible for updating all other OSPF routers when a change occurs in the multiaccess network. The BDR monitors the DR and takes over as DR if the current DR fails. All other routers become DROTHERs. A DROTHER is a router that is neither the DR nor the BDR.

OSPF Algorithm

Each OSPF router maintains a link-state database containing the LSAs received from all other routers. When a router has received all the LSAs and built its local link-state database, OSPF uses Dijkstra’s shortest path first (SPF) algorithm to create an SPF tree. This algorithm accumulates costs along each path, from source to destination. The SPF tree is then used to populate the IP routing table with the best paths to each network.

For example, in Figure 14-4, each path is labeled with an arbitrary value for cost. The cost of the shortest path for R2 to send packets to the LAN attached to R3 is 27 (20 + 5 + 2 = 27). Notice that this cost is not 27 for all routers to reach the LAN attached to R3. Each router determines its own cost to each destination in the topology. In other words, each router uses the SPF algorithm to calculate the cost of each path to a network and determines the best path to that network from its own perspective.

Figure 14-4 Dijkstra’s Shortest Path First Algorithm

Table 14-1 lists the shortest path to each LAN for R1, along with the cost.

Table 14-1 SPF Tree for R1

Destination

Shortest Path

Cost

R2 LAN

R1 to R2

22

R3 LAN

R1 to R3

7

R4 LAN

R1 to R3 to R4

17

R5 LAN

R1 to R3 to R4 to R5

27

You should be able to create a similar table for each of the other routers in Figure 14-4.

Link-State Routing Process

The following list summarizes the link-state routing process OSPF uses. All OSPF routers complete the following generic link-state routing process to reach a state of convergence:

Step 1. Each router learns about its own links and its own directly connected networks. This is done by detecting that an interface has a Layer 3 address configured and is in the up state.

Step 2. Each router is responsible for establishing adjacency with its neighbors on directly connected networks by exchanging hello packets.

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

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

Step 5. Each router uses the database to construct a complete map of the topology and computes the best path to each destination network. The SPF algorithm is used to construct the map of the topology and determine the best path to each network. All routers have a common map or tree of the topology, but each router independently determines the best path to each network within that topology.

OSPFv2 Versus OSPFv3

In 1999, OSPFv3 for IPv6 was published in RFC 2740. In 2008, OSPFv3 was updated in RFC 5340 as OSPF for IPv6. However, it is still referred to as OSPFv3.

OSPFv3 has the same functionality as OSPFv2 but uses IPv6 as the network layer transport, communicating with OSPFv3 peers and advertising IPv6 routes. OSPFv3 also uses the SPF algorithm as the computation engine to determine the best paths throughout the routing domain.

As with all other IPv6 routing protocols, OSPFv3 has separate processes from its IPv4 counterpart. OSPFv2 and OSPFv3 each have separate adjacency tables, OSPF topology tables, and IP routing tables.

Similarities Between OSPFv2 and OSPFv3

OSPFv3 operates much like OSPFv2. Table 14-2 summarizes the operational features that OSPFv2 and OSPFv3 share.

Table 14-2 OSPFv2 and OSPFv3 Similarities

Feature

OSPFv2 and OSPFv3

Link state

Yes

Routing algorithm

SPF

Metric

Cost

Areas

Support the same two-level hierarchy

Packet types

Use the same hello, DBD, LSR, LSU, and LSAck packets

Neighbor discovery

Transition through the same states using hello packets

LSDB synchronization

Exchange contents of their LSDB between two neighbors

DR and BDR

Use the same function and election process

Router ID

Use a 32-bit router ID and the same process in determining the 32-bit router ID

Differences Between OSPFv2 and OSPFv3

Table 14-3 lists the major differences between OSPFv2 and OSPFv3.

Table 14-3 OSPFv2 and OSPFv3 Differences

Feature

OSPFv2

OSPFv3

Advertising

IPv4 networks

IPv6 prefixes

Source address

IPv4 source address

IPv6 link-local address

Destination address

Choice of

Neighbor IPv4 unicast address

224.0.0.5, all-OSPF-routers multicast address

224.0.0.6, DR/BDR multicast address

Choice of

Neighbor IPv6 link-local address

FF02::5, all-OSPFv3-routers multicast address

FF02::6, DR/BDR multicast address

Advertising networks

Configured using the network router configuration command

Configured using the ipv6 ospf area interface configuration command

IP unicast routing

IPv4 unicast routing enabled by default

Requires configuration of the ipv6 unicast-routing global configuration command

Authentication

Plain text and MD5

IPsec

Multiarea OSPF Operation

Single-area OSPF works fine in smaller networks in which the number of links is manageable. However, consider an OSPF single-area network with 900 routers and several thousand subnets. In this situation, the single-area design causes the following problems:

  • Large routing tables: By default, OSPF does not summarize routing updates.

  • Large link-state database (LSDB): In a single area, each router must maintain a database of all active links in the routing domain, regardless of whether that router is currently using a particular link.

  • Frequent SPF calculations: In a large network, changes to the LSDB can cause routers to spend many CPU cycles recalculating the SPF algorithm and updating the routing table.

To address these issues, OSPF supports hierarchical design through the uses of multiple OSPF areas. Multiarea OSPF is useful in larger network deployments to reduce processing and memory overhead. This involves breaking the one large LSDB into several smaller LSDBs by using multiple OSPF areas.

Multiarea OSPF Design

Multiarea OSPF design follows a couple basic rules:

  • Put all interfaces connected to the same subnet inside the same area.

  • An area should be contiguous.

  • Some routers might be internal to an area, with all interfaces assigned to that single area.

  • Some routers might be area border routers (ABRs) because some interfaces connect to the backbone area and some connect to nonbackbone areas.

  • All nonbackbone areas must connect to the backbone area (Area 0) by having at least one ABR connected to both the backbone area and the nonbackbone area.

Figure 14-5 shows a simple multiarea OSPF design with two areas (Area 1 and Area 2) connected to a backbone, Area 0.

Figure 14-5 Sample Multiarea OSPF Design

The figure also shows a few important multiarea OSPF design terms. Table 14-4 describes these terms.

Table 14-4 Multiarea OSPF Design Terminology

Term

Description

Area border router (ABR)

An OSPF router with interfaces connected to the backbone area and to at least one other area.

Backbone router

A router connected to the backbone area (includes ABRs).

Internal router

A router in one area (not the backbone area).

Autonomous system boundary router (ASBR)

A router that has at least one interface connected to an external network. An external network is a network that is not part of the routing domain, such as EIGRP, BGP, or one with static routing to the Internet, as Figure 14-5 shows.

Area

A set of routers and links that shares the same detailed LSDB information—but not with routers in other areas—for better efficiency

Backbone area

A special OSPF area to which all other areas must connect, such as Area 0

Intra-area route

A route to a subnet inside the same area as the router

Interarea route

A route to a subnet in an area the router is not a part of

Multiarea OSPF Improves Performance

In multiarea OSPF, all areas must connect to the backbone area. Routing still occurs between the areas. ABRs send interarea routes between areas. However, the CPU intensive routing operation of recalculating the SPF algorithm is done only for routes within an area. A change in one area does not cause an SPF algorithm recalculation in other areas.

In Figure 14-5, assume that a link fails in Area 1. Only the routers in Area 1 exchange LSAs. D1, the ABR for Area 1, will send one update to Area 0 after Area 1 has converged on the new information.

The following list summarizes how multiarea OSPF improves OSPF performance:

  • The smaller per-area LSDB requires less memory.

  • Routers require fewer CPU cycles to process the smaller per-area LSDB with the SPF algorithm, reducing CPU overhead and improving convergence time.

  • Changes in the network (for example, links failing and recovering) require SPF calculations only on routers connected to the area where the link changed state, reducing the number of routers that must rerun SPF.

  • Less information must be advertised between areas, reducing the bandwidth required to send LSAs.

Study Resources

For today’s exam topics, refer to the following resources for more study.

Resource

Module or Chapter

Enterprise Networking, Security, and Automation

1

CCNA 200-301 Official Cert Guide, Volume 1

19

21

Portable Command Guide

16

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.152.123