Method for quickly switching vrrp (virtual resource rrp) main and standby services on switch

The method for fast VRRP active/standby service switching on a switch addresses the unreliability of existing link protection mechanisms by tracking five-tuple information to detect failures and execute seamless switching operations, improving network stability and reducing resource consumption.

CN119182742APending Publication Date: 2024-12-24HENRICH ELECTRONICS SUZHOU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411246010.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Existing VRRP link protection mechanisms in switch networks rely on interface availability detection, which is unreliable, especially in multi-layer switch networking, and require external support from all networking devices, leading to network instability.

Method used

A method for fast VRRP active/standby service switching on a switch that tracks five-tuple information of service flow messages using hash algorithms to detect link failures, allowing for internal detection without additional messages, and executes master-slave switching operations based on packet loss thresholds.

Benefits of technology

Enhances network stability by quickly detecting link anomalies within 50ms, reducing the need for external support and ensuring seamless switching without additional resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182742A_ABST
    Figure CN119182742A_ABST
Patent Text Reader

Abstract

The invention provides a method for rapidly switching vrrp main and standby services on a switch. The method comprises the following steps: step 1, acquiring quintuple information of each actual service flow message; step 2, detecting quintuple information of each response flow message based on a service flow message tracking mechanism, and if the quintuple information of the corresponding response flow message cannot be detected within a specified time, recording that the service flow message is lost once; and step 3, judging the fault condition of the three-layer main switch according to the loss condition of the service flow message, and executing the main / standby switching operation of the three-layer switch after the fault of the three-layer main switch is confirmed. According to the method, whether a link protection mechanism needs to be started or not is judged by tracking actual service data messages and quintuple information, normal work of a multilayer protection mechanism can be achieved without additional detection messages, and when networking is conducted with external equipment, due to the fact that only service flow messages of the switch equipment are tracked, external support is not needed, and the network access efficiency is greatly improved. And network stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a switching method, in particular to a method for fast switching of VRRP primary and standby services on a switch, belonging to the technical field of switch network communication. Background Art

[0002] Switch network communication is the core link in computer network architecture, which is responsible for achieving high-speed and reliable data transmission between devices. By receiving data packets and using the MAC address table for intelligent forwarding, the switch effectively expands network ports, improves bandwidth utilization, and divides collision domains to improve network performance. In scenarios such as local area networks, wide area networks, and data centers, switches play a key role in connecting various devices and promoting resource sharing and communication.

[0003] When the switch is communicating, in order to ensure the quality of communication service, there will be many link protection mechanisms, among which the VRRP mechanism is implemented on the three-layer switch. VRRP is the abbreviation of Virtual Routing Redundancy Protocol. Figure 3 As shown, the figure shows a typical VRRP networking structure in the prior art, including two three-layer switches L3-1 and L3-2. Under normal circumstances, one of the two three-layer switches serves as the main switch and the other as the backup switch. After the main switch fails, the main and backup service switching mechanism is triggered, and the backup switch is converted to the main switch, so that the failure is recovered. However, the current detection of link failure or network unavailability is basically based on whether the interface is available, which has major defects, especially when the VRRP interface protection fails in multi-layer switch networking. In order to solve this problem, BFD technology has emerged, that is, two-way link detection messages are sent periodically between the two networks. When the interface does not detect failure and the network is unreachable, the main and backup protection switching mechanism will be triggered. However, the BFD mechanism requires the support of all networking devices. When there is an external network, more uncontrollable factors are prone to occur, affecting network stability.

[0004] Therefore, a method for fast VRRP active / standby service switching on a switch is proposed. Summary of the invention

[0005] In view of this, the present invention provides a method for fast VRRP primary and standby service switching on a switch to solve or alleviate one of the technical problems existing in the prior art and at least provide a beneficial option.

[0006] The technical solution of the embodiment of the present invention is implemented as follows: a method for fast VRRP active / standby service switching on a switch, applied to an uplink service failure switching process, comprises the following steps:

[0007] Step 1: Obtain the five-tuple information of each actual service flow message;

[0008] Step 2: Detect the five-tuple information of each response flow message based on the business flow message tracking mechanism. If the five-tuple information of the corresponding response flow message cannot be detected within the specified time, record the loss of the business flow message once;

[0009] Step 3: Determine the fault of the Layer 3 main switch according to the loss of service flow packets. After confirming the fault of the Layer 3 main switch, perform the master-slave switch operation of the Layer 3 switch.

[0010] Step 4: Determine whether the VRRP master-slave switching operation is executed according to the service flow message received by the Layer 2 switch;

[0011] Step 5: The Layer 2 backup switch notifies the Layer 2 master switch, and the Layer 2 master switch performs the master-standby switch operation.

[0012] Further preferably: in step one, when the actual business flow message passes through the main switch, the main switch records the five-tuple information of the actual business flow message, the five-tuple information is the source IP, the destination IP, the source port, the destination port and the protocol number, the protocol number is one of the TCP protocol, the UDP protocol or the ICMP protocol, and when extracting the five-tuple information, it is extracted according to the standard IP protocol header and the TCP / UDP protocol header.

[0013] Further preferably: in step 2, tracking the five-tuple information of the service flow message based on the hash algorithm specifically includes:

[0014] The source IP, destination IP, source port and destination port are converted into binary form;

[0015] The converted values ​​are concatenated into a binary string or a numerical string;

[0016] Calculate the binary string or numerical string according to the hash algorithm MD5 to obtain the hash value;

[0017] Use hash values ​​to index or classify business traffic reports.

[0018] Further preferably: in step three, if the loss of the same service flow message exceeds a certain threshold or multiple service flow messages are lost at the same time, the link protection mechanism is started and the master-slave switching of the three-layer switch is executed.

[0019] In order to solve the above technical problems, another technical solution adopted by the present application is: a method for fast VRRP active-standby service switching on a switch, applied to the downlink service failure switching process, comprising the following steps:

[0020] Step 1: Obtain the five-tuple information of each actual service flow message;

[0021] Step 2: Detect the five-tuple information of each response flow message based on the business flow message tracking mechanism. If the five-tuple information of the corresponding response flow message cannot be detected within the specified time, record the loss of the business flow message once;

[0022] Step 3: Determine the fault of the Layer 2 main switch according to the loss of service flow packets. After confirming the fault of the Layer 2 main switch, perform the master-slave switch operation of the Layer 2 switch.

[0023] Step 4: Determine whether the VRRP master-slave switching operation is executed according to the service flow message received by the three-layer switch;

[0024] Step 5: The Layer 3 backup switch notifies the Layer 3 master switch, and the Layer 3 master switch performs the master-standby switch operation.

[0025] Further preferably: in step 1, based on the Wi reshark network packet capture tool, the data packets in the network are captured, the network protocol header is decoded, and the five-tuple information is extracted.

[0026] Further preferably: in step 4, the layer 3 main switch receives a message from the layer 2 main switch. After the layer 2 main switch performs the master-slave switching operation, the layer 2 main switch sends a message to the layer 3 backup switch. The layer 3 backup switch confirms that the layer 2 switch performs the VRRP master-slave switching operation based on the received business flow message.

[0027] Further preferably: in step five, after the layer 3 backup switch confirms that the layer 2 switch has executed the VRRP master-slave switching operation, it executes the VRRP master-slave switching operation.

[0028] To solve the above technical problem, another technical solution adopted by the present application is: the electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor;

[0029] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method for fast VRRP active-standby service switching on a switch.

[0030] In order to solve the above technical problems, another technical solution adopted by the present application is: the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute a method for fast VRRP primary and backup service switching on a switch.

[0031] The embodiment of the present invention has the following advantages due to the adoption of the above technical solution:

[0032] 1. The present invention determines whether it is necessary to start the link protection mechanism by tracking the actual business data message and the five-tuple information. No additional detection message is required, and the multi-layer protection mechanism can also work normally. When networking with external devices, since only the business flow message of the switch device is tracked, no external support is required, thereby improving network stability.

[0033] 2. The present invention can meet the detection requirements by sampling several streams of a target IP network, saving resources. In scenarios with higher requirements, when link failures need to be quickly discovered, based on the message transmission delay generally within 50ms, link anomalies can be quickly detected.

[0034] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present invention will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 This is a flow chart of Example 1 of the present invention;

[0037] Figure 2 This is a flow chart of Example 2 of the present invention;

[0038] Figure 3 It is a VRRP networking structure diagram in the prior art of the present invention;

[0039] Figure 4 This is a switch networking topology diagram of the present invention. DETAILED DESCRIPTION

[0040] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.

[0041] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0042] Example 1

[0043] like Figure 1 and Figure 4 As shown, an embodiment of the present invention provides a method for fast switching of VRRP active and standby services on a switch, which is applied to an uplink service failure switching process, and includes the following steps:

[0044] Step 1, obtain the five-tuple information of each actual business flow message. When the actual business flow message passes through the main switch L3-2-1 and L3-1-1, the main switch records the five-tuple information of the actual business flow message, captures the data packet in the network based on the Wi reshark network packet capture tool, decodes the network protocol header, and extracts the five-tuple information. The five-tuple information is the source IP, destination IP, source port, destination port and protocol number. The protocol number is one of the TCP protocol, UDP protocol or ICMP protocol. When extracting the five-tuple information, it is extracted according to the standard IP protocol header and TCP / UDP protocol header;

[0045] Characteristics of VRRP networking: The routing path of bidirectional messages will pass through the same point. Based on this logic, if the message has business data in one direction but there is no corresponding response message in the reverse direction, it means that the reverse network is unreachable.

[0046] Currently, most data messages are bidirectional data, such as TCP, and a service flow can be identified by the IP quintuple.

[0047] The TCP protocol is a two-way confirmation mechanism. The data transmission method is data message + peer ack message. The packet loss rate in the network will be relatively low, especially less than 1% in the internal network, and the delay is basically within 50ms.

[0048] The UDP protocol has no confirmation mechanism. Generally, UDP is used as a data channel for business bearer. The application layer will have a corresponding two-way confirmation mechanism for control plane information. It is similar to TCP in terms of packet loss rate and delay.

[0049] The I CMP protocol is a two-way response mechanism, ping-pong mode, the sending frequency can be specified, generally once every 1 second, and is similar to TCP in terms of packet loss rate and delay.

[0050] Step 2: Detect the five-tuple information of each response flow message based on the business flow message tracking mechanism. If the five-tuple information of the corresponding response flow message cannot be detected within the specified time, record the loss of the business flow message. The business flow message tracking mechanism indexes or classifies the business flow message through the hash algorithm, and tracks the five-tuple information of the business flow message based on the hash algorithm, which specifically includes:

[0051] The source IP, destination IP, source port and destination port are converted into binary form;

[0052] The converted values ​​are concatenated into a binary string or a numerical string;

[0053] Calculate the binary string or numerical string according to the hash algorithm MD5 to obtain the hash value;

[0054] Index or classify business flow reports through hash values;

[0055] Step 3: Determine the fault of the Layer 3 main switch L3-1-1 according to the loss of service flow packets. After confirming the failure of the Layer 3 main switch L3-1-1, if the loss of the same service flow packets exceeds a certain threshold or multiple service flow packets are lost at the same time, start the link protection mechanism and perform the master-slave switch of the Layer 3 switch.

[0056] Step 4: Determine whether the VRRP master-slave switching operation is executed according to the service flow message received by the Layer 2 switch. The Layer 2 master switch L3-2-1 receives the message from the Layer 3 master switch L3-1-1. After the Layer 3 master switch L3-1-1 executes the master-slave switching operation, the Layer 3 master switch L3-1-1 sends a message to the Layer 2 backup switch L3-2-2. The Layer 2 backup switch L3-2-2 confirms that the Layer 3 switch executes the VRRP master-slave switching operation according to the received service flow message.

[0057] Step 5: The Layer 2 backup switch L3-2-2 notifies the Layer 2 master switch L3-2-1, and the Layer 2 master switch L3-2-1 performs the master-standby switching operation.

[0058] Example 2

[0059] like Figure 2 and Figure 4 As shown, an embodiment of the present invention provides a method for fast switching of VRRP active and standby services on a switch, which is applied to a downlink service failure switching process, and includes the following steps:

[0060] Step 1, obtain the five-tuple information of each actual business flow message. When the actual business flow message passes through the main switch L3-2-1 and L3-1-1, the main switch records the five-tuple information of the actual business flow message, captures the data packet in the network based on the Wi reshark network packet capture tool, decodes the network protocol header, and extracts the five-tuple information. The five-tuple information is the source IP, destination IP, source port, destination port and protocol number. The protocol number is one of the TCP protocol, UDP protocol or ICMP protocol. When extracting the five-tuple information, it is extracted according to the standard IP protocol header and TCP / UDP protocol header;

[0061] Step 2: Detect the five-tuple information of each response flow message based on the business flow message tracking mechanism. If the five-tuple information of the corresponding response flow message cannot be detected within the specified time, record the loss of the business flow message. The business flow message tracking mechanism indexes or classifies the business flow message through the hash algorithm, and tracks the five-tuple information of the business flow message based on the hash algorithm, which specifically includes:

[0062] The source IP, destination IP, source port and destination port are converted into binary form;

[0063] The converted values ​​are concatenated into a binary string or a numerical string;

[0064] Calculate the binary string or numerical string according to the hash algorithm MD5 to obtain the hash value;

[0065] Index or classify business flow reports through hash values;

[0066] Step 3: Determine the fault of the Layer 2 main switch L3-2-1 according to the loss of service flow packets. After confirming the fault of the Layer 2 main switch L3-2-1, perform the master-slave switching operation of the Layer 2 switch.

[0067] Step 4: Determine whether the VRRP master-slave switching operation is executed according to the service flow message received by the Layer 3 switch. The Layer 3 master switch L3-1-1 receives the message from the Layer 2 master switch L3-2-1. After the Layer 2 master switch L3-2-1 executes the master-slave switching operation, the Layer 2 master switch L3-2-1 sends a message to the Layer 3 backup switch L3-1-2. The Layer 3 backup switch L3-1-2 confirms that the Layer 3 switch executes the VRRP master-slave switching operation according to the received service flow message.

[0068] Step 5: The Layer 3 backup switch notifies the Layer 3 master switch L3-1-1, and the Layer 3 master switch L3-1-1 performs the master-standby switching operation.

[0069] Example 3

[0070] An embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method for fast VRRP primary and standby service switching on a switch is implemented as described above.

[0071] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in a memory and executed by a processor to implement the present invention. One or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in a computer device.

[0072] Computer devices may include but are not limited to processors and memories. Those skilled in the art will appreciate that the diagram is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the diagram, or may combine certain components or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.

[0073] The processor can be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete preset hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0074] The memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. The memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, etc. equipped on the computer device. Furthermore, the memory may also include both an internal storage unit of a computer device and an external storage device.

[0075] Example 4

[0076] An embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method for fast switching of VRRP primary and standby services on a switch is implemented as described above.

[0077] The computer program may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above method embodiments may be implemented. The computer program includes computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium, etc.

[0078] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0079] The steps in the method of the embodiment of the present invention can be adjusted in order, combined or deleted according to actual needs.

[0080] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic preset hardware, or in a combination of computer software and electronic preset hardware. Whether these functions are performed in preset hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0081] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for fast switching of VRRP primary and backup services on a switch, applied to an uplink service failure switching process, characterized in that: The following steps are involved: Step 1: Obtain the five-tuple information of each actual service flow message; Step 2: Detect the five-tuple information of each response flow message based on the business flow message tracking mechanism. If the five-tuple information of the corresponding response flow message cannot be detected within the specified time, record the loss of the business flow message once; Step 3: Determine the fault of the Layer 3 main switch according to the loss of service flow packets. After confirming the fault of the Layer 3 main switch, perform the master-slave switch operation of the Layer 3 switch. Step 4: Determine whether the VRRP master-slave switching operation is executed according to the service flow message received by the Layer 2 switch; Step 5: The Layer 2 backup switch notifies the Layer 2 master switch, and the Layer 2 master switch performs the master-standby switch operation.

2. A method for fast switching of VRRP primary and standby services on a switch according to claim 1, characterized in that: In step one, when the actual business flow message passes through the main switch, the main switch records the five-tuple information of the actual business flow message, the five-tuple information is the source IP, destination IP, source port, destination port and protocol number, the protocol number is one of the TCP protocol, UDP protocol or ICMP protocol, and when extracting the five-tuple information, it is extracted according to the standard IP protocol header and TCP / UDP protocol header.

3. A method for fast switching of VRRP primary and standby services on a switch according to claim 1, characterized in that: In step 2, the five-tuple information of the service flow message is tracked based on the hash algorithm, including: The source IP, destination IP, source port and destination port are converted into binary form; The converted values ​​are concatenated into a binary string or a numerical string; Calculate the binary string or numerical string according to the hash algorithm MD5 to obtain the hash value; Use hash values ​​to index or classify business traffic reports.

4. The method for fast switching of VRRP primary and standby services on a switch according to claim 1, characterized in that: In step three, if the loss of the same service flow message exceeds a certain threshold or multiple service flow messages are lost at the same time, the link protection mechanism is started and the master-slave switching of the three-layer switch is executed.

5. A method for fast switching of VRRP primary and backup services on a switch, applied to a downlink service failure switching process, characterized in that: The following steps are involved: Step 1: Obtain the five-tuple information of each actual service flow message; Step 2: Detect the five-tuple information of each response flow message based on the business flow message tracking mechanism. If the five-tuple information of the corresponding response flow message cannot be detected within the specified time, record the loss of the business flow message once; Step 3: Determine the fault of the Layer 2 main switch according to the loss of service flow packets. After confirming the fault of the Layer 2 main switch, perform the master-slave switch operation of the Layer 2 switch. Step 4: Determine whether the VRRP master-slave switching operation is executed according to the service flow message received by the three-layer switch; Step 5: The Layer 3 backup switch notifies the Layer 3 master switch, and the Layer 3 master switch performs the master-standby switch operation.

6. A method for fast switching of VRRP primary and standby services on a switch according to claim 5, characterized in that: In step 1, the data packets in the network are captured based on the Wireshark network packet capture tool, the network protocol header is decoded, and the five-tuple information is extracted.

7. A method for fast switching of VRRP primary and standby services on a switch according to claim 5, characterized in that: In step 4, the layer 3 master switch receives the message from the layer 2 master switch. After the layer 2 master switch performs the master-slave switching operation, the layer 2 master switch sends a message to the layer 3 backup switch. The layer 3 backup switch confirms that the layer 2 switch performs the VRRP master-slave switching operation based on the received service flow message.

8. The method for fast switching of VRRP primary and backup services on a switch according to claim 5, characterized in that: In step 5, after the layer 3 backup switch confirms that the layer 2 switch has executed the VRRP master-slave switching operation, it executes the VRRP master-slave switching operation.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor, and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for fast VRRP primary and standby service switching on a switch as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute a method for fast switching of VRRP primary and standby services on a switch as described in any one of claims 1-8.