Packet loss rate statistical method based on Telemetry
By using Telemetry technology on the network management server to receive and parse packets sent by the device and calculate the packet loss rate, the problem of low performance in the calculation packet loss rate of the device itself is solved, and efficient, real-time and accurate packet loss rate statistics are achieved, which improves the Equipment performance.
Patent Information
- Application Number
- CN202510001402.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when the equipment itself is used to calculate the packet loss rate, its performance is low, especially when the equipment is busy, which may lead to reduced equipment work efficiency and poor flexibility, affecting its main business.
Using a Telemetry-based packet loss rate statistics method, the packets sent by the first device and the second device are received through the network management server, the basic traffic data is analyzed and saved, the packet loss rate is calculated, and the data analysis, statistics and calculation are performed instead of the device.
It reduces the complexity of the equipment, improves the performance of the equipment, improves the efficiency and real-timeness of the packet loss rate calculation, ensures statistics accuracy, and avoids incorrect packet loss rate calculation.
Smart Images

Figure CN119402391A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and more specifically, to a packet loss rate statistics method based on Telemetry. Background Art
[0002] In the existing communication technology between network management and equipment, the packet loss rate is generally calculated by the equipment's own resources, and the packet loss rate calculation performance is not high. Especially when the equipment is in a busy state, if the packet loss rate is still counted, it may lead to problems such as low equipment efficiency and poor flexibility, which seriously affects the main business of the equipment. Therefore, how to calculate the packet loss rate of the equipment efficiently without affecting the performance of the equipment is an urgent problem to be solved. Summary of the invention
[0003] In order to solve the problem of low performance of statistical packet loss rate of the above-mentioned equipment, the present invention provides solutions in the following aspects.
[0004] The present invention provides a packet loss rate statistics method based on Telemetry, which is applied to a network management server, including: receiving a message sent by a first device and a second device; parsing the message according to a preset message format, judging whether the parsed message is valid according to a preset condition, and if valid, saving basic traffic data; determining a packet loss rate according to the basic traffic data, and the packet loss rate is used to characterize the packet loss situation between the first device and the second device.
[0005] Furthermore, it also includes: setting the Telemetry configuration corresponding to the first device and the second device, and the Telemetry configuration includes an IP address and a port number.
[0006] Furthermore, the message format includes: device id, flow id, type, number of packets received / sent and time of receiving / sending packets, and the time of receiving / sending packets is a relative number of time units in nanoseconds.
[0007] Furthermore, the types include statistics of sent uncolored packets, sent colored packets, received uncolored packets and received colored packets.
[0008] Furthermore, the message format also includes a packet sending time, and the packet sending time is integrated with a reference time to determine a packet sending time of a current data packet.
[0009] Further, determining the packet loss rate according to the basic traffic data includes: matching basic traffic data with the same flow, corresponding type and time interval within a preset value, and calculating the packet loss rate according to the matched basic traffic data.
[0010] Furthermore, the preset value is 5 minutes.
[0011] Furthermore, the packet loss rate is calculated based on the matched basic traffic data, including: calculating the difference between the total number of messages sent by the first device and the total number of messages received by the second device; and obtaining the packet loss rate based on the ratio of the difference to the total number of messages sent by the first device.
[0012] Furthermore, the preset condition is: receiving the message sent by the first device and the message sent by the second device within a time interval of a preset value.
[0013] The beneficial effects of the present invention are as follows: the method of the present invention can replace the device to perform data analysis, statistics and calculation of packet loss rate, thereby reducing the complexity of the device and improving the performance of the device. Furthermore, the message format set by the method of the present invention can increase the speed of message transmission and analysis, thereby improving the efficiency and real-time performance of calculating the packet loss rate of the device. In addition, by matching the stored basic traffic data and then calculating the packet loss rate, the problem of obtaining an erroneous packet loss rate due to mismatched messages is avoided, thereby improving the accuracy of the statistical packet loss rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein: Figure 1 is a flowchart schematically illustrating a packet loss rate statistics method based on Telemetry according to an embodiment of the present invention; Figure 2 is a flowchart schematically illustrating a packet loss rate statistics method based on Telemetry according to another embodiment of the present invention; Figure 3 is a diagram schematically showing the result of parsing a message according to an embodiment of the present invention; Figure 4 FIG. 4 is a diagram schematically showing the result of statistical packet loss rate according to an embodiment of the present invention. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0016] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0017] Figure 1 The flowchart schematically shows a packet loss rate statistics method based on Telemetry according to an embodiment of the present invention.
[0018] The present invention provides a packet loss rate statistics method based on Telemetry, such as Figure 1 As shown, the method of the present invention comprises: S101. Receive messages sent by a first device and a second device.
[0019] Telemetry is a technology that collects data from physical or virtual devices remotely and at high speed. The device periodically and actively sends device information to the collector through "Push Mode", providing more real-time, faster, and more accurate network monitoring functions. Since Telemetry can obtain device data in real time, it can also perform data analysis, statistics, and calculations in real time, thereby improving the real-time and efficiency of statistical device packet loss rate.
[0020] In one embodiment, the IP address and port of the network management server need to be configured in the first device and the second device so that the first device and the second device can send Telemetry data to the network management server, so that the network management server can calculate the packet loss rate between the first device and the second device according to the data sent by the first device and the second device, thereby completing the statistical work of the packet loss rate on behalf of the device, reducing the complexity of the device, allowing the device to fully focus on its main business, and improving the performance of the device.
[0021] Similarly, you also need to enter the Telemetry configurations corresponding to the first device and the second device.
[0022] Since the Telemetry configurations corresponding to the first device and the second device are recorded, when counting the packet loss rate, interference of messages sent by other devices on counting the packet loss rate between the first device and the second device is avoided, thereby improving the accuracy of counting the packet loss rate.
[0023] It is understandable that the first device and the second device can send data to each other. Therefore, when calculating the packet loss rate, the packet loss rate from the first device to the second device can be calculated, and the packet loss rate from the second device to the first device can also be calculated, which improves the flexibility of statistical device packet loss rates.
[0024] It should be noted that when counting packet loss rate, the message sent by the first device to the second device is different from the message sent by the first device and the second device to the network management server. The message sent by the first device to the second device is actual and detailed data, while the message sent by the first device and the second device to the network management server only contains basic traffic data and does not contain invalid data. For example, when a video file is transmitted from the first device to the second device, the message sent by the first device to the second device contains detailed video file data, while when counting packet loss rate, the data sent by the first device to the network management server only contains basic traffic data (data related to packet loss rate, such as informing the network management server when and how many messages it has sent to the second device). Since the content of the message sent by the device to the network management server is concise and small in size, the method of the present invention can transmit the data to be counted by the device to the network management server at a high speed, so that it can quickly count the packet loss rate of the device, and the real-time performance is high. In addition, the method of the present invention can be applied in the operation process of the device, and the packet loss rate of the device can be counted in real time without sending additional test messages.
[0025] S102, parsing the message according to a preset message format, and judging whether the parsed message is valid according to preset conditions, if valid, saving the basic flow data; if invalid, discarding.
[0026] In one embodiment, the network management server parses the received message according to a preset message format. Specifically, the preset message format is shown in Table 1.
[0027] Table 1 Telemetry message format
[0028] In Table 1, the types include: statistics of sending uncolored packets (000), statistics of sending colored packets (001), statistics of receiving uncolored packets (010), and statistics of receiving colored packets (011). Among them, only the same type can be added, for example, the message of 000 can only be added with the message of 000, and the message of 001 can only be added with the message of 001, so as to realize the statistics of packet loss rate. Among them, colored and uncolored are used to distinguish the cycle of each flow (for example, in a file transfer, the time from the beginning of sending the first message of the file to the completion of the entire file transfer is the cycle of the flow). If the type of the message sent by a flow in the current cycle is colored, then the type of the message sent in the next cycle is uncolored. By distinguishing the different cycles of the flow, the situation of adding messages of different cycles is avoided, thereby improving the accuracy of packet loss rate statistics.
[0029] Furthermore, it can be seen from Table 1 that the present invention reduces the occupied fields and the size of the message by placing the number of received packets and the number of sent packets in one field (i.e., the number of received / sent packets, if data is sent, the number of received / sent packets is expressed as the number of sent packets; if data is received, the number of received / sent packets is expressed as the number of received packets), and the packet receiving time and the packet sending time in one field (packet receiving / sending time), thereby reducing the size of the message and improving the message transmission rate.
[0030] Furthermore, in the packet receiving / sending time, only the first packet in the cycle is counted, and other packets are not counted, thereby reducing computing resources and storage resources. In addition, by only recording the minutes and seconds of the packet receiving / sending time, and not recording the year, month, day and time, the length of the time data is shortened, thereby improving the efficiency of binary conversion of time data, thereby improving the efficiency of message assembly, and further improving the efficiency of message transmission. In addition, it also saves the occupied message space, further improving the efficiency of message transmission, so that the obtained packet loss rate can better reflect the current status of the device, with high real-time performance.
[0031] In one embodiment, the packet receiving / sending time is a relative number of time units in nanoseconds. For example, when the packet receiving / sending time in the message is 1000, the actual packet receiving / sending time is 1000 6.25ns, and then the obtained nanoseconds are converted into minutes and seconds, and then integrated with the reference time to obtain the complete packet receiving / sending time. For example, since 5 minutes is set as a time span in this embodiment, the reference time is 5, 10, 15, etc. If the current time of the network management server is 9:28, the reference time is 25 minutes. If the statistical value is 3 minutes and 10 seconds (converted from the number of time units to nanoseconds, and then converted to minutes and seconds), the actual packet receiving / sending time is 28 minutes and 10 seconds. The complete time (including year, month, day, and hour) can be completed by the upper-layer software.
[0032] By using nanoseconds as the unit for receiving / sending packets, the accuracy of the received / sending packets is improved. In addition, the transmission delay can be accurately calculated and the network performance can be evaluated according to actual needs. Furthermore, by setting the receiving / sending packet time to a relative number of nanosecond-level time units, the occupied message space can be further reduced, thereby improving the efficiency of message transmission. In addition, the minimum unit can be set according to actual needs, which is highly flexible.
[0033] In other optional embodiments, the 5 minutes in the packet receiving / sending time can also be set to 10 minutes or other values, and the space occupied by the number of packets received / sent, the packet receiving / sending time, etc. can be changed. Technical personnel in this field can set it according to actual needs.
[0034] By setting the message format to the above form, the content of the message can be effectively simplified and the size of the message can be reduced, so that the message can be efficiently sent to the network management server to perform statistical calculation of the packet loss rate, thereby improving the efficiency and real-time performance of the packet loss rate calculation.
[0035] In one embodiment, the time synchronization between the device and the server can be ensured by using the Network Time Protocol (NTP) and / or the Precision Time Protocol (PTP), thereby avoiding the situation where the statistical packet loss rate is incorrect due to time asynchrony. Specifically, the network management server can be used as the master clock device, and other devices can be used as slave clock devices. The master clock device sends its high-precision time information to the slave clock device through the PTP protocol, so that the slave clock device adjusts its own time according to the clock deviation between the master and slave clocks, thereby achieving synchronization with the master clock.
[0036] In one embodiment, every 512 streams (or messages) may be grouped into one packet and transmitted simultaneously, which can further improve the transmission efficiency. The specific format is shown in Table 2: Table 2
[0037] It can be seen from Table 2 that when the number of flows is less than 512, it can be padded with 0.
[0038] It should be noted that the packet sending time in Table 1 refers to the packet sending time of the packet composed of 512 streams, and the packet receiving / sending time refers to the packet receiving / sending time corresponding to each message. Therefore, when the 512 streams are not combined into one packet and sent simultaneously, the packet sending time may not be set in the message (no space is reserved), thereby reducing the space occupied by the message accordingly. These technical personnel in this field can set it according to actual needs.
[0039] Among them, the packet sending time in the above message format is the same as the packet receiving / sending time, and does not record the year, month, day and time, but only records the minutes and seconds, and also uses 5 minutes as a statistical span, so it can also reduce the volume of the occupied message, so that the message content is concise and the volume is small, thereby making the message transmission efficient. Similarly, those skilled in the art can set the value of the time span of the packet sending time according to actual needs, which does not limit the present invention.
[0040] Specifically, the result of message parsing is as follows: Figure 3 As shown. Figure 3In the , rcv_snd_packets indicates the number of packets received / sent in the message, type indicates the type in the message, report_ip indicates the IP address corresponding to the device, flow_mon_id_ext indicates the device id in the message, flow_mon_id indicates the flow id in the message, and send_time indicates the packet sending time in the message. Figure 3 It can intuitively display the device's receiving / sending time and the number of received / sending packets and other information.
[0041] Furthermore, it is determined whether each byte data in the parsed message meets the requirements of the above-mentioned message format. If not, it indicates that the device has an error log or the data is incomplete, and the message is discarded; if it meets, it is determined whether the message is valid according to the preset conditions. If not, it is discarded; if valid, the basic traffic data obtained by parsing is stored in the database.
[0042] Specifically, when the network management server receives a message sent by the first device, but does not receive a message sent by the second device within a time interval of 5 minutes, it indicates that the message sent by the first device is an invalid message (the packet loss rate cannot be calculated based on the message sent by the first device alone), and it should be discarded; if the message sent by the second device is received within a time interval of 5 minutes, the basic traffic data obtained after parsing is stored in the database. Similarly, when a message sent by the second device is received, but there is no match to the message sent by the first device in the database, or the message sent by the first device is not received within 5 minutes, the message sent by the second device is discarded. By discarding invalid messages, the integrity and accuracy of the data are ensured, and incorrect packet loss rates are avoided, thereby improving the accuracy of statistical packet loss rates.
[0043] S103: Determine a packet loss rate according to the basic traffic data.
[0044] In one embodiment, according to the flow id and type in the message, data with the same flow (same flow id), corresponding type (000 corresponds to 010, 001 corresponds to 011) and a time interval within a preset value is determined. Generally speaking, they appear in pairs, one of which is the sent data and the other is the received data. If there is only received data or only sent data, these data do not participate in the calculation of the packet loss rate. For example, in the process of a first device sending data to a second device, the first device sends a message at a certain moment and informs the network management server that it has sent the message. After the second device receives the message sent by the first device, due to some reasons (such as network disconnection, network freeze, etc.), it does not inform the network management server that it has received the message within the time interval of the preset value. At this time, the message sent by the first device to the network management server is an invalid message.
[0045] In one embodiment, the preset value is related to the span time in the packet receiving / sending time, and specifically, the preset value is 5 minutes.
[0046] By matching the data in the database, it is avoided that the packet loss rate is calculated by mistake for data of different streams, types that do not correspond or data that are not in the same time span, thereby avoiding obtaining incorrect packet loss rate and improving the accuracy of calculating the packet loss rate.
[0047] Furthermore, based on the matched data, the packet loss rate is calculated and counted. Specifically, the packet loss rate calculation formula is as follows: Packet loss rate = (total number of messages sent by the first device - total number of messages received by the second device) / total number of messages sent by the first device.
[0048] It can be understood that, in the above formula, the total number of messages sent by the first device refers to the number of messages sent by the first device to the second device (which can be known through the messages sent by the first device to the network management server), and the total number of messages received by the second device refers to the number of messages sent by the first device received by the second device (which can be known through the messages sent by the second device to the network management server).
[0049] In one embodiment, the packet loss rate statistics are saved and displayed. Specifically, the packet loss rate between the first device and the second device is as follows: Figure 4 shown. Figure 4 The packet loss of different flows between the first device and the second device at different time points is intuitively displayed.
[0050] In summary, the method of the present invention obtains the packet loss rate between the first device and the second device by statistically calculating from the messages sent by the first device and the second device, thereby achieving packet loss rate statistics on behalf of the device, reducing the complexity of the device, and thus improving the performance of the device. In addition, since the messages sent by the first device and the second device only contain basic traffic data, the content is concise and the volume is small, the efficiency of the obtained packet loss rate can be improved, and the real-time performance is high. In addition, when the packet loss rate is statistically calculated, only the data that completes the data matching can be calculated, avoiding obtaining an incorrect packet loss rate, thereby improving the accuracy of the calculated packet loss rate.
[0051] In another embodiment, the method of the present invention can also be Figure 2 In the process of judging whether the message is valid, if the message is invalid, the message is discarded and the received message is continued to be parsed; if the message is valid, the basic flow data obtained by parsing is saved in the database.
[0052] It is understandable that the steps of the above method are divided only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps as long as they include the same logical relationship.
[0053] In the description of this specification, “plurality” means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0054] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A packet loss rate statistics method based on Telemetry, applied to a network management server, characterized in that: include: Receiving messages sent by the first device and the second device; Parsing the message according to a preset message format, judging whether the parsed message is valid according to preset conditions, and if valid, saving basic traffic data; A packet loss rate is determined according to the basic traffic data, where the packet loss rate is used to characterize a packet loss situation between the first device and the second device.
2. The packet loss rate statistics method based on Telemetry according to claim 1 is characterized in that: Also includes: Set the Telemetry configuration corresponding to the first device and the second device, and the Telemetry configuration includes an IP address and a port number.
3. The packet loss rate statistics method based on Telemetry according to claim 1 is characterized in that: The message format includes: device id, flow id, type, number of received / sent packets and time of received / sent packets, wherein the time of received / sent packets is a relative time unit number in nanosecond level.
4. The packet loss rate statistics method based on Telemetry according to claim 3 is characterized in that: The types include statistics of sent uncolored packets, statistics of sent colored packets, statistics of received uncolored packets, and statistics of received colored packets.
5. The packet loss rate statistics method based on Telemetry according to claim 3 is characterized in that: The message format also includes a packet sending time, and the packet sending time is integrated with a reference time to determine the packet sending time of the current data packet.
6. The packet loss rate statistics method based on Telemetry according to claim 3 is characterized in that: Determining the packet loss rate according to the basic traffic data includes: matching basic traffic data with the same flow, corresponding type and time interval within a preset value, and calculating the packet loss rate according to the matched basic traffic data.
7. The packet loss rate statistics method based on Telemetry according to claim 6, characterized in that: The preset value is 5 minutes.
8. The packet loss rate statistics method based on Telemetry according to claim 6, characterized in that: The packet loss rate is calculated according to the matched basic traffic data, including: calculating the difference between the total number of messages sent by the first device and the total number of messages received by the second device; and obtaining the packet loss rate according to the ratio of the difference to the total number of messages sent by the first device.
9. The packet loss rate statistics method based on Telemetry according to claim 1, characterized in that: The preset condition is: receiving the message sent by the first device and the message sent by the second device within a time interval of a preset value.
Citation Information
Patent Citations
Method for measuring downlink packet loss rate of access link of broadband network user
CN102868576A
Packet loss data measurement method, system and related equipment
CN115643191A