CN113992605B - Method, device, equipment and storage medium for backing up and expanding dynamic link of switch - Google Patents

Method, device, equipment and storage medium for backing up and expanding dynamic link of switch Download PDF

Info

Publication number
CN113992605B
CN113992605B CN202111131124.XA CN202111131124A CN113992605B CN 113992605 B CN113992605 B CN 113992605B CN 202111131124 A CN202111131124 A CN 202111131124A CN 113992605 B CN113992605 B CN 113992605B
Authority
CN
China
Prior art keywords
message
port
forwarding
link
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111131124.XA
Other languages
Chinese (zh)
Other versions
CN113992605A (en
Inventor
张锡鑫
刘齐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111131124.XA priority Critical patent/CN113992605B/en
Publication of CN113992605A publication Critical patent/CN113992605A/en
Application granted granted Critical
Publication of CN113992605B publication Critical patent/CN113992605B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/55Prevention, detection or correction of errors
    • H04L49/555Error detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/45Arrangements for providing or supporting expansion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/55Prevention, detection or correction of errors
    • H04L49/557Error correction, e.g. fault recovery or fault tolerance
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method, a device, equipment and a storage medium for backing up and expanding a dynamic link of a switch, wherein the method comprises the following steps: monitoring port and link state; copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state; encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port; forwarding the generated tunnel protocol message; unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times; and when the original destination address record exists in the local port, forwarding the message to the port. The ports reserved due to backup or expansion are not required to be fixedly designated, and when port faults occur or bandwidth expansion is required, the backup or expansion can be automatically carried out, so that the utilization efficiency of the ports is improved; if the fault is relieved or the bandwidth occupation is reduced, the occupied ports or bandwidth are released accordingly, and the forwarding of other messages is not affected.

Description

Method, device, equipment and storage medium for backing up and expanding dynamic link of switch
Technical Field
The present invention relates to the field of switch data transmission technologies, and in particular, to a method, an apparatus, a device, and a storage medium for backup and expansion of a dynamic link of a switch.
Background
The white-box switch is a flexible and efficient network device, and users can deploy different applications and services with personalized characteristics on the same hardware system according to the needs. The device has the characteristics of decoupling software and hardware, can reduce cost and improve use flexibility, and has the biggest bright spot of strong openness.
In the present day with higher and higher requirements for network reliability, the failure backup and expansion of the switch communication link is a very important problem, and especially under the condition that the port bandwidth is higher and the data density is higher at present, the short-time failure of any switch link is likely to cause serious problems for network service. On the other hand, the development of the network also causes more and more traffic on the network, and the requirement on bandwidth is also higher and higher, and if the traffic is suddenly large in a short time, the link congestion and even packet loss are likely to be caused. There are many existing link backup and automatic expansion schemes, for example, a redundant link and port can be physically reserved for the link backup, so that the STP (spanning tree) serial protocol is utilized when the current link fails. For expanding the link bandwidth, the two-layer network has the LACP (link layer aggregation) protocol, and the three-layer network has the ECMP (equivalent routing) protocol for expanding the link bandwidth.
However, the above techniques have various disadvantages resulting in limited use. If the reserved backup port is idle in the case of no failure and cannot be used due to being blocked, the backup port is a physical backup of pure hardware, so that the forwarding capability of the backup port can be considered to be wasted in the case, meanwhile, the reserved backup port can only be used when the failure occurs, the use is not flexible enough, and once the reserved backup port totally fails, the link is not restored.
On the other hand, the existing network expansion protocol also has the problem of inflexibility, the ports to be expanded and the expandable ports are set, the expansion condition can not be changed in real time according to the change of the actual flow, the total expansion bandwidth is fixed, and the emergency situation in the network can not be fully dealt with.
Network tunneling (tunnel) is a technique for transmitting messages of different layers of network protocols or higher layers of network protocols using lower layer network protocols in a network, such as L2TP (two layer network tunneling protocol), PPTP (point-to-point tunneling protocol) for transmitting messages of other protocols of a two layer network, and GRE (generic routing encapsulation) protocol of a three layer network. By using the tunnel technology, the two parties of the message receiving and transmitting do not need to consider the protocol change in the message transmission process, the connection between the two parties can be virtualized into a point-to-point special link, and the transmission reliability and the safety are improved.
Disclosure of Invention
Aiming at the defects in the prior link backup and expansion technology and combining the characteristics of the tunnel technology, the invention provides a method, a device, equipment and a storage medium for dynamically backing up and expanding a link of a switch based on a network tunnel, which overcome the problems.
The technical scheme of the invention is as follows:
in a first aspect, the present invention provides a method for backup and expansion of a dynamic link of a switch, including the following steps:
monitoring port and link state;
copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state;
encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port;
forwarding the generated tunnel protocol message;
unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times;
and when the original destination address record exists in the local port, forwarding the message to the port.
By copying the message, encapsulating the tunnel message, forwarding according to a certain network rule, and receiving the next-stage switch with the message with the corresponding mark, the next-stage switch replaces the fault or the switch port with the full bandwidth to perform corresponding forwarding, thereby ensuring the message delivery.
Further, the step of monitoring the port and link state includes:
monitoring port and link state;
if the port and the link state are found to be changed without setting, judging that the link is faulty;
when the bandwidth is full and packet loss occurs, it is determined that link expansion is required.
If the port/link state is found to change under the condition of no administrator setting or is directly disconnected and the packet loss occurs, the link is considered to be faulty, and when the single-link router is full of bandwidth and the packet loss occurs, the link expansion is considered to be needed.
Further, the step of copying the message to the buffer area and adding a corresponding state mark according to the monitored state includes:
when a link fails, copying a message which needs to be forwarded from a failed port to a buffer area, and adding a port failure mark in the message;
when the link expansion is needed, the discarded message is copied to the buffer area, and the port expansion mark is added in the message.
Further, the step of encapsulating the copied message into the tunnel protocol message with the corresponding attribute according to the attribute of the port includes:
if the port is a two-layer port, the copied message is packaged into a two-layer tunnel protocol message, and a corresponding state mark and a forwarding frequency field are added in the message; forwarding the field value by 1 each time;
if the port has three layers of ports, the copied message is packaged into a three-layer tunnel protocol message, and a corresponding state mark is added.
Besides the characteristics of various tunnel messages, the message of the tunnel protocol is added with fault marks and related information fields, including fault port numbers, type machine models and the like, and is used for transmitting fault information to a switch receiving the message, and meanwhile, the message is provided with a forwarding times field, and the value of the forwarding times field is increased by one each time.
The three-layer tunnel protocol message has a timeout field, so that a forwarding frequency field is not added in the message.
Further, the step of forwarding the generated tunneling protocol message includes:
when the link fails and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port under the same virtual local area network with the failed port;
when the link fails and the attribute is three layers of ports, sending out three layers of tunnel protocol messages from ports which have the same destination route as the failed port;
when the link needs to be expanded and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port which is under the same virtual local area network with the port;
when the link needs to be expanded and the attribute is three-layer port, the three-layer tunnel protocol message is sent out from the port with the same purpose route as the port.
The ports reserved due to backup or expansion are not required to be fixedly designated, and when port faults occur or bandwidth expansion is required, the backup or expansion can be automatically carried out, so that the utilization efficiency of the ports is improved; if the fault is relieved or the bandwidth occupation is reduced, the occupied ports or bandwidth are released accordingly, and the forwarding of other messages is not affected.
Further, when the local port has a record of the original destination address, the method further includes:
searching whether the original destination address record exists in the local port;
if yes, forwarding a message to a local port;
if no: judging whether the forwarding times exceeds the set times; if yes, discarding the message; if not, executing the steps of: and encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port.
Inquiring whether the target address of the original message has a record on a local port, if so, forwarding the message to the port, if not, continuing repackaging the tunnel and adding a fault mark, and forwarding until the port with the address is found, or discarding the message because of excessive forwarding times.
In a second aspect, the present invention further provides a device for backup and expansion of a dynamic link of a switch, which includes a status monitoring module, a message preprocessing module, a message packaging module, a message processing module, and a message parsing module;
the state monitoring module is used for monitoring the states of the ports and the links;
the message preprocessing module is used for copying the message to the buffer area and adding a corresponding state mark according to the monitoring state;
the message encapsulation module is used for encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port;
the message processing module is used for forwarding the tunnel protocol message generated by the message packaging module; the method is also used for forwarding a message to the local port when the record of the original destination address exists in the port;
and the message analysis module is used for unpacking the received tunnel protocol message and reading the original destination address and the forwarding times.
Further, the state monitoring module is specifically used for monitoring the states of the ports and the links; if the port and the link state are found to be changed without setting, judging that the link is faulty; when the bandwidth is full and packet loss occurs, the link expansion is judged to be needed.
Further, the message preprocessing module is specifically configured to copy a message to be forwarded from a failed port to a buffer area when the status monitoring module monitors a link failure, and add a port failure flag to the message; when the state monitoring module monitors that the link needs to be expanded, the message to be discarded is copied to the buffer area, and meanwhile, a port expansion mark is added in the message.
Further, the message packaging module comprises a two-layer port packaging unit and a three-layer port packaging unit;
the two-layer port encapsulation unit is used for encapsulating the copied message into a two-layer tunnel protocol message, and adding a corresponding state mark and a forwarding frequency field into the message; forwarding the field value by 1 each time;
and the three-layer port encapsulation unit is used for encapsulating the copied message into a three-layer tunnel protocol message and adding a corresponding state mark.
Further, the message processing module is specifically configured to send out a two-layer tunnel protocol message from a trunk port under the same virtual local area network as the failed port when the link fails and the attribute is a two-layer port; when the link fails and the attribute is three layers of ports, sending out three layers of tunnel protocol messages from ports which have the same destination route as the failed port; when the link needs to be expanded and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port which is under the same virtual local area network with the port; when the link needs to be expanded and the attribute is three-layer port, the three-layer tunnel protocol message is sent out from the port with the same purpose route as the port.
Further, the device also comprises a destination address searching module and a forwarding frequency judging module;
the target address searching module is used for searching whether the original target address record exists in the local port;
the message processing module is specifically further configured to forward a message to the local port when the destination address searching module finds that the record of the original destination address exists in the local port; the message is discarded when the forwarding frequency judging module judges that the forwarding frequency exceeds the set frequency; the message encapsulation module is also used for triggering the message encapsulation module to encapsulate the corresponding message again when the forwarding frequency judging module judges that the forwarding frequency does not exceed the set frequency;
and the forwarding frequency judging module is used for judging whether the forwarding frequency exceeds the set frequency when the destination address searching module searches that the original destination address record does not exist in the local port.
In a third aspect, the present invention further provides a computer device, including a processor and a memory, where the processor and the memory complete communication with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the switch dynamic link backup and expansion method of the first aspect.
In a fourth aspect, the present disclosure further provides a non-transitory computer readable storage medium, where the non-transitory computer readable storage medium stores computer instructions, where the computer instructions cause the computer to execute the method for backup and expansion of a dynamic link of a switch according to the first aspect.
From the above technical solution, the present invention can be applied to the link failure backup and the dynamic expansion of the bandwidth of the data center white box switch, and has the advantages that:
(1) The physical port for backup or expansion is not required to be reserved, so that the utilization rate of the switch port under the condition of fault backup or dynamic expansion is improved;
(2) The configuration is flexible, the automatic start is realized when faults or anomalies occur, and the automatic recovery can be realized after the faults are eliminated;
(3) The configuration and the deployment are easy, no additional hardware modification is needed, and the configuration and the deployment are lower;
(4) By using the tunnel technology, the receiving end can realize fault-free perception.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
It can be seen that the present invention has outstanding substantial features and significant advances over the prior art, as well as its practical advantages.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method of one embodiment of the invention.
Fig. 2 is a schematic flow chart of a method of another embodiment of the invention.
Fig. 3 is a schematic block diagram of an apparatus of one embodiment of the present invention.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
As shown in fig. 1, embodiment 1 of the present invention provides a method for backup and expansion of a dynamic link of a switch, which includes the following steps:
s11: monitoring port and link state; the state includes link failure and link augmentation;
s12: copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state;
s13: encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port;
s14: forwarding the generated tunnel protocol message;
s15: unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times;
s16: and when the original destination address record exists in the local port, forwarding the message to the port.
After a port backup or dynamic expansion is configured for a certain port of the switch, the state and the bandwidth utilization condition of the port are continuously and automatically circularly inquired; when the port state is abnormal or the bandwidth utilization rate is abnormally increased, the switch software copies the message which cannot be sent or is to be discarded into a part of the buffer area divided in the switch storage space, adds different marks and port machine information according to the abnormal type, encapsulates the message into different tunnel messages according to the attribute of the abnormal port, and forwards the message to the next stage of switch according to different forwarding modes. After the next-stage exchanger receives the message, it inquires whether the destination address of the original message exists on the local exchanger, and if so, it forwards the original message.
By copying the message, encapsulating the tunnel message, forwarding according to a certain network rule, and receiving the next-stage switch with the message with the corresponding mark, the next-stage switch replaces the fault or the switch port with the full bandwidth to perform corresponding forwarding, thereby ensuring the message delivery.
As shown in fig. 2, embodiment 2 of the present invention provides a method for backup and expansion of a dynamic link of a switch, which includes the following steps:
s21: monitoring port and link state; step S22 is executed when the link fails, and step S23 is executed when the link expansion is required;
if the port and the link state are found to be changed without setting, determining that the link is faulty; when the bandwidth is full and packet loss occurs, it is determined that link expansion is required.
In the step, when the monitoring of the port is normal, continuing the monitoring process;
s22: copying the message which needs to be forwarded from the fault port to a buffer area, and adding a port fault mark in the message; step 24 is performed; the buffer area is a part of buffer area divided on a storage medium on the switch;
s23: copying the discarded message to a buffer area, and adding a port expansion mark in the message;
when the bandwidth is full and packet loss occurs, the exchanger copies the data message to be discarded into a buffer zone;
s24: judging the attribute of the port; if the port has the attribute of two layers of ports, executing the step S25, and if the port has the attribute of three layers of ports, executing the step S27;
s25: encapsulating the copied message into a two-layer tunnel protocol message, and simultaneously adding a corresponding state mark and a forwarding frequency field into the message; forwarding the field value by 1 each time; when the link fails, a port failure mark is added in the message; when the link expansion is needed, adding a port expansion mark in the message;
s26: sending out a two-layer tunnel protocol message from a trunk port under the same virtual local area network; step 29 is performed;
in this step, it should be noted that, when the link fails and the attribute is a two-layer port, the two-layer tunnel protocol message is sent out from the trunk port under the same virtual local area network as the failed port; when the link needs to be expanded and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port which is under the same virtual local area network with the port;
s27: packaging the copied message into a three-layer tunnel protocol message, and adding a corresponding state mark; when the link fails, a port failure mark is added in the message; when the link expansion is needed, adding a port expansion mark in the message;
s28: sending out three layers of tunnel protocol messages from ports with the same destination route; step 29 is performed;
after a port backup or dynamic expansion is configured for a certain port of the switch, the state and the bandwidth utilization condition of the port are continuously and automatically circularly inquired; when the port state is abnormal or the bandwidth utilization rate is abnormally increased, the switch software copies the message which cannot be sent or is to be discarded into a part of the buffer area divided in the switch storage space, adds different marks and port machine information according to the abnormal type, encapsulates the message into different tunnel messages according to the attribute of the abnormal port, and forwards the message to the next stage of switch according to different forwarding modes.
S29: unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times;
s30: searching whether the original destination address record exists in the local port, if not, executing step S31; if yes, go to step 33; inquiring whether the target address of the original message has a record on a local port, if so, forwarding the message to the port, if not, continuing repackaging the tunnel and adding a fault mark, and forwarding until the port with the address is found, or discarding the message because of excessive forwarding times.
S31: judging whether the forwarding times exceeds the set times; if yes, go to step S32, if no, go to step S24;
s32: discarding the message;
s33: and forwarding the message to the local port.
After the next-stage switch receives the message, unpacking the tunnel message and obtaining the forwarding times of the message, discarding the message exceeding the forwarding times, if not exceeding, inquiring whether the destination address of the original message exists on the local machine, forwarding the original message, otherwise, re-sealing the corresponding tunnel protocol message, and forwarding the message to the next-stage switch until the forwarding times exceed the limit and are discarded or forwarded by the switch with the original address.
In this embodiment, the method further includes: if the fault is relieved, the forwarding of the message is stopped, and the original state of the switch is automatically restored.
Besides the characteristics of various tunnel messages, the message of the tunnel protocol is added with fault marks and related information fields, including fault port numbers, type machine models and the like, and is used for transmitting fault information to a switch receiving the message, and meanwhile, the message is provided with a forwarding times field, and the value of the forwarding times field is increased by one each time. The three-layer tunnel protocol message has a timeout field, so that a forwarding frequency field is not added in the message.
The ports reserved due to backup or expansion are not required to be fixedly designated, and when port faults occur or bandwidth expansion is required, the backup or expansion can be automatically carried out, so that the utilization efficiency of the ports is improved; if the fault is relieved or the bandwidth occupation is reduced, the occupied ports or bandwidth are released accordingly, and the forwarding of other messages is not affected.
In particular, most of the failure causes of a link are due to medium problems of the link, such as failure of optical transceivers at both ends of the link or cable interruption. After the switch is started, if the dynamic backup is set for a certain port, the port state is circularly inquired.
If the port/link state is found to change without administrator settings. Or directly disconnect, and packet loss occurs. The data message which needs to be forwarded from the fault port is immediately copied to a part of buffer areas which are partitioned on a storage medium on the switch, and then the data message is partitioned according to the type of the fault port:
if the port is a two-layer port, the copied message is packaged into a two-layer tunnel protocol message, meanwhile, a fault mark of the original port is added in the message, and then the message is sent out from a trunk port (representing that the next stage is usually another switch) under the same Vlan (virtual local area network) with the fault message, and the state of the port is required to be normal. The next-stage exchanger inquires the fault mark after receiving the message, unpacks the message after confirming the data packet which is backed up, inquires whether the destination address of the original message has a record on the local port, if yes, forwards the message to the port, if not, continues to repackage the tunnel to the port of the same Vlan and adds the fault mark for forwarding until the port which exists at the address is found, or the forwarding times are too many to be discarded.
If the port is three-layer connection, the basic process is similar to that of the two-layer port, but three-layer tunnel protocol messages are encapsulated and corresponding fault marks are added (the three-layer messages have TTL (time-out) fields, so that forwarding times fields can not be added in the messages), and the messages can be forwarded to the port which can reach the destination IP (network address) of the fault port according to a routing forwarding table in the switch. After the next level switch or router receives the message, the fault flag is also read, and the data packet is decompressed Bao Jiexi and sent to the next destination.
When the single-link router is full of bandwidth and packet loss occurs, the invention can also dynamically expand the link, and the method is as follows: when the bandwidth is full and packet loss occurs, the switch copies the data message to be discarded into a buffer zone, then encapsulates the data message into different tunnel protocol messages according to the property of the port (two-layer port or three-layer port), and adds the part of the related port information, but the added mark does not notice the fault, but prompts to expand. If the message is a two-layer tunnel protocol message, the message is forwarded through the trunk port of the same Vlan, if the message is a three-layer tunnel protocol message, the message is forwarded through a port with the same destination route, and when the message is forwarded, the port with less bandwidth occupation is preferentially selected. After the next-stage switch or router receives the message, unpacking is carried out, and the tunnel message is directly forwarded or re-sealed into the next-stage switch or router according to the destination address.
As shown in fig. 3, the embodiment of the invention further provides a device for backing up and expanding a dynamic link of a switch, which comprises a state monitoring module, a message preprocessing module, a message packaging module, a message processing module and a message analyzing module;
the state monitoring module is used for monitoring the states of the ports and the links;
the message preprocessing module is used for copying the message to the buffer area and adding a corresponding state mark according to the monitoring state;
the message encapsulation module is used for encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port;
the message processing module is used for forwarding the tunnel protocol message generated by the message packaging module; the method is also used for forwarding a message to the local port when the record of the original destination address exists in the port;
and the message analysis module is used for unpacking the received tunnel protocol message and reading the original destination address and the forwarding times.
The state monitoring module is specifically used for monitoring the states of the ports and the links; if the port and the link state are found to be changed without setting, judging that the link is faulty; when the bandwidth is full and packet loss occurs, the link expansion is judged to be needed.
In some embodiments of the apparatus, the message preprocessing module is specifically configured to copy, when the status monitoring module monitors a link failure, a message that needs to be forwarded from a failed port to the buffer area, and add a port failure flag to the message; when the state monitoring module monitors that the link needs to be expanded, the message to be discarded is copied to the buffer area, and meanwhile, a port expansion mark is added in the message.
In some embodiments of the apparatus, the packet encapsulation module includes a two-layer port encapsulation unit and a three-layer port encapsulation unit;
the two-layer port encapsulation unit is used for encapsulating the copied message into a two-layer tunnel protocol message, and adding a corresponding state mark and a forwarding frequency field into the message; forwarding the field value by 1 each time;
and the three-layer port encapsulation unit is used for encapsulating the copied message into a three-layer tunnel protocol message and adding a corresponding state mark.
Correspondingly, the message processing module is specifically configured to send out a two-layer tunnel protocol message from a trunk port under the same virtual local area network as the failed port when the link fails and the attribute is a two-layer port; when the link fails and the attribute is three layers of ports, sending out three layers of tunnel protocol messages from ports which have the same destination route as the failed port; when the link needs to be expanded and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port which is under the same virtual local area network with the port; when the link needs to be expanded and the attribute is three-layer port, the three-layer tunnel protocol message is sent out from the port with the same purpose route as the port.
In some embodiments of the apparatus, the apparatus further includes a destination address lookup module and a forwarding number determination module;
the target address searching module is used for searching whether the original target address record exists in the local port;
the message processing module is specifically further configured to forward a message to the local port when the destination address searching module finds that the record of the original destination address exists in the local port; the message is discarded when the forwarding frequency judging module judges that the forwarding frequency exceeds the set frequency; the message encapsulation module is also used for triggering the message encapsulation module to encapsulate the corresponding message again when the forwarding frequency judging module judges that the forwarding frequency does not exceed the set frequency;
and the forwarding frequency judging module is used for judging whether the forwarding frequency exceeds the set frequency when the destination address searching module searches that the original destination address record does not exist in the local port.
The embodiment of the invention provides a computer device, which can comprise: the device comprises a processor, a communication interface, a memory and a bus, wherein the processor, the communication interface and the memory are in communication with each other through the bus. The bus may be used for information transfer between the electronic device and the sensor. The processor may call logic instructions in memory to perform the following method: monitoring port and link state; copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state; encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port; forwarding the generated tunnel protocol message; unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times; and when the original destination address record exists in the local port, forwarding the message to the port.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Embodiments of the present invention provide a non-transitory computer readable storage medium storing computer instructions that cause a computer to perform the methods provided by the method embodiments described above, for example, including: monitoring port and link state; copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state; encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port; forwarding the generated tunnel protocol message; unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times; and when the original destination address record exists in the local port, forwarding the message to the port.
In some specific embodiments, the program instructions executed by the processor in the readable storage medium may specifically implement the following steps: searching whether the original destination address record exists in the local port; if yes, forwarding a message to a local port; if no: judging whether the forwarding times exceeds the set times; if yes, discarding the message; if not, executing the steps of: and encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Although the present invention has been described in detail by way of preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications and substitutions may be made in the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and it is intended that all such modifications and substitutions be within the scope of the present invention/be within the scope of the present invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method for backing up and expanding dynamic links of a switch is characterized by comprising the following steps:
monitoring port and link state;
copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state;
encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port;
forwarding the generated tunnel protocol message;
unpacking the received tunnel protocol message, and reading the original destination address and the forwarding times;
when the original destination address record exists in the local port, a message is forwarded to the port;
the step of monitoring the port and the link state comprises the following steps:
monitoring port and link state;
if the port and the link state are found to be changed without setting, judging that the link is faulty;
when the bandwidth is full and packet loss occurs, judging that the link expansion is needed;
copying the message to a buffer area, and adding a corresponding state mark according to the monitoring state, wherein the step of adding the corresponding state mark comprises the following steps of:
when a link fails, copying a message which needs to be forwarded from a failed port to a buffer area, and adding a port failure mark in the message;
when the link expansion is needed, the discarded message is copied to the buffer area, and the port expansion mark is added in the message.
2. The method for dynamic link backup and expansion of a switch according to claim 1, wherein the step of encapsulating the copied message into the tunneling protocol message of the corresponding attribute according to the attribute of the port comprises:
if the port is a two-layer port, the copied message is packaged into a two-layer tunnel protocol message, and a corresponding state mark and a forwarding frequency field are added in the message; forwarding the field value by 1 each time;
if the port has three layers of ports, the copied message is packaged into a three-layer tunnel protocol message, and a corresponding state mark is added.
3. The method for dynamic link backup and expansion of a switch according to claim 2, wherein the step of forwarding the generated tunneling protocol message comprises:
when the link fails and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port under the same virtual local area network with the failed port;
when the link fails and the attribute is three layers of ports, sending out three layers of tunnel protocol messages from ports which have the same destination route as the failed port;
when the link needs to be expanded and the attribute is a two-layer port, sending out a two-layer tunnel protocol message from a trunk port which is under the same virtual local area network with the port;
when the link needs to be expanded and the attribute is three-layer port, the three-layer tunnel protocol message is sent out from the port with the same purpose route as the port.
4. The method for backup and expansion of dynamic link of switch according to claim 2, wherein when there is a record of the original destination address in the local port, before forwarding the message to the port, the method further comprises:
searching whether the original destination address record exists in the local port;
if yes, forwarding a message to a local port;
if no: judging whether the forwarding times exceeds the set times; if yes, discarding the message; if not, executing the steps of: and encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port.
5. The dynamic link backup and expansion device of the switch is characterized by comprising a state monitoring module, a message preprocessing module, a message packaging module, a message processing module and a message analyzing module;
the state monitoring module is used for monitoring the states of the ports and the links; the method is particularly used for monitoring the port and link state; if the port and the link state are found to be changed without setting, judging that the link is faulty; when the bandwidth is full and packet loss occurs, judging that the link expansion is needed;
the message preprocessing module is used for copying the message to the buffer area and adding a corresponding state mark according to the monitoring state; when a link fails, copying a message which needs to be forwarded from a failed port to a buffer area, and adding a port failure mark in the message; when the link expansion is needed, copying the discarded message to a buffer area, and adding a port expansion mark in the message;
the message encapsulation module is used for encapsulating the copied message into a tunnel protocol message with corresponding attribute according to the attribute of the port;
the message processing module is used for forwarding the tunnel protocol message generated by the message packaging module; the method is also used for forwarding a message to the local port when the record of the original destination address exists in the port;
and the message analysis module is used for unpacking the received tunnel protocol message and reading the original destination address and the forwarding times.
6. The device for dynamic link backup and expansion of a switch according to claim 5, further comprising a destination address searching module and a forwarding frequency judging module;
the target address searching module is used for searching whether the original target address record exists in the local port;
the message processing module is specifically further configured to forward a message to the local port when the destination address searching module finds that the record of the original destination address exists in the local port; the message is discarded when the forwarding frequency judging module judges that the forwarding frequency exceeds the set frequency; the message encapsulation module is also used for triggering the message encapsulation module to encapsulate the corresponding message again when the forwarding frequency judging module judges that the forwarding frequency does not exceed the set frequency;
and the forwarding frequency judging module is used for judging whether the forwarding frequency exceeds the set frequency when the destination address searching module searches that the original destination address record does not exist in the local port.
7. A computer device comprising a processor and a memory, said processor and said memory completing communication with each other via a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the switch dynamic link backup and expansion method of any of claims 1-4.
8. A non-transitory computer readable storage medium storing computer instructions that cause the computer to perform the switch dynamic link backup and expansion method of any of claims 1 to 4.
CN202111131124.XA 2021-09-26 2021-09-26 Method, device, equipment and storage medium for backing up and expanding dynamic link of switch Active CN113992605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111131124.XA CN113992605B (en) 2021-09-26 2021-09-26 Method, device, equipment and storage medium for backing up and expanding dynamic link of switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111131124.XA CN113992605B (en) 2021-09-26 2021-09-26 Method, device, equipment and storage medium for backing up and expanding dynamic link of switch

Publications (2)

Publication Number Publication Date
CN113992605A CN113992605A (en) 2022-01-28
CN113992605B true CN113992605B (en) 2023-08-08

Family

ID=79736765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111131124.XA Active CN113992605B (en) 2021-09-26 2021-09-26 Method, device, equipment and storage medium for backing up and expanding dynamic link of switch

Country Status (1)

Country Link
CN (1) CN113992605B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101695047A (en) * 2009-10-26 2010-04-14 中兴通讯股份有限公司 Method and switch for realizing forwarding of dynamic tunnel message
CN108521378A (en) * 2018-04-23 2018-09-11 天津芯海创科技有限公司 Retransmission method, device and the network switching equipment of heterogeneous protocol message

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101695047A (en) * 2009-10-26 2010-04-14 中兴通讯股份有限公司 Method and switch for realizing forwarding of dynamic tunnel message
WO2011050644A1 (en) * 2009-10-26 2011-05-05 中兴通讯股份有限公司 Method for performing dynamic tunnel message forwarding and switch thereof
CN108521378A (en) * 2018-04-23 2018-09-11 天津芯海创科技有限公司 Retransmission method, device and the network switching equipment of heterogeneous protocol message

Also Published As

Publication number Publication date
CN113992605A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
US8483050B2 (en) Method and apparatus for ethernet ring protection
US9270485B2 (en) Method for ethernet ring protection
JP7443537B2 (en) Packet processing method, packet processing device, and packet processing system
US20230073121A1 (en) SR Policy Issuing Method and Apparatus and SR Policy Receiving Method and Apparatus
EP3713160B1 (en) Packet transmission method and apparatus
CN112291160B (en) BUM message suppression method, device and medium
JP2017034463A (en) Protection method, communication system, and end node
CN111447095B (en) Bidirectional forwarding detection switching method, bidirectional forwarding detection module and edge device
CN114978987B (en) Server Redundancy Backup Method
CN108199903B (en) Distributed aggregation system configuration method and device
CN101795232A (en) Network failure treating method and device
CN113992605B (en) Method, device, equipment and storage medium for backing up and expanding dynamic link of switch
CN110138656B (en) Service processing method and device
CN107018072B (en) data frame sending method and access equipment
CN112637054B (en) Networking optimization method and device for IP bearing network, computing equipment and storage medium
CN103607301A (en) Link fault protection switching method and device under ECMP mode
CN110138636B (en) Dynamic linear protection method and device
CN106992929A (en) A kind of pseudo-line service retransmission method and device
CN107835126B (en) Message forwarding method and system
EP4325799A1 (en) Data transmission method, communication system, and route advertisement method
CN111478845B (en) Protection switching method and provider network edge device
CN115022120B (en) Message suppression method, device and medium for MLAG in VXLAN network
CN103209085B (en) The processing method of alarm and linkage support system
CN112751696B (en) Method and system for transmitting in-band SD signal in communication network
CN116074395A (en) Message sending method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant