Protocol keep-alive early warning diagnosis method and device
By setting the timeout warning time in the OSPF protocol and increasing the serial number and timestamp of the protocol keep-alive packet, the problem of early warning and fault location during the OSPF protocol is solved, efficient early warning and fault analysis are achieved, and resource consumption and reproduction time are reduced.
Patent Information
- Application Number
- CN202510691726.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-07-25
AI Technical Summary
When the OSPF protocol occasionally breaks in communication devices, it lacks early warning information, makes it difficult to locate the cause of the failure, and requires long-term repeated tests and reproduction, which consumes a lot of resources.
By setting the timeout warning time, the serial number information in the protocol keep-alive packet and the software layer in-out timestamp are added, the number of packets sent and received and timing consistency are judged, the time delay is calculated, and the analysis and diagnosis are carried out, and early warning and fault analysis information are provided.
Provide early warning information before the agreement is disconnected, improve preventability, and provide important analysis information related to the faulty field equipment before and after the disconnection, reduce the need for recurrence of problems, and save resources and time.
Smart Images

Figure CN120378341A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of protocol keep-alive, and specifically relates to a protocol keep-alive early warning diagnosis method and device. Background Art
[0002] OSPF (Open Shortest Path First) is a core routing protocol in the Internet, used for routing control within an autonomous system (IGP).
[0003] OSPF includes five types of packets: Hello packet, DD (Database Description packet), LSR (Link State Request packet), LSU (Link State Update packet), and LSAck (Link State Acknowledgment packet).
[0004] The sending device and the receiving device discover and maintain the OSPF neighbor relationship by periodically sending Hello packets. In various tests of communication devices, long-term stability tests usually last for more than 24 hours. Due to certain reasons, the routing protocol may occasionally experience momentary disconnection, and it is difficult to locate the cause of the failure, resulting in the following problems:
[0005] 1) Before the protocol disconnection, there is no early warning information, and the preventive ability is insufficient.
[0006] 2) After the protocol disconnection, there is a lack of important analysis information related to the devices at both ends of the fault site, making it difficult to determine which device / module at which end has the problem.
[0007] 3) The probability of the problem occurring is low, and it is necessary to repeat long-term tests for reproduction, consuming time and resources. Summary of the Invention
[0008] This application provides a protocol keep-alive early warning diagnosis method and device, which can provide early warning information, improve preventive ability, and can provide important analysis information related to the devices at both ends of the fault site, improving the positioning efficiency.
[0009] In a first aspect, an embodiment of this application provides a protocol keep-alive early warning diagnosis method, and the protocol keep-alive early warning diagnosis method includes:
[0010] Set a timeout early warning time, and determine whether to give an early warning according to the number of protocol keep-alive packets received within each timeout early warning time period.
[0011] Add sequence number information to the protocol keep-alive packet, and determine whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information.
[0012] Add the input and output timestamps of each software layer to the protocol keep-alive packet, calculate the delay in the one-way transmission and reception of the protocol based on the input and output timestamps of each software layer, and determine whether it exceeds the corresponding threshold;
[0013] Perform analysis and diagnosis based on the judgment results of the sequence number information and the input and output timestamps of the software layer.
[0014] Combined with the first aspect, in one implementation, adding sequence number information to the protocol keep-alive packet and judging whether the quantity and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information includes:
[0015] Add sequence number information to the tail of the protocol keep-alive packet;
[0016] Compare the sequence number of the current protocol keep-alive packet with the previously saved sequence number, and judge whether the quantity and timing of the sent and received protocol keep-alive packets are consistent according to the comparison result.
[0017] Combined with the first aspect, in one implementation, comparing the sequence number of the current protocol keep-alive packet with the previously saved sequence number and judging whether the quantity and timing of the sent and received protocol keep-alive packets are consistent according to the comparison result includes:
[0018] Compare the sequence number S_cur of the current protocol keep-alive packet with the previously saved sequence number S_last:
[0019] If S_cur = S_last + 1, it is judged that the sequence number is normal, and an error warning message S_alm = 0 is generated;
[0020] If S_cur > S_last + 1, it is judged as a packet loss error, and an error warning message S_alm = 1 is generated;
[0021] If S_cur = S_last, it is judged as a duplicate error, and an error warning message S_alm = 2 is generated;
[0022] If S_cur < S_last, it is judged as an out-of-order error, and an error warning message S_alm = 3 is generated.
[0023] Combined with the first aspect, in one implementation, adding the input and output timestamps of each software layer to the protocol keep-alive packet, calculating the delay in the one-way transmission and reception of the protocol based on the input and output timestamps of each software layer, and determining whether it exceeds the corresponding threshold includes:
[0024] For the sending device, along the sending direction, insert the input and output timestamps of each software layer into the protocol keep-alive packet;
[0025] For the receiving device, along the receiving direction, insert the input and output timestamps of each software layer into the protocol keep-alive packet;
[0026] Calculate the delay of each layer of the sending device software and the total internal sending delay of the device, and determine whether it exceeds the corresponding threshold;
[0027] Calculate the delay of each layer of the receiving device software and the total internal receiving delay of the device, and determine whether it exceeds the corresponding threshold;
[0028] Calculate the network line delay, and determine whether it exceeds the corresponding threshold;
[0029] Calculate the total one-way sending and receiving delay of the protocol, and determine whether it exceeds the corresponding threshold.
[0030] Combined with the first aspect, in one embodiment, the analysis and diagnosis based on the judgment result of the sequence number information and the in-out timestamps of the software layers includes:
[0031] If S_alm > 0, the timeout reason is related to the network line or the sending device;
[0032] If the delay of any software layer of the sending device and the total internal sending delay of the device both exceed the threshold, the timeout reason is related to the sending device;
[0033] If the delay of any software layer of the receiving device and the total internal receiving delay of the device both exceed the threshold, the timeout reason is related to the receiving device;
[0034] If the total internal sending delay of the sending device, the total internal receiving delay of the receiving device, and the total one-way sending and receiving delay of the protocol all exceed the threshold, the timeout reason is related to both the sending device and the receiving device;
[0035] If the total one-way sending and receiving delay of the protocol and the network line delay both exceed the threshold, the timeout reason is related to the network line.
[0036] Combined with the first aspect, in one embodiment, the setting of the timeout warning time and the judgment of whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period include:
[0037] Set the timeout warning time to half of the standard timeout time defined in the protocol;
[0038] If at least 1 keep-alive packet is received within one timeout warning time period, enter the next detection cycle, otherwise give a warning.
[0039] Combined with the first aspect, in one embodiment, the protocol is the OSPF protocol, and the protocol keep-alive packet is the HELLO message packet.
[0040] In a second aspect, an embodiment of the present application provides a protocol keep-alive warning and diagnosis device, which is characterized in that the protocol keep-alive warning and diagnosis device includes:
[0041] An early warning module, which is used to set an early warning time for timeout, and determine whether to give an early warning according to the number of protocol keep-alive packets received within each timeout early warning time period;
[0042] An insertion module, which is used to add sequence number information to the protocol keep-alive packet, and determine whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information. The insertion module is also used to add the input and output timestamps of each software layer to the protocol keep-alive packet, calculate the delay in the one-way sending and receiving of the protocol according to the input and output timestamps of each software layer, and determine whether it exceeds the corresponding threshold;
[0043] A diagnosis module, which performs analysis and diagnosis based on the judgment results of the sequence number information and the input and output timestamps of the software layer.
[0044] Combined with the second aspect, in an embodiment, the insertion module adds sequence number information to the protocol keep-alive packet, and determines whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information, including:
[0045] Adding sequence number information to the tail of the protocol keep-alive packet;
[0046] Comparing the sequence number of the current protocol keep-alive packet with the previously saved sequence number, and determining whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the comparison result.
[0047] Combined with the second aspect, in an embodiment, the early warning module sets an early warning time for timeout, and determines whether to give an early warning according to the number of protocol keep-alive packets received within each timeout early warning time period, including:
[0048] Setting the early warning time for timeout to half of the standard timeout time defined in the protocol;
[0049] If at least 1 keep-alive packet is received within a timeout early warning time period, enter the next detection cycle, otherwise give an early warning.
[0050] The beneficial effects brought by the technical solution provided by the embodiments of the present application at least include:
[0051] In the protocol keep-alive early warning diagnosis method in the present application, by setting an early warning time for timeout, it is determined whether to give an early warning according to the number of protocol keep-alive packets received within each timeout early warning time period; adding sequence number information to the protocol keep-alive packet, and determining whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information; adding the input and output timestamps of each software layer to the protocol keep-alive packet, calculating the delay in the one-way sending and receiving of the protocol according to the input and output timestamps of each software layer, and determining whether it exceeds the corresponding threshold; performing analysis and diagnosis based on the judgment results of the sequence number information and the input and output timestamps of the software layer.
[0052] That is, by adding sequence number information and the incoming and outgoing timestamps of each software layer to the protocol keep-alive packet, the analysis and diagnosis of keep-alive timeout warning are carried out. Thus, before the protocol disconnection, warning information can be provided to improve preventiveness. Before and after the protocol disconnection, important analysis information related to the devices at both ends of the fault site can be provided to improve the positioning efficiency. For the scenario of occasional momentary disconnection of the protocol, the need for problem reproduction can be greatly reduced, saving device resource consumption and the time of long-term hanging detection. Brief Description of the Drawings
[0053] Figure 1 It is a flowchart of an embodiment of the protocol keep-alive warning diagnosis method of the present application;
[0054] Figure 2 It is a schematic diagram of the total one-way transmission and reception delay of the protocol;
[0055] Figure 3 It is a schematic diagram of the transmission delay and reception delay inside the device;
[0056] Figure 4 It is a schematic table of the inserted sequence number and incoming and outgoing timestamps;
[0057] Figure 5 It is a schematic table of the timestamps of sending and receiving at each software layer;
[0058] Figure 6 It is a schematic table of the standard timeout time defined in the protocol specification;
[0059] Figure 7 It is a schematic diagram of the time in the timeout warning mechanism;
[0060] Figure 8 It is a schematic diagram of the Ta warning table in the present application;
[0061] Figure 9 It is a schematic diagram of the SEQ delay warning table in the present application;
[0062] Figure 10 It is the overall view of the received packets of the protocol keep-alive packet in the present application;
[0063] Figure 11 It is the overall view of the delay warning in the present application;
[0064] Figure 12 It is a structural block diagram of an embodiment of the protocol keep-alive warning diagnosis device of the present application. Detailed Embodiments
[0065] To enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solution in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope of protection of this application.
[0066] To make the purpose, technical solution and advantages of this application clearer, the following will further describe the embodiments of this application in detail with reference to the accompanying drawings.
[0067] In a first aspect, an embodiment of this application provides a protocol keep-alive early warning diagnosis method.
[0068] In one embodiment, referring to Figure 1 as shown, Figure 1 is a schematic flowchart of an embodiment of the protocol keep-alive early warning diagnosis method of this application. As Figure 1 shown, the protocol keep-alive early warning diagnosis method includes:
[0069] S1. Set a timeout early warning time, and determine whether to give an early warning according to the number of protocol keep-alive packets received within each timeout early warning time period;
[0070] Specifically, step S1 includes:
[0071] S11. Set the timeout early warning time to half of the standard timeout time defined in the protocol;
[0072] S12. If at least 1 keep-alive packet is received within a timeout early warning time period, enter the next detection cycle, otherwise give an early warning.
[0073] S2. Add sequence number information to the protocol keep-alive packet, and determine whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information;
[0074] Specifically, step S2 includes:
[0075] S21. Add sequence number information to the tail of the protocol keep-alive packet;
[0076] S22. Compare the sequence number of the current protocol keep-alive packet with the previously saved sequence number, and determine whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the comparison result.
[0077] S3. Add the input and output timestamps of each software layer to the protocol keep-alive packet, calculate the delay in the one-way sending and receiving of the protocol according to the input and output timestamps of each software layer, and determine whether it exceeds the corresponding threshold;
[0078] Specifically, for the sending device, along the sending direction, insert the input and output timestamps at each software layer into the protocol keep-alive packet; for the receiving device, along the receiving direction, insert the input and output timestamps at each software layer into the protocol keep-alive packet.
[0079] The delay in one-way protocol transmission and reception mainly includes the delays of each layer of the sending device software, the total internal sending delay of the device, the delays of each layer of the receiving device software, the total internal receiving delay of the device, the network line delay, and the total one-way protocol transmission and reception delay.
[0080] Therefore, the following calculations and judgments need to be performed in this embodiment:
[0081] Calculate the delays of each layer of the sending device software and the total internal sending delay of the device, and determine whether they exceed the corresponding thresholds;
[0082] Calculate the delays of each layer of the receiving device software and the total internal receiving delay of the device, and determine whether they exceed the corresponding thresholds;
[0083] Calculate the network line delay and determine whether it exceeds the corresponding threshold;
[0084] Calculate the total one-way protocol transmission and reception delay and determine whether it exceeds the corresponding threshold.
[0085] S4. Analyze and diagnose based on the judgment results of the sequence number information and the input and output timestamps of the software layer.
[0086] To facilitate the understanding of the above steps, the following further explanation is provided in conjunction with the accompanying drawings.
[0087] First, introduce the delay in the above one-way protocol transmission and reception, as shown in Figure 2 and Figure 3 as follows:
[0088] 1) The total one-way protocol transmission and reception delay Tt (see Figure 2 )
[0089] Tt = Ts + Tr + Tl
[0090] Ts: Represents the internal sending delay of the sending device;
[0091] Tr: Represents the internal receiving delay of the receiving device;
[0092] Tl: The one-way delay of the network line;
[0093] 2) The sending delay Ts and the receiving delay Tr inside the device (see Figure 3 )
[0094] Ts = Ts_Ln_o - Ts_L1_i;
[0095] Tr = Tr_L1_o - Tr_Ln_i;
[0096] Ts_Ln_o, Ts_L1_i: respectively represent the outgoing timestamp of software layer Ln in the sending direction and the incoming timestamp of layer L1;
[0097] Tr_L1_o, Tr_Ln_i: respectively represent the outgoing timestamp of software layer L1 in the receiving direction and the incoming timestamp of layer Ln;
[0098] 3) Network one-way delay (see Figure 3 )
[0099] Tl = Tr_Ln_i - Ts_Ln_o;
[0100] Tr_Ln_i, Ts_Ln_o: respectively represent the incoming and outgoing timestamps of software layer Ln closest to the network line of the receiving and sending devices;
[0101] Among them, it is necessary for the receiving and sending devices to complete time synchronization first to eliminate the time precision error between the devices.
[0102] In this embodiment, taking the OSPF protocol as an example, its protocol keepalive packet is the HELLO message packet. It should be noted that for other protocols, such as BGP (Border Gateway Protocol), it can also be processed by referring to the OSPF protocol method, and this embodiment does not limit it here.
[0103] To solve the problems in the prior art, this embodiment needs to add the in-path diagnostic information of the protocol keepalive packet, that is, add the sequence number information at the end of the HELLO message packet: the format content is shown in Figure 4 , and its main function is to determine whether the number and timing of the keepalive packets received and sent by the two devices are consistent, and the result can be used for the analysis and diagnosis of keepalive timeout warnings.
[0104] In addition, it is also necessary to add the timestamps of sending and receiving at each software layer, that is, add the timestamp information after the sequence number information of the HELLO message packet: the format content is shown in Figure 4 and Figure 5 .
[0105] Specifically:
[0106] Sending device: Insert the incoming and outgoing timestamps of each software layer in the sending direction into the HELLO message packet;
[0107] Receiving device: Insert the incoming and outgoing timestamps of each software layer in the receiving direction into the HELLO message packet.
[0108] Its main function is to calculate the time consumed at each software level on the transceiver path (Ts_Ln / Tr_Ln) and the total time (Ts / Tr / Tl / Tt), and the results can be used for the analysis and diagnosis of keep-alive timeout warnings.
[0109] Next, add a timeout warning mechanism for protocol keep-alive packets:
[0110] 1) Refer to Figure 6 As shown, the standard timeout time defined in each protocol specification:
[0111] Tx = (3|4)*Ty, where 3|4 means 3 or 4;
[0112] Ty: The sending period of the protocol keep-alive packet;
[0113] 2) Definition of timeout warning time:
[0114] Ta = Tx / 2;
[0115] 3) Warning judgment condition:
[0116] According to the above expressions and Figure 7 , it can be judged that under normal circumstances, the receiving device should receive at least 1 protocol keep-alive packet within each Ta period. If no protocol keep-alive packet is received, a Ta timeout warning message will be generated.
[0117] The following still takes the OSPF protocol as an example to illustrate the above steps in combination with the sending device and the receiving device:
[0118] 1. The receiving device performs Ta timeout warning processing on the protocol keep-alive packet
[0119] The receiving device initially starts the Ta warning timer, records the start time Ta_Start, and initializes the Ta table entry index INDEX = 0;
[0120] 1) If a keep-alive packet is received within the Ta time, then
[0121] A) Restart the Ta timer, record the start time Ta_Start, and enter the next detection cycle;
[0122] 2) If no keep-alive packet is received within the Ta time, then
[0123] A) Set the flag Ta_alm = 1 and record the warning time Ta_time;
[0124] B) Set INDEX++, and save the relevant information to the INDEX table entry of the Ta warning table (refer to Figure 8 );
[0125] C) Restart the Ta timer, record the start time Ta_Start, and enter the next detection cycle.
[0126] 2. Processing of the serial number Sequence
[0127] 1) Processing of the sending device
[0128] If the sending device is configured to enable the insertion of the serial number, insert Sequence at the position described above in the HELLO packet.
[0129] A) Set the SEQ bit: Set SEQ = 1 in the Options field of the HELLO packet.
[0130] B) Insert Sequence: Initialize Sequence = 0, and increment Sequence by 1 for each HELLO packet sent.
[0131] 2) Processing of the receiving device
[0132] The receiving device checks the SEQ bit in the Options field of the HELLO packet. If SEQ = 1, it makes a judgment on the serial number status, that is, compares the serial number S_cur of the current packet with the previously saved serial number S_last.
[0133] A) If S_cur = S_last + 1, it is judged that the serial number is normal, and an error warning message S_alm = 0 is generated.
[0134] B) If S_cur > S_last + 1, it is judged as a packet loss error, and an error warning message S_alm = 1 is generated.
[0135] C) If S_cur = S_last, it is judged as a duplicate error, and an error warning message S_alm = 2 is generated.
[0136] D) If S_cur < S_last, it is judged as an out-of-order error, and an error warning message S_alm = 3 is generated.
[0137] E) Set S_last = S_cur.
[0138] F) If S_alm > 0, record the packet reception time Tp_time and save the relevant information to the SEQ delay warning table (see Figure 9 ).
[0139] 3. Insertion processing of the transmission and reception timestamps TimeStamp
[0140] 1) Insertion of the timestamp of the sending device
[0141] If the originating device is configured to enable the insertion of timestamps, then insert the TimeStamp at the position described above in the HELLO message packet;
[0142] A) Set the TS bit: The software L1 layer is responsible for setting TS = 1 in the Options field of the HELLO message packet;
[0143] B) Insert the transmission timestamp header head: The software L1 layer is responsible for inserting head, setting Type = 1, Length = 1, Value = 0;
[0144] C) Insert the timestamp information of each layer on the transmission path:
[0145] a) Each software layer L1-Ln first sets the layer name Layer_Name of this layer;
[0146] b) Each software layer L1-Ln then inserts the incoming and outgoing timestamps into the timestamp area (IN TimeStamp, OUT TimeStamp) in sequence;
[0147] D) After inserting the timestamp for each layer, set Value++ in the head field;
[0148] 2) Timestamp insertion of the receiving device
[0149] The receiving device checks the TS bit in the Options field of the protocol keep-alive packet HELLO packet. If TS = 1, then:
[0150] A) Insert the receiving timestamp header head: The software Ln layer is responsible for inserting head, setting Type = 2, Length = 1, Value = 0;
[0151] B) Insert the timestamp information of each layer on the receiving path:
[0152] a) Each software layer L1-Ln first sets the layer name Layer_Name of this layer;
[0153] b) Each software layer L1-Ln then inserts the incoming and outgoing timestamps into the timestamp area (IN TimeStamp, OUT TimeStamp) in sequence;
[0154] D) After inserting the timestamp for each layer, set Value++ in the head field;
[0155] 4. The receiving device performs the delay calculation and processing of the keep-alive packet
[0156] 1) Calculate the delay Ts_Ln of each layer of the sending device software and the total internal sending delay Ts of the device, and determine whether they exceed their respective thresholds (the thresholds are Ts_Ln_limit and Ts_limit respectively);
[0157] A) The delay Ts_Ln of each layer of the software is Ts_Ln = Ts_Ln_o - Ts_Ln_i;
[0158] If Ts_Ln >= Ts_Ln_limit for any layer, set the overlimit alarm Ts_Ln_alm = 1;
[0159] B) The total transmission delay Ts inside the device is Ts = Ts_Ln_o - Ts_L1_i;
[0160] If Ts >= Ts_limit, set the overlimit alarm Ts_alm = 1;
[0161] 2) Calculate the delay Tr_Ln of each layer of the receiving device software and the total receiving delay Tr inside the device, and determine whether they exceed their respective thresholds (the thresholds are Tr_Ln_limit and Tr_limit respectively)
[0162] A) The delay Tr_Ln of each layer of the software is Tr_Ln = Tr_Ln_o - Tr_Ln_i;
[0163] If Tr_Ln >= Tr_Ln_limit for any layer, set the overlimit alarm Tr_Ln_alm = 1;
[0164] B) The total receiving delay Tr inside the device is Tr = Tr_L1_o - Tr_Ln_i;
[0165] If Tr >= Tr_limit, set the overlimit alarm Tr_alm = 1;
[0166] 3) Calculate the network line delay Tl and determine whether it exceeds the threshold (the threshold is Tl_limit)
[0167] Tl = Tr_Ln_i - Ts_Ln_o;
[0168] If Tl >= Tl_limit, set the overlimit alarm Tl_alm = 1;
[0169] Among them, the receiving and transmitting devices need to complete time synchronization first (using the NTP or 1588 protocol) to eliminate the time accuracy error between the devices;
[0170] 4) Calculate the total one-way transmission and reception delay Tt of the protocol and determine whether it exceeds the threshold (the threshold is Tt_limit)
[0171] The total delay Tt = Ts + Tr + Tl;
[0172] If Tt >= Tt_limit, set the overlimit alarm Tt_alm = 1;
[0173] 5) Save relevant information to the SEQ delay warning table
[0174] A) If Tt_alm = 1 or Tl_alm = 1, then save the information;
[0175] B) If Ts_alm = 1 or Tr_alm = 1, then save the information;
[0176] C) If Ts_Ln_alm = 1 or Tr_Ln_alm = 1, then save the information;
[0177] 6) Save relevant information to the Ta warning table
[0178] A) If Ta_alm = 1, regardless of whether there are alarms for SEQ and delay, save the relevant information to the current entry (INDEX) of the Ta warning table, and at the same time set Ta_alm = 0;
[0179] 5. Ta timeout warning diagnosis
[0180] Based on the Ta warning table to save the associated SEQ delay information, the cause of the Ta timeout warning can be judged
[0181] A) If Tt_alm = 1 and Ts_alm = 1, then the timeout cause is related to the sending device;
[0182] Continue to combine with Ts_Ln_alm. According to the principle that the larger the value, the greater the association, the Ts_Ln with the largest association can be judged;
[0183] B) If Tt_alm = 1 and Tr_alm = 1, then the timeout cause is related to the receiving device;
[0184] Continue to combine with Tr_Ln_alm. According to the principle of "the larger the value, the greater the association", the Tr_Ln with the largest association can be judged;
[0185] C) If Tt_alm = 1, Ts_alm = 1, and Tr_alm = 1, then the timeout cause is related to both ends of the device;
[0186] Continue to combine with Ts_Ln_alm and Tr_Ln_alm. According to the principle that the larger the value, the greater the association, the Ts_Ln and Tr_Ln with the largest association can be judged;
[0187] D) If Tt_alm = 1 and Tl_alm = 1, then the timeout cause is related to the network line;
[0188] E) If S_alm > 0, then the timeout cause is related to the network line or the sending device;
[0189] 6. According to the Ta warning table, the overall view of the received protocol keep-alive packets can be obtained, which can be used for regular patrol inspection analysis;
[0190] 7. According to the SEQ delay warning table, the overall view of the delay alarms of the protocol keep-alive packets at each level can be obtained, which can be used for regular patrol inspection analysis.
[0191] Thus, in this embodiment, warning information can be provided before the protocol disconnection, and important analysis information related to the devices at both ends of the fault site can be provided before and after the protocol disconnection.
[0192] In summary, in the protocol keep-alive warning and diagnosis method in this application, by setting the timeout warning time, it is determined whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period; sequence number information is added to the protocol keep-alive packets, and it is determined whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information; the in and out timestamps of each software layer are added to the protocol keep-alive packets, and the delay in the one-way transmission and reception of the protocol is calculated according to the in and out timestamps of each software layer, and it is determined whether it exceeds the corresponding threshold; analysis and diagnosis are performed based on the judgment results of the sequence number information and the in and out timestamps of the software layer.
[0193] That is, by adding sequence number information and the in and out timestamps of each software layer to the protocol keep-alive packets to perform the analysis and diagnosis of the keep-alive timeout warning. Thus, warning information can be provided before the protocol disconnection to improve preventive measures, and important analysis information related to the devices at both ends of the fault site can be provided before and after the protocol disconnection to improve the positioning efficiency. For the scenario of occasional momentary disconnection of the protocol, the need for problem reproduction can be greatly reduced, saving device resource consumption and the time of long-term hanging measurement.
[0194] In a second aspect, an embodiment of this application provides a protocol keep-alive warning and diagnosis device.
[0195] In one embodiment, referring to Figure 5 as shown, Figure 5 is the structural block diagram of an embodiment of the protocol keep-alive warning and diagnosis device of this application. As Figure 5 shown, the protocol keep-alive warning and diagnosis device includes:
[0196] A warning module, which is used to set the timeout warning time and determine whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period;
[0197] An insertion module, which is used to add sequence number information to the protocol keep-alive packets and determine whether the number and timing of the sent and received protocol keep-alive packets are consistent according to the sequence number information. The insertion module is also used to add the in and out timestamps of each software layer to the protocol keep-alive packets, calculate the delay in the one-way transmission and reception of the protocol according to the in and out timestamps of each software layer, and determine whether it exceeds the corresponding threshold;
[0198] A diagnostic module that performs analysis and diagnosis based on the judgment results of the serial number information and the input / output timestamps of the software layer.
[0199] Further, in one embodiment, the insertion module adds serial number information to the protocol keep-alive packet and determines whether the number and timing of the transmitted and received protocol keep-alive packets are consistent according to the serial number information, including:
[0200] Add serial number information to the tail of the protocol keep-alive packet;
[0201] Compare the serial number of the current protocol keep-alive packet with the previously saved serial number, and determine whether the number and timing of the transmitted and received protocol keep-alive packets are consistent according to the comparison result.
[0202] Further, in one embodiment, the insertion module compares the serial number of the current protocol keep-alive packet with the previously saved serial number, and determines whether the number and timing of the transmitted and received protocol keep-alive packets are consistent according to the comparison result, including:
[0203] Compare the serial number S_cur of the current protocol keep-alive packet with the previously saved serial number S_last:
[0204] If S_cur = S_last + 1, it is determined that the serial number is normal, and an error warning message S_alm = 0 is generated;
[0205] If S_cur > S_last + 1, it is determined that there is a packet loss error, and an error warning message S_alm = 1 is generated;
[0206] If S_cur = S_last, it is determined that there is a duplicate error, and an error warning message S_alm = 2 is generated;
[0207] If S_cur < S_last, it is determined that there is a reverse order error, and an error warning message S_alm = 3 is generated.
[0208] Further, in one embodiment, the insertion module adds the input / output timestamps of each software layer to the protocol keep-alive packet, calculates the delay in the one-way transmission and reception of the protocol, and determines whether it exceeds the corresponding threshold, including:
[0209] For the sending device, along the sending direction, insert the input / output timestamps of each software layer into the protocol keep-alive packet;
[0210] For the receiving device, along the receiving direction, insert the input / output timestamps of each software layer into the protocol keep-alive packet;
[0211] Calculate the delay of each layer of the sending device software and the total internal sending delay of the device, and determine whether it exceeds the corresponding threshold;
[0212] Calculate the latency of each layer of the receiving device software and the total internal receiving latency of the device, and determine whether it exceeds the corresponding threshold;
[0213] Calculate the network line latency and determine whether it exceeds the corresponding threshold;
[0214] Calculate the total one-way transceiver latency of the protocol and determine whether it exceeds the corresponding threshold.
[0215] Furthermore, in one embodiment, the diagnosis module performs analysis and diagnosis based on the judgment results of the serial number information and the input / output timestamps of the software layer, including:
[0216] If S_alm > 0, the timeout reason is related to the network line or the sending device;
[0217] If the latency of any software layer of the sending device and the total internal sending latency of the device both exceed the threshold, the timeout reason is related to the sending device;
[0218] If the latency of any software layer of the receiving device and the total internal receiving latency of the device both exceed the threshold, the timeout reason is related to the receiving device;
[0219] If the total internal sending latency of the sending device, the total internal receiving latency of the receiving device, and the total one-way transceiver latency of the protocol all exceed the threshold, the timeout reason is related to both the sending device and the receiving device;
[0220] If the total one-way transceiver latency of the protocol and the network line latency both exceed the threshold, the timeout reason is related to the network line.
[0221] Furthermore, in one embodiment, the warning module sets a timeout warning time and determines whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period, including:
[0222] Set the timeout warning time to half of the standard timeout time defined in the protocol;
[0223] If at least 1 keep-alive packet is received within a timeout warning time period, enter the next detection cycle, otherwise give a warning.
[0224] Among them, the function implementation of each module in the above protocol keep-alive warning diagnosis device corresponds to each step in the above protocol keep-alive warning diagnosis method embodiment, and its function and implementation process will not be elaborated here one by one.
[0225] It should be noted that the serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0226] In the description of the specification, claims and the above-mentioned drawings of this application, the terms "comprising", "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices. Descriptions such as "first", "second", and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit that "first", "second", and "third" are different types.
[0227] In the description of the embodiments of this application, words such as "exemplary", "for example" or "for instance" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary", "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary", "for example" or "for instance" is intended to present relevant concepts in a specific manner.
[0228] In the description of the embodiments of this application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; "and / or" in the text is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "a plurality of" means two or more than two.
[0229] In some processes described in the embodiments of this application, a plurality of operations or steps appear in a specific order. However, it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of this application or may be executed in parallel. The serial numbers of the operations are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0230] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions to enable a terminal device to execute the methods described in the various embodiments of this application.
[0231] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall similarly be included in the patent protection scope of the present application.
Claims
1. A protocol keep-alive early warning diagnosis method, characterized in that, The protocol keep-alive warning diagnosis method includes: Setting a timeout warning time, and determining whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period; Adding sequence number information to the protocol keep-alive packet, and determining whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the sequence number information; Adding the input and output timestamps of each software layer to the protocol keep-alive packet, calculating the delay in the one-way transmission and reception of the protocol according to the input and output timestamps of each software layer, and determining whether it exceeds the corresponding threshold; Performing analysis and diagnosis based on the judgment results of the sequence number information and the input and output timestamps of the software layer.
2. The protocol keep-alive early warning diagnosis method according to claim 1, characterized in that The adding sequence number information to the protocol keep-alive packet, and determining whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the sequence number information includes: Adding sequence number information to the tail of the protocol keep-alive packet; Comparing the sequence number of the current protocol keep-alive packet with the previously saved sequence number, and determining whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the comparison result.
3. The protocol keep-alive early warning diagnostic method according to claim 2, characterized in that The comparing the sequence number of the current protocol keep-alive packet with the previously saved sequence number, and determining whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the comparison result includes: Comparing the sequence number S_cur of the current protocol keep-alive packet with the previously saved sequence number S_last: If S_cur = S_last + 1, it is determined that the sequence number is normal, and an error warning message S_alm = 0 is generated; If S_cur > S_last + 1, it is determined as a packet loss error, and an error warning message S_alm = 1 is generated; If S_cur = S_last, it is determined as a duplicate error, and an error warning message S_alm = 2 is generated; If S_cur < S_last, it is determined as an out-of-order error, and an error warning message S_alm = 3 is generated.
4. The protocol keep-alive early warning diagnosis method according to claim 3, characterized in that, The adding the input and output timestamps of each software layer to the protocol keep-alive packet, calculating the delay in the one-way transmission and reception of the protocol according to the input and output timestamps of each software layer, and determining whether it exceeds the corresponding threshold includes: For the sending device, along the sending direction, inserting the input and output timestamps of each software layer into the protocol keep-alive packet; For the receiving device, along the receiving direction, inserting the input and output timestamps of each software layer into the protocol keep-alive packet; Calculating the delay of each software layer of the sending device and the total internal sending delay of the device, and determining whether it exceeds the corresponding threshold; Calculating the delay of each software layer of the receiving device and the total internal receiving delay of the device, and determining whether it exceeds the corresponding threshold; Calculating the network line delay, and determining whether it exceeds the corresponding threshold; Calculating the total one-way transmission and reception delay of the protocol, and determining whether it exceeds the corresponding threshold.
5. The protocol keep-alive early warning diagnosis method according to claim 4, wherein, The performing analysis and diagnosis based on the judgment results of the sequence number information and the input and output timestamps of the software layer includes: If S_alm > 0, the timeout reason is related to the network line or the sending device; If the delay of any software layer of the sending device and the total internal sending delay of the device both exceed the threshold, the timeout reason is related to the sending device; If the delay of any software layer of the receiving device and the total internal receiving delay of the device both exceed the threshold, the timeout reason is related to the receiving device; If the total internal transmission delay of the sending device, the total internal reception delay of the receiving device, and the total one-way transmission and reception delay of the protocol all exceed the threshold, the timeout cause is related to both the sending device and the receiving device; If the total one-way transmission and reception delay of the protocol and the network line delay both exceed the threshold, the timeout cause is related to the network line.
6. The protocol keep-alive early warning diagnosis method according to claim 1, wherein The setting of the timeout warning time, and judging whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period, includes: Set the timeout warning time to half of the standard timeout time defined in the protocol; If at least 1 keep-alive packet is received within one timeout warning time period, enter the next detection cycle, otherwise give a warning.
7. The protocol keep-alive warning diagnosis method according to claim 1, characterized in that: The protocol is the OSPF protocol, and the protocol keep-alive packet is a HELLO message packet.
8. A protocol keep-alive warning and diagnosis device, characterized in that, The protocol keep-alive warning diagnosis device includes: A warning module, which is used to set the timeout warning time and judge whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period; An insertion module, which is used to add sequence number information to the protocol keep-alive packet, judge whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the sequence number information, and the insertion module is also used to add the in and out timestamps of each software layer to the protocol keep-alive packet, and calculate the delay in the one-way transmission and reception of the protocol according to the in and out timestamps of each software layer, and judge whether it exceeds the corresponding threshold; A diagnosis module, which analyzes and diagnoses based on the judgment results of the sequence number information and the in and out timestamps of the software layer.
9. The protocol keep-alive early warning diagnosis device according to claim 8, characterized in that, The insertion module adds sequence number information to the protocol keep-alive packet and judges whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the sequence number information, including: Add sequence number information to the tail of the protocol keep-alive packet; Compare the sequence number of the current protocol keep-alive packet with the previously saved sequence number, and judge whether the number and sequence of the sent and received protocol keep-alive packets are consistent according to the comparison result.
10. The protocol keep-alive early warning diagnosis device according to claim 8, wherein The warning module sets the timeout warning time and judges whether to give a warning according to the number of protocol keep-alive packets received within each timeout warning time period, including: Set the timeout warning time to half of the standard timeout time defined in the protocol; If at least 1 keep-alive packet is received within one timeout warning time period, enter the next detection cycle, otherwise give a warning.