OSPF Practice: DR and BDR Election, Router ID and Cost

Free OSPF practice for the CCNA: pick the DR and BDR on a shared segment, find a router's ID and work out the best path by cost. Check my answer names the slip, such as a router with priority 0 or a DR that a later router would not replace.

Practise

    DR
    BDR

    Check your answer to see the working.

    Cisco IOS defaults: interface priority 1, reference bandwidth 100 Mbps. Later means after the previous election has finished.

    Practise for the CCNA

    OSPF is CCNA topic 3.3, with DR/BDR selection (3.3.c) and the router ID (3.3.d), and it is in ENCOR 3.2 and ENARSI 1.10 too. Start with the free real exam questions, then get the full pack.

    CCNA 200-3011,395 real exam questions · US$39
    Free: 349 questionsGet the full pack
    CCNP ENCOR 350-4011,066 real exam questions · US$39
    Free: 266 questionsGet the full pack
    CCNP ENARSI 300-410620 real exam questions · US$39
    Free: 113 questionsGet the full pack

    OSPF FAQ

    How are the OSPF DR and BDR elected?

    On a broadcast segment such as Ethernet, the routers compare the interface priority first and the highest wins. The default is 1 and the range is 0 to 255. On a tie, the highest router ID wins. When the routers start together, the best becomes DR and the next best BDR.

    Can a router with a higher priority take over as DR?

    No. The election is not preemptive: a router whose interface comes up while there is a DR accepts that DR, whatever its own priority. So the routers that start first often keep the DR and BDR roles.

    What does an OSPF priority of 0 do?

    A router with priority 0 can never become DR or BDR on that segment. It is a quick way to keep a router out of the election.

    What happens when the DR fails?

    The BDR becomes the DR, and a new BDR is elected from the other routers. If the old DR comes back, it does not take the role back, because a router that starts accepts the DR it finds.

    How does a Cisco router choose its OSPF router ID?

    In this order: the router-id command under router ospf; if there is none, the highest IP address on a loopback interface; if there is no loopback, the highest IP address on an interface that is up. Once chosen, it does not change until the OSPF process restarts or the router reloads, so a new router-id on a running process needs a reload or the clear ip ospf command.

    Does the DR election use the interface IP address?

    No. A tie on priority goes to the highest router ID, and the router ID can be a loopback address or a manually set ID rather than the address on the segment.

    How is OSPF cost calculated?

    Cost = reference bandwidth ÷ interface bandwidth. Cisco IOS uses a reference of 100 Mbps by default, so 10 Mbps Ethernet costs 100 ÷ 10 = 10. The interface bandwidth comes from the bandwidth command, and an ip ospf cost command on the interface overrides the formula.

    Does OSPF round the cost up or down?

    The fraction is dropped. Cisco's list of default costs shows it: 64 kbps gives 1562, a T1 at 1.544 Mbps gives 64 and an E1 at 2.048 Mbps gives 48. A cost is never below 1 (the range is 1 to 65535), so with the default reference 100 Mbps, 1 Gbps and 10 Gbps links all cost 1.

    Why change the reference bandwidth?

    To tell fast links apart. Set it in Mbps with auto-cost reference-bandwidth under router ospf. In Cisco's example a reference of 1000 gives a 100 Mbps FDDI link a cost of 10 while Gigabit Ethernet stays at 1.

    How does OSPF pick the best path?

    It adds up the cost of every outgoing interface along each path and takes the lowest total; the number of hops does not count. A route to a LAN also adds the cost of the last router's interface on that LAN. With equal totals, Cisco IOS load balances over both paths.

    Sources
    • IETF, RFC 2328, OSPF Version 2: section 9.4 (the DR and BDR election, priority 0 ineligible, router ID breaks ties), 7.3 (a router that comes up accepts an existing DR regardless of its priority), 7.4 (the BDR becomes DR when the DR fails), 12.4.1.2 (a stub network link carries the interface cost) and 16.1 (path cost is the sum of the link costs).
    • Cisco, IP Routing: OSPF Command Reference, ip ospf priority and router-id: default priority 1, range 0 to 255, higher priority then higher router ID, priority 0 never DR or BDR; a new router-id takes effect at reload or clear ip ospf.
    • Cisco, IP Routing: OSPF Command Reference, auto-cost and ip ospf cost: default reference 100 Mbps, cost = reference ÷ bandwidth, the default cost list (56 kbps 1785, 64 kbps 1562, T1 64, E1 48, Ethernet 10, ATM 1), cost range 1 to 65535, and the reference 1000 example.
    • Cisco, OSPF Frequently Asked Questions (Document 9237): reference bandwidth 100 Mbps, cost formula with the Ethernet example, router ID needs an interface that is up, equal cost paths load balanced.
    • Cisco, Troubleshooting Duplicate Router IDs with OSPF (Document 23862): router ID order (router-id command, highest loopback, highest address) and that it does not change until the OSPF process restarts or the router reloads.
    • Cisco, Catalyst 9500 Routing Configuration Guide, Configuring OSPF: default interface priority 1 and auto cost 100 Mb/s.
    • Cisco exam topics: 200-301 CCNA v2.0 (3.3 single area OSPFv2: 3.3.c broadcast DR/BDR selection, 3.3.d router ID), 350-401 ENCOR v1.2 (3.2.a and 3.2.b OSPF) and 300-410 ENARSI v1.1 (1.10 troubleshoot OSPF, including network types and path preference).
    • Checked 20 November 2026. The tool's own approach: problems are generated, four routers share one Ethernet segment, a later event happens after the previous election has finished, cost links are point to point with the same bandwidth at both ends, and every cost problem has one best path. An independent re-solver (a Python simulation of the RFC 2328 election run by every router, and Dijkstra for the costs) agreed with the drill on 6,000 generated problems, and the drill reproduces Cisco's default cost list.

    Checked 20 November 2026 against RFC 2328, Cisco's OSPF command reference and tech notes, and the CCNA, ENCOR and ENARSI exam topics.

    More free tools

    All free tools