CN112688826B - Link diagnosis method, terminal device, link diagnosis system, and storage medium - Google Patents

Link diagnosis method, terminal device, link diagnosis system, and storage medium Download PDF

Info

Publication number
CN112688826B
CN112688826B CN201910996210.3A CN201910996210A CN112688826B CN 112688826 B CN112688826 B CN 112688826B CN 201910996210 A CN201910996210 A CN 201910996210A CN 112688826 B CN112688826 B CN 112688826B
Authority
CN
China
Prior art keywords
terminal
link
port
message
port link
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
CN201910996210.3A
Other languages
Chinese (zh)
Other versions
CN112688826A (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.)
CRRC Zhuzhou Institute Co Ltd
Original Assignee
CRRC Zhuzhou Institute 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 CRRC Zhuzhou Institute Co Ltd filed Critical CRRC Zhuzhou Institute Co Ltd
Priority to CN201910996210.3A priority Critical patent/CN112688826B/en
Publication of CN112688826A publication Critical patent/CN112688826A/en
Application granted granted Critical
Publication of CN112688826B publication Critical patent/CN112688826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The present invention relates to the field of communication link diagnosis, and in particular, to a link diagnosis method, a terminal device, a link diagnosis system, and a storage medium. The problem of lower diagnosis efficiency of port links in the prior art is solved. The method comprises the following steps: when a port link between a first terminal and a second terminal is effective and the port link is located in a link aggregation group, analyzing a feedback message sent by the second terminal, when the analyzed feedback message comprises overtime information, sending an interactive message to the second terminal through the port link at intervals of a first time period, starting timing when the interactive message is sent, and when the timing reaches a second overtime threshold and the feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link fails and moving the port link out of the link aggregation group.

Description

Link diagnosis method, terminal device, link diagnosis system, and storage medium
Technical Field
The present invention relates to the field of communication link diagnosis, and in particular, to a link diagnosis method, a terminal device, a link diagnosis system, and a storage medium.
Background
In a network, message transmission between terminal devices needs to be realized by connecting port links between the terminal devices, and in the existing method for diagnosing the state of a port link by analyzing the content of an interactive message or a feedback message sent between terminal devices at two ends of the port link, the interactive message or the feedback message needs to be processed by an information processing unit, and the port link can be diagnosed only after an obtained processing result is compared with locally pre-stored recording information, so that the problem of low diagnosis efficiency of the port link exists in the prior art.
Disclosure of Invention
In view of the above problems, the present application provides a link diagnosis method, a terminal device, a link diagnosis system, and a storage medium to solve the above problems.
In a first aspect, the present application provides a link diagnosis method applied to a first terminal, where the method includes:
when a port link between a first terminal and a second terminal is effective and the port link is positioned in a link aggregation group, obtaining a feedback message sent by the second terminal;
analyzing the feedback message, and judging whether the analyzed feedback message comprises overtime information, wherein the overtime information is generated when the second terminal does not receive the interactive message sent by the first terminal within a time length range corresponding to a first overtime threshold;
when the feedback message comprises overtime information, sending an interactive message to the second terminal through the port link at intervals of a first time period, and starting timing when the interactive message is sent;
and when the timing reaches a second overtime threshold and a feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link is invalid, and moving the port link out of the link aggregation group.
According to an embodiment of the present application, preferably, in the above-mentioned link diagnosis method, before the step of enabling a port link between the first terminal and the second terminal and locating the port link in the link aggregation group, the method further includes:
sending an interactive message to the second terminal through the port link every second time period;
analyzing a received feedback message sent by the second terminal, and judging whether the analyzed feedback message includes receiving confirmation information, wherein the receiving confirmation information is generated when the second terminal starts timing when receiving the interactive message sent by the first terminal and receives the interactive message sent by the first terminal again before the timing reaches the first overtime threshold;
and when the analyzed feedback message comprises the receiving confirmation information, determining that the port link is effective, and adding the port link into a link aggregation group when the port link is confirmed to be effective for the first time.
According to an embodiment of the present application, preferably, in the above-mentioned link diagnosis method, after the step of starting timing when the interactive packet is sent, the method further includes:
and when the timing does not reach the second overtime threshold and a feedback message sent by the second terminal based on the interactive message is received, the port link is confirmed to be effective, and the interactive message is sent to the second terminal through the port link every second time period.
According to an embodiment of the present application, preferably, in the above-mentioned link diagnosis method, after the steps of confirming that the port link is failed and moving the port out of the link aggregation group, the method further includes:
sending an interactive message to the second terminal through the port link every second time period, and detecting whether a feedback message sent by the second terminal based on the interactive message is received;
and when the first terminal receives the feedback message, determining that the port link is effective, and adding the port link into a link aggregation group.
According to an embodiment of the present application, in the above-mentioned link diagnosis method, preferably, the number of port links between the first terminal and the second terminal is multiple, where each port link includes two ports, a first port is disposed at the first terminal, and a second port is disposed at the second terminal.
According to an embodiment of the present application, preferably, in the above-mentioned link diagnosis method, after the steps of confirming that the port link is failed and moving the port out of the link aggregation group, the method further includes:
setting two ports included in the port link to be in a discarding state;
when a port set to be in a discarding state receives a message to be transmitted, judging whether the message to be transmitted is an interactive message;
and when the message to be transmitted is not an interactive message, discarding the message to be transmitted.
According to an embodiment of the present application, preferably, in the above link diagnosis method, when a port link between the first terminal and the second terminal is valid and the port link is located in a link aggregation group, the method further includes:
setting two ports included in the port link into a forwarding state;
and when the port set to be in the forwarding state receives the message to be transmitted, forwarding the message to be transmitted.
According to an embodiment of the present application, preferably, in the above link diagnosis method, the second timeout threshold is greater than the first time period.
A link diagnosis method applied to a second terminal, the method comprising: starting timing when an interactive message sent by a first terminal through a port link every second time period is received, and sending a feedback message corresponding to the interactive message to the first terminal;
and when the timing reaches a first overtime threshold and the interactive message sent by the first terminal is not received again, generating a feedback message comprising overtime information and sending the feedback message to the first terminal, wherein the first overtime threshold is greater than the second time period.
The present invention also provides a storage medium storing a computer program executable by one or more processors for implementing a link diagnostic method as in any one of the above.
The invention also provides a terminal device, which comprises a memory and a processor, wherein when the processor executes a computer program stored in the memory, the link diagnosis method applied to the first terminal is realized.
The invention also provides a terminal device, which comprises a memory and a processor, wherein when the processor executes a computer program stored in the memory, the link diagnosis method applied to the second terminal is realized.
The invention also provides a link diagnosis system, which comprises the first terminal and the second terminal.
Compared with the prior art, one or more embodiments in the above scheme can have the following advantages or beneficial effects: when a port link between a first terminal and a second terminal is effective and the port link is located in a link aggregation group, obtaining a feedback message sent by the second terminal, analyzing the feedback message, and judging whether the analyzed feedback message comprises overtime information, when the feedback message comprises the overtime information, sending an interactive message to the second terminal through the port link at intervals of a first time period, starting timing when the interactive message is sent, when the timing reaches a second overtime threshold and the feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link is invalid, and moving the port link out of the link aggregation group; therefore, the problem of low diagnosis efficiency of the port link in the prior art is solved, and the purpose of quickly diagnosing whether the port link fails or not according to the content of the interactive message or the feedback message obtained by analysis is achieved.
Drawings
The scope of the present disclosure will be better understood from the following detailed description of exemplary embodiments, which is to be read in connection with the accompanying drawings. Wherein the included drawings are:
fig. 1 is a flowchart of a link method according to an embodiment of the present invention;
fig. 2 is a flowchart of a link method according to an embodiment of the present invention;
fig. 3 is a timing diagram of a link system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. In the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not intended to be construed as only or implying relative importance.
Example one
Referring to fig. 1, the present embodiment provides a link diagnosis method applied to a first terminal, and the link diagnosis method includes steps S110 to S170.
Step S110: and sending an interactive message to the second terminal through the port link every second time period.
In this embodiment, the number of port links between the first terminal and the second terminal is multiple, where each port link includes two ports, a first port is disposed in the first terminal, and a second port is disposed in the second terminal.
It is understood that the first terminal or the second terminal includes, but is not limited to: the mobile terminal comprises a switch, a smart phone, a tablet computer and a desktop computer, wherein in the embodiment, the first terminal and the second terminal are both switches; the port link is a physical line connecting a port on the first terminal and a port on the second terminal, the port arranged on the first terminal is called a first port, the port arranged on the second terminal is called a second port, and the types of the port links of the first terminal and the second terminal include: ACCESS port, TRUNK port and HYBRID port; the link aggregation group consists of a plurality of port links, and the port links included in the same link aggregation group can be regarded as the same logical link; the interactive message and the feedback message are network layer transmission messages, and the network layer transmission messages comprise fixed message head parts and self-defined actual data parts.
It can be understood that, in order to avoid the overload of the port link, when the port link is diagnosed, an interactive message needs to be sent to the second terminal at intervals. The value of the second time period ranges from 90 milliseconds to 110 milliseconds, and preferably, the second time period in this embodiment is 100 milliseconds.
Step S120: and analyzing the received feedback message sent by the second terminal, and judging whether the analyzed feedback message comprises receiving confirmation information.
And the receiving confirmation information is generated when the second terminal starts timing when receiving the interactive message sent by the first terminal and receives the interactive message sent by the first terminal again before the timing reaches the first overtime threshold.
It can be understood that, the second terminal starts timing each time an interactive packet sent by the first terminal is received, if a port link between the first terminal and the second terminal is valid, even if a delay occurs during a packet transmission process when the port link is valid, the second terminal should receive the interactive packet sent by the first terminal at a time when the timing is greater than a second time period but less than a preset timeout threshold, and the second terminal should include acknowledgment receiving information in a feedback packet.
When the analyzed feedback message includes the receiving confirmation information, executing step S130; and when the analyzed feedback message does not include the receiving confirmation information, returning to execute the step S110.
Step S130: and when the analyzed feedback message comprises the receiving confirmation information, determining that the port link is effective, and adding the port link into a link aggregation group when the port link is confirmed to be effective for the first time.
It can be understood that when the analyzed feedback message includes the reception confirmation information, it indicates that the second terminal can receive the interactive message sent by the first terminal, and the feedback message fed back to the first terminal by the second terminal can also be received by the first terminal, so that it can be determined that the port link is bidirectional and effective, and when it is first confirmed that the port link is effective, the port link is added into the link aggregation group; because the first terminal sends the interactive message to the second terminal every second time period, and when the port link is determined to be valid through the interactive message and the feedback message again subsequently, the port link is already in the link aggregation group, the port link does not need to be added into the link aggregation group repeatedly.
Step S140: and when a port link between the first terminal and the second terminal is effective and the port link is positioned in the link aggregation group, obtaining a feedback message sent by the second terminal.
It should be noted that, when it is determined that a port link between a first terminal and a second terminal is valid, the first terminal continues to send an interaction packet to the second terminal every second time period, and the second terminal sends a feedback packet to the first terminal, in this embodiment, the feedback packet sent by the second terminal includes two cases, where the first case is that the second terminal starts timing when receiving the interaction packet sent by the first terminal, and generates a feedback packet including reception confirmation information when receiving the interaction packet sent by the first terminal again before the timing reaches the first timeout threshold, where the feedback packet is generated based on the received interaction packet sent by the first terminal; and in the second case, the second terminal starts timing when receiving the interactive message sent by the first terminal, and generates a feedback message including timeout information when not receiving the interactive message sent by the first terminal within a time range corresponding to the first timeout threshold, where the feedback message is warning information sent by the second terminal to the first terminal and indicates that the second terminal cannot receive the interactive message sent by the first terminal.
In this embodiment, when a port link between a first terminal and a second terminal is valid and the port link is located in a link aggregation group, setting two ports included in the port link to be in a forwarding state; and when the port set to be in the forwarding state receives the message to be transmitted, forwarding the message to be transmitted.
Step S150: and analyzing the feedback message, and judging whether the analyzed feedback message comprises overtime information.
The timeout information is generated when the second terminal does not receive the interactive message sent by the first terminal within a duration range corresponding to the first timeout threshold.
It should be noted that when the interactive message sent by the first terminal is received again by the second terminal when the timing does not reach the first timeout threshold, it is indicated that the port link through which the message is sent by the first terminal to the second terminal is unidirectionally valid, the second terminal immediately sends a feedback message that does not include timeout information to the first terminal, and when the port link through which the message is sent by the second terminal to the first terminal is unidirectionally valid, the first terminal can receive the feedback message, and when receiving the feedback message, parses the feedback message, and cannot parse the timeout information from the feedback message; in addition, when the port link through which the second terminal sends the packet to the first terminal fails in one direction, the first terminal cannot receive the feedback packet.
When the analyzed feedback message includes the timeout information, executing step S160; and when the analyzed feedback message does not include the timeout information, returning to execute the step S140.
Step S160: and when the feedback message comprises overtime information, sending an interactive message to the second terminal through the port link at intervals of a first time period, and starting timing when the interactive message is sent.
It can be understood that when the first terminal learns that the feedback packet includes the timeout information, it indicates that the port link between the first terminal and the second terminal may be failed in a single direction, and the first terminal further sends the time period of the interaction packet to the second terminal to determine whether the port link fails as soon as possible, so that the first time period in step S160 should be smaller than the second time period in step S110, and the first terminal starts timing when sending the interaction packet. It should be noted that the value of the first time period ranges from 5 ms to 20 ms, and preferably, the first time period in this embodiment is 10 ms.
In this embodiment, when the timing does not reach the second timeout threshold and a feedback packet sent by the second terminal based on the interaction packet is received, it is determined that the port link is valid, and the interaction packet is sent to the second terminal through the port link every second time period.
It can be understood that, when the timing does not reach the second timeout threshold and a feedback packet sent by the second terminal based on the interaction packet is received, the feedback packet is analyzed:
when the analyzed feedback message does not include the timeout information, it indicates that the second terminal can receive the interactive message sent by the first terminal, and the first terminal can also receive the feedback message fed back by the second terminal, so that the port link is still bidirectional and effective, the first terminal changes the time period for sending the interactive message to the second terminal again, so as to prevent the frequency for sending the interactive message from being too high and occupying too much bandwidth resources of the port link, and the first terminal changes the time period for sending the interactive message to the second terminal through the port link from every first time period to every second time period, where in this embodiment, the second time period is greater than the first time period.
When the analyzed feedback message includes timeout information, it indicates that the second terminal receives the interaction message sent by the first terminal when the interaction message is timeout, and at this time, the second terminal cannot receive the interaction message sent by the first terminal, but the first terminal can receive the feedback message fed back by the second terminal, which indicates that the port link from the first terminal to the second terminal is unidirectional and invalid, and the port link from the second terminal to the first terminal is unidirectional and valid.
Step S170: and when the timing reaches a second overtime threshold and a feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link is invalid, and moving the port link out of the link aggregation group.
It can be understood that when the timing reaches a second timeout threshold and a feedback message sent by the second terminal based on the interaction message is not received, it indicates that the second terminal cannot receive the interaction message sent by the first terminal, and the port link from the first terminal to the second terminal fails in a single direction; or the first terminal cannot receive a feedback message fed back by the second terminal, and the port link from the second terminal to the first terminal fails in a single direction; but the physical link state of the unidirectionally failed port link is still generally valid at this time.
In this embodiment, when a unidirectional failure of a port link occurs, the port link should be removed from the link aggregation group, and a specific direction of the unidirectional failure of the port link can be determined according to an analysis result of a message that can be received by the first terminal or the second terminal.
It should be noted that, considering that a port link failure may be only a temporary failure, the port link may automatically recover to be valid, and therefore, when the port link fails, the port link may be kept in the link aggregation group without other processing.
In this embodiment, the first terminal is set as a terminal device having a capability of managing all port links connected to the first terminal in a link aggregation group by a program; and in the process of diagnosing the port link, the port only allows the interactive message and the feedback message to pass through by configuring the attribute of the port in the port link to be diagnosed. The value of the second timeout threshold ranges from 25 milliseconds to 40 milliseconds, and preferably, the second timeout threshold in this embodiment is 30 milliseconds.
In this embodiment, after the step S170, the link diagnosis method further includes steps S181 to S182.
Step S181: and sending an interactive message to the second terminal through the port link every second time period, and detecting whether a feedback message sent by the second terminal based on the interactive message is received.
In this embodiment, after the steps of confirming that the port link fails and moving the port out of the link aggregation group, the method further includes: setting two ports included in the port link to be in a discarding state; when a port set to be in a discarding state receives a message to be transmitted, judging whether the message to be transmitted is an interactive message; and when the message to be transmitted is not an interactive message, discarding the message to be transmitted.
It can be understood that when the port link fails and is moved out of the link aggregation group, a failure alarm signal is sent out to remind related staff of attracting attention. When the message to be transmitted received by the port set to be in the discarding state is not an interactive message, the message to be transmitted is switched to the redundant link in the link aggregation group for transmission in time, so that the message to be transmitted is ensured not to be transmitted through the failed port link to cause message loss.
It should be noted that, in this embodiment, the port set in the discard state can allow the interactive packet to pass through, so when the to-be-transmitted packet received by the port set in the discard state is an interactive packet, the relevant staff analyzes the interactive packet received by the port set in the discard state, and performs effective management and repair on the port link based on the link state information in the analyzed interactive packet or the link state information in the feedback packet, and after performing repair, the repaired port link should be given an opportunity to rejoin the link aggregation group. Therefore, the interactive message may be sent to the second terminal through the repaired port link again, and whether the port link is valid may be determined according to whether the feedback message sent by the second terminal is received.
Step S182: and when the first terminal receives the feedback message, determining that the port link is effective, and adding the port link into a link aggregation group.
It can be understood that, when the first terminal receives the feedback packet, it indicates that the interactive packet previously sent by the first terminal is received by the second terminal, and the first terminal can receive the feedback packet fed back by the second terminal based on the interactive packet, so that it can be proved that the port link between the first terminal and the second terminal is valid, and therefore the valid port link should be added into the link aggregation group.
In this embodiment, the second timeout threshold is greater than the first time period.
It can be understood that a time delay occurs in the transmission process of the interactive packet, and therefore, the second timeout threshold in step S170 should be greater than the first time period in step S160, that is, the second timeout threshold should be greater than the first time period.
It should be noted that, in the link diagnosis process of this embodiment, switching between two time periods of the first terminal may not be set, and diagnosis is performed only according to one time period, so that the real-time performance of link diagnosis may be reduced to some extent, but the object of the present invention may still be achieved.
Example two
Referring to fig. 2, the present embodiment provides a link diagnosis method applied to a second terminal, and the link diagnosis method includes steps S210 to S220.
Step S210: and starting timing when receiving an interactive message sent by a first terminal through a port link at every second time period, and sending a feedback message corresponding to the interactive message to the first terminal.
It can be understood that the second terminal starts timing when receiving the interactive message sent by the first terminal, and the recorded information of receiving the interactive message each time can provide reference for technical parameters for related staff when the port link fails; after receiving the interactive message, the second terminal should send a feedback message to the first terminal to inform the first terminal that the interactive message has been received, and the feedback message includes reception confirmation information, where the reception confirmation information is generated when the second terminal starts timing when receiving the interactive message sent by the first terminal, and receives the interactive message sent by the first terminal again before the timing reaches a first timeout threshold, and when sending the feedback message including the reception confirmation information, the second terminal clears a timer for timing, and restarts timing based on the interaction message received again.
Step S220: and when the timing reaches a first overtime threshold value and the interactive message sent by the first terminal is not received again, generating a feedback message comprising overtime information and sending the feedback message to the first terminal.
Wherein the first timeout threshold is greater than the second time period.
It can be understood that, when the timing reaches the first timeout threshold and the interactive packet sent by the first terminal is not received again, the port link through which the first terminal sends the interactive packet to the second terminal may be failed in a single direction, and at this time, the port link through which the second terminal sends the feedback packet to the first terminal may still be valid, so that the feedback packet may be sent to the first terminal through the second terminal and the feedback packet includes timeout information to notify the first terminal that the port link fails in a single direction from the first terminal to the second terminal.
It can be understood that, due to the time delay occurring in the message transmission process, the time interval of the second terminal receiving the interactive message sent by the first terminal may be greater than the time interval of the first terminal sending the interactive message, and therefore, the first timeout threshold in step S220 should be greater than the second time period in step S210, that is, the first timeout threshold should be greater than the second time period.
EXAMPLE III
The present embodiment provides a terminal device, which is the first terminal in the first embodiment, and includes a memory and a processor, where when executed by the processor, a computer program stored in the memory implements the link diagnosis method in the first embodiment.
Example four
This embodiment provides a terminal device, which is the second terminal in the second embodiment, and includes a memory and a processor, where when being executed by the processor, a computer program stored in the memory implements the link diagnosis method in the second embodiment.
EXAMPLE five
Referring to fig. 3, the present embodiment provides a link diagnostic system, which includes a terminal device (a first terminal) in the third embodiment and a terminal device (a second terminal) in the fourth embodiment.
When the link diagnosis system performs link diagnosis, the following steps are performed:
when a port link between a first terminal 10 and a second terminal 20 is valid and the port link is located in a link aggregation group, the first terminal 10 obtains a feedback message fed back by the second terminal 20 based on an interaction message sent by the first terminal 10, analyzes the feedback message, and determines whether the analyzed feedback message includes timeout information, wherein the timeout information is generated when the second terminal 20 does not receive the interaction message sent by the first terminal 10 within a time range corresponding to a first timeout threshold, when the feedback message includes the timeout information, the interaction message is sent to the second terminal 20 through the port link at intervals of a first time period, and starts timing when the timing reaches a second timeout threshold and does not receive the feedback message sent by the second terminal 20 based on the interaction message, confirming that the port link is invalid, and moving the port link out of the link aggregation group;
the second terminal 20 starts timing when receiving an interactive message sent by the first terminal 10 through the port link every second time period, sends a feedback message corresponding to the interactive message to the first terminal 10, and generates a feedback message including timeout information and sends the feedback message to the first terminal 10 when the timing reaches a first timeout threshold and the interactive message sent by the first terminal 10 is not received again.
In this embodiment, the first timeout threshold is greater than the second time period, the second time period is greater than the second timeout threshold, and the second timeout threshold is greater than the first time period.
It can be understood that, in this embodiment, the first time period, the second time period, the first timeout threshold, and the second timeout threshold have a fixed relationship due to a diagnostic process of a port link, where the first timeout threshold exists based on the second time period, and when the port link is not determined to be valid, the first terminal 10 sends an interactive packet to the second terminal 20 through the port link every second time period, and even if there is a delay in the transmission of the interactive packet, a time interval between two times of receiving the interactive packet sent by the first terminal 10 by the second terminal 20 should not exceed a preset time threshold, and the preset time threshold is set as the first timeout threshold, and the first timeout threshold is greater than the second time period.
It should be noted that the second time period is greater than the second timeout threshold, and the second timeout threshold is greater than the first time period. In this embodiment, the message interaction process of the first terminal 10 and the second terminal 20 is divided into a fast process and a slow process, before the port link between the first terminal 10 and the second terminal 20 is determined to be valid, the first terminal 10 and the second terminal 20 send and feed back messages through the slow process, that is, the first terminal 10 sends an interaction message to the second terminal 20 through the port link every second time period, and the second terminal 20 sends a feedback message to the first terminal based on the received interaction message when the timing does not reach the first timeout threshold; when the interactive message sent by the first terminal 10 is not received again by the second terminal 20 when the first timeout threshold is reached, it indicates that the port link may be in a unidirectional failure or a bidirectional failure, so that the first terminal 10 enters a fast process cycle to determine as soon as possible whether the port link is valid, and shortens a time interval for sending the interactive message to the second terminal 20, that is, the first terminal 10 sends the interactive message to the second terminal 20 through the port link every first time period, where the first time period of the fast process cycle should be smaller than the second time period of the slow process cycle; the first terminal 10 starts timing when sending the interactive message, and because there is a delay in port link message transmission, the time interval from sending the interactive message to receiving the feedback message fed back by the second terminal 20 by the first terminal 10 is inevitably greater than the time interval for sending the interactive message by the first terminal 10, so the maximum time interval at which the first terminal 10 can receive the feedback message sent by the second terminal 20 based on the interactive message is set to be a second timeout threshold greater than the first time period; the second time period and the second timeout threshold are both greater than the first time period, and in order to completely distinguish between fast and slow processes, the second time period in the slow process is set to be greater than the second timeout threshold in the fast process.
EXAMPLE six
The present embodiment provides a storage medium storing a computer program executable by one or more processors and operable to implement the link diagnosis method as in the first and second embodiments.
Wherein the storage medium includes, but is not limited to: flash memory, hard disk, multimedia card, card type memory (e.g., SD or DX memory, etc.), Random Access Memory (RAM), Static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application mall, etc., having stored thereon a computer program which, when executed by a processor, implements the method steps of:
when a port link between a first terminal and a second terminal is effective and the port link is located in a link aggregation group, obtaining a feedback message fed back by the second terminal based on an interactive message sent by the first terminal;
analyzing the feedback message, and judging whether the analyzed feedback message comprises overtime information, wherein the overtime information is generated when the second terminal does not receive the interactive message sent by the first terminal within a time length range corresponding to a first overtime threshold;
when the feedback message comprises overtime information, sending an interactive message to the second terminal through the port link at intervals of a first time period, and starting timing when the interactive message is sent;
and when the timing reaches a second overtime threshold and a feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link is invalid, and moving the port link out of the link aggregation group.
The specific embodiment process of the above method steps can be referred to as embodiment one, and the details of this embodiment are not repeated herein.
Furthermore, the computer program may further implement the following method steps when executed by a processor:
starting timing when an interactive message sent by a first terminal through a port link every second time period is received, and sending a feedback message corresponding to the interactive message to the first terminal;
and when the timing reaches a first overtime threshold and the interactive message sent by the first terminal is not received again, generating a feedback message comprising overtime information and sending the feedback message to the first terminal, wherein the first overtime threshold is greater than the second time period.
The specific embodiment process of the above method steps can be referred to as embodiment two, and the details of this embodiment are not repeated herein.
In summary, according to the link diagnosis method, the terminal device, the link diagnosis system and the storage medium provided by the present invention, when a port link between a first terminal and a second terminal is valid and the port link is located in a link aggregation group, a feedback message sent by the second terminal is obtained, the feedback message is analyzed, and whether the analyzed feedback message includes timeout information or not is determined, when the feedback message includes the timeout information, an interaction message is sent to the second terminal through the port link every a first time period, timing is started when the interaction message is sent, when the timing reaches a second timeout threshold and the feedback message sent by the second terminal based on the interaction message is not received, the failure of the port link is determined, and the port link is moved out of the link aggregation group, which can solve the problem of low diagnosis efficiency of the port link in the prior art, the purpose of quickly diagnosing whether the port link is failed or not according to the content of the interactive message or the feedback message obtained by analysis is achieved. Further, in the link diagnosis method provided by the present invention, when the second terminal cannot receive the interactive packet sent by the first terminal, but the first terminal can receive the feedback packet fed back by the second terminal, it can be determined that the port link from the first terminal to the second terminal is unidirectionally failed, and the port link from the second terminal to the first terminal is unidirectionally valid; on the contrary, when the second terminal can receive the interactive message sent by the first terminal, but the first terminal cannot receive the feedback message fed back by the second terminal, the port link from the second terminal to the first terminal can be judged to be unidirectionally invalid, and the port link from the first terminal to the second terminal is unidirectionally valid, so that the troubleshooting workload of a worker during overhauling the invalid port link can be reduced. Further, in the link diagnosis method provided by the present invention, when the port link is determined to be invalid and the port is moved out of the link aggregation group, the to-be-transmitted message set to be transmitted by the invalid port link is switched to any other effective port link in the link aggregation group for transmission, thereby avoiding the problem that the to-be-transmitted message is lost due to the fact that the physical state of the port link is still displayed as effective when the port link is unidirectionally invalid and the to-be-transmitted data is transmitted through the port link.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (13)

1. A link diagnostic method applied to a first terminal, the method comprising:
when a port link between a first terminal and a second terminal is effective and the port link is positioned in a link aggregation group, obtaining a feedback message sent by the second terminal;
analyzing the feedback message, and judging whether the analyzed feedback message comprises overtime information, wherein the overtime information is generated when the second terminal does not receive the interactive message sent by the first terminal within a time length range corresponding to a first overtime threshold;
when the feedback message comprises overtime information, sending an interactive message to the second terminal through the port link at intervals of a first time period, and starting timing when the interactive message is sent;
and when the timing reaches a second overtime threshold and a feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link is invalid, and moving the port link out of the link aggregation group.
2. The link diagnostic method according to claim 1, wherein before the step of the port link between the first terminal and the second terminal being active and the port link being located in a link aggregation group, the method further comprises:
sending an interactive message to the second terminal through the port link every second time period;
analyzing a received feedback message sent by the second terminal, and judging whether the analyzed feedback message includes receiving confirmation information, wherein the receiving confirmation information is generated when the second terminal starts timing when receiving the interactive message sent by the first terminal and receives the interactive message sent by the first terminal again before the timing reaches the first overtime threshold;
and when the analyzed feedback message comprises the receiving confirmation information, determining that the port link is effective, and adding the port link into a link aggregation group when the port link is confirmed to be effective for the first time.
3. The link diagnostic method according to claim 1, wherein after the step of starting timing when the interactive message is transmitted, the method further comprises:
and when the timing does not reach the second overtime threshold and a feedback message sent by the second terminal based on the interactive message is received, the port link is confirmed to be effective, and the interactive message is sent to the second terminal through the port link every second time period.
4. The link diagnostic method according to claim 1, wherein after the steps of confirming the port link failure and moving the port out of the link aggregation group, the method further comprises:
sending an interactive message to the second terminal through the port link every second time period, and detecting whether a feedback message sent by the second terminal based on the interactive message is received;
and when the first terminal receives the feedback message, determining that the port link is effective, and adding the port link into a link aggregation group.
5. The link diagnosis method according to claim 1, wherein the port links between the first terminal and the second terminal are multiple, and each port link includes two ports, a first port is disposed on the first terminal, and a second port is disposed on the second terminal.
6. The link diagnostic method according to claim 1, wherein after the steps of confirming the port link failure and moving the port out of the link aggregation group, the method further comprises:
setting two ports included in the port link to be in a discarding state;
when a port set to be in a discarding state receives a message to be transmitted, judging whether the message to be transmitted is an interactive message;
and when the message to be transmitted is not an interactive message, discarding the message to be transmitted.
7. The link diagnostic method according to claim 1, wherein when a port link between a first terminal and a second terminal is active and the port link is located in a link aggregation group, the method further comprises:
setting two ports included in the port link into a forwarding state;
and when the port set to be in the forwarding state receives the message to be transmitted, forwarding the message to be transmitted.
8. The link diagnostic method of claim 1, wherein the second timeout threshold is greater than the first time period.
9. A link diagnostic method applied to a second terminal, the method comprising:
starting timing when an interactive message sent by a first terminal through a port link every second time period is received, and sending a feedback message corresponding to the interactive message to the first terminal;
when the timing reaches a first overtime threshold and an interactive message sent by the first terminal is not received again, generating a feedback message comprising overtime information and sending the feedback message to the first terminal, wherein the first overtime threshold is larger than the second time period, the first terminal obtains the feedback message sent by the second terminal when a port link between the first terminal and the second terminal is effective and the port link is located in a link aggregation group, analyzes the feedback message and judges whether the analyzed feedback message comprises the overtime information or not; when the feedback message comprises overtime information, sending an interactive message to the second terminal through a port link at intervals of a first time period, and starting timing when the interactive message is sent; and when the timing reaches a second overtime threshold and a feedback message sent by the second terminal based on the interactive message is not received, confirming that the port link is invalid, and moving the port link out of the link aggregation group.
10. A storage medium storing a computer program executable by one or more processors for implementing a link diagnostic method as claimed in any one of claims 1 to 9.
11. A terminal device characterized by comprising a memory and a processor, wherein a computer program stored in the memory when executed by the processor implements the link diagnosis method according to any one of claims 1 to 8.
12. A terminal device comprising a memory and a processor, wherein a computer program stored in the memory when executed by the processor implements the link diagnostic method as claimed in claim 9.
13. A link diagnostic system comprising a terminal device according to claim 11 and a terminal device according to claim 12.
CN201910996210.3A 2019-10-18 2019-10-18 Link diagnosis method, terminal device, link diagnosis system, and storage medium Active CN112688826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910996210.3A CN112688826B (en) 2019-10-18 2019-10-18 Link diagnosis method, terminal device, link diagnosis system, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910996210.3A CN112688826B (en) 2019-10-18 2019-10-18 Link diagnosis method, terminal device, link diagnosis system, and storage medium

Publications (2)

Publication Number Publication Date
CN112688826A CN112688826A (en) 2021-04-20
CN112688826B true CN112688826B (en) 2022-05-20

Family

ID=75445038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910996210.3A Active CN112688826B (en) 2019-10-18 2019-10-18 Link diagnosis method, terminal device, link diagnosis system, and storage medium

Country Status (1)

Country Link
CN (1) CN112688826B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404171A (en) * 2011-11-24 2012-04-04 中兴通讯股份有限公司 Method and device for detecting Ethernet links
CN107370636A (en) * 2016-05-12 2017-11-21 华为技术有限公司 Link State determines method and apparatus
CN107404393A (en) * 2016-05-20 2017-11-28 北京信威通信技术股份有限公司 A kind of method and system for judging link failure
CN108270602A (en) * 2016-12-30 2018-07-10 中兴通讯股份有限公司 A kind of detection method of data link, apparatus and system
CN109245965A (en) * 2018-10-24 2019-01-18 新华三技术有限公司 A kind of method and apparatus of determining duration
CN109245961A (en) * 2018-09-29 2019-01-18 优刻得科技股份有限公司 Link-quality detection method, device, storage medium and equipment
CN109327383A (en) * 2017-07-31 2019-02-12 北京华为数字技术有限公司 A kind of fault handling method and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2747386A1 (en) * 2012-12-20 2014-06-25 Telefonica S.A. Method and System for the creation, modification and removal of a distributed virtual customer premises equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404171A (en) * 2011-11-24 2012-04-04 中兴通讯股份有限公司 Method and device for detecting Ethernet links
CN107370636A (en) * 2016-05-12 2017-11-21 华为技术有限公司 Link State determines method and apparatus
CN107404393A (en) * 2016-05-20 2017-11-28 北京信威通信技术股份有限公司 A kind of method and system for judging link failure
CN108270602A (en) * 2016-12-30 2018-07-10 中兴通讯股份有限公司 A kind of detection method of data link, apparatus and system
CN109327383A (en) * 2017-07-31 2019-02-12 北京华为数字技术有限公司 A kind of fault handling method and equipment
CN109245961A (en) * 2018-09-29 2019-01-18 优刻得科技股份有限公司 Link-quality detection method, device, storage medium and equipment
CN109245965A (en) * 2018-10-24 2019-01-18 新华三技术有限公司 A kind of method and apparatus of determining duration

Also Published As

Publication number Publication date
CN112688826A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN112328418B (en) Method and system for improving MQ synchronization reliability
CN107872396B (en) Communication method with timeout control, processing device, terminal device and server
CN105515912B (en) Linkage availability detection and processing method between a kind of multinode
CN109962827B (en) Equipment link detection method, device, equipment and readable storage medium
CN110933142A (en) ICFS cluster network card monitoring method, device and equipment and medium
CN112202635B (en) Link monitoring method and device, storage medium and electronic device
CN110213759A (en) Anti-lost detection method, storage medium and electronic equipment based on broadcast
CN114675983A (en) Business data processing method and device, storage medium and electronic equipment
CN112994971A (en) Equipment offline monitoring method based on cloud server and related device
CN115023919A (en) Firewall rule updating method and device, server and storage medium
CN112688826B (en) Link diagnosis method, terminal device, link diagnosis system, and storage medium
CN110442461A (en) A kind of message dilivery method, storage medium
CN111880947B (en) Data transmission method and device
US6154129A (en) Operation system for transmission devices and alarm monitoring method
CN108712494A (en) Handle the method, apparatus and equipment of asynchronous message
WO2023116701A1 (en) Data information pushing method and apparatus based on internet of things platform, and device and medium
CN109040286B (en) Client online state maintenance method based on memory database
CN111064639A (en) Service state announcement method, device, equipment and storage medium
CN114466321B (en) Message sending method and device, electronic equipment and storage medium
CN104104555B (en) Monitoring method, system, control terminal and actuating station
CN108781215B (en) Network service implementation method, service controller and communication system
CN111901366B (en) Data pushing method, device, equipment and storage medium
CN113965495A (en) Method and device for detecting activity of terminal application program, electronic equipment and storage medium
CN112069027A (en) Interface data processing method and device, electronic equipment and storage medium
CN114116906A (en) Data synchronization method, device, electronic device 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