What is HSRP in Networking?
Redundancy is a crucial component of every modern network. In this digital era, staying without a network for even a short time is hard. You should include some redundancy if you don’t want your firm to cease operating. All of your devices will stop communicating with the outside world if the default gateway fails since they all point to it. That’s where HSRP comes into action, but what is HSRP in networking? The Hot Standby Router Protocol (HSRP) enables a backup router to take control of the default gateway. In this blog, we will discuss HSRP in networking in detail, it’s working, why we need it, its benefits, and drawbacks. Let’s Begin! HSRP in Networking or Hot Standby Router Protocol is a Cisco proprietary redundancy protocol for default gateway configuration in a network and fault tolerance. In order to maintain network connection even when one of the routers fails, HSRP enables several routers to cooperate and provide a single virtual router to the linked hosts. In an HSRP, routers in a group speak to one another via User Datagram Protocol (UDP) port 1985 using the multicast address 224.0.0.2. One router is chosen to serve as the group’s “active” router, which is in charge of forwarding traffic, and another is chosen to serve as the group’s “standby” or “backup” router, which assumes control in the event that the active router fails. HSRP stands for Hot Standby Router Protocol, a Cisco proprietary protocol that provides redundancy and load balancing for network routers. HSRP was first introduced in 1998, described in RFC 2281, and has been updated several times since then. The main updates are: As per the requirements, new patch update or enhancements has been made for better functioning. Before getting into the workings of Hot Standby Router Protocol, let’s first understand why HSRP is required. A device either has a static IP address or asks a DHCP server for a dynamic one. The device will always have an IP address, a subnet address, and the address of its default gateway. Unfortunately, the default gateway IP address can only be stored on a small number of devices. As a side effect, they will just point to a black hole if that gateway malfunctions. Outside of their subnet, they won’t be able to communicate with one another. You will experience significant downtime if the default gateway fails. As a result of this, the router faces a Single Point of Failure (SPoF). As you can see in the image below, if the router fails, then the network will be isolated. Also, if we take the case of the switch, the device that is connected to it will not be able to access the internet. But a switch is not SPoF; it will not impact the whole infrastructure of the company. Learn the difference between Switch and Router. Now, the question that arises is how to overcome this issue. For this type of scenario where SPoF occurs, we do this by setting up HSRP on the two routers. Instead of informing the customers, we set up the backup gateway to pass as the main one in the event of a primary gateway failure. You must add a Virtual IP Address (VIP) to both routers in order to complete that setup. It will only be used by the main router by default. However, the backup router will begin utilizing that IP if the main one fails. For better understanding, we have taken an example. Let’s now understand the different states of Hot Standby Router Protocol. The various HSRP states are listed below: The router sends periodic hello messages and forwards packets for the HSRP group. The router doesn’t send or receive HSRP messages and is not an HSRP participant. The router is learning the HSRP group’s virtual MAC address and IP address. The router monitors both the active and standby routers’ HSRP hello messages. The router is participating in the election of the active and standby routers and transmitting HSRP hello messages. The router periodically sends hello signals and waits to take over as the active router. Below, we have explained the working of HSRP in detail. Configuration HSRP is set up on routers connected to the same local area network (LAN) by network administrators. They allocate routers to an HSRP group with a certain group number. Additionally, a priority value is given to each router in the group (the default is 100), which establishes that router’s place in the group. Election process When routers have HSRP enabled, they communicate using HSRP hello messages to find one another and choose which routers are active and standby depending on priority settings. The router with the greatest priority is made active, and the router with the next-highest priority is made available as a standby. The router with the higher IP address prevails in cases when both have the same priority value. MAC address and virtual IP address A virtual IP address and virtual MAC address are shared by all group members in a HSRP group. The end devices’ default gateway address is typically specified as the virtual IP address. The virtual MAC address has the following format: 0000.0C07.ACxx, where xx is the hexadecimal representation of the HSRP group number. Active router role The virtual IP address’s active router relays traffic on its behalf. In order to keep its position and update the other routers in the group on its status, it also regularly broadcasts HSRP hello messages (the default interval is 3 seconds). Standby router role When the active router sends an HSRP hello message, the standby router waits for it. If it doesn’t get any hello messages from the current router for a certain amount of time (the default is 10 seconds), it is ready to take over as the active router. Failover process The standby router takes over as the active router if the current router fails or becomes inaccessible. Starting the traffic forwarding process, it adopts the virtual IP and MAC addresses. A new standby router is chosen in the meantime from among the group’s remaining routers using priority values. Recovery Depending on its priority value and preemption settings, the failed active router either rejoins the HSRP group as a standby router or assumes its previous active function. High availability and redundancy are provided by HSRP, which ensures network traffic keeps moving even if a router malfunctions. In this lab you’ll configure and test HSRP (Hot Standby Router Protocol) for a small campus network to ensure the Create a topology like shown below: Configure the IP addresses on R1, R2 and R3. Then configure the virtual IP address 192.168.10.254 /24 using the R1: Now, configure the same IP address on R2’s interface. Let’s check which router out of R1 and R2 is in active state. Use the command ‘show standby’ in the enable mode to In this topology, R1 is in active state. Configure DHCP pool on R1 and R2 with the default gateway as 192.168.10.254 and R3 with 192.168.30.3 R1: R2: R3: Now, the last step is to configure routing on the devices. We are configuring EIGRP 1 here. R1: R2: R3: After configuring the end devices with the IP address let’s test the working of HSRP. Run a continuous ping from PC0 to PC1 using command ‘ping -t 192.168.30.1’ and shutdown the interface fa 0/0 of R1. R1(config)#interface fa 0/0 You’ll observe that PC0’s will recover from the R1’s route failure and will start transmitting through R2. Reply from 192.168.30.1: bytes=32 time<1ms TTL=126 Now, if you check the HSRP details on R2 using command ‘show standby’ you’ll find it in the active state. We have a detailed understanding of how HSRP functions, so let’s discuss the advantages and disadvantages of using HSRP. Here are the main advantages – Although HSRP provides advantages, there are a number of disadvantages to take into account: Now, we have understood everything related to HSRP in networking. Let’s wrap this article. HSRP is a Cisco proprietary protocol that enables two or more routers to work together to offer a network with redundancy and load balancing. HSRP, or Hot Standby Router Protocol, is a Cisco proprietary, which means it is suitable for Cisco devices, whereas VRRP, or Virtual Router Redundancy Protocol, is an open standard protocol that is suitable for a variety of vendors. HSRP is a layer 3, i.e., network layer protocol. HSRP and VRRP are both protocols that provide redundancy for routers in a network. HSRP is specially developed for Cisco devices, whereas VRRP supports various vendors. In this blog, we have explained what is HSRP in networking, how it works, different HSRP states, the need for Hot Standby Router Protocol, advantages and disadvantages. If you want to learn HSRP in detail, you can join PyNet Labs’ CCNA Course. If you have any suggestions or queries, feel free to comment below.Introduction
What is HSRP in Networking?
History of HSRP
The Need for Hot Standby Router Protocol
Hot Standby Router Protocol States
Active
Init
Learn
Listen
Speak
Standby
How does HSRP work?
HSRP Configuration
recovery of user traffic transparently and immediately from first hop router failures.
commands given below.
R1(config)#int fa 0/0
R1(config-if)#standby ip 192.168.10.254
R1(config-if)#ex
R2(config)#int fa 0/0
R2(config-if)#standby ip 192.168.10.254
R2(config-if)#ex
check the details.
R1(config)#ip dhcp pool a
R1(dhcp-config)#network 192.168.10.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.10.254
R1(dhcp-config)#ex
R2(config)#ip dhcp pool a
R2(dhcp-config)#network 192.168.10.0 255.255.255.0
R2(dhcp-config)#default-router 192.168.10.254
R2(dhcp-config)#ex
R3(config)#ip dhcp pool a
R3(dhcp-config)#network 192.168.30.0 255.255.255.0
R3(dhcp-config)#default-router 192.168.30.3
R3(dhcp-config)#ex
R1(config)#router eigrp 1
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.10.0
R1(config-router)#network 192.168.20.0
R1(config-router)#ex
R2(config)#router eigrp 1
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.10.0
R2(config-router)#network 192.168.20.0
R2(config-router)#ex
R3(config)#router eigrp 1
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.20.0
R3(config-router)#network 192.168.30.0
R3(config-router)#ex
R1(config-if)#shutdown
Reply from 192.168.30.1: bytes=32 time<1ms TTL=126
Request timed out.
Request timed out.
Reply from 192.168.30.1: bytes=32 time<1ms TTL=126
Reply from 192.168.30.1: bytes=32 time<1ms TTL=126Advantages of Hot Standby Router Protocol
Disadvantages of Hot Standby Router Protocol
Frequently Asked Questions
Q1 – Why HSRP is used in networking?
Q2 – What is HSRP and VRRP?
Q3 – Is HSRP a layer 2 or 3 network?
Q4 – Is HSRP and VRRP the same?
Conclusion