Disclosure of Invention
The invention provides a method, a device and a system for fast convergence of a link, which are used for solving the problem that when a member port in the system exits the link, the link cannot fast converge to select a new service data interaction port, and the stability of the system is influenced.
To achieve the above object, a primary object of the present invention is to provide a method for fast convergence of a link established between member devices including at least two physical connections, the method including:
the member device receiving the member port exit instruction sends a message notification message to the opposite member device to inform the opposite member device that the member port is about to be abnormal;
after receiving the message notification message, the opposite-end member device triggers a local member port correspondingly connected with the member port in advance to perform service switching;
and the member equipment receiving the member port exit instruction executes corresponding exit operation.
Further, the member device that receives the member port exit instruction sends a message notification packet to the opposite member device, and the specific implementation steps include:
acquiring the physical port number of the member port and the logic port number of the link to be exited by the member port;
assembling a message notification message, and sending the assembled message notification message to the opposite-end member equipment in a highest priority mode;
the member device receiving the member port exit instruction executes corresponding exit operation, and the specific implementation steps include: and selecting a new service forwarding port from the local non-abnormal member ports, and updating the software and hardware forwarding table.
Further, the message notification message content includes: message type, physical port number of member port, logical port number of corresponding link.
Further, the message notification message is a user-defined message.
Further, after receiving the message notification packet, the opposite-end member device triggers a local member port correspondingly connected to the member port in advance to perform service switching, and the specific implementation steps include:
after receiving a message notification message of a link quitted by a member port, the opposite-end member equipment analyzes the message notification message and acquires the physical port number of the member port of the link to be quitted and the logical port number of the link to be quitted by the member port;
according to the physical port number of the member port which is about to exit the link and the logical port number of the link which is about to exit the member port, the physical port number of the local member port which is correspondingly connected with the member port and the logical port number of the corresponding connection link are searched;
and triggering the local member port to switch the new service port and simultaneously updating the software and hardware forwarding table after the found physical port number of the local port and the logic port number of the corresponding connection link.
Another object of the present invention is to provide a device for fast convergence of a link, which is applied in a member device that establishes a link including at least two physical connections with an opposite member device, and the device specifically includes:
a port number obtaining module, configured to obtain, after receiving a member port exit instruction, a physical port number of the member port and a logical port number of a link to be exited by the member port;
the message sending module is used for assembling a message notification message by using the acquired physical port number of the member port and the logical port number of the link to be exited of the member port, and sending the assembled message notification message to the opposite-end member equipment in a highest priority mode;
and the port selection module is used for selecting a new service forwarding port from the member ports corresponding to the local links to be exited from the member ports after the message sending module finishes sending the message notification message.
Further, the device also comprises a message receiving module, configured to receive a message notification message from the member device at the opposite end;
the port number obtaining module is further configured to analyze the message notification message received by the message receiving module, and obtain a physical port number of a member port of the opposite-end member device and a logical port number of a link to be exited by the member port in the message notification message; searching the physical port number of a local member port correspondingly connected with the member port and the logical port number of a corresponding connection link according to the acquired physical port number of the member port of the opposite-end member device and the logical port number of the link to be exited of the member port;
and the port selection module is also used for triggering the link correspondingly connected with the local member port to switch the service port after the port number acquires the physical port number of the local member port and the logic port number of the corresponding connection link.
Further, the device further comprises a port updating module for updating the software and hardware forwarding table.
Further, the message notification message content includes: a message type, a physical port number of a member port that is to exit the link, and a logical port number of a link that the member port is to exit.
Further, the message notification message is a user-defined message.
Another object of the present invention is also a system for fast convergence of links, comprising two devices for fast convergence of said links, between which a link comprising at least two physical connections is established.
The invention has the beneficial effects that: in the operation process that the member port exits the link, before the port between the devices with data interaction does not receive the real exit link of the member port, the port exiting link event is predicted in advance, the advance convergence of the link is triggered, the forwarding data is guaranteed to be switched to the physical port without abnormity in advance, and the stability between the devices in the system is improved.
Detailed Description
In order to make the technical scheme of the invention more clear, the invention is further described in detail with reference to the attached drawings:
the embodiment of the invention provides a method for fast convergence of a link, which adopts a pre-notification mechanism to enable member equipment in a system to predict in advance that a certain member port in the link is about to be abnormal, so that the switching of a data interaction port in the link and the setting of a software and hardware forwarding table are accelerated, and the stability among system equipment is improved.
As shown in fig. 1, when a member device in the system needs to exit a member port from a link according to a requirement, a member device at an opposite end is notified in advance that the member port is about to be abnormal, and the specific operation steps include:
s101, the member device receiving the exit instruction of the member port sends a message notification message to the opposite-end member device to inform the opposite-end member device that the member port is about to be abnormal; the concrete implementation steps comprise:
the member device receiving the member port exit instruction obtains the physical port number of the member port of the local link to be exited and the logical port number of the link to be exited. The port number is user-defined and is mainly used for identifying different ports.
Assembling a message notification message, wherein the message notification message is a user-defined message or is expanded in an existing general protocol message, and the content of the message notification message comprises: and the message type is used for indicating that a member port exits from the link, the logical port number of the link with the member port exiting from the link and the physical port number of the member port exiting from the link.
And sending the assembled message notification message to the opposite-end member equipment in a highest priority mode, wherein the message notification message is sent in the highest priority in order to ensure that the member equipment can receive and process the message notification message as soon as possible.
S102, after receiving the message notification message, the opposite member device triggers a local member port correspondingly connected with the member port in advance to perform service switching. The concrete implementation steps comprise:
after receiving a message notification message of a link quitted by a member port, the opposite-end member equipment analyzes the message notification message and acquires the physical port number of the member port of the link to be quitted and the logical port number of the link to be quitted by the member port; searching the physical port number of a local member port correspondingly connected with the member port and the logic port number of a link correspondingly connected with the member port according to the physical port number of the member port and the logic port number of the link to be exited of the member port; and triggering the local member port to switch the new service port according to the found physical port number of the local member port and the logic port number of the corresponding connected link, and updating the software and hardware forwarding table.
S103, the member equipment receiving the member port quit instruction executes corresponding quit operation. The specific implementation comprises the following steps: and selecting a new member port from the local non-abnormal member ports as a service forwarding port between the devices, and updating a software and hardware forwarding table.
The embodiment of the present invention takes a stacking system composed of two switching devices as an example to explain the technical scheme and technical effect of the present invention in detail, as shown in fig. 2, the stacking system is composed of two three-layer switches, SW0 device and SW1 device, SW0 device is configured with a virtual switching link (vsl-channel 0/1), and two physical member ports te0/1/1 and te0/1/2 are added in the vsl-channel 0/1 link. The SW1 device is configured with one virtual switch link (vsl-channel 1/1) with two physical member ports te1/1/1 and te1/1/2 added to the vsl-channel 1/1 link. The connection relation of the virtual switch links of the SW0 and the SW1 is that the vsl-channel 1/1 corresponds to the vsl-channel 0/1; the physical port connection relationship between the two devices is te0/1/1 connected with te1/1/1, and te0/1/2 connected with te 1/1/2. Two physical ports exist in the virtual switch link, and the stack devices SW0 and SW1 need to select control ports so as to receive and transmit service data messages interacted between devices through the control ports; SW0 device elects te0/1/1 as control port, SW1 device corresponds to electing te1/1/1 as control port. Meanwhile, two stacking devices need to generate a master device and a member device through interactive election, and the master device is SW0 and the member device is SW1 through election. After the stacking system completes all elections, the system will enter a steady state.
When the SW0 device receives an operation instruction that the control port te0/1/1 needs to exit the virtual switch link vsl-channel 0/1 according to the management requirement, this operation will cause the te0/1/1 port to no longer be used as the stack port of the SW0 device to perform the service data packet operation. In this embodiment of the present invention, when the SW0 device executes the control port te0/1/1 to exit the virtual switch link vsl-channel 0/1, specific operation steps that the SW0 device needs to execute include:
the method comprises the following steps: the SW0 device needs to quit the control port te0/1/1 from the virtual switch link vsl-channel 0/1 according to the requirement, and the operation mode of executing port quitting usually includes: shell command configuration and snmp agent execution.
Step two: the SW0 device obtains the internal port number corresponding to the control port te0/1/1 and the internal number corresponding to the virtual switch link vsl-channel 0/1 according to the port data carried in the shell command or the port data issued by the snmp agent.
Step three: and assembling a message notification message according to the internal port numbers of the control port te0/1/1 and the virtual switch link vsl-channel 0/1 obtained in the step two, wherein the assembled message notification message is realized by expanding an lmp (link management protocol) link management protocol field.
Step four: according to the message notification message assembled in the step three, the SW0 processes the message notification message according to the principle of sending the message processed by the device with the highest priority. To ensure that the member device SW1 receives and processes the message as soon as possible, the message notification message is sent with the highest priority.
Step five: after the message notification message is sent successfully, the SW0 device will elect a new control port te0/1/2 according to the existing member port information, and then update the elected new control port information into the hardware and software forwarding table. At this time, the new control port te0/1/2 will be responsible for traffic data transceiving between the subsequent stack devices SW0 and SW 1.
After the SW1 device receives the message notification packet from the SW0, the specific operation steps that the SW1 device needs to execute include:
the method comprises the following steps: the SW1 device receives the message notification packet from the SW0 device, and since the message notification packet needs to be processed with priority, the message notification packet needs to be executed according to the processing flow of the message with the highest priority received by the SW1 device.
Step two: and analyzing and acquiring the data information carried by the message notification message according to the message notification message received in the step one. The information includes: message type, internal port number corresponding to control port te0/1/1 exiting the virtual switch link, and virtual switch link vsl-channel 0/1 logical port internal number.
And step three, inquiring a virtual switching link vsl-channel 1/1 and a stack control port te1/1/1 to which the SW1 device is docked according to the analyzed vsl-channel 0/1 internal port number and te0/1/1 internal port number in the step two.
Step four, according to the stack control port te1/1/1 of the SW1 device obtained in step three, it can be predicted that the service data packet sent from this control port te1/1/1 will or cannot reach the stack device SW0, because the control port te0/1/1 connected to it will exit or already exit the virtual switch link vsl-channel 0/l, the port te0/1/1 will become a normal port, and will not bear the forwarding capability of the stack service data. In order to ensure that the SW1 device can quickly switch the forwarding port carrying the stack service data, the failure of the control te1/1/1 port needs to be simulated, and the SW1 device is triggered to elect the control port.
Step five: according to the step four, the control port election of the SW1 device is triggered, the SW1 device elects a new control port te1/1/2, and then the software and hardware forwarding table of the SW1 stacking device is updated. the te1/1/2 port carries stack service data receiving and forwarding between the SW0 device and the SW1 device.
Normally, the control port te1/1/1 port in the virtual switch link of the SW1 device needs to detect the DOWN event before the election switching of the control port can be performed. Before the SW1 device performs control port switching, all stack service transmission data need to be transmitted through the te1/1/1 port, and at this time, the port te0/1/1 connected to the SW1 device cannot process stack service data, which may cause interruption of data transmitted from the SW1 device to the SW0 device, and service data forwarding cannot be resumed until the control port te1/1/2 is newly elected. In the embodiment of the present invention, a pre-notification mechanism is mainly used to trigger the stack device SW1 device in advance to perform election switching of a control port in a virtual switch link, thereby accelerating convergence of the virtual switch link and enhancing stability of a stack system.
As shown in fig. 3, a device for fast convergence of a link is provided for embodiment 1 of the present invention, where the implementing device is equivalent to a member device for implementing the method for fast convergence of a link, and two end member devices that establish a link including at least two physical connections are peer-to-peer, that is, the device may be a member device that sends a message notification message or a device that receives a message notification message. When the member device receives the member port exit instruction, the method specifically includes:
a port number obtaining module 301, configured to obtain, after receiving a member port exit instruction, a physical port number of the member port and a logical port number of a link to be exited by the member port;
a message sending module 302, configured to assemble a message notification message by using the obtained physical port number of the member port and the logical port number of the link to be exited by the member port, and send the assembled message notification message to an opposite-end member device in a highest priority manner;
and the port selection module 303 is configured to select a new service forwarding port from the member ports corresponding to the local link to be exited from the member port after the message sending module completes sending of the message notification message.
As shown in fig. 4, a device for fast convergence of a link is provided in embodiment 2 of the present invention, where the device for fast convergence of a link in this embodiment includes, in addition to the three modules in fig. 3, a message receiving module 304, configured to receive a message notification message from an opposite-end member device;
the port number obtaining module 301 is further configured to analyze the message notification message received by the message receiving module, and obtain a physical port number of a member port of the opposite-end member device in the message notification message and a logical port number of a link to be exited by the member port; searching the physical port number of a local member port correspondingly connected with the member port and the logical port number of a corresponding connection link according to the acquired physical port number of the member port of the opposite-end member device and the logical port number of the link to be exited of the member port;
the port selection module 303 is further configured to trigger the link correspondingly connected to the local member port to perform service port switching after the port number obtains the physical port number of the local member port and the logical port number of the corresponding connection link.
As shown in fig. 5, a device for fast convergence of a link according to embodiment 3 of the present invention is provided, and the device for fast convergence of a link according to this embodiment includes, in addition to the four modules shown in fig. 4, a port update module 305 for updating a hardware and software forwarding table.
As shown in fig. 6, a system for fast convergence of a link is provided for embodiment 1 of the present invention, where the system includes a first member device and a second member device, and a link including at least two physical connections is established between the two member devices. When first member equipment in the system needs to quit a first member port from a link according to requirements, second member equipment is informed that the member port of the second member equipment is about to be abnormal in advance, and when the second member equipment receives a message informing message that the first member port is about to quit the link, a local second member port correspondingly connected with the first member port is triggered in advance to carry out service switching. Wherein,
the first member equipment is used for sending a message notification message after receiving the exit instruction of the first member port and informing the second member equipment that the first member port is about to be abnormal,
and the second member device is used for triggering a local second member port correspondingly connected with the first member port in advance to perform service switching after receiving the message notification message.
The embodiment of the invention is not only suitable for the virtual exchange link control port of the stacking system, but also suitable for the virtual logic port with a plurality of physical ports. As long as the equipment can prejudge some abnormity of the port, the equipment can trigger the connecting equipment to carry out corresponding processing in advance by sending a message to the butt joint equipment.
The above description is only a preferred embodiment of the present application and should not be taken as limiting the scope of the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the technical solution of the present application should be included in the scope of the present application. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.