HSRP


HSRP (HOT STANDBY ROUTER PROTOCOL)

OVERVIEW

·         Hot Standby Router Protocol (HSRP) is a routing protocol that allows host computers on the Internet to use multiple routers that act as a single virtual router, maintaining connectivity even if the first hop router fails.
·         HSRP is Cisco proprietary which allows several routers or multilayer switches to appear as a single gateway IP address.
·         HSRP has 5 states: Initial, listen, speak, standby and active.
·         HSRP allows multiple routers to share a virtual IP and MAC address so that the end-user hosts do not realize when a failure occurs.
·         The active (or Master) router uses the virtual IP and MAC addresses.
Standby routers listen for Hellos from the Active router. A hello packet is sent every 3 seconds by default. The hold time (dead interval) is 10 seconds.
·         Virtual MAC of 0000. 0C07.ACxx, where xx is the hexadecimal number of HSRP group.
·         The group numbers of HSRP version 1 range from 0 to 255. HSRP version 1 supports up to 256 group numbers. HSRP version 2 supports 4096 group numbers.
·         A set of routers that run HSRP works in concert to present the illusion of a single default gateway router to the hosts on the LAN.
·         This set of routers is known as an HSRP group or standby group.
·         Active router forwards packets that hosts send to the virtual router. Only single router is chosen from group of routers.
·         Another router is elected as the standby router. If the active router fails, the standby assumes the packet forwarding duties.

HSRP States

HSRP consists of 5 states:
State
Description
Initial
This is the beginning state. It indicates HSRP is not running. It happens when the configuration changes or the interface is first turned on
Listen
The router knows both IP and MAC address of the virtual router but it is not the active or standby router. For example, if there are 3 routers in HSRP group, the router which is not in active or standby state will remain in listen state.
Speak
The router sends periodic HSRP hellos and participates in the election of the active or standby router.
Standby
In this state, the router monitors hellos from the active router and it will take the active state when the current active router fails (no packets heard from active router)
Active
The router forwards packets that are sent to the HSRP group. The router also sends periodic hello messages

STATE Transition

  • Now let’s take an example of a router passing through these states.
  •  Suppose there are 2 routers A and B in the network.
  • Router A is turned on first. It enters the initial state. Then it moves to listen state in which it tries to hear if there are already active or standby routers for this group.
  •  After learning no one take the active or standby state, it determines to take part in the election by moving to speak state.
  •  Now it starts sending hello messages containing its priority. These messages are sent to the multicast address 224.0.0.2 (which can be heard by all members in that group).
  • When it does not hear a hello message with a higher priority it assumes the role of active router and moves to active state. In this state, it continues sending out periodic hello messages.
  • Now router B is turned on. It also goes through initial and listen state. In listen state, it learns that router A has been already the active router and no other router is taking standby role so it enters speak state to compete for the standby router -> it promotes itself as standby router.

  
TIMERS

Default hello timers ----------------   3 seconds
               hold timers ---------------- 10 seconds




The timers can be changed with following command: 

standby [group-number] timers hello-time hold-time


Example- standby 1 timers 5 15



      ·           The HSRP preemption feature enables the router with highest priority to immediately become the Active router. Priority is determined first by the priority value that you configure, and then by the IP address.
  •     When a higher priority router preempts a lower priority router, it sends a coup message.
  •       When a lower priority active router receives a coup message or hello message from a higher priority active router, it changes to the speak state and sends a resign message.

        

The preempt delay feature allows preemption to be delayed for a configurable time period, allowing the router to populate its routing table before becoming the active router.
To configure HSRP priority and preemption

 standby [group] [priority number] [preempt [delay [minimum]seconds] [sync seconds]]



3.Interface Tracking

·                   ·         Interface tracking allows you to specify another interface on the router for the HSRP              process to monitor in order to alter the HSRP priority for a given group.
  •                If the specified interface's line protocol goes down, the HSRP priority of this router is reduced, allowing another HSRP router with higher priority can become active (if it has preemption enabled).


To configure HSRP interface tracking
 


        standby [group] track interface 

         standby 1  track serial0

  •  When multiple tracked interfaces are down, the priority is reduced by a cumulative amount. If you explicitly set the decrement value, then the value is decreased by that amount if that interface is down, and decrements are cumulative.
  •  If you do not set an explicit decrement value, then the value is decreased by 10 for each interface that goes down, and decrements are cumulative. 

Example:
interface ethernet0
     ip address 10.1.1.1 255.255.255.0
     standby ip 10.1.1.3
     standby priority 150
     standby track serial0
     standby track serial1
The HSRP behaviour with this configuration is:
·         0 interfaces down = no decrease (priority is 150)
·         1 interface down = decrease by 10 (priority becomes140)
·         2 interfaces down = decrease by 10 (priority becomes 130)




No comments:

Post a Comment