CN113411254A - Link processing method and device - Google Patents

Link processing method and device Download PDF

Info

Publication number
CN113411254A
CN113411254A CN202110520177.4A CN202110520177A CN113411254A CN 113411254 A CN113411254 A CN 113411254A CN 202110520177 A CN202110520177 A CN 202110520177A CN 113411254 A CN113411254 A CN 113411254A
Authority
CN
China
Prior art keywords
link
switch
aggregation mode
member link
state
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.)
Granted
Application number
CN202110520177.4A
Other languages
Chinese (zh)
Other versions
CN113411254B (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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202110520177.4A priority Critical patent/CN113411254B/en
Publication of CN113411254A publication Critical patent/CN113411254A/en
Application granted granted Critical
Publication of CN113411254B publication Critical patent/CN113411254B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results
    • 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

Landscapes

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

Abstract

The application provides a link processing method and a device, wherein the method is applied to a first switch, the first switch receives a first Link Layer Discovery Protocol (LLDP) message sent by a second switch, and the first LLDP message comprises a first aggregation mode of member links of the second switch and a first link state of the member links; detecting a second aggregation mode of the member link of the self and a second link state of the member link; and for each member link, processing the member link based on the second aggregation mode of the member link, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch and the first link state of the member link. By adopting the method, the problem of packet loss when the aggregation modes of the two switches are inconsistent is solved.

Description

Link processing method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a link processing method and apparatus.
Background
Link aggregation is an important technology in terms of increasing link bandwidth, implementing link transmission resilience, engineering redundancy, and the like. Link aggregation refers to aggregating a plurality of physical ports (member ports) together to form a logical port, so as to implement load sharing of the throughput of the ingress/egress traffic at each member port, and the switch determines from which member port the network packet is sent to the switch of the opposite end according to a port load sharing policy configured by a user. When the exchanger detects that the member link of one member port has a fault, the exchanger stops sending the message on the member port, recalculates the sending port of the message in the rest member links according to the load sharing strategy, and acts as the receiving and sending port again after the fault port is recovered.
When the configuration of the aggregated links of the two switches is different, for example, the link aggregation of one switch is configured as static aggregation, and the link aggregation of the other switch is configured as dynamic aggregation, when there is a failure of one switch, the other switch cannot sense the failure of the link, and still distributes traffic to the interrupted link, thereby causing loss of the traffic.
Therefore, when the link aggregation configurations of the two switches are different, how to solve the problem of packet loss is one of the considerable technical problems.
Disclosure of Invention
In view of this, the present application provides a link processing method and apparatus, so as to solve the problem of packet loss when link aggregation configurations of two switches are different.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of the present application, there is provided a link processing method applied in a first switch, the method including:
receiving a first Link Layer Discovery Protocol (LLDP) message sent by a second switch, wherein the first LLDP message comprises a first aggregation mode of a member link of the second switch and a first link state of the member link;
detecting a second aggregation mode of the member link of the self and a second link state of the member link;
and for each member link, processing the member link based on the second aggregation mode of the member link, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch and the first link state of the member link.
According to a second aspect of the present application, there is provided a link processing apparatus provided in a first switch, the apparatus including:
a receiving module, configured to receive a first link layer discovery protocol LLDP message sent by a second switch, where the first LLDP message includes a first aggregation mode of a member link of the second switch and a first link state of the member link;
the state detection module is used for detecting a second aggregation mode of the member link of the state detection module and a second link state of the member link;
and the link processing module is used for processing each member link based on the second aggregation mode of the member link, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch and the first link state of the member link.
According to a third aspect of the present application, there is provided an electronic device comprising a processor and a machine-readable storage medium, the machine-readable storage medium storing a computer program executable by the processor, the processor being caused by the computer program to perform the method provided by the first aspect of the embodiments of the present application.
According to a fourth aspect of the present application, there is provided a machine-readable storage medium storing a computer program which, when invoked and executed by a processor, causes the processor to perform the method provided by the first aspect of the embodiments of the present application.
The beneficial effects of the embodiment of the application are as follows:
the first switch may perform switching processing on the member link based on the first aggregation mode and the first link state sent by the second switch, and the second aggregation mode and the second link state detected by the first switch, for example, disconnect an unavailable member link, and switch originally-received traffic on the unavailable member link to an available member link for transmission, thereby avoiding occurrence of a packet loss situation. Thus, the problem of packet loss when the aggregation modes of the two switches are inconsistent is solved.
Drawings
Fig. 1 is a schematic flowchart of a link processing method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a structure of a TLV extension field according to an embodiment of the present disclosure;
fig. 3 is an application scenario diagram of a link processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a link processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic hardware structure diagram of an electronic device implementing a link processing method according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with aspects such as the present application.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the corresponding listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Before introducing the link processing method provided by the present application, technical terms related to the present application are explained:
link Layer Discovery Protocol (LLDP), belonging to ieee802.1ab Protocol, provides a standard Link Layer Discovery mode, which can organize Information such as main capability, Management address, device identifier, interface identifier, etc. of a local device into different TLVs (Type/Length/Value), encapsulate the TLVs into Link Layer Discovery Protocol Data Units (LLDPDUs), distribute the Information to neighbors directly connected to the local device, and store the Information in the form of standard Management Information Base (MIB) for a network Management system to query and judge the communication status of a Link. Based on the principle, the present application proposes that the local side switch may add the aggregation mode and the link state to the TLV extension field in the LLDP message, and then send the aggregation mode and the link state detected by the local side switch to the opposite side switch through the LLDP message, so that the opposite side switch switches the member links based on the aggregation mode and the link state in the LLDP message, thereby avoiding a packet loss situation when the aggregation modes of the local side switch and the opposite side switch are inconsistent.
In the first aggregation mode, the second aggregation mode, the third aggregation mode, and the fourth aggregation mode according to the present application, the first to fourth modes are only aggregation modes for distinguishing the first switch or the second switch acquired at different times. Similarly, the first to fourth link states among the first link state, the second link state, the third link state, and the fourth link state are only link states used for distinguishing the first switch or the second switch acquired at different times, and do not represent link states of the first link to the fourth link.
The link processing method provided in the present application is explained in detail below.
Referring to fig. 1, fig. 1 is a flowchart of a link processing method provided in the present application, where the method may be applied to a first switch, and the first switch may implement the method and may include the following steps:
s101, receiving a first Link Layer Discovery Protocol (LLDP) message sent by a second switch, wherein the first LLDP message comprises a first aggregation mode of a member link of the second switch and a first link state of the member link.
In this step, the second switch periodically detects the link status of each member link thereon and the aggregation mode of the member links. It should be noted that the aggregation modes of all member links in the second switch are generally the same, and certainly, there may be a case where the aggregation modes of different member links are different, and when the aggregation modes of all member links are the same, it is only necessary to detect the aggregation mode of one member link or detect the aggregation mode from the configuration; when the aggregation mode of all the member links is different, the aggregation mode of each member link may be detected separately. For convenience of description, the aggregation modes of all member links in the second switch are taken as the same example for explanation (the same applies to the first switch), and based on this, after the second switch detects the first aggregation mode of its own member link and the first link state of the member link, in order to solve the problem of packet loss caused by inconsistency between the aggregation modes of the first switch and the second switch, the application proposes that the second switch carries the detected first aggregation mode and the first link state of the member link in the first LLDP message, and then sends the first LLDP message to the first switch.
Specifically, the first aggregation mode and the first link status are added to an extension field of the TVL in the first LLDP message. Referring to fig. 2, a TLV extension field is added in the original TLV shown in the left frame of fig. 2, and the TLV extension field is shown in the right frame of fig. 2, where: link Layer Discovery Protocol, TLV Type, TLV Length, and Link mode, where the aggregation mode includes two modes, static aggregation and dynamic aggregation, and correspondingly, the value of Link mode is dynamic, which indicates that the aggregation mode of the Link is dynamic aggregation, and when the value of Link mode is static, it indicates that the aggregation mode of the Link is static aggregation; in addition, Link status in fig. 2 represents a Link state, and the Link state in this application may include a selected state and an unselected state, and when the Link status is selected, it indicates that the corresponding member Link is available, and may provide a communication service; when the Link status is unselected, the member Link is indicated to be unavailable and cannot provide communication service; it should be noted that each member Link characterizes a Link between ports on two switches, and therefore, a Link port (Link port) of each member Link in the local end switch is also included in the TLV extension field, as shown in fig. 2, the Link port: ten-gigabit Ethernet 1/0/18.
Specifically, when the Link mode in the newly added content in the TLV extension field in the first LLDP message: and when the Link status in the newly added content in the TLV extension field in the first LLDP message is selected and the Link port is Ten-gigabit ethernet1, the Link state of the member Link corresponding to the Link port number Ten-gigabit ethernet1 is the selected state, that is, the member Link corresponding to the Ten-gigabit ethernet1 is available.
It should be noted that, in this embodiment, the number of the member links detected by the second switch is not limited, and for convenience of description, in the following description, the example that the second switch detects the link states of all the member links is taken as an example to describe, and accordingly, the first link state of all the member links is added in the first LLDP message; in addition, since the link states of different member links may be the same or different, the values of the first link states of the respective member links may be the same or different, and need to be determined according to the actual situations of the member links.
S102, detecting a second aggregation mode of the member link of the user and a second link state of the member link.
In this step, after the first switch receives the first LLDP message sent by the second switch, on one hand, the first aggregation mode sent by the second switch and the first link state of each member link can be analyzed from the first LLDP message; on the other hand, the first switch may detect the second aggregation mode of the member link on the side of the first switch and the second link status of the member link, where it should be noted that the member link detected by the first switch is the same as the member link detected by the second switch.
S103, for each member link, processing the member link based on the second aggregation mode, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch, and the first link state of the member link.
In this step, after the first switch executes the steps S102 and S102, the first switch may perform switching processing on the member links based on the first aggregation mode and the first link state sent by the second switch, and the second aggregation mode and the second link state detected by the first switch, for example, the unavailable member links are disconnected, and the originally received traffic on the unavailable member links is switched to the available member links for transmission, so as to avoid occurrence of packet loss. Thus, the problem of packet loss when the aggregation modes of the two switches are inconsistent is solved.
In one possible embodiment, step S103 may be performed according to the following procedure: when the second aggregation mode is inconsistent with the first aggregation mode, encapsulating the second aggregation mode and a second link state of the member link into a second LLDP message; and sending the second LLDP message to the second switch, and after receiving the second LLDP message by the second switch, if it is determined that the first aggregation mode is inconsistent with the second aggregation mode and the first link state of the member link is inconsistent with the second link state of the member link, cutting off the member link.
Specifically, when the first aggregation mode and the second aggregation mode are not consistent, it indicates that one of the first switch and the second switch is dynamic aggregation and one is static aggregation. For example, if the second aggregation mode is static aggregation and the first aggregation mode is dynamic aggregation, the second switch may not sense the link failure, and based on this, the first switch may encapsulate the second aggregation mode and the second link state detected by itself into the second LLDP message and send the second LLDP message to the second switch. Thus, after receiving the second LLDP message, the second switch can parse the second aggregation pattern and the second link status from the second LLDP message, then, whether the first aggregation mode and the second aggregation mode are the same or not can be compared, if not, the second link state of each member link can be respectively compared with the corresponding first link state, then, the member link with the second link status inconsistent with the first link status can be confirmed, and the member link with the inconsistent link status is disconnected, then the original carried traffic of the disconnected member link is switched to other available member links for processing, therefore, the situation that when the aggregation modes of the two switches are inconsistent, whether the member link fails or not can not be perceived, and the flow is still transmitted by the failed member link, and packet loss is caused is avoided.
Optionally, when the member link is disconnected, the member link is not disabled later, so the second switch may perform a link failure alarm to perform failure handling on the member link. After the broken member link is processed to be failed, the member link will become available from unavailable, and accordingly, the link status of the member link will also change, so the second switch will also detect the link status (denoted as the first link status) and the aggregation mode (denoted as the first aggregation mode) of its own member link periodically, and then continue to execute step S101.
It should be noted that the second aggregation mode and the second link status are also added in the TLV extension field in the second LLDP message, please refer to fig. 2.
In another possible embodiment, step S103 may also be executed according to the following procedure: judging whether the second aggregation mode is the same as the first aggregation mode or not; if not, judging whether the second link state of the member link is consistent with the first link state of the member link; if not, the member link is disconnected.
On this basis, the following process can also be performed: continuously detecting a third aggregation mode of the member link of the self and a third link state of the member link; packaging the third aggregation mode and the third link state of the member link into a third LLDP message; and sending the third LLDP message to a second switch.
Specifically, after the first switch performs step S102, it may further compare whether the second aggregation mode detected by the first switch is the same as the first aggregation mode sent by the second switch, and if not, it indicates that the aggregation modes configured by the first switch and the second switch are one dynamic aggregation and one static aggregation, the first switch may compare whether the second link status of each member link is the same as the corresponding first link status, then finding out the member links with inconsistent link states, disconnecting the member links with inconsistent link states, then the original carried traffic of the disconnected member link is switched to other available member links for processing, therefore, the situation of packet loss caused by that the flow is still transmitted by the member link with the fault when the aggregation modes of the two switches are inconsistent because whether the member link is in fault cannot be sensed is avoided.
On this basis, when the member link is disconnected, the first switch may continue to detect its own link state (third link state) and aggregation mode (third aggregation mode), and then encapsulate the third link state and the third aggregation mode into a third LLDP packet and send the third LLDP packet to the second switch, so that the second switch can periodically obtain the link state of the member link detected by the first switch, and the like.
In addition, when the member link is disconnected, the member link is not unavailable later, so that the first switch can perform link failure alarm to perform failure processing on the member link. After the broken member link is subjected to fault processing, the member link is changed from unavailable to available, and accordingly, the link state of the member link is changed, so that the first switch also detects the link state (denoted as a first link state) and the aggregation mode (denoted as a first aggregation mode) of the member link at regular intervals, and then executes a step of continuously detecting the third aggregation mode of the member link and the third link state of the member link. Therefore, the occurrence of packet loss caused by that the flow is still transmitted by the failed member link due to the fact that whether the member link fails or not cannot be sensed when the aggregation modes of the two switches are inconsistent can be avoided.
It is noted that the fourth aggregation mode and the fourth link status may be encapsulated in a TLV extension field in the fourth LLDP message, as also shown in fig. 2.
Optionally, before executing step S101, the link processing method provided in this embodiment further includes: detecting a fourth aggregation mode of the member link of the self and a fourth link state of the member link; and encapsulating the fourth aggregation mode and the fourth link state of the member link in a fourth LLDP message, and sending the fourth LLDP message to a second switch.
Specifically, in this embodiment, the first switch may actively detect its own aggregation mode and the link state of the member link, and in order to distinguish from the above embodiments, the aggregation mode detected by the first switch is referred to as a fourth aggregation mode, and the detected link state of the member link is denoted as a fourth link state, and then the fourth aggregation mode and the fourth link state are encapsulated in a fourth LLDP message and are sent to the second switch, so that, after receiving the fourth LLDP message, the second switch may detect its own aggregation mode and link state, that is, the first aggregation mode and the first link state, and then may compare whether the first aggregation mode and the fourth aggregation mode are the same, and when they are different, it indicates that there is a switch that cannot sense a link failure in the first switch and the second switch, at this time, the second switch may encapsulate the first aggregation mode and the first link state in the first LLDP message, then, the first aggregation mode and the first link state can be analyzed from the first LLDP message after the first LLDP message is received by the first switch, then step S102 is executed, that is, the second aggregation mode and the second link state are detected, and then the first switch judges whether the second aggregation mode is the same as the first aggregation mode; if not, judging whether the second link state of the member link is consistent with the first link state of the member link; if not, the member link is disconnected. Therefore, the problem of packet loss caused by the fact that flow is still transmitted by the failed member link due to the fact that whether the member link fails or not cannot be sensed when the aggregation modes of the two switches are inconsistent can be solved.
In addition, when the first switch sends the fourth LLDP packet to the second switch, the second switch may further perform the following process: when the second switch detects the first aggregation mode and the second link state of the second switch, the second switch may determine whether the first aggregation mode is the same as the fourth aggregation mode, and when the first aggregation mode is different from the fourth aggregation mode, the second switch may compare the second link state of each member link with the corresponding fourth link state, to find out the member links whose link states are unmatched, and disconnect the member links whose link states are unmatched.
It is noted that the fourth aggregation mode and the fourth link status may be encapsulated in a TLV extension field in the fourth LLDP message, as also shown in fig. 2.
In any of the above embodiments, when the aggregation modes of the first switch and the second switch are the same, that is, the second aggregation mode is the same as the first aggregation mode, the processing may be performed in the existing manner, and this case is not limited in the present application.
To better understand the link processing method provided by this embodiment, an application scenario shown in fig. 3 may be taken as an example for explanation, and when both ports in Switch a and Switch B in fig. 3 are dynamic ports or both static ports, that is, when aggregation modes of Switch a and Switch B are both static aggregation or dynamic aggregation, processing is performed according to the current processing flow at this time. Taking the example that the aggregation modes of Switch a and Switch B are both dynamic aggregation, when the aggregation mode of Switch a is switched from dynamic aggregation to static aggregation (the configuration may be automatically implemented, or may be considered to be changed), a transient unselected state may occur on ports on Switch a and Switch B, but in this case, the protocol is still in a pass state, which may cause a problem of packet loss.
Based on the same inventive concept, the application also provides a link processing device corresponding to the link processing method. The link processing apparatus may be implemented by referring to the above description of the link processing method, which is not discussed herein.
Referring to fig. 4, fig. 4 is a link processing apparatus provided in a first switch according to an exemplary embodiment of the present application, where the apparatus includes:
a receiving module 401, configured to receive a first link layer discovery protocol LLDP message sent by a second switch, where the first LLDP message includes a first aggregation mode of a member link of the second switch and a first link state of the member link;
a state detection module 402, configured to detect a second aggregation mode of its own member link and a second link state of the member link;
a link processing module 403, configured to, for each member link, process the member link based on a second aggregation mode of the member link, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch, and the first link state of the member link.
In a possible embodiment, the link processing module 403 is specifically configured to, when the second aggregation mode is inconsistent with the first aggregation mode, encapsulate the second aggregation mode and the second link status of the member link into a second LLDP message; and sending the second LLDP message to the second switch, and after receiving the second LLDP message by the second switch, if it is determined that the first aggregation mode is inconsistent with the second aggregation mode and the first link state of the member link is inconsistent with the second link state of the member link, cutting off the member link.
In another possible embodiment, the link processing module 403 is specifically configured to determine whether the second aggregation mode is the same as the first aggregation mode; if not, judging whether the second link state of the member link is consistent with the first link state of the member link; if not, the member link is disconnected.
On this basis, the state detection module 402 is further configured to continue to detect the third aggregation mode of the own member link and the third link state of the member link;
on this basis, the link processing apparatus provided in this embodiment further includes:
a first encapsulating module (not shown in the figure), configured to encapsulate the third aggregation mode and the third link state of the member link into a third LLDP message;
a first sending module (not shown in the figure), configured to send the third LLDP packet to the second switch.
Optionally, the state detecting module 402 is further configured to detect a fourth aggregation mode of a member link of the receiving module and a fourth link state of the member link before the receiving module receives the first link layer discovery protocol LLDP packet sent by the second switch;
on this basis, the link processing apparatus provided in this embodiment further includes:
a second encapsulating module (not shown in the figure), configured to encapsulate the fourth aggregation mode and the fourth link status of the member link in a fourth LLDP message;
a second sending module (not shown in the figure), configured to send the fourth LLDP packet to a second switch;
further, the receiving module 401 is specifically configured to receive the first LLDP packet sent by the second switch when it is determined that the fourth aggregation mode of the fourth LLDP packet is inconsistent with the first aggregation mode detected by the second switch itself.
By implementing the link processing apparatus provided in this embodiment, the first switch may perform switching processing on the member links based on the first aggregation mode and the first link state sent by the second switch, and the second aggregation mode and the second link state detected by the first switch, for example, disconnect an unavailable member link, and switch traffic originally carried on the unavailable member link to an available member link for transmission, thereby avoiding occurrence of a packet loss situation. Thus, the problem of packet loss when the aggregation modes of the two switches are inconsistent is solved.
Based on the same inventive concept, the present application provides an electronic device, which may be the first switch or the second switch, as shown in fig. 5, the electronic device includes a processor 501 and a machine-readable storage medium 502, the machine-readable storage medium 502 stores a computer program that can be executed by the processor 501, and the processor 501 is caused by the computer program to execute the link processing method provided by the present application.
The computer-readable storage medium may include a RAM (Random Access Memory), a DDR SRAM (Double Data Rate Synchronous Dynamic Random Access Memory), and may also include a NVM (Non-volatile Memory), such as at least one disk Memory. Alternatively, the computer readable storage medium may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In addition, the embodiment of the present application provides a machine-readable storage medium, which stores a computer program, and when the computer program is called and executed by a processor, the computer program causes the processor to execute the link processing method provided by the embodiment of the present application.
For the embodiments of the electronic device and the machine-readable storage medium, since the contents of the related methods are substantially similar to those of the foregoing embodiments of the methods, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the embodiments of the methods.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The implementation process of the functions and actions of each unit/module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the units/modules described as separate parts may or may not be physically separate, and the parts displayed as units/modules may or may not be physical units/modules, may be located in one place, or may be distributed on a plurality of network units/modules. Some or all of the units/modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A link processing method applied to a first switch, the method comprising:
receiving a first Link Layer Discovery Protocol (LLDP) message sent by a second switch, wherein the first LLDP message comprises a first aggregation mode of a member link of the second switch and a first link state of the member link;
detecting a second aggregation mode of the member link of the self and a second link state of the member link;
and for each member link, processing the member link based on the second aggregation mode of the member link, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch and the first link state of the member link.
2. The method of claim 1, wherein for each member link, processing the member link based on the second aggregation mode of the member link, the second link status of the member link detected by the first switch, the first aggregation mode sent by the second switch, and the first link status of the member link comprises:
when the second aggregation mode is inconsistent with the first aggregation mode, encapsulating the second aggregation mode and a second link state of the member link into a second LLDP message;
and sending the second LLDP message to the second switch, and after receiving the second LLDP message by the second switch, if it is determined that the first aggregation mode is inconsistent with the second aggregation mode and the first link state of the member link is inconsistent with the second link state of the member link, cutting off the member link.
3. The method of claim 1, wherein for each member link, processing the member link based on the second aggregation mode of the member link, the second link status of the member link detected by the first switch, the first aggregation mode sent by the second switch, and the first link status of the member link comprises:
judging whether the second aggregation mode is the same as the first aggregation mode or not;
if not, judging whether the second link state of the member link is consistent with the first link state of the member link;
if not, the member link is disconnected.
4. The method of claim 3, further comprising:
continuously detecting a third aggregation mode of the member link of the self and a third link state of the member link;
packaging the third aggregation mode and the third link state of the member link into a third LLDP message;
and sending the third LLDP message to a second switch.
5. The method of claim 3, wherein before receiving the first Link Layer Discovery Protocol (LLDP) message sent by the second switch, the method further comprises:
detecting a fourth aggregation mode of the member link of the self and a fourth link state of the member link;
encapsulating the fourth aggregation mode and a fourth link state of the member link in a fourth LLDP message, and sending the fourth LLDP message to a second switch;
then, receiving a first link layer discovery protocol LLDP message sent by the second switch, including:
and receiving the first LLDP message sent by the second switch when the fourth aggregation mode of the fourth LLDP message is determined to be inconsistent with the first aggregation mode detected by the second switch.
6. A link processing apparatus provided in a first switch, the apparatus comprising:
a receiving module, configured to receive a first link layer discovery protocol LLDP message sent by a second switch, where the first LLDP message includes a first aggregation mode of a member link of the second switch and a first link state of the member link;
the state detection module is used for detecting a second aggregation mode of the member link of the state detection module and a second link state of the member link;
and the link processing module is used for processing each member link based on the second aggregation mode of the member link, the second link state of the member link detected by the first switch, the first aggregation mode sent by the second switch and the first link state of the member link.
7. The apparatus of claim 6,
the link processing module is specifically configured to, when the second aggregation mode is inconsistent with the first aggregation mode, encapsulate the second aggregation mode and a second link state of the member link into a second LLDP message; and sending the second LLDP message to the second switch, and after receiving the second LLDP message by the second switch, if it is determined that the first aggregation mode is inconsistent with the second aggregation mode and the first link state of the member link is inconsistent with the second link state of the member link, cutting off the member link.
8. The apparatus of claim 6,
the link processing module is specifically configured to determine whether the second aggregation mode is the same as the first aggregation mode; if not, judging whether the second link state of the member link is consistent with the first link state of the member link; if not, the member link is disconnected.
9. The apparatus of claim 8,
the state detection module is further configured to continue to detect a third aggregation mode of the own member link and a third link state of the member link;
the device, still include:
a first encapsulation module, configured to encapsulate the third aggregation mode and a third link state of the member link into a third LLDP message;
and the first sending module is used for sending the third LLDP message to a second switch.
10. The apparatus of claim 8,
the state detection module is further configured to detect a fourth aggregation mode of a member link of the state detection module and a fourth link state of the member link before the receiving module receives the first link layer discovery protocol LLDP packet sent by the second switch;
the device, still include:
a second encapsulating module, configured to encapsulate the fourth aggregation mode and a fourth link status of the member link in a fourth LLDP message;
the second sending module is configured to send the fourth LLDP packet to a second switch;
the receiving module is specifically configured to receive the first LLDP packet sent by the second switch when it is determined that the fourth aggregation mode of the fourth LLDP packet is inconsistent with the first aggregation mode detected by the second switch itself.
CN202110520177.4A 2021-05-13 2021-05-13 Link processing method and device Active CN113411254B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110520177.4A CN113411254B (en) 2021-05-13 2021-05-13 Link processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110520177.4A CN113411254B (en) 2021-05-13 2021-05-13 Link processing method and device

Publications (2)

Publication Number Publication Date
CN113411254A true CN113411254A (en) 2021-09-17
CN113411254B CN113411254B (en) 2023-03-31

Family

ID=77678590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110520177.4A Active CN113411254B (en) 2021-05-13 2021-05-13 Link processing method and device

Country Status (1)

Country Link
CN (1) CN113411254B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104363181A (en) * 2014-08-28 2015-02-18 杭州华三通信技术有限公司 Traffic transmission control method and device
WO2015096409A1 (en) * 2013-12-24 2015-07-02 中兴通讯股份有限公司 Method, device and system for discovering link in software-defined network
US20160057043A1 (en) * 2014-08-20 2016-02-25 Level 3 Communications, Llc Diagnostic routing system and method for a link access group
CN105721234A (en) * 2014-12-05 2016-06-29 杭州迪普科技有限公司 Port aggregation method and apparatus
WO2016107424A1 (en) * 2014-12-31 2016-07-07 华为技术有限公司 Link state detection method, apparatus and system
WO2016206635A1 (en) * 2015-06-25 2016-12-29 中兴通讯股份有限公司 Lacp-based forwarding detection method and system
CN106533964A (en) * 2015-09-09 2017-03-22 中兴通讯股份有限公司 Method and device for managing packet loss of link aggregation member ports

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015096409A1 (en) * 2013-12-24 2015-07-02 中兴通讯股份有限公司 Method, device and system for discovering link in software-defined network
US20160057043A1 (en) * 2014-08-20 2016-02-25 Level 3 Communications, Llc Diagnostic routing system and method for a link access group
CN104363181A (en) * 2014-08-28 2015-02-18 杭州华三通信技术有限公司 Traffic transmission control method and device
CN105721234A (en) * 2014-12-05 2016-06-29 杭州迪普科技有限公司 Port aggregation method and apparatus
WO2016107424A1 (en) * 2014-12-31 2016-07-07 华为技术有限公司 Link state detection method, apparatus and system
WO2016206635A1 (en) * 2015-06-25 2016-12-29 中兴通讯股份有限公司 Lacp-based forwarding detection method and system
CN106533964A (en) * 2015-09-09 2017-03-22 中兴通讯股份有限公司 Method and device for managing packet loss of link aggregation member ports

Also Published As

Publication number Publication date
CN113411254B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
US7933198B1 (en) Virtual router failover dampening
CN109525445B (en) Link switching method, link redundancy backup network and computer readable storage medium
US8027246B2 (en) Network system and node apparatus
EP2243255B1 (en) Method and system for dynamic link failover management
US9270485B2 (en) Method for ethernet ring protection
US20140254347A1 (en) Ethernet Ring Protection Switching Method, Node, and System
JP2006245849A (en) Communication apparatus
CN110730125B (en) Message forwarding method and device, dual-active system and communication equipment
CN105791126B (en) Ternary Content Addressable Memory (TCAM) table look-up method and device
CN105340230A (en) Virtual chassis topology management
CN112822102B (en) Link switching method, device, equipment, system and storage medium
CN109462533B (en) Link switching method, link redundancy backup network and computer readable storage medium
EP3029883B1 (en) Network protection method and apparatus, next-ring node, and system
CN112491700A (en) Network path adjusting method, system, device, electronic equipment and storage medium
CN102891769A (en) Link fault informing method and apparatus
EP2640012B1 (en) Multi-ring ethernet network and protection method thereof
CN102857316A (en) Method and system for realizing source looped network protection
CN114244736A (en) Multi-master detection method, equipment and medium based on stacking environment
CN113411254B (en) Link processing method and device
US8724518B2 (en) Communication system, node, terminal, program and communication method
CN115333991B (en) Cross-device link aggregation method, device, system and computer readable storage medium
CN109194592B (en) Method and system for solving island problem in multi-link network
WO2022267938A1 (en) Fault processing method, stack device, and storage medium
CN108881011B (en) LACP (Link aggregation control protocol) switching method and device applied to cross-device
CN107995111B (en) Service forwarding method, link change notification method, convergence device and access 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