OSPF Router ID and DR/BDR Election

In OSPF (Open Shortest Path First), the Router ID and the Designated Router (DR)/Backup Designated Router (BDR) play key roles in the network’s routing stability and efficiency.


1. OSPF Router ID

The Router ID is a unique identifier for each OSPF router. It’s a 32-bit value (similar to an IPv4 address) that is selected based on the following priority order:

Router ID Selection Criteria (Highest Priority First):

  1. Manually Configured Router ID β€” If set manually (e.g., router-id 1.1.1.1), this takes the highest priority.
  2. Highest IP Address on a Loopback Interface β€” If no manual Router ID is set, the router will pick the highest IP address of a loopback interface.
  3. Highest IP Address on an Active (Physical) Interface β€” If no loopback interface is configured, the router will choose the highest IP address of its active interfaces.

Best Practice: Assign a manual Router ID for consistency and easier troubleshooting.


2. DR/BDR Election

In OSPF, DR and BDR are elected to reduce overhead in multi-access networks like Ethernet. Instead of every router forming a full mesh of adjacencies, the DR acts as the central point for exchanging LSAs (Link-State Advertisements).

Election Process:

  • The router with the highest OSPF priority becomes the DR.
  • The router with the second-highest OSPF priority becomes the BDR.
  • In case of a tie (default priority is 1), the router with the highest Router ID wins.
  • If a router’s OSPF priority is set to 0, it cannot become a DR or BDR.

Key Points:

  • DR and BDR elections are not preemptive β€” once elected, they remain in place until they fail or their interfaces go down.
  • If the DR fails, the BDR automatically takes over, and a new BDR is elected.

Default OSPF Priority Values:

  • Cisco Default: 1
  • To modify: ip ospf priority <value> (on the interface level)

Example Scenario

Router A (Router ID: 1.1.1.1, Priority 100)  β€” DR
Router B (Router ID: 2.2.2.2, Priority 50) β€” BDR
Router C (Router ID: 3.3.3.3, Priority 0) β€” DROTHER

In this case:

  • Router A becomes the DR because of its higher priority.
  • Router B becomes the BDR.
  • Router C cannot become a DR or BDR due to its priority being 0.

Best Practices for OSPF Design

βœ… Use loopback interfaces for stable Router IDs.
βœ… Manually assign Router IDs for predictability.
βœ… Set the OSPF priority to 0 on routers that should never be elected as DR/BDR.
βœ… Ensure DR/BDR roles are assigned to routers with higher stability and performance.

Comments

Leave a comment