CN112953789B - Link detection method and device - Google Patents

Link detection method and device Download PDF

Info

Publication number
CN112953789B
CN112953789B CN202110090065.XA CN202110090065A CN112953789B CN 112953789 B CN112953789 B CN 112953789B CN 202110090065 A CN202110090065 A CN 202110090065A CN 112953789 B CN112953789 B CN 112953789B
Authority
CN
China
Prior art keywords
switch
port
link
detection
message
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
CN202110090065.XA
Other languages
Chinese (zh)
Other versions
CN112953789A (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 CN202110090065.XA priority Critical patent/CN112953789B/en
Publication of CN112953789A publication Critical patent/CN112953789A/en
Application granted granted Critical
Publication of CN112953789B publication Critical patent/CN112953789B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/0001Arrangements for dividing the transmission path
    • H04L5/0003Two-dimensional division
    • H04L5/0005Time-frequency
    • H04L5/0007Time-frequency the frequencies being orthogonal, e.g. OFDM(A), DMT
    • H04L5/001Time-frequency the frequencies being orthogonal, e.g. OFDM(A), DMT the frequencies being arranged in component carriers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • H04Q11/0001Selecting arrangements for multiplex systems using optical switching
    • H04Q11/0062Network aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • H04Q11/0001Selecting arrangements for multiplex systems using optical switching
    • H04Q11/0062Network aspects
    • H04Q2011/0079Operation or maintenance aspects
    • H04Q2011/0083Testing; Monitoring
    • 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)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The method is applied to a first switch, the first switch and a second switch are configured with a link aggregation function, a port of the first switch and a port of the second switch form a member link in a link aggregation group, and when the member link in the link aggregation group is detected, a reference port in the first switch is used for sending a first LLDP message to the second switch; if a first confirmation message of a first LLDP message fed back by a second switch is received, a first detection message is sent to the second switch by using a second port of the first switch corresponding to the member link; if the first detection message returned by the second switch through the first port is received, confirming that the member link has no fault; and if the first detection message returned by the second switch through the first port is not received, confirming that the member link fails. Thereby enabling active detection of member links.

Description

Link detection method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a link detection method and apparatus.
Background
Link Aggregation (Link Aggregation) is to aggregate a plurality of physical ports together to form a logical port to realize load sharing of the throughput of the ingress/egress traffic on each member port, and a switch determines from which member port a network packet is sent to a switch at the opposite end according to a port load sharing policy configured by a user. The technology allows two network devices to be connected in parallel through a plurality of member ports to form a plurality of member links, and simultaneously, data are transmitted in parallel through the member links, so that higher bandwidth and throughput are provided, and the stability of the system is improved.
However, when a member link fails due to a failure of an optical module in an aggregated link, normal forwarding of service traffic is affected due to failure of sensing abnormality in time and failure troubleshooting in time.
Disclosure of Invention
In view of this, the present application provides a link detection method and device for detecting a failed link in an aggregated link, so as to avoid a situation that a service traffic cannot be forwarded normally due to a link failure.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of the present application, there is provided a link detection method applied to a first switch, where the first switch and a second switch are configured with a link aggregation function, and a port of the first switch and a port of the second switch form a member link in a link aggregation group, the method including:
when detecting a member link in a link aggregation group, sending a first Link Layer Discovery Protocol (LLDP) message to a second switch by using a reference port in the first switch, wherein the first LLDP message carries first detection enabling information of a first port of the second switch corresponding to the member link;
if a first confirmation message of the first LLDP message fed back by the second switch is received, sending a first detection message to the second switch by using a second port of the member link corresponding to the first switch, wherein the first confirmation message is generated by the second switch after the first port is enabled based on the first detection enabling information;
if the first detection message returned by the second switch through the first port is received, confirming that the member link has no fault;
and if the first detection message returned by the second switch through the first port is not received, confirming that the member link fails.
According to a second aspect of the present application, there is provided a link detection apparatus applied to a first switch, the first switch and a second switch are configured with a link aggregation function, a port of the first switch and a port of the second switch form a member link in a link aggregation group, the apparatus including:
a first sending module, configured to send a first link layer discovery protocol LLDP message to the second switch by using a reference port in the first switch when detecting a member link in a link aggregation group, where the first LLDP message carries first detection enabling information of a first port of the second switch corresponding to the member link;
a second sending module, configured to send a first detection packet to the second switch by using a second port of the first switch corresponding to the member link if a first acknowledgement packet of the first LLDP packet fed back by the second switch is received, where the first acknowledgement packet is generated by the second switch after the first port is enabled based on the first detection enabling information;
the judging module is used for judging whether the first detection message returned by the second switch through the first port is received or not;
a first determining module, configured to determine that the member link has no failure if the determination result of the determining module is yes
And the second determining module is used for determining that the member link fails if the judgment result of the judging module is negative.
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:
when detecting the member link, the opposite terminal port of the member link required to be detected is informed through adding detection enabling information in an LLDP message, and after receiving a confirmation message sent by the opposite terminal switch after enabling the opposite terminal port, a detection message is sent to the opposite terminal switch by using the local terminal port of the member link required to be detected so as to detect whether a member link formed by the local terminal port and the opposite terminal port is failed.
Drawings
Fig. 1 is a schematic flowchart of a link detection method according to an embodiment of the present application;
fig. 2 is a schematic view of an application scenario of a link detection method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a first LLDP packet provided in this application;
fig. 4 is a schematic structural diagram of a second acknowledgment packet provided in the embodiment of the present application;
fig. 5 is a schematic flowchart of another link detection method provided in an embodiment of the present application;
fig. 6 is a schematic application scenario diagram of another link detection method provided in the embodiment of the present application;
fig. 7 is a schematic structural diagram of a link detection apparatus according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of an electronic device implementing the link detection 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 describing the link detection method provided by any embodiment of the present application, technical terms related to the present application are described:
link Layer Discovery Protocol (LLDP), belonging to ieee802.1ab standard, 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 values), encapsulate the TLVs into a Link Layer Discovery Protocol Data Unit (LLDPDU), distribute the Information to neighbors directly connected to the local device, and store the Information in the form of a standard Management Information Base (MIB) after the neighbors receive the Information, so as to allow a network Management system to query and judge the communication status of a Link. The method and the device utilize the characteristics of the LLDP and expand the TLV field of the LLDP message to add the detection enabling information of the port to detect whether the member links in the link aggregation group have faults or not in sequence.
The link detection method provided in the present application is described in detail below, and the link detection method may be applied to link detection of any member link in an aggregation link group between leaf nodes and spine nodes in an Ethernet-based Virtual Private Network (EVPN).
Referring to fig. 1, fig. 1 is a flowchart of a link detection method provided by the present application, where the method is applied to a first switch in fig. 2, the first switch and a second switch in fig. 2 are configured with a link aggregation function, a port of the first switch and a port of the second switch form a member link in a link aggregation group, the first switch may be disposed in a leaf node, and the second switch may be disposed in a spine node, and by performing link detection on the member link in the aggregation link group formed by the ports of the first switch and the second switch, detection on the member link between the leaf node and the spine node can be achieved. When the first switch implements the above-mentioned link detection method, the method may include the following steps:
s101, when detecting a member link in a link aggregation group, sending a first Link Layer Discovery Protocol (LLDP) message to a second switch by using a reference port in the first switch, wherein the first LLDP message carries first detection enabling information of a first port of the second switch corresponding to the member link.
Specifically, the link aggregation group may record a correspondence relationship between two ports constituting each member link, where the two ports are a port of the first switch and a port of the second switch, respectively. In practical application, before Link detection, when a first switch and a second switch configure a Link Aggregation function, the two switches may interact through Link Aggregation Control Protocol (LACP) messages to elect a member port of each member Link, and after the member ports constituting each member Link are elected, the member ports of each member Link are written into a Link Aggregation group.
On this basis, after the first switch starts the aggregation member link detection function, the member links in the aggregation link group can be periodically detected one by one, and certainly, only selected member links can be detected according to actual requirements. Specifically, with reference to fig. 2 as an example, to describe by taking an example of detecting whether a member link formed between port 1 (located in the first switch) and port2 (located in the second switch) in fig. 2 fails, a reference port, that is, port 3 in fig. 2, is configured in the first switch, based on which, when detecting a member link formed between port 1 and port2 in the aggregation link group, a first LLDP packet may be pre-configured, that is, a first detection enabling information about port2 (that is, the first port) is added to the first LLDP packet, and then the first LLDP packet is sent to the second switch by using port 3 of the first switch.
Optionally, the first detection enabling information is located in a TLV extension field of the first LLDP packet, as shown in fig. 3, the first LLDP packet may include, but is not limited to: a source MAC address (source MAC address), a Destination MAC address (Destination MAC address), a protocol Type (Type), and a DATA, where the DATA is an LLDPDU including a TLV and a TLV extension field, and the TLV extension field includes first detection enabling information, where the first detection enabling information may include, but is not limited to: protocol information, TLV type, TLV length, Link detection mode (Link Check mode), enabled detection port information (Enable Check port) and Status information of enabled detection port (Enable Check port Status), etc.
In fig. 3, IEEE 802.3Link Layer discovery Protocol is the above Protocol information; 1111111 … … ═ TLV Type: organization specificity (127) is the above TLV type; in fig. 3, … … 000000110-TLV Length:6 is the above-mentioned TLV Length.
In addition, Link Check mode:0(no)/1(yes) in fig. 3 is the above Link detection mode, the above Link detection mode is obtained by the first switch and the second switch through negotiation, and whether the negotiated Link detection mode is used for Link detection may be determined by the second switch, for example, in fig. 3, the negotiated Link detection mode is denoted by 1, the negotiated Link detection mode is denoted by 0, and the Link detection mode in the first detection enable message sent to the second switch is denoted by the form shown in fig. 3, so that the second switch determines whether the negotiated Link detection mode is used. It should be noted that the link detection mode may include more than one link detection mode, which may be determined according to actual situations.
In addition, the Enable Check port in FIG. 3: port2 is the above-mentioned enabled detected port information, which is used to indicate that the second switch enables port2 (i.e. the member link being detected corresponds to the first port of the second switch). In FIG. 3, the Enable Check port Status is 0(no)/1(yes) is the Status information of the enabled detection port, where 0 indicates that the detection port needing to be enabled is not successfully enabled, and 1 indicates that the detection port needing to be enabled is successfully enabled.
And S102, if a first confirmation message of the first LLDP fed back by the second switch is received, sending a first detection message to the second switch by using the second port of the member link corresponding to the first switch.
Specifically, after the second switch receives the first LLDP message, the first detection enabling information may be analyzed from the first LLDP message, then the enabling operation is performed on the first port according to the first detection enabling information, and when the enabling operation of the first port is successful, the first confirmation message is sent to the first switch, so that a message is subsequently sent from the first port to the first switch, and whether a member link where the first port is located fails is tested. On this basis, after the first switch receives the first confirmation message, the first switch can send the first detection message to the second switch through the second port, that is, the port of the first switch corresponds to the member link to which the first port currently being tested belongs.
Also taking the first LLDP message of fig. 3 as an example for explanation, after parsing the first detection enable information from the first LLDP message, the second switch may parse the enable detection port information from the first detection enable information, then confirm that the port that needs to be enabled is port2 based on the enable detection port information, and if the port2 is successfully enabled, feed back the first confirmation message to the first switch.
Optionally, the first acknowledgement packet also belongs to a packet of an LLDP Type, and the first acknowledgement packet includes a source MAC address, a destination MAC address, a protocol Type (Type), and a DATA, where the DATA is denoted as LLDPDU, and an extension field of a TLV and a TLV is encapsulated in the LLDPDU, where the TLV extension field includes a first enable result, and the first enable result may include, but is not limited to, a link detection mode, enable detection port information, and enable detection port status information. Specifically, when the second switch selects to use the Link detection mode based on the first LLDP packet in fig. 3, the value of the Link detection mode of the first enable result in the first acknowledgment packet is configured to be 1, refer to Link Check mode:1(yes) shown in fig. 4; and when the port2 is successfully enabled, the value of the Status information of the enabled detection port in the first enabling result is configured as 1, please refer to Enable Check port Status:1(yes) in fig. 4. On this basis, the first acknowledgement message is sent to the first switch.
Optionally, the second switch sends the first acknowledgement packet to the first switch based on the port corresponding to the reference port 3. For example, the reference port 3 of the first switch and the port 4 of the second switch form a member link, and when the first switch searches for the reference port, it needs to ensure that the member link corresponding to the reference port is currently faultless, that is, when it is determined that the member link formed by the reference port 3 and the port 4 is faultless, the first LLDP message is sent to the second switch, and on this basis, after the second switch receives the first LLDP message based on the reference port 3, the first confirmation message can be fed back through the port 4.
Optionally, the second switch configures the first port as an outbound loopback port when the first port is enabled. By configuring the first port, that is, the port2 in fig. 2, as an external loopback port, the packet received by the second switch can be returned through the port2 in the original path, so that the purpose of detecting the link of the member link formed by the port2 and the port 1 is achieved.
On this basis, after receiving the first acknowledgement message, the first switch may send a first probe message to the second switch through the port 1 corresponding to the port 2.
It should be noted that, if the first switch does not receive the first acknowledgment packet, the first switch may wait for a first preset time, and then send the first LLDP packet to the second switch again; if the first confirmation message is still not received, the alarm information can be output so that operation and maintenance personnel can maintain the alarm information conveniently.
S103, judging whether the first detection message returned by the second switch through the first port is received or not; if yes, executing step S104; if not, go to step S105.
S104, confirming that the member link has no fault.
And S105, confirming the failure of the member link.
In steps S103 to S105, after the second switch receives the first probe packet based on the first port, if the member link formed by the first port and the second port is not faulty, the second switch will return the first probe packet to the first switch through the first port, and if the member link formed by the first port and the second port is faulty, the second switch will not receive the first probe packet sent by the first switch, and accordingly, the second switch cannot return the first probe packet to the first switch. Based on this principle, the first switch may determine whether the first detection packet fed back by the second switch through the first port can be received through the second port, and if the first switch can receive the first detection packet, the first switch indicates that the member link formed by the first port and the second port is not faulty, that is, step S104 is executed; if the first switch does not receive the first detection message, it indicates that the member link formed by the first port and the second port has a failure, then step S105 is executed.
Optionally, when the first switch executes step S103, a time may be set, for example, a second preset time, and if the first detection packet is not received even if the second preset time is exceeded, it is determined that a member link formed by the first port and the second port has a fault, and then the second port is actively subjected to shutdown processing and outputs an alarm prompt message, and similarly, the second switch performs shutdown processing on the first port and outputs an alarm prompt message.
Optionally, the first detection message belongs to a speed limit message, and the first detection message is configured to be the speed limit message with a detection function, so that processing resources for detecting a failure of a member link can be saved, and it is ensured that other normal member links between the first switch and the second switch provide communication services.
By adopting the link detection method provided by the embodiment, when detecting the member link, the opposite end port of the member link required to be detected is informed through adding the detection enabling information in the LLDP message, and after receiving the confirmation message sent by the opposite end switch after enabling the opposite end port, the local end port of the member link required to be detected is started to send the detection message to the opposite end switch so as to detect whether the member link formed by the local end port and the opposite end port is failed, so that the active detection of the member link is realized, whether the member link is failed is actively checked, the network operation and maintenance cost is reduced, the member link failure caused by optical module failure and the like is avoided, the message loss is caused under the condition of no perception, and the member link in the link aggregation group is ensured to be free of failure, and further ensure the normal forwarding of the subsequent flow.
Optionally, before performing step S101, the first switch may further include the following process: the first port and the second port that constitute the member link are removed from the link aggregation group.
Specifically, since the currently tested member link may be failed or may be normal, in order to avoid a situation that the traffic forwarding service subsequently provided by the first switch using the currently tested member link may fail to forward the traffic normally due to the failure of the member link, the port forming the member link may be first deleted from the aggregation link group, for example, the first port and the second port may be deleted from the link aggregation group.
On this basis, after the first switch executes step S104, the following process may be further included: and rewriting the first port and the second port which form the member link into the link aggregation group.
Specifically, when it is determined that the member link formed by the first port and the second port is failure-free based on the method shown in fig. 1, it indicates that the member link can provide the traffic forwarding service normally, and at this time, the first port and the second port of the member link may be rewritten into the link aggregation group.
Optionally, when performing the member link detection, the second switch may also initiate a detection process, and then the link detection method implemented by the first switch may further include the process shown in fig. 5, and is described with reference to fig. 6, where:
s501, receiving a second LLDP message sent by the second switch by using a reference port in the second switch, wherein the second LLDP message carries second detection enabling information of a third port of the first switch corresponding to the other member links.
And the second LLDP packet is sent by the second switch when detecting other member links in the link aggregation group.
In this step, when the second switch actively initiates member link detection, for example, when detecting a member link (i.e., the other member links) formed by port 5(port5) and port 6 in fig. 6, the second switch may generate a second LLDP packet related to port5 (third port), where the second LLDP packet carries second detection enabling information related to port5, and a structure of the enabling information may be as shown in fig. 3, where port2 is changed to port5, and other contents are adjusted accordingly, which is not described in detail here.
After generating the second LLDP detection message, when the second switch determines that the member link corresponding to the port 4 and the port 3 in fig. 6 has no fault, the second switch may determine the port 4 as a reference port, and send the second LLDP message to the first switch through the port 4.
When the first switch receives the second LLDP message based on port 3, the second detection enabling information may be parsed from the second LLDP message.
It should be noted that the other member links are any member links currently not detected in the link aggregation group.
S502, enabling the third port and generating a second confirmation message based on the second detection enabling information.
Specifically, the first switch may parse the link detection mode, the enabled detection port information, and the state information of the enabled detection port from the second detection enabling information, and extract the port that needs to be enabled as the port5 from the enabled detection port information, and then the first switch may enable the port5, generate the second acknowledgement packet after the enabling is successful, and feed back the second acknowledgement packet to the second switch.
Optionally, the second acknowledgment packet also belongs to a packet of the LLDP type, and when the second acknowledgment packet is generated, the second enable result is added to a TLV extension field of the second acknowledgment packet, and if the first switch selects to use the link detection mode, the value of the second enable result including the link detection mode is configured as 1; and if the port5 is successfully enabled, the status information of the enabled detection port in the second enabling result is also configured to be 1, specifically referring to fig. 4, port2 in fig. 4 is changed to port 5.
Optionally, when the first switch enables the third port, the third port is configured as an external loopback port, that is, the port5 in fig. 6 is configured as an external loopback port, so that the packet received by the first switch can be returned through the port5 in the original path, thereby achieving the purpose of detecting the link of the member link formed by the port5 and the port 6.
S503, sending the second confirmation message to the second switch.
Specifically, after the second acknowledgement packet is generated based on step S503, the second acknowledgement packet is sent to the second switch through port 4 in fig. 6.
S504, receiving a second detection message sent by the second switch through the fourth port of the second switch corresponding to the other member link.
In this step, after the second switch receives the second acknowledgement packet through the port 4, indicating that the first switch has enabled the port5, the second switch may send a second probe packet to the first switch through the port 6 (the fourth port).
Optionally, the second detection message belongs to a speed limit message, and the second detection message is configured to be the speed limit message with a detection function, so that processing resources for detecting a failure of a member link can be saved, and it is ensured that other normal member links between the first switch and the second switch provide communication services.
And S505, if the other member links have no fault, feeding back the second detection message to the second switch by using the third port.
In this step, if the member link formed by the port5 of the first switch and the port 6 of the second switch is not faulty, the first switch can receive the second detection message, and then the first switch returns the second detection message to the second switch as the port5 is configured as an external loopback port, so that the second switch confirms whether the member link formed by the port5 and the port 6 is faulty. Thereby realizing the fault detection of the member link.
It should be noted that, when the second switch initiates fault detection on the other member links, the third port and the fourth port of the other member links may be deleted from the link aggregation group, and when the second switch confirms that the other member links are not faulty, the third port and the fourth port of the other member links are rewritten into the link aggregation group. For example, the member link formed by the port 6 and the port5 is deleted from the link aggregation group, and when it is to be confirmed that the member link formed by the port 6 and the port5 has no failure, the port 6 and the port5 are added to the link aggregation group again.
Based on the same inventive concept, the application also provides a link detection device corresponding to the link detection method. The link detection apparatus may be implemented by referring to the above description of the link detection method, which is not discussed herein.
Referring to fig. 7, fig. 7 is a link detection apparatus provided in an exemplary embodiment of the present application, and is applied to a first switch, where the first switch and a second switch are configured with a link aggregation function, and a port of the first switch and a port of the second switch form a member link in a link aggregation group, where the apparatus includes:
a first sending module 701, configured to send a first link layer discovery protocol LLDP message to the second switch by using a reference port in the first switch when detecting a member link in a link aggregation group, where the first LLDP message carries first detection enabling information of a first port of the second switch corresponding to the member link;
a second sending module 702, configured to send a first detection packet to the second switch by using a second port of the first switch corresponding to the member link if a first acknowledgement packet of the first LLDP packet fed back by the second switch is received, where the first acknowledgement packet is generated by the second switch after the first port is enabled based on the first detection enabling information;
a determining module 703, configured to determine whether the first detection packet returned by the second switch through the first port is received;
a first determining module 704, configured to determine that the member link has no failure if the determination result of the determining module 703 is yes
A second determining module 705, configured to determine that the member link fails if the determination result of the determining module 703 is negative.
Optionally, the first port is configured as an external loopback port when the second switch enables it.
Optionally, the first detection enabling information is located in a type length value TLV extension field of the first LLDP packet.
Optionally, the link detection apparatus provided in this embodiment further includes:
a first receiving module (not shown in the figure), configured to receive a second LLDP message sent by the second switch by using a reference port therein, where the second LLDP message is sent by the second switch when detecting other member links in a link aggregation group, and the second LLDP message carries second detection enabling information of a third port of the first switch, where the third port corresponds to the other member links;
an enabling module (not shown in the figure) for enabling the third port based on the second detection enabling information;
a message generating module (not shown in the figure) for generating a second confirmation message;
a third sending module (not shown in the figure), configured to send the second acknowledgement packet to the second switch;
a second receiving module (not shown in the figure), configured to receive a second detection message sent by the second switch through the fourth port of the second switch corresponding to the other member link;
a fourth sending module (not shown in the figure), configured to feedback the second detection packet to the second switch by using the third port if the other member links have no failure.
Optionally, the enabling module (not shown in the figure) is specifically configured to configure the third port as an external loopback port.
Optionally, the link detection apparatus provided in this embodiment further includes:
a deleting module (not shown in the figure), configured to delete the first port and the second port that constitute the member link from the link aggregation group before the first sending module sends the link layer discovery protocol first LLDP packet to the second switch by using the reference port in the first switch;
and a rewriting module (not shown in the figure) for rewriting the first port and the second port constituting the member link into the link aggregation group when the first determining module confirms that the member link is failure-free.
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. 8, and includes a processor 801 and a machine-readable storage medium 802, where the machine-readable storage medium 802 stores a computer program capable of being executed by the processor 801, and the processor 801 is caused by the computer program to execute the link detection 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 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 detection method provided by 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 detection method is applied to a first switch, the first switch and a second switch are configured with a link aggregation function, a port of the first switch and a port of the second switch form a member link in a link aggregation group, and the method comprises the following steps:
when detecting a member link in a link aggregation group, sending a first Link Layer Discovery Protocol (LLDP) message to a second switch by using a reference port in the first switch, wherein the first LLDP message carries first detection enabling information of a first port of the second switch corresponding to the member link;
if a first confirmation message of the first LLDP message fed back by the second switch is received, sending a first detection message to the second switch by using a second port of the member link corresponding to the first switch, wherein the first confirmation message is generated by the second switch after the first port is enabled based on the first detection enabling information;
if the first detection message returned by the second switch through the first port is received, confirming that the member link has no fault;
and if the first detection message returned by the second switch through the first port is not received, confirming that the member link fails.
2. The method of claim 1, wherein the first port is configured as an outbound loopback port when enabled by the second switch.
3. The method of claim 1, wherein the first detection enabling information is located in a type length value, TLV, extension field of the first LLDP packet.
4. The method of claim 1, further comprising:
receiving a second LLDP message sent by the second switch by using a reference port therein, where the second LLDP message is sent by the second switch when detecting other member links in a link aggregation group, and the second LLDP message carries second detection enabling information of a third port of the first switch corresponding to the other member links;
enabling the third port based on the second detection enabling information and generating a second confirmation message;
sending the second confirmation message to the second switch;
receiving a second detection message sent by the second switch through the fourth port of the second switch corresponding to the other member link;
and if the other member links have no fault, feeding back the second detection message to the second switch by using the third port.
5. The method of claim 4, wherein enabling the third port comprises:
configuring the third port as an external loopback port.
6. The method of claim 1, further comprising, prior to sending a link layer discovery protocol first LLDP message to the second switch using a reference port in the first switch:
deleting the first port and the second port which form the member link from the link aggregation group;
when confirming that the member link has no fault, the method further comprises the following steps:
and rewriting the first port and the second port which form the member link into the link aggregation group.
7. A link detection device applied to a first switch, the first switch and a second switch being configured with a link aggregation function, a port of the first switch and a port of the second switch forming a member link in a link aggregation group, the device comprising:
a first sending module, configured to send a first link layer discovery protocol LLDP message to the second switch by using a reference port in the first switch when detecting a member link in a link aggregation group, where the first LLDP message carries first detection enabling information of a first port of the second switch corresponding to the member link;
a second sending module, configured to send a first detection packet to the second switch by using a second port of the first switch corresponding to the member link if a first acknowledgement packet of the first LLDP packet fed back by the second switch is received, where the first acknowledgement packet is generated by the second switch after the first port is enabled based on the first detection enabling information;
the judging module is used for judging whether the first detection message returned by the second switch through the first port is received or not;
a first determining module, configured to determine that the member link has no failure if the determination result of the determining module is yes
And the second determining module is used for determining that the member link fails if the judgment result of the judging module is negative.
8. The apparatus of claim 7, further comprising:
a first receiving module, configured to receive a second LLDP packet sent by the second switch using a reference port therein, where the second LLDP packet is sent by the second switch when detecting other member links in a link aggregation group, and the second LLDP packet carries second detection enabling information of a third port of the first switch corresponding to the other member links;
an enabling module configured to enable the third port based on the second detection enabling information;
the message generating module is used for generating a second confirmation message;
a third sending module, configured to send the second acknowledgement packet to the second switch;
a second receiving module, configured to receive a second detection message sent by the second switch through the fourth port of the second switch corresponding to the other member link;
and a fourth sending module, configured to, if the other member links have no failure, utilize the third port to feed back the second detection packet to the second switch.
9. The apparatus of claim 8, wherein the enabling module is specifically configured to configure the third port as an outbound loopback port.
10. The apparatus of claim 7, further comprising:
a deleting module, configured to delete the first port and the second port that form the member link from the link aggregation group before the first sending module sends the link layer discovery protocol first LLDP packet to the second switch by using the reference port in the first switch;
and a rewriting module, configured to rewrite, when the first determining module determines that the member link is failure-free, the first port and the second port that constitute the member link into the link aggregation group.
CN202110090065.XA 2021-01-22 2021-01-22 Link detection method and device Active CN112953789B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110090065.XA CN112953789B (en) 2021-01-22 2021-01-22 Link detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110090065.XA CN112953789B (en) 2021-01-22 2021-01-22 Link detection method and device

Publications (2)

Publication Number Publication Date
CN112953789A CN112953789A (en) 2021-06-11
CN112953789B true CN112953789B (en) 2022-04-01

Family

ID=76235858

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110090065.XA Active CN112953789B (en) 2021-01-22 2021-01-22 Link detection method and device

Country Status (1)

Country Link
CN (1) CN112953789B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369933A (en) * 2008-09-26 2009-02-18 中兴通讯股份有限公司 Automatic test method and system
CN101908986A (en) * 2010-08-12 2010-12-08 杭州华三通信技术有限公司 Method and equipment for detecting link fault
CN104184628A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Looped network detection method in network, network equipment and looped network detection system
CN104394034A (en) * 2014-12-04 2015-03-04 上海斐讯数据通信技术有限公司 Method and system based on LLDP protocol detection link aggregation configuration
CN107332726A (en) * 2016-04-29 2017-11-07 华为技术有限公司 A kind of detection method and device of communication link

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9166884B2 (en) * 2007-10-31 2015-10-20 Extreme Networks, Inc. Network location service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369933A (en) * 2008-09-26 2009-02-18 中兴通讯股份有限公司 Automatic test method and system
CN101908986A (en) * 2010-08-12 2010-12-08 杭州华三通信技术有限公司 Method and equipment for detecting link fault
CN104184628A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Looped network detection method in network, network equipment and looped network detection system
CN104394034A (en) * 2014-12-04 2015-03-04 上海斐讯数据通信技术有限公司 Method and system based on LLDP protocol detection link aggregation configuration
CN107332726A (en) * 2016-04-29 2017-11-07 华为技术有限公司 A kind of detection method and device of communication link

Also Published As

Publication number Publication date
CN112953789A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
WO2020020144A1 (en) Link switching method, link switching device, network communication system and computer readable storage medium
EP2553886B1 (en) Aggregating data traffic from access domains
EP1391079B1 (en) Method and system for implementing a fast recovery process in a local area network
US7933198B1 (en) Virtual router failover dampening
CN105791126B (en) Ternary Content Addressable Memory (TCAM) table look-up method and device
WO2020001204A1 (en) Link backup method and device, and computer readable storage medium
CN108632099B (en) Fault detection method and device for link aggregation
CN112751733B (en) Link detection method, device, equipment, system and switch
US10404611B2 (en) Discovering path maximum transmission unit
CN113746733A (en) Table item synchronization method, gateway equipment, networking system and storage medium
WO2020173424A1 (en) Message processing method, and gateway device
JP5678678B2 (en) Provider network and provider edge device
US11456943B2 (en) Packet transmission method and apparatus
CN101841424B (en) EMS network management system and method based on SOCKS proxy connection
US20080267080A1 (en) Fault Verification for an Unpaired Unidirectional Switched-Path
CN103220189A (en) Multi-active detection (MAD) backup method and equipment
CN101808043A (en) Method and device for detecting service message forwarding state of TRUNK members
CN111684428B (en) Super-scale clouding N-route protection
CN112953789B (en) Link detection method and device
US20230269186A1 (en) Packet Sending Method, Device, and System
CN112104548A (en) Communication method and device
WO2016138705A1 (en) Method and device for managing link in load sharing
CN115333991B (en) Cross-device link aggregation method, device, system and computer readable storage medium
WO2016065925A1 (en) Controller replacing method and device
WO2022088931A1 (en) Information processing method and apparatus, broadband access server, and storage medium

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