I am trying to implement IEEE 802.1D. I know how the root bridge id is elected. Initially, every switch will advertise that they are the root bridge. Next, it will check whether the bridge ID received in BPDU is lower than it's bridge ID or not. Based on which has a lower bridge Id, it will either forward or stop advertising the root bridge ID. I can implement this part in Python. However, I am unsure when will I know when the election is over. Like, how will I know that each device knows the root bridge ID in the network? Once it is completed, I can assign ports block, forwarding based on root path cost.

  • 3
    That's why STP has timers for the different stages.
    – Ron Maupin
    Aug 31, 2018 at 1:20
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 25, 2018 at 9:24

1 Answer 1


The election is over when you say it's over. In other words, each switch decides on its own when to start forwarding. That decision is made when timers expire. Depending on the circumstance, that can be Forward-delay timer, or Max-age timer plus twice forward delay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.