OSPFv2 Single-Area Concepts

Module 1: Single-Area OSPFv2 Concepts

Module Objectives

  • Explain how single-area OSPF operates in both point-to-point and broadcast multiaccess networks.
    • OSPF Features and Characteristics
      • Describe basic OSPF features and characteristics.
    • OSPF Packets
      • Describe the OSPF packet types used in single-area OSPF.
    • OSPF Operation
      • Explain how single-area OSPF operates.

OSPF Features and Characteristics

  • OSPF is a link-state routing protocol developed as an alternative to the distance vector Routing Information Protocol (RIP).
  • OSPF offers faster convergence and scales to larger network implementations compared to RIP.
  • OSPF uses the concept of areas, allowing a network administrator to divide the routing domain into distinct areas to control routing update traffic.
  • A link is defined as an interface on a router, a network segment connecting two routers, or a stub network (like an Ethernet LAN) connected to a single router.
  • Link-state information includes:
    • Network prefix
    • Prefix length
    • Cost
  • This module focuses on basic, single-area OSPF implementations and configurations.
Components of OSPF
  • Routing protocols use routing protocol messages to exchange route information.
  • Messages are used to build data structures, which are then processed using a routing algorithm.
  • Routers running OSPF exchange messages using five types of packets:
    • Hello packet
    • Database description packet
    • Link-state request packet
    • Link-state update packet
    • Link-state acknowledgment packet
  • These packets are used for:
    • Discovering neighboring routers
    • Exchanging routing information
    • Maintaining accurate network information
OSPF Databases
  • OSPF messages are used to create and maintain three OSPF databases:
    • Adjacency Database (Neighbor Table)
      • Lists all neighbor routers with established bi-directional communication.
      • Unique for each router.
      • Can be viewed using the show ip ospf neighbor command.
    • Link-state Database (LSDB) (Topology Table)
      • Lists information about all other routers in the network.
      • Represents the network LSDB.
      • All routers within an area have identical LSDBs.
      • Can be viewed using the show ip ospf database command.
    • Forwarding Database (Routing Table)
      • Lists routes generated when an algorithm is run on the link-state database.
      • Each router's routing table is unique.
      • Contains information on how and where to send packets to other routers.
      • Can be viewed using the show ip route command.
Dijkstra's Shortest-Path First (SPF) Algorithm
  • The router builds the topology table using calculations based on the Dijkstra shortest-path first (SPF) algorithm.
  • The SPF algorithm is based on the cumulative cost to reach a destination.
  • The SPF algorithm creates an SPF tree by placing each router at the root and calculating the shortest path to each node.
  • The SPF tree is used to calculate the best routes.
  • OSPF places the best routes into the forwarding database, which is used to make the routing table.
Link-State Operation
  • To maintain routing information, OSPF routers complete a generic link-state routing process to reach a state of convergence. The following are the link-state routing steps that are completed by a router:
    1. Establish Neighbor Adjacencies
    2. Exchange Link-State Advertisements
    3. Build the Link State Database
    4. Execute the SPF Algorithm
    5. Choose the Best Route
Single-Area and Multiarea OSPF
  • OSPF supports hierarchical routing using areas for efficiency and scalability.
  • An OSPF area is a group of routers that share the same link-state information in their LSDBs.
  • OSPF can be implemented in two ways:
    • Single-Area OSPF
      • All routers are in one area (area 0 is best practice).
    • Multiarea OSPF
      • Implemented using multiple areas in a hierarchical fashion.
      • All areas must connect to the backbone area (area 0).
      • Routers interconnecting the areas are referred to as Area Border Routers (ABRs).
  • This module focuses on single-area OSPFv2.
Multiarea OSPF Advantages
  • Smaller routing tables
    • Fewer routing table entries due to network address summarization between areas (not enabled by default).
  • Reduced link-state update overhead
    • Smaller areas minimize processing and memory requirements.
  • Reduced frequency of SPF calculations
    • Topology changes within an area have localized impact.
    • LSA flooding stops at the area boundary.
OSPFv3
  • OSPFv3 is the OSPFv2 equivalent for exchanging IPv6 prefixes.
  • OSPFv3 exchanges routing information to populate the IPv6 routing table with remote prefixes.
  • With the OSPFv3 Address Families feature, OSPFv3 includes support for both IPv4 and IPv6 (beyond the scope of this curriculum).
  • OSPFv3 has the same functionality as OSPFv2.
  • Uses IPv6 as the network layer transport.
  • Communicates with OSPFv3 peers and advertises IPv6 routes.
  • Uses the SPF algorithm to determine the best paths.
  • OSPFv3 has separate processes from its IPv4 counterpart but the processes and operations are basically the same as in the IPv4 routing protocol, but run independently.

OSPF Packets

OSPF Packet Types

The five different types of Link State Packets (LSPs) used by OSPFv2:

  • Type 1: Hello
    • Discovers neighbors and builds adjacencies between them
  • Type 2: Database Description (DBD)
    • Checks for database synchronization between routers
  • Type 3: Link-State Request (LSR)
    • Requests specific link-state records from router to router
  • Type 4: Link-State Update (LSU)
    • Sends specifically requested link-state records
  • Type 5: Link-State Acknowledgment (LSAck)
    • Acknowledges the other packet types
Link-State Updates (LSUs)
  • LSUs are also used to forward OSPF routing updates.
  • An LSU packet can contain 11 different types of OSPFv2 LSAs.
  • OSPFv3 renamed several of these LSAs and also contains two additional LSAs.
  • LSU and LSA are often used interchangeably, but the correct hierarchy is that LSU packets contain LSA messages.
Hello Packet
  • The OSPF Type 1 packet is the Hello packet.
  • 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 Designated Router (DR) and Backup Designated Router (BDR) on multiaccess networks like Ethernet.
    • Point-to-point links do not require DR or BDR.

OSPF Operation

OSPF Operational States
  • Down State
    • No Hello packets received.
    • Router sends Hello packets.
    • Transition to Init state.
  • Init State
    • Hello packets are received containing the Router ID of the sending router.
    • Transition to Two-Way state.
  • Two-Way State
    • Communication between the two routers is bidirectional.
    • Routers elect a DR and a BDR on multiaccess links.
    • Transition to ExStart state.
  • ExStart State
    • On point-to-point networks, the two routers decide which router will initiate the DBD packet exchange and decide upon the initial DBD packet sequence number.
  • Exchange State
    • Routers exchange DBD packets.
    • Transition to Loading if additional router information is required; otherwise, transition to Full.
  • Loading State
    • LSRs and LSUs are used to gain additional route information.
    • Routes are processed using the SPF algorithm.
    • Transition to the Full state.
  • Full State
    • The link-state database of the router is fully synchronized.
Establish Neighbor Adjacencies
  • To determine if there is an OSPF neighbor on the link, the router sends a Hello packet that contains its router ID out all OSPF-enabled interfaces.
  • The Hello packet is sent to the reserved All OSPF Routers IPv4 multicast address 224.0.0.5224.0.0.5. Only OSPFv2 routers will process these packets.
  • The OSPF router ID is used by the OSPF process to uniquely identify each router in the OSPF area. A router ID is a 32-bit number formatted like an IPv4 address and assigned to uniquely identify a router among OSPF peers.
  • When a neighboring OSPF-enabled router receives a Hello packet with a router ID that is not within its neighbor list, the receiving router attempts to establish an adjacency with the initiating router.
Establish Adjacency on a Multiaccess Network
  1. Down to Init State
    • When OSPFv2 is enabled on the interface, R1 transitions from Down to Init and starts sending OSPFv2 Hellos out of the interface in an attempt to discover neighbors.
  2. Init State
    • When a R2 receives a hello from the previously unknown router R1, it adds R1’s router ID to the neighbor list and responds with a Hello packet containing its own router ID.
  3. Two-Way State
    • R1 receives R2’s hello and notices that the message contains the R1 router ID in the list of R2’s neighbors.
    • R1 adds R2’s router ID to the neighbor list and transitions to the Two-Way State.
    • If R1 and R2 are connected with a point-to-point link, they transition to ExStart
    • If R1 and R2 are connected over a common Ethernet network, the DR/BDR election occurs.
  4. Elect the DR & BDR
    • The DR and BDR election occurs, where the router with the highest router ID or highest priority is elected as the DR, and second highest is the BDR
Synchronizing OSPF Databases
  • After the Two-Way state, routers transition to database synchronization states.
  • This is a three step process:
    • Decide first router: The router with the highest router ID sends its DBD first.
    • Exchange DBDs: As many as needed to convey the database. The other router must acknowledge each DBD with an LSAck packet.
    • Send an LSR: Each router compares the DBD information with the local LSDB. If the DBD has more current link information, the router transitions to the loading state.
  • After all LSRs have been exchanged and satisfied, the routers are considered synchronized and in a full state.
  • Updates (LSUs) are sent:
    • When a change is perceived (incremental updates)
    • Every 30 minutes
The Need for a DR

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

  • Creation of multiple adjacencies
    • Ethernet networks could potentially interconnect many OSPF routers over a common link.
    • Creating adjacencies with every router would lead to an excessive number of LSAs exchanged between routers on the same network.
  • Extensive flooding of LSAs
    • Link-state routers flood their LSAs any time OSPF is initialized, or when there is a change in the topology.
    • This flooding can become excessive.
LSA Flooding with a DR
  • An increase in the number of routers on a multiaccess network also increases the number of LSAs exchanged between the routers. This flooding of LSAs significantly impacts the operation of OSPF.
  • 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.
  • On multiaccess networks, OSPF elects a DR to be the collection and distribution point for LSAs sent and received. A BDR is also elected in case the DR fails. All other routers become DROTHERs. A DROTHER is a router that is neither the DR nor the BDR.
  • The DR is only used for the dissemination of LSAs. The router will still use the best next- hop router indicated in the routing table for the forwarding of all other packets.