08-05-2011 07:57 AM - edited 03-07-2019 01:34 AM
hi, I was trying to find any documents about HSRP states shifting, especially on this question, which state will a router will be when it is in active state and is preempted by another router with a higher priority.
thanks,
Han
Solved! Go to Solution.
08-05-2011 01:44 PM
Hello,
To add and possibly correct some friends' replies here: Indeed, if an Active router is preempted by another router, it will fall back into the Speak state. Follow the link to the document Reza originally provided: there is a diagram of state transitions in HSRP. The preemption is performed by a router sending the Coup message to the currently Active router. In the diagram, it is the event number 10. As you can see, the arrow signifies the transition from the Active state to the Speak state.
Why Speak? Because in HSRP, only the Active and Standby routers send Hello packets. Other routers are silent. When an Active router is preempted, it must establish its new role - it can be either the new Standby or a silent member. But for this to happen reliably, it cannot just go into Listening state because there is almost nothing to listen for - the former Standby router has just promoted itself to the Active role, and neither other router currently sends Hello packets. So it is important for the former Active router to continue sending its Hello packets to determine whether it may be at least in the Standby role. As the Standby role is permanently preemptive and nonsignalled, as I explained earlier, it is important that even after ceasing to be the Active, the router still continues to advertise its presence for a certain time so that other routers either accept it as the new Standby, or some other router takes over the Standby role (if it has a higher priority).
Best regards,
Peter
08-05-2011 08:34 AM
Han,
When the active router is preempted by another router with a higher priority, then the active router goes to stand-by
State | Definition |
---|---|
Initial | This is the state at the start. This state indicates that HSRP does not run. This state is entered through a configuration change or when an interface first becomes available. |
Learn | The router has not determined the virtual IP address and has not yet seen an authenticated hello message from the active router. In this state, the router still waits to hear from the active router. |
Listen | The router knows the virtual IP address, but the router is neither the active router nor the standby router. It listens for hello messages from those routers. |
Speak | The router sends periodic hello messages and actively participates in the election of the active and/or standby router. A router cannot enter speak state unless the router has the virtual IP address. |
Standby | The router is a candidate to become the next active router and sends periodic hello messages. With the exclusion of transient conditions, there is, at most, one router in the group in standby state. |
Active | The router currently forwards packets that are sent to the group virtual MAC address. The router sends periodic hello messages. With the exclusion of transient conditions, there must be, at most, one router in active state in the group. |
http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a0080094afd.shtml#topic13
08-05-2011 09:43 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Reza Sharifi wrote:
Han,
When the active router is preempted by another router with a higher priority, then the active router goes to stand-by
True if there is not already a standby, otherwise it doesn't transition out of listen (assuming there's no preemption for standby, and I don't believe there is).
08-05-2011 11:20 AM
Joseph,
assuming there's no preemption for standby, and I don't believe there is
The Standby role is permanently preemptive but this preemptivity is unsignalled. A router that has the highest priority among non-active routers becomes the Standby router. If a new router comes in that has a higher priority, it simply announces itself during the Speak state and subsequently becomes the new Standby. This is in contrast to preempting the Active role which absolutely requires the preempting router to send the Coup messages - otherwise, no Active role takeover takes place.
There is a small detail about the Standby preemption: a router with the same priority but a higher IP address will not preempt the current Standby router. For the Active role, if both contending routers have the same priority, the one with the higher IP address on the segment becomes the Active router. EDIT: This information is wrong. See my later post - SORRY!
Best regards,
Peter
Message was edited by: Peter Paluch
08-05-2011 11:58 AM
Hi Peter,
very informative as always indeed. If I could rate a 10 I would.
Regards.
Alain.
08-05-2011 12:55 PM
Alain,
You are very kind, thank you! I appreciate it very much.
Best regards,
Peter
08-05-2011 01:10 PM
Peter and all,
Despite your nice explanation, I am still unclear about the answer. I was told by someone that it is Speak state. Does it make any sense to you guys?
thanks,
Han
08-05-2011 01:30 PM
Han
2 switches running HSRP
sw1 priority 110
sw2 priority 100
in the above scenario sw1 will be active and sw2 will be standby. You can run the "sh standby brief" command on each switch to see the status
3 switches running HSRP
sw1 priority 110
sw2 priority 100
sw3 priority 90
in the above sw1 will be active and sw2 standby. You can only have one standby router at any one time so sw3 will be in the listen state. It will not be in the speak state so whoever told you that was incorrect.
If you shutdown the interface on the active switch (sw1) then sw2 will become the active switch. Sw3 will transition from listen to speak to standby.
Basically speak is a transitory stage. Listen/standby/active are the states that routers using HSRP on the same subnet will use when everything is stable.
Jon
08-05-2011 01:44 PM
Hello,
To add and possibly correct some friends' replies here: Indeed, if an Active router is preempted by another router, it will fall back into the Speak state. Follow the link to the document Reza originally provided: there is a diagram of state transitions in HSRP. The preemption is performed by a router sending the Coup message to the currently Active router. In the diagram, it is the event number 10. As you can see, the arrow signifies the transition from the Active state to the Speak state.
Why Speak? Because in HSRP, only the Active and Standby routers send Hello packets. Other routers are silent. When an Active router is preempted, it must establish its new role - it can be either the new Standby or a silent member. But for this to happen reliably, it cannot just go into Listening state because there is almost nothing to listen for - the former Standby router has just promoted itself to the Active role, and neither other router currently sends Hello packets. So it is important for the former Active router to continue sending its Hello packets to determine whether it may be at least in the Standby role. As the Standby role is permanently preemptive and nonsignalled, as I explained earlier, it is important that even after ceasing to be the Active, the router still continues to advertise its presence for a certain time so that other routers either accept it as the new Standby, or some other router takes over the Standby role (if it has a higher priority).
Best regards,
Peter
08-05-2011 06:29 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Peter, thank you! That tidbit I couldn't find documented, i.e. preemption of the standby role, including not using IP address as a tie breaker.
Does the same apply for standby if the priority changes on the fly, for example on a tracked interface state change?
08-06-2011 04:14 AM
Joseph and everybody,
I would like to correct a misinformation I have originally written here. I have written that a router with the same priority but a higher IP address will not preempt the current Standby router, but it might preempt the current Active router.
In reality, it is reversed: a Standby router with the same priority but a higher IP will not preempt the current Active router - obviously because of stability reasons. However, the Standby role itself is always fully preemptive and the tiebreakers hold: first the higher priority, then the higher IP address.
So to sum it up - hopefully correctly now: the Active role is preemptive upon explicit configuration. If multiple routers contend for an Active role, the router with the highest priority and then the highest IP address becomes the Active. Once the Active is elected, a Standby router with the same priority but a higher IP address will not take over the current Active router.
The Standby role is permanently preemptive, and the tiebreakers are always: the highest priority, then the highest IP address.
This information is partially taken from the FHRP configuration guide at:
Please accept my sincere apologies for confusing you!
Joseph, to your question: Yes, the Standby router is preemptive on the fly. Observe the following output. I have had 3 routers connected to the segment, neither of them configured for preemption. R1 is 10.0.0.1, priority 110, Active. R2 is 10.0.0.2, priority 100, currently Standby. When I start the third router, R3, address 10.0.0.3 and priority 100, it eventually takes over R2 because its IP address is higher even though the priorities are the same:
R2#
*Mar 1 00:04:39.011: HSRP: Fa0/0 Grp 1 Standby: f/Hello rcvd from higher pri Speak router (100/10.0.0.3)
*Mar 1 00:04:39.011: HSRP: Fa0/0 Grp 1 Standby -> Listen
*Mar 1 00:04:39.011: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Listen
*Mar 1 00:04:39.011: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Standby -> Backup
*Mar 1 00:04:49.011: HSRP: Fa0/0 Grp 1 Standby router is 10.0.0.3, was local
R2#
Afterwards, I lowered the priority on R3 from 100 to 95. The R2 took over as the Standby:
R2#
*Mar 1 00:06:01.003: HSRP: Fa0/0 Grp 1 Listen: l/Hello rcvd from lower pri Standby router (95/10.0.0.3)
*Mar 1 00:06:01.007: HSRP: Fa0/0 Grp 1 Listen -> Speak
*Mar 1 00:06:01.007: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Backup -> Speak
*Mar 1 00:06:11.007: HSRP: Fa0/0 Grp 1 Speak: d/Standby timer expired (10.0.0.3)
*Mar 1 00:06:11.011: HSRP: Fa0/0 Grp 1 Standby router is local, was 10.0.0.3
*Mar 1 00:06:11.011: HSRP: Fa0/0 Grp 1 Speak -> Standby
*Mar 1 00:06:11.015: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby
*Mar 1 00:06:11.015: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Speak -> Standby
R2#
Then I returned the priority on R3 back to 100, and the role of Standby was again retaken by R3:
R2#
*Mar 1 00:06:29.047: HSRP: Fa0/0 Grp 1 Standby: f/Hello rcvd from higher pri Speak router (100/10.0.0.3)
*Mar 1 00:06:29.051: HSRP: Fa0/0 Grp 1 Standby -> Listen
*Mar 1 00:06:29.055: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Listen
*Mar 1 00:06:29.055: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Standby -> Backup
*Mar 1 00:06:39.039: HSRP: Fa0/0 Grp 1 Standby router is 10.0.0.3, was local
R2#
Best regards,
Peter
08-07-2011 07:50 PM
Peter, 5 stars to you for labbing it. Always appreciate the efforts you take to make things clearer and spread the knowledge. and grats for becoming VIP. You deserve it
08-07-2011 09:13 PM
Hi Peter,
How about based on your senario, 3 routers, R1 is 10.0.0.1 priority 110 (active), R2 is 10.0.0.2 priority 90 (standby). When i connected the third router, R3 with address 10.0.0.3 and priority 110, will R3 become and takeover the active role since its has a higher IP address than R1 with the same priority ? (with and without premption command), thanks
08-07-2011 11:00 PM
Hello Wai,
No, under these circumstances, R3 should not take over the Active role, regardless of the preemption configuration, because an already-established Active role is preempted only due to higher priority, not due to higher IP address. However, because R3 has currently the highest priority, it will become the new Standby - again, regardless of the preemption configuration.
Best regards,
Peter
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide