> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/online-courses/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/online-courses/ccna-200-301/spanning-tree-protocol/timers.md).

# Timers

| STP Timer         | Purpose                                                                                                          | Duration           |
| ----------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------ |
| **Hello**         | How often the root bridge sends hello BPDUs                                                                      | 2sec               |
| **Forward delay** | How long the switch will stay in the Listening and Learning states (each state is 15 seconds = total 30 seconds) | 15sec              |
| **Max Age**       | How long an interface will wait *after ceasing to receive Hello BPDUs* to change the STP topology                | 20sec (10\* hello) |

## Hello

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FGeGbIRtf9wa47KOXxRQj%2FScreenshot%20from%202023-06-26%2017-36-20.png?alt=media&amp;token=d7a9660f-6eae-4da5-b443-5c6c24d3815a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FE0xGjWawg5v8sMbod85B%2FScreenshot%20from%202023-06-26%2017-37-14.png?alt=media&amp;token=95eefe16-f5f6-421d-aaea-89a9a4cebdab" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FN4fB2hLQWRZlim6rfMhl%2FScreenshot%20from%202023-06-26%2017-39-42.png?alt=media&amp;token=ec81c82d-9bb8-4d61-b1a6-c3280ffaef9f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FIerkAMOXW41gwM8hjjWA%2FScreenshot%20from%202023-06-26%2017-37-56.png?alt=media&amp;token=b2127d8e-3165-4e13-a7ab-cd1f5cae6025" alt=""><figcaption></figcaption></figure>

Switches do not forward the BPDUss out of their **root** ports and **non-designated** ports, only their **designated** ports.

## Max Age

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FlvvnBrUn6ae2qLPcp2Y4%2FScreenshot%20from%202023-06-26%2018-02-10.png?alt=media&amp;token=256ba8ca-9124-4516-9e41-b928b7a3047a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FlozjXSO043WvE3BqTigu%2FScreenshot%20from%202023-06-26%2018-02-17.png?alt=media&amp;token=13f0ed5a-7315-4099-b452-985623c1acb9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FYhZhwO0pBxLr58Ob6ZA9%2FScreenshot%20from%202023-06-26%2018-02-21.png?alt=media&amp;token=068c212f-4390-4602-8e66-e109839b22df" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2Fx3yIQqsVc4R3g8D0rOno%2FScreenshot%20from%202023-06-26%2018-06-43.png?alt=media&amp;token=408308fe-2272-41a3-8410-fd6ef705ddd4" alt=""><figcaption><p>Counts down the 2 seconds</p></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FmQ7uKwMbOB48tPpYCk2U%2FScreenshot%20from%202023-06-26%2018-07-39.png?alt=media&amp;token=0168b25d-6ac5-46e2-a4b2-6c3ecb4fc711" alt=""><figcaption><p>The timer is reset and it will start counting again</p></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FE0pajzUBUjulbwoLbUnI%2FScreenshot%20from%202023-06-26%2018-08-40.png?alt=media&amp;token=ab208318-fb25-46cf-a689-fcafa3cda78f" alt=""><figcaption><p>If a connection fails, the timer won't be reset</p></figcaption></figure>

If another BPDU **is received** before the max age timer counts down to 0, the time will reset to 20 seconds and no changes will occur.

If another BPUD **is not received**, the max age timer counts down to 0 and the switch will reevaluate its STP choices, including root bridge, and local root, designated, and non-designated ports.

If a non-designated port is selected to become a designated or root port, it will transition from the blocking state to the listening state (15 seconds), then learning state (15 seconds), and then finally the forwarding state. So, it can take a total of **50 seconds** for a blocking interface to transition to forwarding.

These timers and transitional states are to make sure that loops aren't accidentally created by an interface moving to forwarding state too soon.

{% hint style="info" %}
A forwarding interface can move directly to a blocking state (there is no worry about creating a loop by blocking an interface).

A blocking interface **cannot move directly to forwarding state**. It must go through the listening and learning state.
{% endhint %}
