The Wayback Machine - https://web.archive.org/web/20241008094746/https://www.geeksforgeeks.org/hot-standby-router-protocol-hsrp/
Open In App

Hot Standby Router Protocol (HSRP)

Last Updated : 25 Oct, 2021
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol, which provides redundancy for a local subnet. In HSRP, two or more routers gives an illusion of a virtual router.

HSRP allows you to configure two or more routers as standby routers and only a single router as an active router at a time. All the routers in a single HSRP group shares a single MAC address and IP address, which acts as a default gateway to the local network. The Active router is responsible for forwarding the traffic. If it fails, the Standby router takes up all the responsibilities of the active router and forwards the traffic.

Some important terms related to HSRP :

  1. Virtual IP : IP address from local subnet is assigned as default gateway to all local hosts in the network.
  2. Virtual MAC address : MAC address is generated automatically by HSRP. The first 24 bits will be default CISCO address (i.e. 0000.0c). The next 16 bits are HSRP ID (i.e. 07.ac). The next 8 bits will be the group number in hexadecimal. e.g- if the group number is 10 then the last 8 bits will be 0a.
     
    Example of virtual MAC address –

    0000.0c07.ac0a
  3. Hello messages : Periodic messages exchanged by active and standby routers. These messages are exchanged after every 3 seconds telling the state of router.
  4. Hold down timer : Its default value is 10 seconds i.e roughly 3 times the value of hello message. This timer tells us about the router that how much time will the standby router waits for hello message if it is not received on time.

    Note : If the active router fails then the standby router will become the active router.

  5. Priority : By default, the priority value is 100. It is helpful when the active router comes back after falling down, we can change the priority of standby router (which has become the active router after the original active router is down) to less than 100 therefore it again becomes standby router.

    Note : The router having higher priority will become the active router.

  6. Preempt : It is a state in which the standby router automatically becomes the active router.

WORKING :

Members having same group ID are the members of same group. One of the member of the group will be elected as the active router while others remain as standby routers. The virtual IP is configured as default gateway of all the hosts in the local subnet and the active router is responsible for forwarding the traffic of local hosts. If the active router goes down then the hello messages are not exchanged between the active and the standby routers therefore the standby router waits until the hold-down timer time. As soon as the hold down time is finished, the standby router will become the active router and take up all the responsibilities of active router. This is known as preempt.
If in case the original active router comes back then we can decrease the priority of the standby router so that it will become the standby router again.

Hot Standby Router Protocol (HSRP) has 2-versions :

version 1 : The messages are multicast at 224.0.0.2 and uses the UDP port 1985. This version allows group number range from 0 to 255.
version 2 : The messages are multicast at 224.0.0.102 and uses the UDP port 1985. This version allows group number range from 0 to 4095.

CONFIGURATION :


Consider above given topology. There are 2 routers named R1 and R2. IP address of R1 (f 0/0) is 10.1.1.1/24 and R2 (f 0/0) is 10.1.1.2/24.

Assigning IP address to router R1.

r1#(config) int fa0/0
r1#(config-if)ip add 10.1.1.1 255.255.255.0

Assigning IP address to router R2.

r2#(config) int fa0/0
r2#(config-if)ip address 10.1.1.2 255.255.255.0

Now, Let’s provide virtual IP address (10.1.1.100), group name HSRP_TEST, group number 1and priority 110. Also, preempt has been enabled i.e. if the active router goes down then the standby router automatically becomes the active router.

r1#(config-if) standby 1 ip 10.1.1.100
r1#(config-if) standby 1 name HSRP_TEST
r1#(config-if) standby 1 priority 110
r1#(config-if) standby 1 preempt

Now, we will provide virtual IP address (10.1.1.100), group name HSRP_TEST and priority 100. Also, group number 1 and preempt has been enabled.

r2#(config) int fa0/0
r2#(config-if) standby 1 ip 10.1.1.100
r2#(config-if) standby 1 name HSRP_TEST
r2#(config-if) standby 1 priority 100
r2#(config-if) standby 1 preempt

Note : As we have provided priority 110 to r1, therefore it will become the active router.


Previous Article
Next Article

Similar Reads

Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol used to provide redundancy in a network. Only one router is the active router while others will be in standby state i.e the standby router will be responsible for forwarding the traffic when the active router fails. Virtual Router Redundancy Protocol (VRRP) is an open standard proto
3 min read
HSRP vs VRRP vs GLBP Protocols
HSRP, VRRP, and GLBP all are First Hop Redundancy Protocols and network-layer protocols which are used to provide redundancy in the network. The main purpose of them is to provide redundancy to the default gateway in a LAN environment. Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol, that provides a mechanism that is designed to
4 min read
Introduction of Virtual Router Redundancy Protocol (VRRP) and its configuration
VRRP is an open standard protocol, which is used to provide redundancy in a network. It is a network layer protocol (protocol number-112). The number of routers (group members) in a group acts as a virtual logical router which will be the default gateway of all the local hosts. If one router goes down, one of the other group members can take place
4 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Both the Stop and Wait protocol and the Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between the Stop-and-wait protocol and the Sliding window protocol is that in the Stop-and-Wait Protocol, the sender sends one frame and waits for acknowledgment from the receiver whereas in the sliding wi
5 min read
Difference between Border Gateway Protocol (BGP) and Routing Information Protocol (RIP)
When dealing with network routing, it's crucial to understand the various protocols that help direct traffic across complex networks. Two significant protocols in this space are the Border Gateway Protocol (BGP) and the Routing Information Protocol (RIP). Each serves different purposes and operates under different principles. This article explores
5 min read
Difference between File Transfer Protocol (FTP) and Secure File Transfer Protocol (SFTP)
Data transfer is the most common task in network and system communications, and they involve transfer of files using two means i.e the File Transfer Protocol (FTP) and the Secure File Transfer Protocol (SFTP). FTP is a commonly applied protocol that enables files to be transferred through a network from one computer to another, but FTP is unsecure
5 min read
Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP), are designed to avoid network loops in Ethernet. It provide loop-free logical topology. They were both designed to provide network reliability and particularly avoid broadcast radiation, but the major differences are on the rate, functionality and versatility. In this article we
5 min read
Difference between Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP)
SLIP and PPP, which are the widely used serial connection techniques, help to connect the distant devices of the network. The fullform of SLIP is Session Layer Internetworking Protocol. SLIP being a primitive protocol put into use during the early connections to the Internet, when there was not much overhead. PPP is slightly more complex as the pro
6 min read
Hot Spot 2.0
A wireless local area network (LAN) node that provides internet connection and virtual private network (VPN) access from a given location for users of devices with wireless connectivity is a Hot Spot. Nowadays hot spots are common in airports, libraries, hotels, coffee shops, etc. A user can connect to a hot spot manually by checking the wireless c
5 min read
Hot and Cold Migrations
1. Cold Migration : A powered down Virtual Machine is carried to separate host or data store. Virtual Machine's power state is OFF and there is no need of common shared storage. There is a lack of CPU check and there is long shortage time. Log files and configuration files are migrated from the source host to the destination host. The first host’s
2 min read
Configuration of Router on a stick
Prerequisite - Access and trunk ports Switches divide broadcast domain through VLAN (Virtual LAN). VLAN is a partitioned broadcast domain from a single broadcast domain. Switch doesn't forward packets across different VLANs by itself. If we want to make these virtual LANs communicate with each other, a concept of Inter VLAN Routing is used. Inter V
3 min read
Open shortest path first (OSPF) router roles and configuration
Prerequisite - Open shortest path first (OSPF) Open shortest path first (OSPF) is a link-state routing protocol which is used to find the best path between the source and the destination router using its own SPF algorithm. Open shortest path first (OSPF) router roles - An area is a group of contiguous networks and routers. Routers belonging to same
3 min read
Backing up Cisco IOS Router image
As a network administrator, you should always have a backup for worse conditions. One of the common worse conditions that can occur is the IOS image of a device being deleted. This condition gets worse if there is no backup of the IOS image present. So to ignore conditions like these, a backup should be a must and here we will take a Cisco IOS imag
4 min read
Cisco Router modes
A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP address and the entry in the routing table. By using a routing table, it finds an optimized path between the source and destination network. Let's discuss the Cisco router's different modes
4 min read
Cisco Router basic commands
A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP address and the entry in the routing table. By using a routing table, it finds an optimized path between the source and destination network. Here, we will talk about Cisco router's basic co
4 min read
Difference between Bridge and Router
Prerequisite - Network Devices Bridge is a network device, which works in data link layer. Through bridge, data or information is not stored and sent in the form of packets. Whereas Router is also a network device which works in network layer. Through router, data or information is stored and sent in the form of packets. The main difference between
2 min read
How to connect one router to another to expand the network?
Prerequisite - Router Step-1 : Set up Primary Router Figure - Set Up Primary Router To set up your primary router, connect the Ethernet cable provided by your internet service provider which carries internet to the WAN port of a router. On many routers, the "WAN" port is also labelled as "Internet". Once your primary router is installed and interne
3 min read
Port Forwarding on Router and Why do we need It
Router port forwarding is used to allow the remote computers to connect to a specific service or computer on a Local Area Network. Now the question is why do we need it. And we will discuss all of these things one by one. Use Cases : Suppose you are at the office and want to connect to your computer which is present in your house, the computer pres
4 min read
How to Configure DHCP Server on a Cisco Router?
In this article, we will discuss the overview of DHCP and will focus to implement How to Configure DHCP Server on a Cisco Router step by step. Let's discuss it one by one. Overview :DHCP (Dynamic Host Configuration Protocol) configuration is performed on routers to assign an IP address, subnet mask, gateway address ad DNS server address to the host
3 min read
What are the different memories used in a CISCO router?
Before we discuss the memories that are used in a Cisco router, let's understand what basically a Router is. When we want to connect two or more IP networks or subnetworks together, then a piece of hardware is needed and that hardware is called a Router. It generally serves two purposes: Enabling the usage of a single Internet connection by several
4 min read
What are Different Types of Passwords used in Securing Cisco Router?
Passwords are an essential part of the cisco router access control methods. These are used to restrict access to a CISCO router; As there is no automatic or default password defense that comes with the routers, different types of passwords are used, such as the Console password used for setting up the console port password, Aux Passwords for settin
4 min read
Passive Queue Management in Router
Congestion occurs when packets' arriving rate is faster than packets forwarding speed. The router has input and output ports. Thus congestion can happen at any port depending upon the speed of switching fabric. Congestion at Input PortsSuppose the router has N input ports and N output ports. If the speed of switching fabric is less than N times the
6 min read
Internal Components of Router
A Router is a networking device that fulfills the need for devices to share files and forward data packets between devices over computer networks. Routers perform some directing functions on the Internet so the data sent over the internet, such as a web page in the form of data packets Example: Let us understand this by a very general example, supp
3 min read
Steps of Configuring the Router ID
Prerequisites: Routing Tables in Computer Network A router ID is a 32-bit Internet Protocol address that uniquely identifies a router or an interface in an Autonomous System. This article will discuss how to configure the router ID in the Cisco packet tracer. let's discuss the proper steps to configure the router: Step 1: First open The Cisco packe
3 min read
Difference between User Mode and Privileged Mode in Cisco Router
A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP address and the entry in the routing table. By using a routing table, it finds an optimized path between the source and destination network. In this article we will see difference between U
3 min read
How Does a Router Work?
A Router is a networking device that forwards data packets between computer networks. One or more packet-switched networks or subnetworks can be connected using a router. By sending data packets to their intended IP addresses, it manages traffic between different networks and permits several devices to share an Internet connection. Although there a
6 min read
How To Use a Router as a Gateway?
A router is a networking device that forwards data packets between computer networks. It works by receiving incoming data packets and forwarding them to the appropriate network based on their destination address. This allows multiple devices to communicate with each other and access the internet using a single connection. In addition to forwarding
4 min read
How to Add Port in Router in CISCO Packet Tracer?
Cisco Packet Tracer is a tool built by Cisco and it provides network simulation to practice simple and complex networks. The main purpose of the Cisco Packet Tracer is to help students learn the principles of networking and demonstrate the networking concepts. Router is a networking device that works in the network layer and can connect two differe
2 min read
Difference Between Modem and Router
The basic difference between a Modem and a Router is that a Modem takes Internet Signals from the provider and connects it with your device and a Router takes the Internet from the modem and transfers it to your wireless devices. Both Modem and Router measure the networking devices, wherever a piece of electronic equipment connects your laptop or y
9 min read