A link state detection and performance measurement method and device, electronic equipment and storage medium

By introducing extended flag fields and BFD information fields into TWAMP messages, link performance measurement and link status detection are unified, solving the complexity problem of link performance measurement and status detection in existing technologies, simplifying the detection scheme and expanding the scope of application.

CN117221194BActive Publication Date: 2026-06-02SUZHOU CENTEC COMM CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU CENTEC COMM CO LTD
Filing Date
2023-10-24
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, link performance measurement and link status detection need to be performed using TWAMP messages and BFD messages respectively. The solutions are complex and the message formats are fixed, which cannot meet the measurement requirements in certain scenarios.

Method used

By introducing extended flag fields and BFD information fields into TWAMP messages, link performance measurement and link state detection are unified, and the information carried by TWAMP messages is used for link performance calculation and BFD state machine update.

Benefits of technology

It simplifies the detection and measurement scheme, reduces the overhead and complexity of protocol messages, expands the scope of application, and enables the function of completing multiple status measurements and monitoring through a single message.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117221194B_ABST
    Figure CN117221194B_ABST
Patent Text Reader

Abstract

The application discloses a link state detection and performance measurement method and device, electronic equipment and a storage medium, and belongs to the technical field of network communication. The method comprises the following steps: receiving a TWAMP measurement packet; judging whether to perform link performance measurement according to information carried by the TWAMP measurement packet, and measuring the link performance when the link performance measurement is performed; further judging whether the link performance exceeds a preset threshold value, and judging whether to enable the link state detection according to an extension flag field when the link performance does not exceed the preset threshold value; and updating a BFD state machine according to a BFD information field in the measurement packet when the link state detection is enabled, further judging whether the state of the BFD state machine is timed out, and reporting the link state or editing and sending a TWAMP reply packet according to the judgment result. The application can simultaneously realize the link performance measurement and the link state detection through one packet, and simplifies the measurement scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, and in particular to a method for link status detection and performance measurement, as well as an apparatus, electronic device, and storage medium for implementing the method. Background Technology

[0002] Currently, network communication requires measuring link performance, such as packet loss rate and latency, to understand the network's operational status. Simultaneously, link status monitoring is also necessary to ensure stable service operation. However, existing technologies perform link performance measurement and link status monitoring through two independent technical solutions. For link performance measurement, network devices exchange TWAMP (Two-Way Active Measurement Protocol) messages to measure link performance, such as latency and packet loss rate. For link status monitoring, BFD (Bidirectional Forwarding Detection) technology is used. As can be seen, both link performance measurement and link status monitoring require simultaneously sending two fixed-format TWAMP and BFD messages. This approach is complex because sending both messages simultaneously for link performance measurement and link status monitoring is not ideal, and the fixed message format may not meet measurement requirements in certain scenarios.

[0003] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0004] The purpose of this invention is to provide a link status detection and performance measurement method that can simultaneously perform link performance measurement and link status detection through a single message, simplifying the detection and measurement scheme and expanding its applicability.

[0005] The present invention also aims to provide an apparatus, electronic device, and storage medium for implementing the link status detection and performance measurement method, which can simultaneously achieve link performance measurement and link status detection through a single message, simplifying the detection and measurement scheme and expanding the scope of application.

[0006] To achieve the above objectives, embodiments of the present invention provide a link state detection and performance measurement method, the method comprising:

[0007] Receive TWAMP measurement messages, which include an extended flag field for identifying whether link state detection is performed and a BFD information field for recording BFD control information;

[0008] Determine whether to perform link performance measurements based on the information carried in the TWAMP measurement messages;

[0009] In response to perform link performance measurements, measure link performance;

[0010] Determine if the link performance exceeds a preset threshold;

[0011] In response to the link performance not exceeding a preset threshold, determine whether to enable link status detection based on the extended flag field;

[0012] In response to enabling link state detection, the BFD state machine is updated according to the BFD information field;

[0013] Determine if the state of the BFD state machine has timed out;

[0014] In response to the judgment result, report the link status or edit and send a TWAMP reply message.

[0015] In one or more embodiments of the present invention, the extended flag field is obtained by configuring a reserved field in the TWAMP measurement message.

[0016] In one or more embodiments of the present invention, the BFD information field is obtained by configuring the PADDING field of the TWAMP measurement message.

[0017] In one or more embodiments of the present invention, determining whether to perform link performance measurement based on the information carried in the TWAMP message includes:

[0018] The ACL matches the five-tuple information of the packets and performs link performance calculations during the matching process.

[0019] In one or more embodiments of the present invention, the link performance includes link latency, which is calculated in the following manner:

[0020] The timestamp is obtained from the TWAMP measurement message by the timestamp offset;

[0021] The link latency is calculated by combining the obtained timestamp with the local timestamp.

[0022] In one or more embodiments of the present invention, the link performance includes the link packet loss rate, which is calculated in the following manner:

[0023] The sequence number is obtained from the TWAMP message using the sequence number offset;

[0024] The link packet loss rate is calculated by combining the obtained sequence number with the local sequence number.

[0025] In one or more embodiments of the present invention, determining whether to enable link state detection includes:

[0026] Determine if the value of the extended flag field is the first preset value;

[0027] In response to the first preset threshold, enable link status detection.

[0028] In one or more embodiments of the present invention, updating the BFD state machine according to the BFD information field includes:

[0029] Obtain the local BFD status of the sending end recorded in the BFD information field;

[0030] The current BFD state is switched according to the local BFD state of the sending end.

[0031] In one or more embodiments of the present invention, determining whether the state of the BFD state machine has timed out includes:

[0032] Determine whether the duration of the state in the BFD state machine exceeds a preset threshold.

[0033] If the preset threshold is exceeded, the state of the BFD state machine is determined to have timed out; if the preset threshold is not exceeded, the state of the BFD state machine is determined not to have timed out.

[0034] Embodiments of the present invention also provide a link status detection and performance measurement device, the device comprising:

[0035] The message receiving module is used to receive TWAMP measurement messages, which include an extended flag field for identifying whether link state detection is performed and a BFD information field for identifying BFD control information.

[0036] The first judgment module is used to determine whether to perform link performance measurement based on the information carried in the TWAMP measurement message.

[0037] The performance measurement module is used to measure link performance when the first judgment module determines that link performance measurement is required.

[0038] The second judgment module is used to determine whether the link performance exceeds a preset threshold.

[0039] The third judgment module is used to determine whether to enable link status detection when the second judgment module determines that the link performance has not exceeded the preset threshold.

[0040] The state update module is used to update the BFD state machine according to the BFD information field when the third judgment module determines to enable link state detection;

[0041] The fourth judgment module is used to determine whether the state of the BFD state machine has timed out;

[0042] The processing module is used to report the link status or edit and send TWAMP reply messages based on the judgment result of the fourth judgment module.

[0043] An embodiment of the present invention provides an electronic device, the electronic device comprising:

[0044] At least one processor; and

[0045] At least one memory is coupled to the at least one processor and stores a computer program for execution by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method described above.

[0046] Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a machine, implements the methods described above.

[0047] Compared with existing technologies, this invention can simultaneously perform link performance measurement and link status detection through a single message, realizing the function of completing multiple status measurements and monitoring with a single protocol message, reducing the overhead and complexity of protocol messages, and providing greater flexibility. Attached Figure Description

[0048] Figure 1 This is a flowchart of a link status detection and performance measurement method according to an embodiment of the present invention;

[0049] Figure 2 This is a message processing flowchart according to an embodiment of the present invention;

[0050] Figure 3 This is a schematic diagram of a network device structure according to an embodiment of the present invention;

[0051] Figure 4 This is a schematic diagram of the TWAMP message format according to an embodiment of the present invention;

[0052] Figure 5 This is a schematic diagram of a link status detection and performance measurement device according to an embodiment of the present invention. Detailed Implementation

[0053] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings, but it should be understood that the scope of protection of the present invention is not limited to the specific embodiments.

[0054] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.

[0055] like Figures 1 to 2 As shown, a link state detection and performance measurement method according to a preferred embodiment of the present invention can simultaneously perform link performance measurement and link state detection using a single message. This enables a single protocol message to perform multiple state measurements and monitoring functions, simplifies the measurement and detection scheme, reduces the overhead and complexity of the protocol message, and offers greater flexibility. It also has a wider range of applications.

[0056] Specifically, such as Figure 1 As shown, the link state detection and performance measurement method includes the following steps:

[0057] S1, Receive TWAMP measurement message, which includes an extended flag field for identifying whether link state detection is performed and a BFD information field for identifying BFD control information;

[0058] Specifically, such as Figure 3 The diagram illustrates a network device architecture, including an ACL engine, a TWAMP engine, and a BFD engine for packet processing. When performing link performance measurements, such as link latency and / or packet loss rate measurements, the network device can use TWAMP messages. TWAMP messages include TWAMP measurement messages and TWAMP response messages. TWAMP measurement messages are sent from the sender to the receiver, and TWAMP response messages are sent from the receiver to the sender. TWAMP is a performance measurement technology for IP links, enabling bidirectional performance statistics in both directions, including bidirectional network latency, jitter, and packet loss rate.

[0059] In order to enable link status detection and link performance measurement, such as Figure 4As shown, this invention improves TWAMP packets by configuring an extended flag field and a BFD information field. The extended flag field indicates whether link state detection is performed, and the BFD information field carries BFD control information, including but not limited to local BFD status. In specific implementation, a certain number of bits are selected from the reserved field of the TWAMP packet to form the extended flag field, with 1 bit chosen as the extended flag field. Simultaneously, the padding field of the TWAMP packet is configured to carry BFD control information, forming the BFD information field.

[0060] S2, determine whether to perform link performance measurement based on the information carried in the TWAMP measurement message;

[0061] S3, responding to perform link performance measurement, measures link performance;

[0062] Specifically, upon receiving a TWAMP measurement message, the system determines whether to perform a link performance measurement based on the five-tuple information carried in the TWAMP measurement message. The five-tuple information includes the source IP address, source port, destination IP address, destination port, and transport layer protocol.

[0063] In specific implementation, such as Figure 4 As shown, the ACL (Access Control List) engine matches the five-tuple information of TWAMP measurement packets, and determines whether to perform link performance measurement based on the matching result. If the five-tuple matching result is a match, link performance measurement is performed. If the five-tuple matching result is a mismatch, link performance measurement is not performed, and the TWAMP measurement packet can be discarded.

[0064] When link performance measurement is determined, it is further measured. This link performance measurement includes, but is not limited to, calculating link latency and link packet loss rate. In this embodiment, taking the measurement of link latency and link packet loss rate as examples, the specific calculation method for link latency and link packet loss rate is explained.

[0065] like Figure 4 As shown, for link latency, when matching TWAMP measurement packets via ACL, the timestamp offset corresponding to the matched TWAMP measurement packet is transmitted to the TWAMP engine. The TWAMP engine uses the timestamp offset to obtain the corresponding timestamp from the TWAMP measurement packet, and calculates (usually by subtracting) the obtained timestamp from the local timestamp to obtain the link latency.

[0066] like Figure 4As shown, for link packet loss rate, when matching TWAMP measurement packets via ACL, the corresponding sequence number offset of the matched TWAMP measurement packets is transmitted to the TWAMP engine. The TWAMP engine uses the sequence number offset to obtain the corresponding sequence number from the TWAMP measurement packets, and calculates the link packet loss rate by comparing the obtained sequence number with the local sequence number.

[0067] The timestamp offset and sequence number offset here are configurable.

[0068] S4, determine whether the link performance exceeds the preset threshold;

[0069] Specifically, after measuring link performance, the measurement results are compared with preset thresholds to execute corresponding operations based on the comparison results. For example, if the link latency and / or link packet loss rate are greater than the preset threshold, the link latency and / or link packet loss rate information is reported to the CPU via an interrupt. If the link latency and / or link packet loss rate are less than the preset threshold, the next step is executed.

[0070] S5, in response to the link performance not exceeding the preset threshold, determine whether to enable link status detection;

[0071] Specifically, when the calculated link performance does not exceed a preset threshold, a further determination is made as to whether to perform link state detection to check the current link status. In specific implementation, this can be determined by the value of the extended flag field in the TWAMP message. When the value of the extended flag field is a first preset value (e.g., the first preset value is 1), link state detection is performed. When the value of the extended flag field is a second preset value (e.g., the second preset value is 0), link state detection is not performed.

[0072] S6, in response to enabling link state detection, the BFD state machine is updated according to the BFD control information carried in the TWAMP measurement message, that is, the BFD state machine is updated through the BFD information field.

[0073] Specifically, when link state detection is determined to be performed based on the value of the extended flag field in the TWAMP measurement message, the BFD state machine is further updated according to the BFD control information carried in the TWAMP measurement message. For example, if the BFD control information in the TWAMP measurement message records that the sender's local BFD state is Down, the receiver will switch its local BFD state to Init.

[0074] S7, determine if the state of the BFD state machine has timed out;

[0075] S8, in response to the judgment result, reports the link status or edits and sends a TWAMP reply message.

[0076] Specifically, after updating the BFD state machine using the BFD control information carried in the TWAMP measurement message, it is further determined whether the current state of the BFD state machine has timed out, i.e., whether the state of the BFD state machine has changed within a preset time. If the BFD state machine has not changed within the preset time, i.e., no TWAMP measurement message has been received within the preset time, it indicates that there is a link fault, and the link status can be reported by interrupting the process.

[0077] When it is determined that the current state of the BFD state machine has not timed out, that is, the state of the BFD state machine has changed within the preset time, it indicates that a TWAMP measurement message has been received within the preset time, and the link is not faulty. When it is determined that there is no link fault, the TWAMP reply message is further edited and sent, such as editing the current state of the BFD state machine into the TWAMP reply message and sending it to the sender.

[0078] This invention enables link state detection and link performance measurement to be performed simultaneously using only one message by configuring extended flag fields and BFD information fields in TWAMP messages. In other words, this invention can achieve multiple state measurement and monitoring functions with a single protocol message, reducing the overhead and complexity of protocol messages and providing greater flexibility.

[0079] like Figure 5 As shown, this invention discloses a link status detection and performance measurement device that can realize the link status detection and performance measurement method described above. It can simultaneously realize link performance measurement and link status detection through a single message, simplifying the measurement scheme and expanding the scope of application.

[0080] Specifically, the link status detection and performance measurement device includes a message receiving module, a first judgment module, a performance measurement module, a second judgment module, a third judgment module, a status update module, a fourth judgment module, and a message processing module. The system includes a message receiving module for receiving TWAMP measurement messages, which include an extended flag field for identifying whether link state detection is performed and a BFD information field for identifying BFD control information. A first judgment module determines whether to perform link performance measurement based on the information carried in the TWAMP measurement message. A performance measurement module measures link performance when the first judgment module determines that link performance measurement is required. A second judgment module determines whether the link performance exceeds a preset threshold. A third judgment module determines whether to enable link state detection when the second judgment module determines that the link performance does not exceed the preset threshold. A state update module updates the BFD state machine based on the BFD control information carried in the TWAMP measurement message when the third judgment module determines that link state detection is enabled. A fourth judgment module checks whether the BFD state machine's state has timed out. A processing module reports the link state or sends a TWAMP reply message based on the judgment result of the fourth judgment module; that is, it reports the link state when the fourth judgment module determines that the state has timed out, and edits and sends a TWAMP reply message when the fourth judgment module determines that the state has not timed out.

[0081] How each module implements its corresponding function is detailed above, and will not be repeated here.

[0082] The electronic device disclosed in one embodiment of the present invention may include, but is not limited to, switches, routers, personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile electronic devices, smartphones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable electronic devices, consumer electronic devices, etc. This electronic device can implement the link state detection and performance measurement method described above, enabling simultaneous link performance measurement and link state detection through a single message, simplifying the measurement scheme and expanding its applicability. Specifically, the electronic device includes at least one memory, at least one processor, and a computer program. The at least one memory is coupled to the at least one processor, wherein the computer program is stored in the memory and can be run in the processor, such as a message statistics program. In implementation, when the processor executes the computer program, it can implement various steps in the above method, such as determining whether to perform link performance measurement based on the information carried in the TWAMP measurement message, etc.

[0083] The computer program here can be divided into one or more units, which are stored in the memory and executed by the memory to complete the present invention. The one or more units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0084] It should be noted that the electronic devices mentioned here include, but are not limited to, the memory, processor, and computer program described above. They may also include other devices, such as input devices for inputting instructions (e.g., keyboards), displays for displaying negotiation results, communication interfaces, etc. These components communicate with each other via a bus.

[0085] This invention also discloses a computer-readable storage medium storing a computer program. When executed by a processor, this computer program can implement the aforementioned link status detection and performance measurement method. It can simultaneously perform link performance measurement and link status detection through a single message, simplifying the measurement scheme and expanding its applicability. The computer program includes computer program code, which can be in source code form, an executable file, or some intermediate form. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), etc.

[0086] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0087] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0090] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.

Claims

1. A method for link status detection and performance measurement, characterized in that, The methods include: Receive TWAMP measurement messages, which include an extended flag field for identifying whether link state detection is performed and a BFD information field for recording BFD control information; Determine whether to perform link performance measurements based on the information carried in the TWAMP measurement messages; In response to perform link performance measurements, measure link performance; Determine if the link performance exceeds a preset threshold; In response to the link performance not exceeding a preset threshold, determine whether to enable link status detection based on the extended flag field; In response to enabling link state detection, the BFD state machine is updated according to the BFD information field; Determine if the state of the BFD state machine has timed out; In response to the judgment result, report the link status or edit and send a TWAMP reply message.

2. The method as described in claim 1, characterized in that, The extended flag field is obtained by configuring a reserved field in the TWAMP measurement message.

3. The method as described in claim 1, characterized in that, The BFD information field is obtained by configuring the PADDING field of the TWAMP measurement message.

4. The method as described in claim 1, characterized in that, Determining whether to perform link performance measurements based on the information carried in TWAMP messages includes: The five-tuple information of TWAMP measurement messages is matched using ACL, and link performance is measured during the matching process.

5. The method as described in claim 1, characterized in that, The link performance includes link latency, which is calculated in the following way: The timestamp is obtained from the TWAMP measurement message by the timestamp offset; The link latency is calculated by combining the obtained timestamp with the local timestamp.

6. The method as described in claim 1, characterized in that, The link performance includes the link packet loss rate, which is calculated in the following way: The sequence number is obtained from the TWAMP message using the sequence number offset; The link packet loss rate is calculated by combining the obtained sequence number with the local sequence number.

7. The method as described in claim 1, characterized in that, Determining whether to enable link state detection includes: Determine if the value of the extended flag field is the first preset value; In response to the first preset threshold, enable link status detection.

8. The method as described in claim 1, characterized in that, Updating the BFD state machine based on the BFD information field includes: Obtain the local BFD status of the sending end recorded in the BFD information field; The current BFD state is switched according to the local BFD state of the sending end.

9. The method as described in claim 1, characterized in that, Determining whether a BFD state machine has timed out includes: Determine whether the duration of the state in the BFD state machine exceeds a preset threshold. If the preset threshold is exceeded, the state of the BFD state machine is determined to have timed out; if the preset threshold is not exceeded, the state of the BFD state machine is determined not to have timed out.

10. A link status detection and performance measurement device, characterized in that, The device includes: The message receiving module is used to receive TWAMP measurement messages, which include an extended flag field for identifying whether link state detection is performed and a BFD information field for identifying BFD control information. The first judgment module is used to determine whether to perform link performance measurement based on the information carried in the TWAMP measurement message. The performance measurement module is used to measure link performance when the first judgment module determines that link performance measurement is required. The second judgment module is used to determine whether the link performance exceeds a preset threshold. The third judgment module is used to determine whether to enable link status detection when the second judgment module determines that the link performance has not exceeded the preset threshold. The state update module is used to update the BFD state machine according to the BFD information field when the third judgment module determines to enable link state detection; The fourth judgment module is used to determine whether the state of the BFD state machine has timed out; The processing module is used to report the link status or edit and send TWAMP reply messages based on the judgment result of the fourth judgment module.

11. An electronic device, characterized in that, The electronic device includes: At least one processor; and At least one memory coupled to the at least one processor and storing a computer program for execution by the at least one processor, wherein, when executed by the at least one processor, the electronic device performs the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a machine, implements the method described in any one of claims 1 to 9.