Subject: Elementary Problem!

From: Rohit Gupta <[email-masked]>
Date: Thu, 4 Sep 2003 23:22:30 -0700

What happens when two OSPF speaking routers are
simultaneously switched on a broadcast network? Both
of them will put the DR and the BDR as Zero in their
HELLO packets.

They will both start with Neighbor Down state and
Interface down state. Once the Interface will come up
both will go to Waiting state. Now when they recieve
the HELLO message listiing each other they will reach
the 2-Way state.

What happens after that is not clear to me from the
RFC. How does the DR and BDR get elected? DO we wait
for the Wait timer to get expired?

The scenario is clear to me when one of them has
already elected a DR and a BDR. What is not clear to
me is when none of them have elected a DR and BDR.

Please help!

Regards,
Rohit

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---

From: Farshad Tavallaei <[email-masked]>
Date: Thu, 4 Sep 2003 23:49:00 -0700

Rohit,

Here is a copy/paste from the RFC (please read carefully and tell me
what part you don't understand):

Electing the Designated Router

        This section describes the algorithm used for calculating a
        network's Designated Router and Backup Designated Router.  This
        algorithm is invoked by the Interface state machine.  The
initial time a router runs the election algorithm for a network,
the network's Designated Router and Backup Designated Router are
        initialized to 0.0.0.0.  This indicates the lack of both a
        Designated Router and a Backup Designated Router.

        The Designated Router election algorithm proceeds as follows:
        Call the router doing the calculation Router X.  The list of
        neighbors attached to the network and having established
        bidirectional communication with Router X is examined.  This
        list is precisely the collection of Router X's neighbors (on
this network) whose state is greater than or equal to 2-Way (see
        Section 10.1).  Router X itself is also considered to be on the
        list.  Discard all routers from the list that are ineligible to
        become Designated Router.  (Routers having Router Priority of 0
        are ineligible to become Designated Router.)  The following
        steps are then executed, considering only those routers that
        remain on the list:

        (1) Note the current values for the network's Designated Router
            and Backup Designated Router.  This is used later for
            comparison purposes.

        (2) Calculate the new Backup Designated Router for the network
            as follows.  Only those routers on the list that have not
            declared themselves to be Designated Router are eligible to
            become Backup Designated Router.  If one or more of these
            routers have declared themselves Backup Designated Router
            (i.e., they are currently listing themselves as Backup
            Designated Router, but not as Designated Router, in their
            Hello Packets) the one having highest Router Priority is
            declared to be Backup Designated Router.  In case of a tie,
            the one having the highest Router ID is chosen.  If no
            routers have declared themselves Backup Designated Router,
            choose the router having highest Router Priority, (again
            excluding those routers who have declared themselves
            Designated Router), and again use the Router ID to break
            ties.

        (3) Calculate the new Designated Router for the network as
            follows.  If one or more of the routers have declared
            themselves Designated Router (i.e., they are currently
            listing themselves as Designated Router in their Hello
            Packets) the one having highest Router Priority is declared
            to be Designated Router.  In case of a tie, the one having
            the highest Router ID is chosen.  If no routers have
declared themselves Designated Router, assign the Designated Router to
be the same as the newly elected Backup Designated Router.

        (4) If Router X is now newly the Designated Router or newly the
Backup Designated Router, or is now no longer the Designated Router or
no longer the Backup Designated Router, repeat steps 2 and 3, and then
proceed to step 5.  For example, if Router X is now the Designated
Router, when step 2 is repeated X will no longer be eligible for Backup
Designated Router election.  Among other things, this will ensure that
no router will declare itself both Backup Designated Router and
Designated Router.[5]

        (5) As a result of these calculations, the router itself may now
            be Designated Router or Backup Designated Router.  See
            Sections 7.3 and 7.4 for the additional duties this would
            entail.  The router's interface state should be set
accordingly.  If the router itself is now Designated Router, the new
interface state is DR.  If the router itself is now Backup Designated
Router, the new interface state is Backup. Otherwise, the new interface
state is DR Other.

        (6) If the attached network is non-broadcast, and the router
            itself has just become either Designated Router or Backup
            Designated Router, it must start sending Hello Packets to
            those neighbors that are not eligible to become Designated
            Router (see Section 9.5.1).  This is done by invoking the
            neighbor event Start for each neighbor having a Router
            Priority of 0.

        (7) If the above calculations have caused the identity of either
the Designated Router or Backup Designated Router to change, the set of
adjacencies associated with this interface will need to be modified.
Some adjacencies may need to be formed, and others may need to be
broken.  To accomplish this, invoke the event AdjOK?  on all neighbors
whose state is at least 2-Way.  This will cause their eligibility for
adjacency to be reexamined.

        The reason behind the election algorithm's complexity is the
        desire for an orderly transition from Backup Designated Router
        to Designated Router, when the current Designated Router fails.
        This orderly transition is ensured through the introduction of
        hysteresis: no new Backup Designated Router can be chosen until
        the old Backup accepts its new Designated Router
        responsibilities.

        The above procedure may elect the same router to be both
        Designated Router and Backup Designated Router, although that
        router will never be the calculating router (Router X) itself.
        The elected Designated Router may not be the router having the
        highest Router Priority, nor will the Backup Designated Router
        necessarily have the second highest Router Priority.  If Router
        X is not itself eligible to become Designated Router, it is
        possible that neither a Backup Designated Router nor a
        Designated Router will be selected in the above procedure.

        Note also that if Router X is the only attached router that is
        eligible to become Designated Router, it will select itself as
        Designated Router and there will be no Backup Designated Router
        for the network.

Best regards,

Farshad

-----Original Message-----
From: Mailing List [mailto:[email-masked]] On Behalf Of Rohit
Gupta
Sent: Thursday, September 04, 2003 11:23 PM
To: [email-masked]
Subject: Elementary Problem!

Please help!

Regards,
Rohit

---

From: Erblichs <[email-masked]>
Date: Mon, 8 Sep 2003 00:49:09 -0700

Rohit,

        If you want a short answer here it is.

        If these two routers are the only ones
        on this broadcast networks, then they
        wait until the Wait timer expires to
        see if anyone annouces a DR and/or
        BDR.

        During that time we will form neighbors
        between these new routers if a number of
        parameters are consistent.

        Each router will then do the appropriate
        DR/BDR election.

        Mitchell Erblich
        Sr Software Engineer
        -------------------------