What is the VRRP protocol? Explain how it works

Author: Insist--

Personal homepage: insist--personal homepage

The author will continue to update network knowledge and python basic knowledge , looking forward to your attention

foreword

This article will explain what VRRP is, how it works, its advantages, and its basic concepts.

Table of contents

1. What is the VRRP protocol?

2. Working principle of VRRP protocol

1. In preemptive mode

2. In non-preemptive mode

3. Advantages of VRRP

1. Simplify network management

2. Strong adaptability

3. Small network overhead

4. Basic concepts of VRRP

1. Virtual router

2. Master router

3. Backup router

4、Priority

5、twist

6. Virtual IP address

7. IP address owner

8. Virtual MAC address


1. What is the VRRP protocol?

2c2fe1f7ac1f4e87a56cd0d60d72aa15.JPG

VRRP (Virtual Router Redundancy Protocol) is a protocol for implementing router redundancy , and is usually used to ensure high availability of the network . When the main router fails, the backup router will automatically take over the work of the main router, so as to ensure that the network can still work smoothly.

The VRRP protocol is mainly used to solve the single point of failure problem , that is, when a router in the network fails, other routers can automatically take over the function of the router, thereby ensuring network connectivity. The VRRP protocol configures multiple routers as a group, one of which is elected as a virtual router, and the other routers are used as backup routers, while monitoring the status of the virtual routers. When a virtual router fails, the backup router will automatically take over its functions, thus ensuring network connectivity.

2. Working principle of VRRP protocol

After the router enables the VRRP function, it will determine its own role in the backup group according to the priority . The router with a higher priority becomes the active router, and the router with a lower priority becomes the standby router . The active router regularly sends VRRP notification messages to inform other routers in the backup group that it is working normally; the backup router starts a timer and waits for the notification messages to arrive.

In different master preemption modes of VRRP, the master role is replaced in different ways:

1. In preemptive mode

When the standby router receives the VRRP advertisement message, it compares its own priority with the priority in the advertisement message. If it is greater than the priority in the advertisement message, it will become the active router; otherwise, it will remain in the standby state.

2. In non-preemptive mode

As long as the active router does not fail, the routers in the backup group will always maintain the active or standby status, and the routers in the backup group will not become active routers even if they are configured with a higher priority later.

If the timer of the standby router expires and still does not receive the VRRP advertisement message sent by the active router, it is considered that the active router has failed to work normally. At this time, the standby router will consider itself to be the active router and send a VRRP advertisement to the outside world. message. The routers in the backup group elect the active router according to the priority to undertake the packet forwarding function.

3. Advantages of VRRP

afeb685cd3f6490bb90c4518df2cf141.jpg

1. Simplify network management

In a LAN with multicast or broadcast capabilities (such as Ethernet), VRRP can still provide a highly reliable default link when a certain device fails, effectively avoiding the problem of network interruption after a single link fails . There is no need to modify configuration information such as dynamic routing protocols and route discovery protocols, and there is no need to modify the default gateway configuration of the host.

2. Strong adaptability

VRRP packets are encapsulated in IP packets and support various upper-layer protocols.

3. Small network overhead

VRRP defines only one type of message, that is, VRRP Advertisement message, and only routers in the Master state can send VRRP messages.

4. Basic concepts of VRRP

1. Virtual router

Consisting of a Master device and multiple Backup devices, it is used as the default gateway of hosts in a shared LAN . For example, RouterA and RouterB together form a virtual router.

2. Master router

A VRRP device responsible for forwarding packets, such as RouterA.

3. Backup router

A group of VRRP devices that do not undertake the forwarding task, when the master device fails, they will become the new master device through election, such as RouterB.

4、Priority

The priority of the device in the backup group, the value range is 0~255.

0 means that the device stops participating in the VRRP backup group, which is used to make the backup device become the master device as soon as possible without waiting for the timer to expire

255 is reserved for the IP address owner and cannot be manually configured; the default priority value of the device is 100.

5、twist

The ID of the virtual router , as shown in the figure, the vrid of the virtual router composed of RouterA and RouterB is 1, which needs to be manually specified, and the range is 1-255.

6. Virtual IP address

The IP address of the virtual router . A virtual router can have one or more IP addresses, which are configured by the user. For example, the virtual IP address of the virtual router composed of RouterA and RouterB is 10.1.1.254/24.

7. IP address owner

If a VRRP device configures the real interface IP address as the virtual router IP address , the device is called the IP address owner. If the IP address owner is available, it will always be the Master.

8. Virtual MAC address

The MAC address generated by the virtual router based on the vrid. A virtual router has a virtual MAC address. When a virtual router responds to an ARP request, it uses the virtual MAC address instead of the real MAC address of the interface . For example, the vrid of the virtual router composed of RouterA and RouterB is 1, so the MAC address of this VRRP backup group is 00-00-5E-00-01-01.

Guess you like

Origin blog.csdn.net/m0_73995538/article/details/131446109