Virtual routing device identification conflict detection method, device, equipment and storage medium
Patent Information
- Application Number
- CN202210860923.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-07-21
AI Technical Summary
如果两个集群都配置VRID为1,VRRP协议会误以为A、B、C、D是一个集群,选举出一个master,而实际上这是两个集群,彼此没有关联,如此将会导致有一个集群工作不正常
[0042] The VRID modification module is used to receive VRID modification messages, determine whether the cluster identifier carried in the VRID modification message is the same as the cluster identifier of the device itself, and modify the VRID identifier of the device itself to the VRID carried in the VRID modification message if they are the same.
Smart Images

Figure CN115460170B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of communication and cloud computing technology, and in particular to a method, apparatus, device and storage medium for detecting virtual routing device identifier conflicts. Background Technology
[0002] All hosts within the same network segment are typically configured with the same default gateway. Packets sent by a host to other network segments are forwarded through the default gateway, enabling communication between the host and the external network. When the default gateway fails, all hosts within the network segment will be unable to communicate with the external network.
[0003] The default gateway facilitates user configuration, but it places high stability requirements on the gateway device. Adding gateways is a common way to improve link reliability. At this point, how to select routes among multiple exit points becomes a problem that needs to be solved.
[0004] The Virtual Router Redundancy Protocol (VRRP) combines several routing devices into a single virtual routing device, assigning it a virtual IP address. Through a specific mechanism, it ensures high availability by promptly switching services to the backup routing device when the primary routing device fails. VRRP uses an election mechanism to determine which routing device undertakes forwarding tasks. Hosts within the local area network (LAN) only need to know the virtual IP address of this virtual routing device and set it as the gateway's IP address. Hosts within the LAN can then communicate with the external network through this virtual routing device.
[0005] VRRP improves reliability while simplifying host configuration. In local area networks (LANs) with multicast or broadcast capabilities (such as Ethernet), VRRP can provide a highly reliable link even if a router fails, effectively avoiding network outages caused by a single link failure.
[0006] The proper functioning of the VRRP protocol depends on the correct sending and receiving of VRRP messages. VRRP defines only one message format, namely the Advertisement message, which is encapsulated in an IP message. The protocol number field in the IP message header is usually 112, and the destination IP address of the message is usually the multicast address 224.0.0.18.
[0007] The VRRP message format includes a Virtual Router Identification (VRID) field, which is used to uniquely identify a virtual routing device in the network. The value range is 1 to 255, and routing devices belonging to the same VRRP group must use the same VRID.
[0008] Currently, VRIDs are configured by the users themselves, and multiple software programs using the VRRP protocol are prone to VRID configuration conflicts. For example, keepalive software uses VRRP, and in actual development, a software system may use multiple software programs such as OpenStack and Ceph, which in turn use keepalive software. Since these software programs are unaware of each other's existence, VRID configuration conflicts are likely to occur, leading to VRRP election failure. For instance, if clusters A and B are one cluster, and clusters C and D are another, a master router should be elected between A and B, and between C and D, for a total of two masters. If both clusters are configured with VRID 1, the VRRP protocol will mistakenly believe that A, B, C, and D are a single cluster and elect a single master, when in fact they are two unrelated clusters. This will cause one cluster to malfunction. Summary of the Invention
[0009] In view of this, the present invention provides a method, apparatus, device and storage medium for detecting virtual routing device identifier conflicts, which is used to solve the technical problem of VRID conflicts.
[0010] According to one aspect of the embodiments of the present invention, the present invention provides a virtual routing device identifier conflict detection method, which is applied to a device (device A) using the Virtual Router Redundancy Protocol (VRRP), and the method includes:
[0011] The device sends a Virtual Router Device Identifier (VRID) check message to the network, the VRID check message carrying the device's Virtual Router Device Identifier (VRID) and cluster identifier;
[0012] The device determines whether a VRID conflict exists based on whether a VRID response message is received within a preset response time range;
[0013] If the device receives a VRID response message from another device within the preset response time range, it is determined that there is a VRID conflict in the network.
[0014] If no VRID response message is received from other devices within the preset response time range, it is determined that there is no VRID conflict in the network.
[0015] Furthermore, after receiving the VRID response message, the method further includes:
[0016] Probe unused VRIDs by sending messages;
[0017] After detecting an unused VRID, the device's VRID is modified using the unused VRID, and the local VRID configuration is updated.
[0018] Furthermore, the method for detecting unoccupied VRIDs by sending messages is as follows:
[0019] Generate a new VRID according to preset rules;
[0020] The device sends a VRID check message in the network carrying the new VRID and the cluster identifier of the device;
[0021] If no VRID response message is received from other devices within the preset response time range, it is determined that the new VRID is not in use.
[0022] Furthermore, the method also includes:
[0023] The device sends a VRID modification message in the network, carrying the unoccupied VRID and the device's cluster identifier, so that other devices in the same cluster as the device can modify their VRID to the unoccupied VRID based on the VRID modification message.
[0024] Furthermore, the VRID check message, VRID response message, and VRID modification message are implemented based on the VRRP announcement message format.
[0025] Based on another aspect of the embodiments of the present invention, the present invention also provides a method for detecting virtual routing device identifier conflicts, the method being applied to a device (device C) using the Virtual Router Redundancy Protocol (VRRP), the method comprising:
[0026] The device receives a Virtual Router Device Identifier (VRID) check message, which carries the Virtual Router Device Identifier (VRID) and the cluster identifier.
[0027] When the device determines that the cluster identifier in the VRID check message is different from its own cluster identifier and the VRID in the VRID check message is the same as its own VRID, the device sends a VRID response message to the device that sent the VRID check message. The VRID response message carries the device's own VRID and cluster identifier.
[0028] Furthermore, the method also includes:
[0029] When the device receives a VRID modification message, and the cluster identifier carried in the VRID modification message is the same as the device's own cluster identifier, the device modifies its own VRID identifier to the VRID carried in the VRID modification message.
[0030] According to one aspect of the present invention, the present invention provides a virtual routing device identifier conflict detection device. The device is applied to a device (device A) using the Virtual Router Redundancy Protocol (VRRP). The device can be implemented in software, hardware, or a combination of both. When implemented as a software module, the program code of the software module is loaded into the device's storage medium, and the processor reads and executes the program code from the storage medium, thereby realizing the functions of each component module in the device. The device includes:
[0031] The message detection module is used to send a Virtual Router ID (VRID) check message to the network, wherein the VRID check message carries the Virtual Router ID (VRID) and cluster identifier of the device.
[0032] The conflict detection module is used to determine whether a VRID conflict exists based on whether a VRID response message is received within a preset response time range. If a VRID response message sent by another device is received within the preset response time range, a VRID conflict is determined to exist in the network. If no VRID response message sent by another device is received within the preset response time range, a VRID conflict is determined to exist in the network.
[0033] Furthermore, the device also includes: a VRID generation module and a VRID update module;
[0034] The VRID generation module is used to generate a new VRID according to preset rules after receiving the VRID response message;
[0035] The message detection module is also used to send a VRID check message carrying the new VRID and the cluster identifier of the device in the network;
[0036] The conflict determination module is also used to determine whether the new VRID is occupied based on whether a VRID response message carrying the new VRID is received from another device within a preset response time range.
[0037] The VRID update module is used to modify the device's VRID and update the local VRID configuration after detecting an unused VRID.
[0038] Furthermore, the VRID update module is also used to send a VRID modification message carrying the unoccupied VRID and the cluster identifier of the device in the network, so that other devices located in the same cluster as the device can modify their VRID to the unoccupied VRID based on the VRID modification message.
[0039] Based on one aspect of the embodiments of the present invention, the present invention also provides a virtual routing device identifier conflict detection device, the device being applied to a device (device C) using the Virtual Router Redundancy Protocol (VRRP), and the device can be implemented in software, hardware, or a combination of both. When implemented as a software module, when the program code of the software module is loaded into the storage medium of the device, the processor reads the program code from the storage medium and executes it, thereby realizing the functions of each component module in the device. The device includes:
[0040] The VRID response module receives a Virtual Router Device Identifier (VRID) check message and determines whether a VRID conflict exists based on the VRID and cluster identifier carried in the VRID check message. If it determines that the cluster identifier in the VRID check message is different from its own cluster identifier and the VRID in the VRID check message is the same as its own VRID, it sends a VRID response message to the device that sent the VRID check message. The VRID response message carries the device's own VRID and cluster identifier to notify the device that sent the VRID check message that a VRID conflict exists.
[0041] Furthermore, the device also includes:
[0042] The VRID modification module is used to receive VRID modification messages, determine whether the cluster identifier carried in the VRID modification message is the same as the cluster identifier of the device itself, and modify the VRID identifier of the device itself to the VRID carried in the VRID modification message if they are the same.
[0043] This invention extends the VRRP protocol by adding a VRRP message type for discovering and resolving VRID conflicts. The added message automatically detects whether VRID conflicts exist in the network. After a conflict is detected, the message can automatically detect non-conflicting VRIDs and modify them, thereby avoiding VRID conflicts and improving the intelligence and high availability of virtual devices. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained from these drawings of the embodiments of the present invention.
[0045] Figure 1 This is a schematic diagram of the structure of a VRRP notification message provided in an embodiment of the present invention;
[0046] Figure 2 This is a flowchart of the steps for detecting VRID conflicts in one embodiment of the present invention;
[0047] Figure 3 This is an example of the field content presentation of a VRRP notification message in one embodiment of the present invention;
[0048] Figure 4 This is a schematic diagram of the steps for detecting and modifying an unoccupied VRID in one embodiment of the present invention;
[0049] Figure 5 A schematic diagram of the electronic device structure for implementing the virtual routing device identifier conflict detection method provided by the present invention. Detailed Implementation
[0050] The terminology used in this embodiment of the invention is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of the invention. The singular forms “a,” “the,” and “the” as used in this embodiment are also intended to include the plural forms unless the context clearly indicates otherwise. The term “and / or” as used in this invention refers to any or all possible combinations comprising one or more of the associated listed items.
[0051] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of the present invention, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of embodiments of the present invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0052] In complex distributed cluster networks, multiple devices or software may simultaneously use the VRRP protocol within the same network. For example, a network might deploy virtual routers using VRRP and virtual servers using the keepalive component for high availability, with keepalive also using the VRRP protocol. If users manually configure these multiple devices, all using the VRRP protocol, and incorrectly configure their VRIDs to be the same, VRID conflicts will occur, leading to network or service failures.
[0053] To address the technical problem of potential VRID conflicts arising from multiple groups of devices using the VRRP protocol, this invention provides a method for detecting virtual routing device identifier conflicts. This method automatically detects VRID conflicts and modifies them upon detection, thereby avoiding conflicts. The core idea of this invention is to improve the VRRP protocol by adding VRRP message types for detecting and resolving VRID conflicts. These added messages automatically detect the presence of VRID conflicts in the network. Upon detection, the method automatically identifies and modifies non-conflicting VRIDs, thus avoiding conflicts and improving the intelligence and high availability of virtual devices.
[0054] Figure 1 This is a schematic diagram of the structure of a VRRP announcement message provided in an embodiment of the present invention. The existing VRRP announcement message's Type field is 1. The present invention adds a new message type for VRID conflict detection based on the existing VRRP announcement message format. The meanings of each field in the announcement message are explained below:
[0055] Version / Version field: Used to identify the VRRP protocol version.
[0056] The Type field is used to define the type of VRRP advertisement message.
[0057] Virtual Router Identifier / VRID field: Used to uniquely identify a virtual routing device consisting of multiple routing devices in the network. The value range is 1 to 255. Routing devices belonging to the same VRRP group must use the same VRID.
[0058] Priority field: Used to identify the priority of the routing device. The value ranges from 0 to 255. The larger the value, the higher the VRRP priority, and the more likely the routing device is to become the Master.
[0059] Count IP Address: The number of virtual IP addresses in the VRRP group. The value of this field indicates the number of subsequent "IP Address" fields in this message.
[0060] The Authentication Type field indicates the authentication type of the VRRP message, and there are three possible cases:
[0061] When this field is 0, it indicates no authentication.
[0062] When this field is 1, it indicates plaintext authentication (Simple Text Password);
[0063] When this field is 2, it indicates MD5 authentication (IP Authentication Header).
[0064] Advertisement Interval: Indicates the time interval (in seconds) for sending VRRP messages. By default, the VRRP message sending interval is 1 second.
[0065] Checksum field: Used to store message verification.
[0066] The IP Address field is used to store the VRRP virtual IP address.
[0067] Authentication Data field: This field is used to store VRRP authentication data. When VRRP plaintext authentication or MD5 authentication is activated, this field is filled with the corresponding data.
[0068] This invention, based on the basic format of VRRP announcement messages, adds three message types for detecting VRID conflicts, responding to VRID conflicts, and modifying VRIDs. Based on these new message types, it implements the steps of VRID conflict detection and automatic VRID modification when a conflict is detected.
[0069] Figure 2 This is a flowchart illustrating the steps for detecting VRID conflicts in one embodiment of the present invention. The network illustrated in this embodiment includes two virtual routing devices, located in clusters with cluster identifiers 1111 and 2222, respectively. Virtual routing device 1 in cluster 1111 consists of devices A and B, while virtual routing device 2 in cluster 2222 consists of devices C and D. Virtual routing devices 1 and 2 use the same default VRID or have been incorrectly configured with the same VRID by the administrator. Assuming virtual routing device 2 starts before virtual routing device 1, and device A is the primary routing device in virtual routing device 1, the VRID conflict detection steps include:
[0070] Step 101. The master router A in virtual router device 1 sends a VRID check message to the network, wherein the VRID check message carries the virtual router device identifier (VRID) and cluster identifier of device A;
[0071] After the primary router A in virtual routing device 1 comes online, it can proactively send VRID check messages to its network via broadcast or multicast. The VRID check message is a new message type added in this invention for detecting VRID conflicts in the network. The VRID check message is implemented based on the VRRP advertisement message format, identified by specifying a new message type field value. VRRP advertisement messages are typically encapsulated in IP packets and sent via multicast. The protocol number field value in the IP packet header is typically 112, and the destination IP address is typically the multicast address 224.0.0.18.
[0072] Figure 3 This is an example of the field content presentation of a VRRP announcement message in one embodiment of the present invention. The VRRP announcement message carries an authentication string field (which can reuse the authentication data field or be added separately), with a value of "1111". The authentication string is used to identify the cluster to which the routing device sending the announcement message belongs. The cluster can be understood as a group of devices composed of multiple servers that complete a certain business or function. The servers in the cluster can run the VRRP protocol to achieve features such as high availability of the devices.
[0073] In one embodiment of the present invention, a VRRP advertisement message with a Type field value of 2 is used as a VRID check message to detect whether VRID conflicts exist in the network. The VRID check message also carries an authentication string, which indicates the cluster to which the routing device belongs.
[0074] Step 102. When device B, which belongs to the same virtual routing device 1 as the main routing device A, receives the VRID check message sent by device A, it determines that it is in the same cluster based on the cluster identifier and does not respond.
[0075] Device B and Device A both belong to Virtual Router Device 1 and are in the same cluster. Therefore, Device B's VRID and authentication string are the same as Device A's. When Device B receives a VRID check message from Device A, it parses the message to obtain the VRID and authentication string carried in the message, and determines whether they match its own configured VRID and cluster identifier. If they match, it does not respond.
[0076] For example, if both device A and device B have VRID of 1 and authentication string "1111", and device B receives the VRID check message from device A, it does not respond. If the device that sent the VRID check message does not receive a response message within a specified time range, such as 3 seconds, it is determined that there is no VRID conflict in the network.
[0077] Step 103. When devices C and D, which are not in the same cluster as the device that sent the VRID check message, receive the VRID check message sent by device A, they determine that there is a VRID conflict based on the VRID and authentication string carried in the check message, and then send a VRID response message to device A.
[0078] This invention adds a VRID response message type to the VRRP announcement message format. This type is used to notify the device sending the VRID check message of a VRID conflict and instruct subsequently online virtual routing devices to modify their VRIDs. For example, a value of 3 for the `Type` field can be specified as the VRID response message type. The VRID response message carries the VRID and cluster identifier of the responding device.
[0079] by Figure 2 For example, after devices C and D in cluster 2222 receive a VRID check message from device A in cluster 1111, they parse the message to obtain the VRID and authentication string. They find that the VRID is 1 and the cluster identifier is 1111. The authentication string indicates that device A is not in the same cluster as them, but has the same VRID, indicating a VRID conflict. Therefore, devices C and / or D send a VRID response message to device A. The Type field in the response message has a value of 3, the VRID is 1, and the authentication string carries the cluster identifier 2222 of devices C and D. Upon receiving the response message, device A determines that a VRID conflict exists in the network. Device A can send an alarm message to the administrator or record the alarm information, or it can automatically perform VRID conflict avoidance processing, such as the subsequent VRID detection and modification steps.
[0080] Step 104. After receiving the VRID response message, Device A detects unused VRIDs through the VRID check message. After detecting an unused VRID, Device A modifies its own VRID to the unused VRID and updates the local VRID configuration.
[0081] If device A sends a VRID check message with VRID 1 and does not receive a VRID response message within the preset response time range, it indicates that there is no VRID conflict, and devices A and B can continue to use virtual router device identifier 1. If device A receives a VRID response message within the preset response time range after sending the VRID check message, it indicates that a VRID conflict exists, and device A needs to modify its VRID identifier to avoid VRID conflicts.
[0082] After receiving a VRID response message, Device A can only determine which VRID identifier has conflicted based on the VRID in the response message, but not which VRID identifiers do not conflict. Therefore, Device A needs to probe for unused VRIDs. For example, Device A records the conflicting VRID identifiers reported in the response message, then generates a new VRID according to a preset VRID generation rule, and sends a VRID check message carrying the newly generated VRID to detect whether the newly generated VRID will conflict, thereby determining whether the newly generated VRID is already in use.
[0083] This invention does not limit the method of generating a new VRID identifier. For example, a VRID that is different from the conflicting VRID of the record can be generated randomly, or a new VRID identifier can be generated by using the network identifier + the current time.
[0084] Figure 4 This is a flowchart illustrating the steps of detecting and modifying unused VRIDs in one embodiment of the present invention. After receiving a response message for VRID 1, device A learns that VRID identifier 1 is already in use. It then probes for unused VRIDs sequentially (e.g., incrementing by 1 step) according to identifier size. Device A continues to send a check message for VRID=2. If a response message is received, it indicates that VRID=2 is also in use. It then continues to send a check message for VRID=3. If no response message is received within a preset response time range, it indicates that VRID=3 is unused and can be used.
[0085] After determining that the newly generated VRID is not in use, Device A modifies its own VRID to the newly generated VRID and records the new VRID in its local configuration file. When Device C and / or Device D receive the check message with VRID=3 from Device A, they determine based on the authentication string that they are in a different cluster than Device A and that they are not using VRID=3 locally, so they do not respond by default. When Device B receives the check message with VRID=3 from Device A, it determines based on the authentication string that it is in the same cluster as Device A but that it is not using VRID=3 locally, so it also does not respond by default.
[0086] Step 105. Device A sends a VRID modification message in the network, which carries the unoccupied VRID determined by detection and the cluster identifier of Device A;
[0087] This invention introduces a new message type, the VRID modification message, which instructs devices within the same cluster or routing device group to modify their VRID to the VRID carried in the modification message. For example, based on the format of the VRRP advertisement message, a new message with a Type field value of 4 is added as the VRID modification message. The VRID modification message carries a detected, unused VRID and the identifier of the cluster or routing device group to which the sending device belongs.
[0088] like Figure 4 For example, if device A does not receive a VRID response message within the preset response time range and determines that the newly generated VRID will not cause a conflict, it sends a VRID modification message with a type / Type field value of 4, which carries a VRID field of 3 and an authentication string "1111" indicating that it is located in cluster 1111. Through this modification message, it instructs device B, which is located in the same cluster, to modify its VRID to 3.
[0089] Step 106. After receiving the VRID modification message, device B determines that it is in the same cluster as device A based on the cluster identifier carried in the modification message. If so, it modifies its own VRID to the VRID carried in the modification message and updates its local configuration file.
[0090] After receiving the VRID modification message sent by the master device A, device B parses the message to obtain the VRID and authentication string carried in the message. It uses the cluster identifier carried in the authentication string to determine whether it and device A are in the same cluster or routing device group. If they are in the same cluster or routing device group, it modifies its own VRID to the VRID in the modification message and automatically writes the non-conflicting VRID in the message to the local configuration file for persistence. In this way, device B will still use VRID=3 after restarting, thus avoiding the VRID detection process again.
[0091] Figure 5 This is a schematic diagram of an electronic device structure for implementing the virtual routing device identifier conflict detection method provided by the present invention. The device 500 includes: a processor 510 such as a central processing unit (CPU), a communication bus 520, a communication interface 540, and a storage medium 530. The processor 510 and the storage medium 530 can communicate with each other via the communication bus 520. The storage medium 530 stores a computer program, which, when executed by the processor 510, performs one or more steps of the method provided by the present invention.
[0092] The storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the storage medium may be at least one storage device located remotely from the aforementioned processor. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0093] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in non-transitory memory. The methods can be implemented using standard programming techniques, including a non-transitory storage medium configured with a computer program within the computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit. Moreover, the operations of the processes described in this invention can be performed in any suitable order unless otherwise indicated by the invention or otherwise clearly contradicted by the context. The processes (or variations and / or combinations thereof) described in this invention can be executed under the control of one or more computer systems configured with executable instructions and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program includes a plurality of instructions executable by one or more processors.
[0094] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention also includes the computer itself.
[0095] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting virtual routing device identifier conflicts, characterized in that, The method is applied to devices using the Virtual Router Redundancy Protocol (VRRP), and the method includes: The device sends a Virtual Router Device Identifier (VRID) check message to the network, the VRID check message carrying the device's Virtual Router Device Identifier (VRID) and cluster identifier; The device determines whether a VRID conflict exists based on whether a VRID response message is received within a preset response time range; If the device receives a VRID response message from another device within the preset response time range, it is determined that there is a VRID conflict in the network. If no VRID response message is received from other devices within the preset response time range, it is determined that there is no VRID conflict in the network. After receiving the VRID response message, the system detects unoccupied VRIDs by sending messages. After detecting an unused VRID, modify the device's VRID using the unused VRID and update the local VRID configuration; The device sends a VRID modification message in the network, carrying the unoccupied VRID and the device's cluster identifier, so that other devices in the same cluster as the device can modify their VRID to the unoccupied VRID based on the VRID modification message.
2. The method according to claim 1, characterized in that, The method for detecting unoccupied VRIDs by sending messages is as follows: Generate a new VRID according to preset rules; The device sends a VRID check message in the network carrying the new VRID and the cluster identifier of the device; If no VRID response message is received from other devices within the preset response time range, it is determined that the new VRID is not in use.
3. The method according to claim 1, characterized in that, The VRID check message, VRID response message, and VRID modification message are implemented based on the VRRP announcement message format.
4. A method for detecting virtual routing device identifier conflicts, characterized in that, The method is applied to devices using the Virtual Router Redundancy Protocol (VRRP), and the method includes: The device receives a Virtual Router Device Identifier (VRID) check message, which carries the Virtual Router Device Identifier (VRID) and the cluster identifier. When the device determines that the cluster identifier in the VRID check message is different from its own cluster identifier and the VRID in the VRID check message is the same as its own VRID, the device sends a VRID response message to the device that sent the VRID check message. The VRID response message carries the device's own VRID and cluster identifier to notify the device that sent the VRID check message that there is a VRID conflict. When the device receives a VRID modification message, and the cluster identifier carried in the VRID modification message is the same as the device's own cluster identifier, the device modifies its own VRID identifier to the VRID carried in the VRID modification message.
5. A virtual routing device identifier conflict detection device, characterized in that, The apparatus is used in devices employing the Virtual Router Redundancy Protocol (VRRP), and the apparatus includes: The message detection module is used to send a Virtual Router ID (VRID) check message to the network, wherein the VRID check message carries the Virtual Router ID (VRID) and cluster identifier of the device. The conflict detection module is used to determine whether a VRID conflict exists based on whether a VRID response message is received within a preset response time range. If a VRID response message sent by another device is received within the preset response time range, it is determined that a VRID conflict exists in the network. If no VRID response message sent by another device is received within the preset response time range, it is determined that there is no VRID conflict in the network. The VRID generation module is used to generate a new VRID according to preset rules after receiving the VRID response message; The message detection module is also used to send a VRID check message carrying the new VRID and the cluster identifier of the device in the network; The conflict determination module is also used to determine whether the new VRID is occupied based on whether a VRID response message carrying the new VRID is received from another device within a preset response time range. The VRID update module is used to modify the device's VRID and update the local VRID configuration after detecting an unused VRID. The VRID update module is also used to send a VRID modification message in the network carrying the unoccupied VRID and the cluster identifier of the device, so that other devices located in the same cluster as the device can modify their VRID to the unoccupied VRID based on the VRID modification message.
6. A virtual routing device identifier conflict detection device, characterized in that, The apparatus is used in devices employing the Virtual Router Redundancy Protocol (VRRP), and the apparatus includes: The VRID response module is used to receive a Virtual Router Device Identifier (VRID) check message, and determine whether a VRID conflict exists based on the VRID and cluster identifier carried in the VRID check message. If it is determined that the cluster identifier in the VRID check message is different from its own cluster identifier and the VRID in the VRID check message is the same as its own VRID, the module sends a VRID response message to the device that sent the VRID check message. The VRID response message carries the device's own VRID and cluster identifier to notify the device that sent the VRID check message that a VRID conflict exists. The VRID modification module is used to receive VRID modification messages, determine whether the cluster identifier carried in the VRID modification message is the same as the cluster identifier of the device itself, and modify the VRID identifier of the device itself to the VRID carried in the VRID modification message if they are the same.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a storage medium, and a communication bus, wherein the processor, the communication interface, and the storage medium communicate with each other through the communication bus; Storage medium used to store computer programs; A processor, when executing a computer program stored on a storage medium, implements the method according to any one of claims 1-4.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Virtual routing redundancy protocol configuration method and related device
CN111064662A