Comparison between Gateway Redundancy Protocol HSRP and VRRP Technology
A redundancy protocol generally refers to a protocol that prevents network equipment from failing. Now there are three redundancy protocols: VRRP of IETF, HSRP of Cisco, and NSRP of JUNIPER.
Today, let’s compare the differences between Cisco’s HSRP and Huawei and H3C’s VRRP protocols.
HSRP: (Hot Standby Router Protocol) – Hot Standby Routing Protocol
It is a unique technology of the cisco platform and a private agreement of cisco.
The design goals of the Hot Standby Router Protocol (HSRP) are to support IP traffic failover under certain circumstances without causing confusion, to allow hosts to use a single router, and to maintain inter-router communication even if the actual first-hop router fails. Connectivity. In other words, when the source host cannot dynamically know the IP address of the first-hop router, the HSRP protocol can protect the first-hop router from failure. The protocol contains multiple routers, corresponding to a virtual router. The HSRP protocol only supports one router to implement the packet forwarding process on behalf of the virtual router. End hosts forward their respective packets to the virtual router.
A router responsible for forwarding packets is called an active router. Once the active router fails, HSRP will activate the standby routers (Standby Routers) to replace the active router. The HSRP protocol provides a mechanism to decide whether to use an active router or a backup router, and to designate a virtual IP address as the default gateway address of the network system. If the active router fails, the backup routers (Standby Routers) take over all the tasks of the active router and will not cause interruption of host connectivity.
HSRP runs on UDP using port number 1985. The source address of the router forwarding protocol packets is the actual IP address, not the virtual address. Based on this, HSRP routers can identify each other.
VRRP: (Virtual Router Redundancy Protocol) – Virtual Router Redundancy Protocol
It is an international standard. It is a routing protocol proposed by IETF to solve the single-point failure phenomenon of configuring static gateways in LANs.
Virtual Router Redundancy Protocol (VRRP) is an alternative protocol that dynamically assigns the responsibilities of a virtual router to one of the VRRP routers on the local area network. The VRRP router that controls the IP addresses of the virtual routers is called the master router, and it is responsible for forwarding packets to these virtual IP addresses. This selection process provides a dynamic failover mechanism once the primary router becomes unavailable, which allows the IP address of the virtual router to act as the default first-hop router for end hosts. The benefit of using VRRP is higher availability of default paths without the need to configure dynamic routing or route discovery protocols on each end host. VRRP packets are sent encapsulated in IP packets.
With VRRP, a virtual IP address can be set as the default router either manually or by DHCP. Virtual IP addresses are shared among routers, with one designated as the primary router and the others as backup routers. If the primary router is unavailable, this virtual IP address is mapped to the IP address of a backup router (the backup router becomes the primary router). VRRP can also be used for load balancing. VRRP is part of IPv4 and IPv6.
All are to improve network reliability: use backup for routers or core devices to protect the first-hop router from failure.
A group of routers, the external performance is a router, (including a Master that is the active router and several Backups that are backup routers).
Provide a Virtual IP and Virtual MAC to the outside world.
The active router (usually the one with higher priority) forwards the packet.
The other one with low priority is in hot standby/backup state and does not forward data packets.
Once the active router fails, the router in hot standby/back up will immediately become the active router for packet forwarding
HSRP defines 6 states:
Initial state: The state when HSRP is started. HSRP is not running yet. Generally, this state is entered when the configuration is changed or the port is just started.
Learning state learn: The router is still waiting for a message from an active router. At this time, the router has not seen the Hello message of the active router and has not learned the IP address of the virtual router.
Listening state listen: The router is listening for Hello messages. The virtual IP address is already known.
Speak state: In this state, the router sends periodic Hello messages and participates in the election of the active router or the backup router. The router with a higher priority will become the active router.
Backup state standby: When the active router fails, the router is ready to take over the packet transmission function.
Active state: The router performs the packet transmission function.
MAC address of the HSRP virtual router:
00-00-0c – 07-ac – 0a
Vendor code MAC virtual address HSRP group number
There are three types of multicast messages in the routing exchange of the HSRP protocol:
1. The Hello:hello message informs other routers to send the HSRP priority and status information of the router. The HSRP router sends a hello message every 3s by default.
2. Coup: A coup message is sent when a standby router becomes an active router.
3. Resign: When the active router is about to go down or a router with a higher priority sends a hello message, the active router sends a resign message.
HSRP runs on UDP, uses port number 1985, and the destination address is the multicast address of all routers:
The HSRPv1 address is 126.96.36.199, which conflicts with the CGMP address. HSRPv2 is changed to 188.8.131.52.
VRRP defines 3 states:
Initial state: The state when VRRP is started. VRRP is not running yet. Generally, it enters this state when the configuration is changed or the port is just started.
Master state master: The router performs the forwarding function.
Backup state backup: When the router fails, the router is ready to take over the packet forwarding function.
VRRP virtual machine router MAC address:
00-00-5e – 00-01 – Group Number
Vendor code Virtual MAC address VRRP group number
There is only one broadcast message in the routing exchange of VRRP protocol:
Advertisement Advertisement message: The sender can only be the master, and by default, an advertisement message is sent every 1s.
Advertisement contains information about various routers, such as version number, priority, number of virtual IP addresses in the backup group, and so on.
VRRP messages are encapsulated in ip packets, using port number 112, and the destination address is the multicast address of all routers: 184.108.40.206.