Overview
VRRP overview
With the development of the Internet, higher network reliability is increasingly required. For LAN users, it is essential to be in contact with the external network at all times. Generally, all hosts on an internal network are configured with a default route to an exit gateway, through which they communicate with external networks. If the exit gateway fails, communication between these hosts and external networks will be interrupted. It is common to configure multiple exit gateways to improve system reliability. However, most hosts on a LAN generally do not support dynamic routing protocols, so selecting a path among multiple exit gateways is a problem. The IETF (Internet Engineering Task Force) developed VRRP (Virtual Router Redundancy Protocol) to allow LAN hosts to reliably access external networks.
3. What are the benefits of VRRP?
The VRRP function dynamically assigns a virtual router to one of the VRRP routers on a LAN. The VRRP router that controls the virtual router’s IP address is called the master router, which forwards packets to those virtual IP addresses. If the master router fails, this selection process provides a dynamic failover mechanism. Thus, if a host fails to route the next hop, another router can quickly replace it, ensuring continuity and reliability of communication.
4. How does VRRP work?
Comme le montre la Figure 1, les routeurs A, B et C constituent un routeur virtuel VRRP. L’adresse IP virtuelle du VRRP est 10.110.10.1. Le routeur A sert de routeur maître et son adresse IP est 10.110.10.5 ; les routeurs B et C servent de routeurs de secours, et leurs adresses IP sont respectivement 10.110.10.6 et 10.110.10.7. La passerelle par défaut pour les hôtes A, B et C sur le LAN est définie sur l’adresse IP virtuelle du VRRP 10.110.10.1. Normalement, le routeur A agit comme routeur maître pour acheminer les paquets du LAN vers le réseau externe ; en cas d’arrêt ou de défaillance du routeur A, le routeur B ou le routeur C (selon la priorité) en tant que routeur de secours deviendra le routeur maître pour acheminer les paquets du LAN vers les réseaux externes, afin de maintenir la communication entre le LAN et le réseau externe et d’améliorer la fiabilité du réseau.
Figure 1 Virtual router diagram
As shown in Figure 1, the virtual router's network environment is as follows:
Hosts communicate with external networks via this virtual gateway. The router’s operating mechanism is as follows:
● The master router is selected based on priority levels:
The router with the highest priority is selected as the master router.
If two routers have the same priority, then compare the IP address of the interface. The router with the highest interface IP address will be selected as the master router.
Other routers serve as backup routers that constantly monitor the status of the master router.
● If the group’s backup router does not receive packets from the master router during the Master_Down_Interval period, it will switch to master router. In a VRRP group with multiple backup routers, multiple master routers can be generated in a short time, then the priorities of received VRRP packets are compared with local priorities, and the router with the highest priority is selected as the master router.
5. VRRP state machine
VRRP defines three states: Initial, Master, and Backup. Only the router in Master state can forward packets destined for the virtual IP address.
Figure 1 shows the VRRP state transition.
Figure 1 VRRP State Transition
The master becomes Initialize: receive a shutdown message
Initialization becomes Master: receipt of a Shutup message with priority 255
The master becomes backup: receives a packet with a higher priority than the local one
Initialization becomes Backup: receipt of a 'Shutup' message with a priority lower than 255
Backup becomes master: expiration
· Initialize
A router enters the Initialise state at boot. If an interface startup message is received, the router switches to the Backup or Master state (if the IP address owner’s interface priority is 255, the router immediately goes to Master). In this state, the router does not process VRRP packets.
· Main
(1) In Master mode, a router performs the following actions:
· Periodically transmits VRRP packets.
Responds to ARP requests for a virtual IP address and replies with the virtual MAC address instead of the physical interface MAC.
· Transfers packets whose destination MAC address is a virtual MAC address.
· Switch to backup state if a higher priority packet is received.
· Switches to standby mode if a packet of the same priority is received and the primary IP address at the sending end is higher than the local one.
· Transition to the Initialize state when the interface shutdown event is received.
· Backup
· (2) In backup mode, the router performs the following actions:
· Receives VRRP packets transmitted by the master and determines if the master router is functioning correctly.
· Does not respond to ARP requests for the virtual IP address.
· Reject IP packets whose destination MAC address is a virtual MAC address.
· Does not receive IP packets whose destination IP address is a virtual IP address.
· Switch to Master-only state only when the backup router receives an event indicating the MASTER_DOWN_TIMER has expired.
· Transition to Initialization state upon receiving an interface shutdown event.6. Conclusion
VRRP provides redundancy through two or more routing switches that support VRRP. When the master router fails, communication can be maintained via the backup routers. In case of failure, no replacement of the client equipment (CPE) configuration is required. The routing function automatically fails over to the backup routers. In practice, choosing the appropriate routing technology based on planned requirements is highly beneficial for network stability.
Common network mode
1. What is VRRP?
VRRP (Virtual Routing Redundancy Protocol) is a network selection protocol. In simple terms, the basic principle of VRRP is redundant backup of the gateway, meaning a virtual router is created from two or more routers through the operation of VRRP, and the virtual router is used as the gateway for downstream devices.
The basic concepts related to VRRP are presented as follows :
|
Concepts |
Descriptions |
| VRRP Router | A router running VRRP that can belong to one or more virtual routers. |
| Virtual router | An abstract device managed by VRRP, also called a VRRP backup group. A virtual router serves as the default gateway for hosts on a shared LAN. A virtual router includes a virtual router ID and a set of virtual IP addresses. |
| Virtual IP address | IP address of a virtual router. A virtual router is manually assigned one or more virtual IP addresses. |
| (IP address owner) | A VRRP router that uses the virtual router's IP address as the real interface address. When functioning correctly, the VRRP router responds to packets destined for the virtual IP address, such as ping packets and TCP packets. |
|
(Virtual MAC address ) |
A MAC address generated by a virtual router based on the virtual router ID. A virtual router has a virtual MAC address. A virtual router responds to ARP (Address Resolution Protocol) requests using a virtual MAC address instead of the real MAC address of the interface. |
| (Adresse IP principale) | Une adresse IP sélectionnée parmi les adresses IP des interfaces physiques. C'est généralement la première adresse IP configurée. L’adresse IP principale sert d’adresse IP source dans les paquets de diffusion VRRP. |
| Main router (Primary virtual router) |
AVRRP router forwards packets to the virtual IP address and responds to ARP requests. When a proprietary IP address is available, it usually functions as the master router. |
| Backup router (Virtual backup router) | A set of VRRP routers that do not forward packets. If the master router fails, the most appropriate backup router, selected by competition, becomes the new master router. |
