OSPF Designated Router
OSPF elects a Designated Router (DR) for each broadcast network to act as the main point of contact for the network segment. Each router on the segment becomes adjacent with the DR, which handles all LSAs for the network. Each router sends the DR information using the multicast address 224.0.0.6. The DR sends the network LSA (LSA Type 2) to represent the broadcast network to the rest of the OSPF area.
To avoid DR as a single point of failure, a Backup Designated Router (BDR) is also elected for the broadcast network. The BDR also listens to 224.0.0.6 multicast address and becomes active in case of DR failure. Like DR, all the routers on the broadcast network also form FULL adjacency with the BDR.
Network topology:
OSPF Configuration:
SRX210 OSPF Configuration
interface {    ge-0/0/0 {        unit 0 {            family inet {                address 172.16.6.20/24;            }        }    }}protocols {    ospf {        area 0.0.0.0 {            interface  ge-0/0/0.0;
        }    }}J4350 OSPF Configuration
interface {    ge-0/0/0 {        unit 0 {            family inet {                address 172.16.6.10/24;            }        }    }}protocols {    ospf {        area 0.0.0.0 {            interface ge-0/0/0.0;        }    }}J2350 OSPF Configuration
interface {    ge-0/0/0 {        unit 0 {            family inet {                address 172.16.6.15/24;            }        }    }}protocols {    ospf {        area 0.0.0.0 {            interface ge-0/0/0.0;        }    }}OSPF DR Election:
On a broadcast network, DR election takes place based on OSPF router priority. The Priority is set to 128 by default by JUNOS software. In case of a tie, the router with highest router-id is elected the DR.
OSPF Priority is exchanged by OSPF Hello packets. A router with priority 0 is ineligible to become a DR or BDR. Once a DR is elected, a BDR is elected in the similar fashion.
All routers on the broadcast segment form FULL adjacency with, both, DR and BDR. All other routers on the segment are in DROTHER state.
In this case, since all router report the same OSPF priority, the router IDs are used to elect DR and BDR. Since the SRX210 router has the highest IP address, it becomes the DR with J2350 as BDR.
OSPF Adjacency and Neighbors
SRX210 router:root> show ospf interfaceInterface           State   Area            DR ID           BDR ID          Nbrsge-0/0/0.0          DR      0.0.0.0         172.16.6.20     172.16.6.15        2root> show ospf neighborAddress          Interface              State     ID               Pri  Dead172.16.6.15      ge-0/0/0.0             Full      172.16.6.15      128    31172.16.6.10      ge-0/0/0.0             Full      172.16.6.10      128    33J4350 router:root> show ospf interfaceInterface           State   Area            DR ID           BDR ID          Nbrsge-0/0/0.0          DRother 0.0.0.0         172.16.6.20     172.16.6.15        2root> show ospf neighborAddress          Interface              State     ID               Pri  Dead172.16.6.20      ge-0/0/0.0             Full      172.16.6.20      128    36172.16.6.15      ge-0/0/0.0             Full      172.16.6.15      128    34J2350 router:root> show ospf interfaceInterface           State   Area            DR ID           BDR ID          Nbrsge-0/0/0.0          BDR     0.0.0.0         172.16.6.20     172.16.6.15        2root> show ospf neighborAddress          Interface              State     ID               Pri  Dead172.16.6.20      ge-0/0/0.0             Full      172.16.6.20      128    37172.16.6.10      ge-0/0/0.0             Full      172.16.6.10      128    32Only DR sends network LSAs (LSA Type 2) to all other routers on the broadcast segment. This network LSA contains information about all routers attached to this broadcast segment. Here, the SRX210 router (router ID: 172.16.6.20) is advertising Type 2 LSAs.
LSA Type 2
SRX210 router:root> show ospf database network extensive    OSPF database, Area 0.0.0.0 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  LenNetwork *172.16.6.20      172.16.6.20      0x80000009    79  0x22 0x9179  36  mask 255.255.255.0  attached router 172.16.6.20  attached router 172.16.6.15  attached router 172.16.6.10  Gen timer 00:48:41  Aging timer 00:58:41  Installed 00:01:19 ago, expires in 00:58:41, sent 00:01:18 ago  Last changed 00:01:19 ago, Change count: 9, OursJ4350 router:root> show ospf database network extensive    OSPF link state database, Area 0.0.0.0 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  LenNetwork  172.16.6.20      172.16.6.20      0x80000009   846  0x22 0x9179  36  mask 255.255.255.0  attached router 172.16.6.20  attached router 172.16.6.15  attached router 172.16.6.10  Aging timer 00:45:53  Installed 00:14:04 ago, expires in 00:45:54, sent 00:22:06 ago  Last changed 00:14:04 ago, Change count: 8J2350 router:root> show ospf database network extensive    OSPF link state database, Area 0.0.0.0 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  LenNetwork  172.16.6.20      172.16.6.20      0x80000009   950  0x22 0x9179  36  mask 255.255.255.0  attached router 172.16.6.20  attached router 172.16.6.15  attached router 172.16.6.10  Aging timer 00:44:10  Installed 00:15:48 ago, expires in 00:44:10  Last changed 00:15:48 ago, Change count: 8