Network link order-preserving detection method and device
By adding an order-preserving detection flag and sequence number field to the BFD control message and combining it with the out-of-order judgment condition, the problem that the BFD protocol cannot detect the order-preserving performance of network links is solved. This enables order-preserving performance detection and processing of network paths, improving the service quality of key businesses.
Patent Information
- Application Number
- CN202511133997.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-14
AI Technical Summary
The existing BFD protocol cannot detect the order of network links and cannot guarantee the order of data packets, which may lead to logical errors, data corruption or security threats.
Added the order-preserving detection flag and sequence number fields to BFD control packets, detects out-of-order events through out-of-order judgment conditions, and performs corresponding processing when out-of-order is detected, including state machine switching and service path adjustment.
It achieves real-time detection of network path message sequence, identifies out-of-order events, improves the service quality of sequence-sensitive services, and avoids service failures.
Smart Images

Figure CN120750796A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method and device for detecting sequence preservation of a network link. Background Art
[0002] Bidirectional Forwarding Detection (BFD) is a fast link fault detection protocol based on RFC5880. It aims to provide millisecond-level fault detection for networks and accelerate routing convergence by collaborating with upper-layer protocols (such as OSPF and BGP), thereby improving network reliability. BFD not only monitors physical links but also verifies the connectivity of logical links (such as Multiprotocol Label Switching (MPLS) tunnels and VPNs), offering high scalability.
[0003] BFD detects link connectivity by establishing sessions. Sessions are classified into four states: Down, Init, Up, and AdminDown. Session establishment uses a three-way handshake mechanism to ensure state synchronization between the two ends.
[0004] The BFD process mainly includes the following steps: First, a BFD session is established on the link between the two endpoints based on the neighbor information provided by the upper-layer protocol. If there are multiple links, a separate session can be established for each link.
[0005] Secondly, BFD detection is carried out between two network nodes that have established a session. Once a link failure is detected, the BFD neighbor relationship is removed and the upper-layer protocol is immediately notified, so that the upper-layer protocol can quickly perform corresponding processing operations.
[0006] The core goal of the existing BFD protocol is to quickly detect link connectivity failures (such as outages and packet loss), rather than ensuring data integrity or packet order. Its mechanism focuses solely on whether a sufficient number of packets have been received within a specified timeframe, making it incapable of ensuring the order of network links. Summary of the Invention
[0007] The embodiments of the present application provide a network link order-preserving detection method and apparatus, which are used to provide order-preserving detection capabilities for the BFD protocol.
[0008] Based on one aspect of an embodiment of the present application, the present application provides a network link sequence detection method, the method comprising: Upon receiving a BFD control message, reading the sequence-preserving detection flag from the message; when the sequence-preserving detection flag indicates that sequence-preserving detection needs to be performed, reading the sequence number carried in the BFD control message as the current sequence number; Determine whether an out-of-order event has occurred based on an out-of-order judgment condition; the out-of-order judgment condition includes a sequence number judgment condition, which is: the current sequence number (Current_Seq) is less than the historical sequence number (Last_Valid_Seq) and the difference between the historical sequence number and the current sequence number is within the out-of-order judgment window (Max_Reorder_Gap); the historical sequence number is the sequence number carried in the most recently received BFD control message with a normal sequence number; When it is determined that an out-of-order event occurs, the out-of-order counter is updated and the out-of-order processing process is executed.
[0009] Furthermore, the mandatory part of the BFD control message includes a 1-bit ordering detection flag; when the ordering detection flag indicates that ordering detection needs to be performed, the BFD control message also includes a sequence number field for identifying the order in which messages are sent.
[0010] Furthermore, when the sequence detection flag indicates that sequence detection needs to be performed, the BFD control message also includes a timestamp field for identifying the time when the message is sent; the out-of-order judgment condition also includes a time judgment condition, and the sequence number judgment condition and the time judgment condition are in a logical AND relationship; the time judgment condition is: the time interval between the current timestamp and the historical timestamp is greater than a first threshold; The current timestamp is a timestamp carried in a currently received BFD control message, and the historical timestamp is a timestamp carried in a most recently received BFD control message with a normal sequence number.
[0011] Furthermore, the out-of-order processing process includes: Calculate the out-of-order rate within the out-of-order rate statistical time window, where the out-of-order rate is the ratio of the number of BFD control packets determined to be out-of-order to the total number of BFD control packets within the out-of-order rate statistical time window. When the disorder rate is greater than the preset first disorder rate threshold, the state machine is switched to the order-preserving abnormal state (OrderingDegraded) and the disorder alarm is triggered; when the disorder rate is not greater than the preset first disorder rate threshold, the state machine is switched to the order-preserving normal state (OrderingValid).
[0012] Furthermore, when it is detected through the BFD protocol that the current path continuity is in an abnormal state of order preservation, a first order preservation request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a link switch of the current path to the optimal backup path; the method for judging whether the current path continuity is in an abnormal state of order preservation is: the disorder rate is continuously greater than a preset second disorder rate threshold within a first preset number of consecutive disorder detection windows.
[0013] Furthermore, when it is detected through the BFD protocol that the current path continuity is in an abnormal state of order preservation and there is no alternative path, a second order preservation request message is reported to the software-defined network SDN controller to instruct the SDN controller to perform flow limiting operations on low-priority services on the current path to prioritize the bandwidth and queue resources of high-priority services.
[0014] Based on another aspect of the embodiments of the present application, the present application further provides a network link sequence-preserving detection device, the device comprising: A reading module is configured to parse a BFD control message upon receipt, read an order-preserving detection identifier from the BFD control message, and read a sequence number carried in the BFD control message as a current sequence number when the order-preserving detection identifier indicates that order-preserving detection needs to be performed; A judgment module is configured to determine whether an out-of-order event has occurred based on an out-of-order judgment condition; the out-of-order judgment condition includes a sequence number judgment condition, which is: the current sequence number (Current_Seq) is less than the historical sequence number (Last_Valid_Seq) and the difference between the historical sequence number and the current sequence number is within the out-of-order judgment window (Max_Reorder_Gap); the historical sequence number is the sequence number carried in the most recently received BFD control message with a normal sequence number; The out-of-order processing module is used to update the out-of-order counter and execute the out-of-order processing process when it is determined that an out-of-order event occurs.
[0015] Furthermore, the mandatory part of the BFD control message includes a 1-bit ordering detection flag; when the ordering detection flag indicates that ordering detection needs to be performed, the BFD control message also includes a sequence number field for identifying the order in which the messages are sent and a timestamp field for identifying the time when the messages are sent; The reading module is further configured to read the timestamp field carried by the BFD control message as the current timestamp; The disorder judgment condition also includes a time judgment condition, and the sequence number judgment condition and the time judgment condition are in a logical AND relationship; the judgment module jointly judges whether an disorder event occurs based on the sequence number judgment condition and the time judgment condition; The time judgment condition is: the time interval between the current timestamp and the historical timestamp is greater than a first threshold; the historical timestamp is the timestamp carried by the most recently received BFD control message with a normal sequence number.
[0016] Furthermore, the out-of-order processing module also includes: The out-of-order rate statistics module calculates the out-of-order rate within the out-of-order rate statistics time window. The out-of-order rate is the ratio of the number of BFD control packets determined to be out-of-order to the total number of BFD control packets within the out-of-order rate statistics time window. A state update module is configured to switch the state machine to the Ordering Degraded state and trigger an out-of-order alarm when the out-of-order rate exceeds a preset first out-of-order rate threshold; and to switch the state machine to the Ordering Valid state when the out-of-order rate does not exceed the preset first out-of-order rate threshold. The order-preserving request module is used to determine whether the current path is continuously in an abnormal order-preserving state. If it is determined that it is continuously in an abnormal order-preserving state and there is an alternative path, a first order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a link switch from the current path to the optimal backup path; if there is no alternative path, a second order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a flow limiting operation on low-priority services on the current path to give priority to protecting the bandwidth and queue resources of high-priority services; the condition for determining that the current path is continuously in an abnormal order-preserving state is: the disorder rate is continuously greater than the preset second disorder rate threshold within a first preset number of consecutive disorder detection windows.
[0017] Based on another aspect of the embodiment of the present application, the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0018] This application adds a new order-preserving detection function to the BFD protocol. It adds fields such as an order-preserving detection flag and a sequence number to the BFD control message. Based on the out-of-order judgment condition, it monitors whether an out-of-order event has occurred and performs appropriate processing if an out-of-order event occurs. This invention can detect the order-preserving status of messages between network paths establishing a BFD session in real time and respond promptly when an out-of-order event is detected. This can improve order-preserving sensitivity or the quality of service for critical services and prevent service failures.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments of the present invention or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present invention.
[0021] Figure 1 A schematic diagram of a flow chart of steps in a method for detecting network link order preservation according to an embodiment of the present invention; Figure 2 Schematic diagram of the BFD control message structure used in one embodiment of the present invention; Figure 3 A schematic flow chart of steps involved in out-of-order judgment conditions in one embodiment of the present invention; Figure 4 Schematic diagram of a BFD state machine in one embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a network link sequence-preserving detection device according to an embodiment of the present invention; Figure 6 Schematic diagram of the structure of a network link sequence-preserving detection device in one embodiment of the present invention. DETAILED DESCRIPTION
[0022] The exemplary embodiments will be described in detail below. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. They are merely exemplary embodiments of devices and methods consistent with some aspects of this specification.
[0023] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification are also intended to include plural forms, unless the context clearly indicates otherwise.
[0024] It should be understood that the terms "first," "second," "third," etc., which may be used in this specification to describe various information or structural modules, are intended to more clearly describe the solution and should not be understood to indicate or imply relative importance or implicitly specify the number, order, or position of the technical features indicated. Therefore, features defined as "first," "second," "third," etc. may explicitly or implicitly include one or more of such features. In the description of this specification, unless otherwise specified, "plurality" means two or more; "if" can be interpreted as "when..." or "when..." or "in response to a determination."
[0025] In this specification, unless otherwise specified or limited, the term "connected" should be understood broadly. For example, "connected" can mean fixed, removable, or integrated; it can mean directly connected or indirectly connected through an intermediary. In addition, the term "coupled" can mean direct electrical connection or indirect electrical connection through an intermediary. The term "contacting" can mean direct contact or indirect contact through an intermediary.
[0026] In this specification, "and / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0027] Message order preservation refers to the property of network communications whereby data packets (messages) are correctly received and processed by the receiver in the order they were sent. Network message order preservation is crucial, and its importance is primarily reflected in the following aspects: In terms of data integrity, for applications such as file transfer and database operations, disordered data order can cause logical errors or data corruption. From the perspective of protocol functional requirements, protocols such as the Transmission Control Protocol (TCP) need to ensure the order of byte streams to achieve reliable transmission. From the perspective of business logic dependencies, scenarios such as web page loading that do not require high real-time performance also need to process resources in order. In terms of security requirements, the destruction of order preservation may hide security threats. Attackers may use out-of-order data packets to cause processing exceptions at the receiving end, and then implement denial of service (DoS) or code injection attacks.
[0028] As mentioned above, the BFD protocol is mainly used to detect link connectivity. However, the mechanism has limitations and cannot detect the order preservation of network packets.
[0029] To achieve the goal of network link order preservation detection based on the BFD protocol, this paper proposes a network link order preservation detection solution based on BFD to detect link connectivity. The solution aims to improve network service quality by monitoring link order preservation to meet the needs of business application scenarios such as real-time services that are sensitive to message sequence (such as financial transactions, industrial control, and distributed database synchronization) or services that require simultaneous monitoring of link availability and transmission quality (such as SD-WAN and 5G slicing networks).
[0030] Figure 1This is a flowchart of a method for detecting network link order preservation according to an embodiment of the present invention. The method provided in this embodiment can be applied to either end of a BFD session. The method includes the following steps: Step 102: When a BFD control message is received, an order-preserving detection flag is read from the message; when the order-preserving detection flag indicates that order-preserving detection needs to be performed, a sequence number carried in the BFD control message is read as the current sequence number; The present invention improves the BFD control message format, at least adding an order-preserving detection identification field for indicating whether to perform order-preserving detection and a sequence number field for marking the message sending order.
[0031] Step 104: Determine whether an out-of-order event has occurred based on an out-of-order determination condition. The out-of-order determination condition includes a sequence number determination condition, which is: the current sequence number (Current_Seq) is less than the historical sequence number (Last_Valid_Seq) and the difference between the historical sequence number and the current sequence number is within the out-of-order determination window (Max_Reorder_Gap). The historical sequence number is the sequence number carried in the most recently received BFD control message with a normal sequence number. When the network is unobstructed and normal, the sequence number of the BFD control message received later should be greater than the sequence number of the BFD control message received earlier. When the sequence number of the message received later is smaller than the sequence number of the message received earlier, it means that some network reasons have caused the message sequence to be disordered, that is, an out-of-order event has occurred. There may be many reasons for the disorder. In order to distinguish the disorder in special circumstances (such as network jitter, packet loss, etc.) from the disorder in non-special circumstances, the present invention distinguishes them by setting the disorder judgment condition.
[0032] The out-of-order judgment condition includes at least a sequence number judgment condition. The sequence number judgment condition in this embodiment is: the current sequence number (Current_Seq) is less than the historical sequence number (Last_Valid_Seq) and the difference between the historical sequence number and the current sequence number is within the out-of-order judgment window (Max_Reorder_Gap).
[0033] The out-of-order judgment window is mainly used to distinguish whether the out-of-order event is caused by packet loss. If the current sequence number is less than the difference between the historical sequence number and the out-of-order judgment window, it is determined to be network packet loss.
[0034] It should be noted that the present invention refers to the situation where the sequence number of the BFD control message received later is greater than the sequence number of the previously received BFD control message as the situation where the sequence number is normal. When the sequence number is normal, after completing the out-of-order event detection of the current message, the receiving end will assign the sequence number (Current_Seq) of the currently received control message to the historical sequence number (Last_Valid_Seq) to update the historical sequence number. If the BFD control message carries a sending timestamp, the current timestamp and the historical timestamp will also be assigned.
[0035] Step 106: When it is determined that an out-of-order event occurs, the out-of-order counter is updated and an out-of-order processing process is executed.
[0036] The present invention reuses and is compatible with the BFD protocol, adding an order-preserving detection function to the BFD protocol. It can realize real-time detection of the order of network path messages, identify transmission quality problems such as out-of-order events, and provide early warning of potential failures (such as congestion or hardware anomalies) so as to respond in advance, thereby avoiding passive response after business is damaged.
[0037] Figure 2 FIG. 1 is a schematic diagram of the BFD control message structure used in an embodiment of the present invention. This embodiment adds the following fields to the BFD control message: 1) Ordering Flag: This flag is set in the mandatory part of the BFD control message structure to indicate whether the ordering flag is enabled in the current BFD protocol. The end receiving the BFD control message determines whether to perform ordering flag based on this flag. Figure 2 In the example BFD control message structure, the order-preserving detection flag (O) uses an unused reserved bit in the BFD control message. It is located between the query request flag (D, Demand) and the detection timeout multiplier (Detect Mult) field. This is a one-bit binary flag. When set to 1, it indicates that the order-preserving detection function is supported and must be performed. The present invention does not limit the location of the order-preserving detection flag in the message structure; for example, it can also reuse a reserved bit in the diagnostic word (Diag) or a new field.
[0038] 2) Sequence Number field: This field is a monotonically increasing positive integer field, usually set to 1, and is used to identify the order in which messages are sent.
[0039] 3) Sending Timestamp field: This field is a time type field and is used to mark the timestamp of the sending end sending the BFD control message.
[0040] The values of the sequence number field and the timestamp field are valid only when the value of the sequence detection identification field indicates that sequence detection is required.
[0041] Figure 3 The figure is a flow chart illustrating the steps involved in the out-of-order determination condition in one embodiment of the present invention. In this embodiment, the out-of-order determination condition includes not only a sequence number determination condition but also a time determination condition. The sequence number determination condition and the time determination condition are in a logical AND relationship, meaning that an out-of-order event is determined only when both conditions are met.
[0042] The time judgment condition is: the time interval between the current timestamp (cur_Timestamp) and the historical timestamp (last_Timestamp) is greater than a first threshold.
[0043] That is, the out-of-order judgment condition to determine whether an out-of-order event occurs needs to meet the following three conditions at the same time: (1) The current sequence number is less than the historical sequence number: Current_Seq< Last_Valid_Seq; When the current sequence number is greater than the historical sequence number, it indicates that the sequence number status is normal, as shown in step 302 in the figure.
[0044] (2) The difference between the historical sequence number and the current sequence number is within the disorder judgment window, that is: Last_Valid_Seq - Current_Seq<=Max_Reorder_Gap When the current sequence number is greater than the historical sequence number and the difference between the historical sequence number and the current sequence number is greater than the disorder judgment window, it indicates that packet loss is detected, as shown in step 306.
[0045] (3) The time interval between the current timestamp and the historical timestamp is greater than the first threshold, that is: |cur_Timestamp–last_Timestamp|>first threshold When the above conditions (1), (2) and (3) are met at the same time, it is determined that an out-of-order event is detected, as shown in step 305.
[0046] When the above two conditions (1) and (2) are met but the condition (3) is not met, it is determined that the network has short delay jitter, which is a tolerable situation, as shown in step 307 in the figure.
[0047] The first threshold is an empirical value used to distinguish network delay jitter and can be determined by testing in an actual network environment. In one embodiment of the present invention, the first threshold is determined by combining the network trace route and ping delays. If the route has many hops and the ping delay is high under good network conditions, a higher delay can be selected. Typically, the first threshold is in the millisecond range, for example, 1ms.
[0048] The out-of-order judgment window can be determined based on the baseline delay of the network link between the two endpoints of the BDF session. For example, the preset Max_Reorder_Gap=3. If the end-to-end delay is large, this parameter can be increased according to the situation.
[0049] It should be noted that the above-mentioned out-of-order judgment window and the first threshold can be adjusted dynamically in real time according to the specific network conditions. For example, when the route changes or the network conditions change, the SDN controller or network management system can make dynamic adjustments according to the specific conditions of the network or routing to adapt to the specific network scenario.
[0050] Figure 4 This figure is a schematic diagram of the BFD state machine in one embodiment of the present invention. The BFD protocol state machine is primarily used to manage BFD session state transitions. The BFD protocol state machine defines four main states: session not established (Down), session initialized (Init), session established (Up), and session explicitly administratively closed (AdminDown) (not shown). Transitions between these states are triggered by the exchange of BFD control messages and timer expiration events. The present invention reuses the BFD protocol state machine, and the original BFD protocol state transition method remains unchanged, so this application does not elaborate on this.
[0051] Based on the original state and state switching relationship of the BFD protocol state machine, this invention improves the BFD protocol state machine and further divides the UP state into the following two sub-states: Ordering Valid: The BFD session has been established and the message sequence is normal, that is, the ordering is normal.
[0052] Ordering Degraded: A BFD session is established, but out-of-order packets are detected. This is an ordering degraded state.
[0053] The above sub-state division enables the system to distinguish the states of packet transmission order preservation (order preservation) in the current BFD session.
[0054] In one embodiment of the present invention, when an out-of-order event is determined to have occurred, the out-of-order counter (used to record the number of out-of-order BFD control packets within the out-of-order rate statistical time window) is first updated. Then, during the out-of-order processing process, the UP state is updated based on the out-of-order rate. The updating method is as follows: First, calculate the out-of-order rate within the out-of-order rate statistics window. The out-of-order rate is calculated as the percentage of the total number of BFD control packets detected within the out-of-order rate statistics window divided by the number of out-of-order BFD control packets within the out-of-order rate statistics window. To prevent frequent changes in the order-preserving state, a statistics timer can be used to trigger the out-of-order rate calculation. The timer's value is set to the length of the out-of-order rate statistics window.
[0055] Then, determine whether the calculated out-of-order rate is greater than the preset first out-of-order rate threshold (for example, 2%, configurable). When the out-of-order rate is greater than the preset first out-of-order rate threshold, switch the state machine to the order-preserving abnormal state (Ordering Degraded) and trigger an out-of-order alarm; when the out-of-order rate is not greater than the preset first out-of-order rate threshold, switch the state machine to the order-preserving normal state (Ordering Valid).
[0056] The out-of-sequence alarm can be triggered by generating an alarm log (SNMP Trap / Syslog). The following is an example of the alarm message or log format: Timestamp, alarm level, source device IP, destination device IP, current out-of-order rate, link identifier 2023-10-01T14:23:45, CRITICAL, 192.168.1.1, 192.168.1.2, Out of Order Rate = 8%, (Link- ID=Port1 / 0 / 1) Out-of-sequence alarms can be reported to the network management server. Network management personnel can monitor out-of-sequence alarms and out-of-sequence status information of network paths through the control page, and can also configure and modify parameters related to sequence detection.
[0057] In one embodiment of the present invention, for order-preserving sensitive services such as financial transactions and distributed databases, in order to prevent data errors or logical failures caused by the disorder of business data messages in these services and ensure transaction consistency, the network link order-preserving detection method provided by the present invention is used to perform order-preserving detection on the network path where the business traffic is located, and at the same time supports quantitative evaluation of link quality (such as based on the disorder rate, etc.). When it is detected that the business path continuity is in an abnormal order-preserving state, a first order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute link switching from the current path to the optimal backup path.
[0058] For example, the condition for determining that the current path continuity is in an abnormal state of order preservation is: the disorder rate is continuously greater than a preset second disorder rate threshold (such as 2%, 3%, etc., which is configurable) within a first preset number (such as 3) of disorder detection windows. The disorder detection window is the window in which the BFD agent on the forwarding device detects disorder persistence. For example, for a detection multiple and a detection interval of 3 In a 3ms BFD detection scenario, the out-of-order detection window can be set to 1 second. The specific value can be determined based on the actual application scenario.
[0059] When the BFD agent (or order-preserving detection device) on the forwarding device determines that the current path continuity is in an abnormal order-preserving state, the following steps can be used to trigger the SDN controller to switch to the optimal backup path: S11. The forwarding device sends a first order preservation request to the SDN controller (using a REST API or NETCONF interface) to notify the SDN controller to switch the link to the optimal backup path.
[0060] S12. The SDN controller calculates the optimal backup path (e.g., the shortest latency path). S13. The SDN controller sends a flow table update instruction (OpenFlow) to the forwarding device. The forwarding device switches the service traffic to the optimal backup path based on the sent flow table. S14. Verify the order-preserving status of the new network path. If it is normal, the SDN controller updates the topology database.
[0061] In another embodiment of the present invention, in order to ensure the service quality of order-sensitive services, the management system (such as an SDN controller) can dynamically schedule service traffic according to the order-preserving status of the link, and schedule high-priority order-sensitive critical services to paths with low disorder rates and stable order-preserving status.
[0062] However, in some cases, the link path where the critical business traffic is located may not have an available backup path or a backup path with better status, making it impossible to dispatch the critical business traffic on the current path to other backup paths. In this case, the management system can dynamically adjust the service quality or service priority of multiple business flows on the current path, such as limiting the flow of low-priority business traffic or lowering the priority of non-critical business to reduce retransmission overhead and improve resource utilization, thereby ensuring the service quality of critical business with high priority and sensitive to order. The specific processing methods are as follows: S21. When the BFD protocol detects that the current path is in an abnormal order-preserving state and there are no alternative paths, identify low-priority services (such as video streaming and file downloads) on the current path. S22 reports a second order preservation request message to the SDN controller to instruct the SDN controller to perform a flow control operation on the low-priority service on the current path (for example, limiting the bandwidth and / or queue resources of low-priority services through QoS policies, or reducing the priority of other services) to prioritize bandwidth and queue resources for high-priority services (for example, VoIP, financial transaction services with high real-time requirements); S22. After verifying that the current path is back in order and in a normal state through BFD, the original bandwidth allocation can be restored by reporting a request message.
[0063] Corresponding to the embodiment of the aforementioned method, an embodiment of the present invention further provides an embodiment of a network link sequence-preserving detection device and a device using the device.
[0064] The embodiments of the network link sequence detection device provided in this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented through software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor on the device where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 5 As shown in the figure, it is a hardware structure diagram of the computer device where the network link sequence detection device 531 provided in the embodiment of this specification is located. Figure 5 In addition to the processor 510, memory 530, network interface 520, and non-volatile memory 540 shown, the server or electronic device where the device 531 is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.
[0065] Figure 6 This is a schematic diagram of the structure of a network link sequence detection device in an embodiment of this specification. The device 531 is a forwarding device (such as a routing device, a switching device, etc.) controlled by an SDN controller, and includes: The reading module 610 is configured to parse the BFD control message upon receiving the BFD control message, read the sequence preservation detection flag from the BFD control message, and read the sequence number carried in the BFD control message as the current sequence number when the sequence preservation detection flag indicates that the sequence preservation detection needs to be performed; A determination module 620 is configured to determine whether an out-of-order event has occurred based on an out-of-order determination condition. The out-of-order determination condition includes a sequence number determination condition, wherein the current sequence number is less than a historical sequence number and the difference between the historical sequence number and the current sequence number is within an out-of-order determination window. The historical sequence number is the sequence number carried in the most recently received BFD control message with a normal sequence number. The out-of-order processing module 630 is configured to update the out-of-order counter and execute an out-of-order processing process when it is determined that an out-of-order event occurs.
[0066] In one embodiment of the present specification, the mandatory part of the BFD control message includes a 1-bit ordering flag, a 3-byte sequence number field, and a 3-byte timestamp field.
[0067] The reading module is further configured to read the timestamp field carried in the BFD control message as the current timestamp. The out-of-order judgment condition also includes a time judgment condition, where the sequence number judgment condition and the time judgment condition are logically ANDed. The judgment module determines whether an out-of-order event has occurred based on the sequence number judgment condition and the time judgment condition. The time judgment condition is defined as follows: the time interval between the current timestamp and a historical timestamp is greater than a first threshold; the historical timestamp is the timestamp carried in the most recently received BFD control message with a normal sequence number.
[0068] In one embodiment of this specification, the out-of-order processing module further includes: The out-of-order rate statistics module calculates the out-of-order rate within the out-of-order rate statistics time window. The out-of-order rate is the ratio of the number of BFD control packets determined to be out-of-order to the total number of BFD control packets within the out-of-order rate statistics time window. A state update module is configured to switch the state machine to an order-preserving abnormal state and trigger an order-preserving alarm when the out-of-order rate exceeds a preset first out-of-order rate threshold; and to switch the state machine to an order-preserving normal state (Ordering Valid) when the out-of-order rate does not exceed the preset first out-of-order rate threshold. The order-preserving request module is used to determine whether the current path is continuously in an abnormal order-preserving state. If it is determined that it is continuously in an abnormal order-preserving state and there is an alternative path, a first order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a link switch from the current path to the optimal backup path; if there is no alternative path, a second order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a flow limiting operation on low-priority services on the current path to give priority to protecting the bandwidth and queue resources of high-priority services; the condition for determining that the current path is continuously in an abnormal order-preserving state is: the disorder rate is continuously greater than the preset second disorder rate threshold within a first preset number of consecutive disorder detection windows.
[0069] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0070] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0071] While the foregoing descriptions are based on exemplary embodiments of this specification, it should be understood that, in some cases, the modules described herein may be divided differently from those described in the exemplary embodiments, and the actions or steps described may be performed in an order different from those described in the exemplary embodiments, while still achieving the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0072] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the present invention and practicing the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not exemplified in this specification.
[0073] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A network link sequence detection method, characterized in that: The method includes: Upon receiving a bidirectional forwarding detection (BFD) control message, reading an order-preserving detection identifier from the message; and when the order-preserving detection identifier indicates that order-preserving detection needs to be performed, reading a sequence number carried in the BFD control message as a current sequence number. Determine whether an out-of-order event has occurred based on an out-of-order judgment condition; the out-of-order judgment condition includes a sequence number judgment condition, wherein the sequence number judgment condition is: the current sequence number is less than the historical sequence number and the difference between the historical sequence number and the current sequence number is within the out-of-order judgment window; the historical sequence number is the sequence number carried by the most recently received BFD control message with a normal sequence number; When it is determined that an out-of-order event occurs, the out-of-order counter is updated and the out-of-order processing process is executed.
2. The method according to claim 1, characterized in that The mandatory part of the BFD control message includes a 1-bit sequence detection flag; In the case where the sequence preservation detection flag indicates that sequence preservation detection needs to be performed, the BFD control message further includes a sequence number field for identifying the order in which messages are sent.
3. The method according to claim 1, characterized in that When the order-preserving detection flag indicates that order-preserving detection needs to be performed, the BFD control message further includes a timestamp field for identifying a time when the message is sent; The disorder judgment condition also includes a time judgment condition, and the sequence number judgment condition and the time judgment condition are in a logical AND relationship; The time judgment condition is: the time interval between the current timestamp and the historical timestamp is greater than a first threshold; The current timestamp is a timestamp carried in a currently received BFD control message, and the historical timestamp is a timestamp carried in a most recently received BFD control message with a normal sequence number.
4. The method according to claim 3, characterized in that The out-of-order processing process includes: Calculate the out-of-order rate within the out-of-order rate statistical time window, where the out-of-order rate is the ratio of the number of BFD control packets determined to be out-of-order to the total number of BFD control packets within the out-of-order rate statistical time window. When the disorder rate is greater than the preset first disorder rate threshold, the state machine is switched to the order-preserving abnormal state and the disorder alarm is triggered; When the disorder rate is not greater than a preset first disorder rate threshold, the state machine is switched to the order-preserving normal state.
5. The method according to claim 4, characterized in that When the BFD protocol detects that the current path continuity is in an abnormal state of order preservation, a first order preservation request message is reported to the software-defined network SDN controller to instruct the SDN controller to perform link switching of the current path to the optimal backup path; The method for determining whether the current path is continuously in an abnormal state of order preservation is: the out-of-order rate is continuously greater than a preset second out-of-order rate threshold within a first preset number of consecutive out-of-order detection windows.
6. The method according to claim 5, characterized in that When the BFD protocol detects that the current path is in an abnormal state of order preservation and there is no alternative path, a second order preservation request message is reported to the software-defined network SDN controller to instruct the SDN controller to perform flow limiting operations on low-priority services on the current path to prioritize the bandwidth and queue resources of high-priority services.
7. A network link sequence detection device, characterized in that: The device comprises: A reading module is configured to parse a BFD control message upon receipt, read an order-preserving detection identifier from the BFD control message, and read a sequence number carried in the BFD control message as a current sequence number when the order-preserving detection identifier indicates that order-preserving detection needs to be performed; A judgment module is configured to determine whether an out-of-order event has occurred based on an out-of-order judgment condition; the out-of-order judgment condition includes a sequence number judgment condition, wherein the sequence number judgment condition is: the current sequence number is less than the historical sequence number and the difference between the historical sequence number and the current sequence number is within the out-of-order judgment window; the historical sequence number is the sequence number carried by the most recently received BFD control message with a normal sequence number; The out-of-order processing module is used to update the out-of-order counter and execute the out-of-order processing process when it is determined that an out-of-order event occurs.
8. The device according to claim 7, characterized in that The mandatory part of the BFD control message includes a 1-bit sequence detection flag; when the sequence detection flag indicates that sequence detection needs to be performed, the BFD control message also includes a sequence number field for identifying the order in which the messages are sent and a timestamp field for identifying the time when the messages are sent; The reading module is further configured to read the timestamp field carried by the BFD control message as the current timestamp; The disorder judgment condition also includes a time judgment condition, and the sequence number judgment condition and the time judgment condition are in a logical AND relationship; the judgment module jointly judges whether an disorder event occurs based on the sequence number judgment condition and the time judgment condition; The time judgment condition is: the time interval between the current timestamp and the historical timestamp is greater than a first threshold; the historical timestamp is the timestamp carried by the most recently received BFD control message with a normal sequence number.
9. The device according to claim 8, characterized in that The out-of-order processing module also includes: The out-of-order rate statistics module calculates the out-of-order rate within the out-of-order rate statistics time window. The out-of-order rate is the ratio of the number of BFD control packets determined to be out-of-order to the total number of BFD control packets within the out-of-order rate statistics time window. A state update module is configured to switch the state machine to an abnormal state of maintaining order and trigger an out-of-order alarm when the out-of-order rate is greater than a preset first out-of-order rate threshold; and to switch the state machine to a normal state of maintaining order when the out-of-order rate is not greater than the preset first out-of-order rate threshold; The order-preserving request module is used to determine whether the current path is continuously in an abnormal order-preserving state. If it is determined that it is continuously in an abnormal order-preserving state and there is an alternative path, a first order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a link switch from the current path to the optimal backup path; if there is no alternative path, a second order-preserving request message is reported to the software-defined network SDN controller to instruct the SDN controller to execute a flow limiting operation on low-priority services on the current path to give priority to protecting the bandwidth and queue resources of high-priority services; the condition for determining that the current path is continuously in an abnormal order-preserving state is: the disorder rate is continuously greater than the preset second disorder rate threshold within a first preset number of consecutive disorder detection windows.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Periodic line quality detecting method and device
CN101247288A
Bidirectional forwarding detection (BFD) method and system
CN102064981A
Message processing method and device
CN109302270A
Event processing method and related equipment
CN116431364A
Network quality identification method based on RTT calculation
CN118018386A