A real-time compression method and system for telemetry data based on in-band network telemetry

By judging the parsing stage in in-band network telemetry and using blocking and Huffman coding technologies, the problem of complex and low efficiency in existing in-band telemetry data compression is solved, and the network can be compressed efficiently without changing the source code of the switch. Status data improves data transmission efficiency.

CN118018615BActive Publication Date: 2024-09-13COMP APPL TECH INST OF CHINA NORTH IND GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410109084.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-25
Publication Date
2024-09-13
Estimated Expiration
2044-01-25

AI Technical Summary

Technical Problem

Existing in-band telemetry data compression methods are complex and inefficient, making it difficult to meet the real-time and efficient requirements of network status monitoring. Especially when the network scale expands, the data packet length exceeds the maximum transmission unit, resulting in reduced network transmission efficiency.

Method used

After the switch receives and parses the network data packet, it determines whether it is in the re-parsing stage, and uses technologies such as blocking and Huffman coding to compress data, reducing the amount of data and improving compression efficiency, avoiding the need to re-encode the switch compiler.

Benefits of technology

It is possible to reduce the amount of telemetry data, simplify the compression and encoding process, improve data transmission efficiency, and reduce the overhead caused by network status monitoring without modifying the switch compiler.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118018615B
    Figure CN118018615B
Patent Text Reader

Abstract

The present invention relates to a real-time compression method and system for telemetry data based on in-band network telemetry. The method comprises: obtaining a network data packet and parsing it to obtain a data packet header, INT data of each node and business data; judging whether it is currently in a re-parsing stage; if not, collecting the network status data of the current node in a first format to form the INT data of the current node; reversely parsing the data packet header, INT data of each node and business data to form a network data packet, and sending the formed network data packet to an input end of the current node; if it is in the re-parsing stage, parsing the INT data of the current node into network status data in a second format; compressing the network status data of the current node in the second format, and using the compressed network status data as the INT data of the current node; reversely parsing the data packet header, INT data of each node and business data to form a network data packet, and sending it to a next-hop node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of in-band network telemetry, and in particular to a real-time compression method and system for telemetry data based on in-band network telemetry. Background Art

[0002] As the scale of the Internet continues to expand, the user base continues to surge, the types of services tend to be differentiated, and the characteristics of network traffic become complex, new challenges have been brought to network management. Real-time, efficient, and fine-grained monitoring of network status, and the realization of in-depth and comprehensive observability of network status have put forward new requirements for network measurement. Traditional network measurement methods have problems such as coarse monitoring granularity and poor real-time performance, which are difficult to meet the needs of network management. In recent years, with the development of programmable data planes, in-band network telemetry (INT) technology has gradually emerged. In-band network telemetry collects network status by inserting metadata in messages through switching nodes. It is a network measurement method that obtains network status with packets. INT can accurately realize real-time monitoring of network status by packet, flow, and path. It inserts metadata at the corresponding position of user data packets through intermediate switching nodes to realize network status data collection function, providing reliable data support for intelligent network management. However, as the network scale increases, when the number of network nodes that a data packet or network traffic passes through exceeds a certain threshold, the length of the data packet will exceed the Maximum Transmission Unit (MTU), and the data used to monitor the network status will increase dramatically, resulting in a significant reduction in network transmission efficiency. Therefore, how to monitor the network status in real time and efficiently, fundamentally reduce the number of nodes reporting INT measurement data, and reduce the overhead generated by network status monitoring, is a key issue that the in-band network telemetry mechanism needs to solve.

[0003] The existing in-band telemetry data compression method needs to modify the compiler of the switch and recompile the compiler, so the method is complicated and the compression efficiency is low. Summary of the invention

[0004] In view of the above analysis, an embodiment of the present invention aims to provide a real-time compression method for telemetry data based on in-band network telemetry, so as to solve the problems of complex compression and low compression efficiency of existing in-band telemetry data.

[0005] On the one hand, an embodiment of the present invention provides a method for real-time compression of telemetry data based on in-band network telemetry, comprising the following steps:

[0006] Obtain network data packets and parse them to obtain the data packet header, INT data of each node, and business data;

[0007] Determine whether the current phase is the re-parsing phase; if not, collect the network status data of the current node in the first format to form the INT data of the current node; reverse parse the data packet header, the INT data of each node and the service data to form a network data packet, and send the formed network data packet to the input end of the current node;

[0008] If it is the re-parsing stage, the INT data of the current node is parsed into the network status data in the second format; the network status data in the second format of the current node is compressed, and the compressed network status data is used as the INT data of the current node; the data packet header, the INT data of each node and the business data are reversely parsed to form a network data packet, which is sent to the next hop node.

[0009] Based on the further improvement of the above method, the second format is a format obtained by dividing each field in the first format into blocks; compressing the network status data of the current node includes:

[0010] Obtain the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node;

[0011] Compare each block of the second format network status data of the current node with the corresponding block in the second format network status data of the previous hop node of the current node, use the compression flag to record whether each block is the same, and delete the same blocks; the remaining blocks and the compression flag constitute the compressed network status data of the current node.

[0012] Based on the further improvement of the above method, each block of the network status data of the current node in the second format is XORed with the block corresponding to the network status data of the previous hop node in the second format of the current node. If the result is 0, the corresponding compression flag position is 0, otherwise it is set to 1.

[0013] Based on the further improvement of the above method, the network status data of the previous hop node of the current node in the second format is obtained according to the INT data of the previous hop node of the current node, including:

[0014] Block each field of the INT data of the first hop node to obtain the network status data of the first hop node in the second format;

[0015] If the previous hop node of the current node is not the first hop node, then:

[0016] The previous hop node from the second hop node to the current node is taken as the current traversal node in sequence, and the network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag in the INT data of the current traversal node, and the block data.

[0017] Based on the further improvement of the above method, the network status data in the second format of the previous hop node of the current traversal node, the compression flag bit in the INT data of the current traversal node and the block data restoration are obtained, including:

[0018] Traverse each compression flag bit in the INT data of the current traversal node in turn. For the i-th flag bit, if it is 0, take the i-th block in the second format of the network status data of the previous hop node of the current traversal node as the i-th data block after the current traversal node is restored; if it is 1, take the frontmost block of the block data of the current traversal node as the i-th data block after the current traversal node is restored, and delete the frontmost block of the block data of the current traversal node;

[0019] The restored data blocks of the current traversal node constitute the network status data of the current traversal node in the second format.

[0020] Based on the further improvement of the above method, a bit in the TOS field of the IPv4 packet header or a bit in the Traffic Class field of the IPv6 packet header in the data packet header is used as a re-parse flag; it is used to determine whether it is the re-parse stage according to the re-parse flag when the node receives the network data packet.

[0021] Based on the further improvement of the above method, the second format is a format obtained by dividing each field in the first format into blocks; compressing the network status data of the current node includes:

[0022] Counting the frequency of each block in the second format of the network status data of the current node, constructing a Huffman tree according to the frequency of each block, and obtaining the code of each block according to the constructed Huffman tree;

[0023] The network status data of the current node in the second format is encoded according to the encoding of each block to obtain the compressed network status data of the current node.

[0024] On the other hand, an embodiment of the present invention provides a telemetry data real-time compression system based on in-band network telemetry, comprising the following modules:

[0025] The data acquisition module is used to acquire network data packets and parse them to obtain the data packet header, INT data of each node, and business data;

[0026] The judgment module is used to determine whether the current stage is the re-parsing stage;

[0027] The initial parsing module is used for collecting the network status data of the current node according to the first format to form the INT data of the current node if it is not the re-parsing stage; reverse parsing the data packet header, the INT data of each node and the service data to form a network data packet, and sending the formed network data packet to the input end of the current node;

[0028] The re-parsing module is used to parse the INT data of the current node into the network status data in the second format if it is in the re-parsing stage; compress the network status data in the second format of the current node and use the compressed network status data as the INT data of the current node; reversely parse the data packet header, the INT data of each node and the business data to form a network data packet, and send it to the next hop node.

[0029] Based on further improvement of the above system, the second format is a format obtained by dividing each field in the first format into blocks; compressing the network status data of the current node includes:

[0030] Obtain the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node;

[0031] Compare each block of the second format network status data of the current node with the corresponding block in the second format network status data of the previous hop node of the current node, use the compression flag to record whether each block is the same, and delete the same blocks; the remaining blocks and the compression flag constitute the compressed network status data of the current node.

[0032] Based on the further improvement of the above system, the network status data of the previous hop node of the current node in the second format is obtained according to the INT data of the previous hop node of the current node, including:

[0033] Block each field of the INT data of the first hop node to obtain the network status data of the first hop node in the second format;

[0034] If the previous hop node of the current node is not the first hop node, then:

[0035] The previous hop node from the second hop node to the current node is taken as the current traversal node in sequence, and the network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag in the INT data of the current traversal node, and the block data.

[0036] Compared with the prior art, the present invention provides a real-time compression method and system for telemetry data based on in-band network telemetry. When the switch receives and parses the network data packet, it first determines whether it is in the re-parse phase. If it is not a re-parse, that is, it is the first parsing, the INT data constituting the current node is collected in the first format, and then the inversely parsed network data packet is sent to the input end of the current node for re-parse. At this time, after receiving the network data packet, the current node determines that it is in the re-parse phase according to the data packet header, parses the INT data of the current node into network status data in the second format, and compresses it. The compressed data is used as the INT data of the current node telemetry. Therefore, there is no need to re-encode the compiler of the switch, which greatly reduces the complexity of the compression coding while reducing the amount of telemetry data, thereby improving the efficiency of data compression.

[0037] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;

[0039] Figure 1 It is a flow chart of a method for real-time compression of telemetry data based on in-band network telemetry according to an embodiment of the present invention;

[0040] Figure 2 A schematic diagram of a network data packet format according to an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of a compression algorithm according to an embodiment of the present invention;

[0042] Figure 4 A schematic diagram of a Huffman tree constructed for an embodiment of the present invention;

[0043] Figure 5 The present invention is a block diagram of a real-time compression system for telemetry data based on in-band network telemetry according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0045] As the number of switch nodes increases, more and more telemetry data is inserted into network data packets, and the length of the data packets will exceed the maximum transmission unit, resulting in a significant reduction in network transmission efficiency. Therefore, it is necessary to reduce the overhead generated by network status monitoring.

[0046] The present invention proposes a real-time encoding method for telemetry data based on programmable switches (Programming Protocol-independent Packet Processors, P4), which realizes in-network line-speed compression of telemetry data and improves the data transmission efficiency of in-band network telemetry technology.

[0047] The built-in properties of P4 mean that when obtaining INT network status, it can only be parsed according to the internal fixed header length format. For example, qdepth_t represents 32 bits, that is, the queue depth of the switch is 32 bits. To obtain the queue depth of the switch, it must be stored in a field with a length of 32 bits; time_t represents 48 bits, so the time must be stored in a 48-bit field. If you want to modify other formats, you need to modify the compiler, which greatly increases the difficulty of telemetry data compression for P4 switches.

[0048] A specific embodiment of the present invention discloses a real-time compression method for telemetry data based on in-band network telemetry, such as Figure 1 As shown, the following steps are included:

[0049] S1. Obtain network data packets and parse them to obtain data packet headers, INT data of each node, and business data;

[0050] S2, determine whether the current stage is re-analysis;

[0051] S3. If not, collect the network status data of the current node in the first format to form the INT data of the current node; reverse parse the data packet header, the INT data of each node and the service data to form a network data packet, and send the formed network data packet to the input end of the current node;

[0052] S4. If it is the re-parsing stage, the INT data of the current node is parsed into the network status data in the second format; the network status data in the second format of the current node is compressed, and the compressed network status data is used as the INT data of the current node; the data packet header, the INT data of each node and the business data are reversely parsed to form a network data packet, and sent to the next hop node.

[0053] It should be noted that the node refers to a programmable switch, the first format is the length of each field originally defined by the programmable switch, and the second format is a format obtained by dividing each field in the first format into blocks. Exemplarily, the first format may be as follows:

[0054]

[0055]

[0056] During implementation, the fields included in the first format and the data collected can be determined according to the telemetry needs. Each field in the first format is divided into blocks to obtain the second format. For example, if the blocks are divided into 8 bits (i.e., 1 byte), the corresponding second format is:

[0057]

[0058] Where compression_slice represents 1 Byte. Since the P4 switch uses Byte as the unit, a 1-Byte bit slice granularity can be used, which has a higher data compression rate than other slice granularities. When implementing, other granularity block sizes can also be used, but they must be multiples of 8 bits.

[0059] Compared with the prior art, the real-time compression method for telemetry data based on in-band network telemetry provided in this embodiment determines whether it is a re-parsing stage after the switch receives and parses the network data packet. If it is not a re-parsing stage, that is, it is the first parsing, the INT data constituting the current node is collected in the first format, and then the inversely parsed network data packet is sent to the input end of the current node for re-parsing. At this time, after receiving the network data packet, the current node determines that it is a re-parsing stage according to the data packet header, parses the INT data of the current node into network status data in the second format, and compresses it, and uses the compressed data as the INT data of the current node telemetry. Therefore, there is no need to re-encode the compiler of the switch, which greatly reduces the complexity of compression coding while reducing the amount of telemetry data, thereby improving the efficiency of data compression.

[0060] During implementation, the source node (first-hop switch node) can be set not to re-parse, retain the original data for reference by subsequent nodes, and other nodes can re-parse and compress the data. Other rules can also be set according to requirements, and the present invention does not limit it. After the reverse parsing and data compression, the terminal node reversely parses the data packet header and the INT data of each node and sends it to the INT server, and reversely parses the data packet header and the service number and sends it to the destination address.

[0061] When implemented, a bit in the TOS field of the IPv4 packet header or a bit in the TrafficClass field of the IPv6 packet header in the packet header is used as the re-parse flag bit, which is used to determine whether it is the re-parse phase according to the re-parse flag bit after the node receives the network data packet. The re-parse flag bit is 0 initially.

[0062] For the source node, the network data packet initially received does not contain INT data, but only the data packet header and business data, such as Figure 2 As shown in (a), the telemetry data of the node is collected according to the existing P4 process, the INT data (INT_Data1) of the node is formed according to the first format, and the INT header (INT_Header) is generated, and the INT data is stacked after the INT header. The INT header can record the number of hops. Then the data packet header, INT header, INT data of the source node and business data are reversely parsed to form a network data packet. At this time, the network data packet contains the data packet header, INT header, INT data of the source node and business data in sequence, as shown in FIG. Figure 2 As shown in (b) in FIG. It should be noted that the INT packet header may be generated or not.

[0063] It should be noted that the reverse analysis is performed at the output end of the switch.

[0064] If the source node is set not to reparse, the reparse flag is written to 0 and the network data packet is sent to the next hop node. If the source node is set to reparse, the reparse flag is written to 1 and the network data packet is sent to the input end of the source node.

[0065] Assuming that the source node does not perform re-parse, when the second-hop node receives the network data packet, it parses the data packet to obtain the data packet header, INT header, INT data of the source node, and business data. Then, the INT data of the current node is collected according to the first format, stacked after the INT data of the source node, and then reverse parsed to form a network data packet. If the second-hop node needs to perform re-parse, the re-parse flag bit is rewritten to 1, and the network data packet is sent to the input end of the second-hop node.

[0066] During implementation, the RECIRCULATE method of the P4 switch is used to resubmit the network data packet, that is, the network data packet is resubmitted to the input end of the second hop node.

[0067] After the second-hop node receives the network data packet, it parses it to obtain the data packet header, INT packet header, INT data of the source node, INT data of the second-hop node and business data. At this time, the INT data of the second-hop node is in the first format. According to the re-parsing flag in the data packet header, it is determined that the current stage is the re-parsing stage. The INT data of the second-hop node is parsed into the network status data in the second format, and then the network status data in the second format is compressed.

[0068] Specifically, the network status data of the current node is compressed, including:

[0069] S401, obtaining the network status data of the previous hop node of the current node in a second format according to the INT data of the previous hop node of the current node;

[0070] S402. Compare each block of the network status data of the current node in the second format with the corresponding block in the network status data of the previous hop node in the second format of the current node, use a compression flag to record whether each block is the same, and delete the same blocks; the remaining blocks and the compression flag constitute the compressed network status data of the current node.

[0071] During implementation, each block of the second format network status data of the current node is XORed with the corresponding block of the second format network status data of the previous hop node of the current node. If the result is 0, the corresponding compression flag position is 0, otherwise it is set to 1.

[0072] Specifically, step S41 obtains the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node, including:

[0073] S4011, dividing each field of the INT data of the first hop node into blocks to obtain network status data of the first hop node in a second format;

[0074] S4012: If the previous hop node of the current node is not the first hop node, then:

[0075] The previous hop node from the second hop node to the current node is taken as the current traversal node in sequence, and the network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag in the INT data of the current traversal node, and the block data.

[0076] During implementation, the INT data of the first hop node is in the first format, so it is necessary to first convert the INT in the first format into the second format to obtain the network status data in the second format. During implementation, the INT data of the first hop node is divided into blocks according to the second format to obtain the network status data in the second format.

[0077] If the current node is the second-hop node, each block of the second-hop node is traversed in turn and compared with the corresponding block in the second format of the network status data of the first-hop node. If they are the same, the compression flag bit corresponding to the block is 0, otherwise, the corresponding compression flag bit is 1, and then the same blocks are deleted, only the different blocks are retained, and the remaining blocks and the compression flag bit are combined to form the compressed network status data of the second-hop node, such as Figure 3 The original INT data of the second hop node is deleted, and the compressed network status data of the second hop node is used as the INT data of the second hop node.

[0078] It should be noted that the length of the compression flag is the same as the number of blocks, and each block corresponds to one bit. During implementation, a variable length field is used to store the remaining blocks. That is, the network status data (INT_Data2) compressed by the second-hop node includes block data (variable_compression_data), a compression flag (compression_flag) and a supplementary field (supp_bit), etc. The supplementary field is used to fill the length of the INT data to an integer multiple of bytes. The data packet header, INT packet header, INT data of the first-hop node (INT_Data1), INT data of the second-hop node (INT_Data2) and business data are then reverse-parsed to form a network data packet, such as Figure 2 As shown in (c), since it is already the re-parsing stage, the network data packet is sent to the next hop node. It should be noted that before sending to the next hop node, the re-parsing flag in the data packet header needs to be set to 0.

[0079] If the previous hop node of the current node is not the first hop node, the INT data from the second hop node to the previous hop node of the current node are all compressed data. Therefore, the previous hop nodes from the second hop node to the current node are taken as the current traversal nodes in turn. The network status data in the second format of the previous hop node of the current traversal node, the compression flag bit in the INT data of the current traversal node, and the block data are restored to obtain the network status data in the second format of the current traversal node, which specifically includes:

[0080] Traverse each compression flag bit in the INT data of the current traversal node in turn. For the i-th flag bit, if it is 0, take the i-th block in the second format of the network status data of the previous hop node of the current traversal node as the i-th data block after the current traversal node is restored; if it is 1, take the frontmost block of the block data of the current traversal node as the i-th data block after the current traversal node is restored, and delete the frontmost block of the block data of the current traversal node;

[0081] The restored data blocks of the current traversal node constitute the network status data of the current traversal node in the second format.

[0082] For example, the current node is the third-hop node. After obtaining the network status data in the second format of the first-hop node, since the INT data of the second hop stores compressed network status data, it is necessary to first restore the network status data in the second format of the second-hop node and then compare it with the network status data in the second format of the third-hop node, so as to achieve compression of the network status data of the third-hop node. During implementation, the second hop node is taken as the current traversal node, the block data (variable_compression_data) and the compression flag (compression_flag) in the INT data are extracted, and each compression flag of the second hop node is traversed in turn. For example, for the first flag, if it is 0, the first block in the second format of the network status data of the first node is extracted as the first block of the second format of the network status data of the second hop node. If the first flag is 1, the frontmost block in the block data (variable_compression_data) of the second hop node, that is, the first block, is used as the first block of the second format of the network status data of the second hop node, and then the first block in the block data (variable_compression_data) is deleted. For the second flag bit, if it is 0, the second block in the second format network status data of the first node is extracted as the second block of the second format network status data of the second hop node; if the second flag bit is 1, the frontmost block in the block data (variable_compression_data) of the second hop node, that is, the first block, is used as the second block of the second format network status data of the second hop node, and then the first block in the block data (variable_compression_data) is deleted, and so on, to obtain n data blocks of the second hop node (assuming that the length of the compression flag bit is n) arranged in sequence to constitute the second format network status data of the second hop node, and then the compressed network status data of the third hop node is obtained according to the process of step S402.

[0083] According to the same process, the second format network status data of the current traversal node can be obtained in sequence, thereby obtaining the second format network status data of the previous hop node of the current node, and then the compressed network status data of the current node is obtained according to the process of step S402.

[0084] Since the data between two adjacent switches has great similarity, by comparing the similarity between the blocks of the network status data of two adjacent switches, the same parts will not be transmitted to the next hop along with the data packet, and only the different parts will be retained, thereby greatly reducing the amount of transmitted data. In order to improve the compression rate of telemetry data, the present invention proposes a method based on bit slicing, which divides the built-in header length of the P4 switch into 1 Byte, and then compresses the data by position according to the compression algorithm, thereby improving the platform portability of the INT data compression method. Without changing the P4 source code, the line speed compression of the data in the network is achieved, reducing the system complexity of INT data compression.

[0085] During implementation, Huffman coding can also be used to compress the network status data of the current node, including:

[0086] S411, counting the frequency of each block in the second format of the network status data of the current node, constructing a Huffman tree according to the frequency of each block, and obtaining a code of each block according to the constructed Huffman tree;

[0087] S412: Encode the network status data of the current node in the second format according to the encoding of each block to obtain compressed network status data of the current node.

[0088] It should be noted that blocks with the same value are the same type of blocks. When implementing, first count the frequency of each block in the second format of the network status data of the current node. For example, if the block 01011010 appears 4 times in the second format of the network status data of the current node, the corresponding frequency is 4, and if the block 01101010 appears 11 times in the second format of the network status data of the current node, the corresponding frequency is 11.

[0089] During implementation, S411 may construct a Huffman tree in the following manner:

[0090] S4111. Each block is regarded as a node, and the nodes are sorted in ascending order of frequency;

[0091] S4112, combining the two nodes with the smallest frequencies to obtain a parent node, where the frequency corresponding to the parent node is the sum of the frequencies of the two nodes;

[0092] S4113. Delete the two nodes with the smallest frequency from the sequence. If the sequence is not empty, insert the parent node into the sorted sequence according to the frequency, and return to step S4112; otherwise, obtain a Huffman tree.

[0093] In the obtained Huffman tree, each leaf node corresponds to a block. Each non-leaf node of the Huffman tree includes two left and right branches, represented by 0 and 1 respectively. The path from the root point of the Huffman tree to each leaf node constitutes the code of each leaf node, that is, the code of the corresponding block.

[0094] Exemplarily, the second format network status data of the current node includes 4 blocks: 10000100, frequency is 15; 01101010, frequency is 11; 01011010, frequency is 4; 11101010, frequency is 3; 01111010, frequency is 2. The constructed Huffman tree is as follows Figure 4 As shown, the code corresponding to block 10000100 is 0, the code corresponding to 01101010 is 11, the code corresponding to block 01011010 is 100, the code corresponding to block 11101010 is 1010, and the code corresponding to block 01111010 is 1011.

[0095] After the encoding of each block is obtained, the second format network status data of the current node is encoded according to the encoding of the block, so as to obtain compressed network status data.

[0096] If the current node's second format network status data is: 10000100 01101010 10000100 11101010

[0101] …

[0102] It can be encoded as 0110100…….

[0103] The encoding corresponding to each block and the data encoded for the second format network status data of the current node are stored as the compressed network status data of the current node, thereby greatly reducing the amount of transmitted data and improving the efficiency of telemetry data transmission.

[0104] When the compressed network status data needs to be decompressed, the data encoded according to the encoding corresponding to each block and the second format network status data can be decoded.

[0105] For example, the code corresponding to block 10000100 is 0, the code corresponding to 01101010 is 11, the code corresponding to block 01011010 is 100, the code corresponding to block 11101010 is 1010, and the code corresponding to block 01111010 is 1011. The encoded data of the second format network status data is 0110100…, and the uncompressed second format network status data can be decoded.

[0106] A specific embodiment of the present invention discloses a real-time compression system for telemetry data based on in-band network telemetry, such as Figure 5 As shown, it includes the following modules:

[0107] The data acquisition module is used to acquire network data packets and parse them to obtain the data packet header, INT data of each node, and business data;

[0108] The judgment module is used to determine whether the current stage is the re-parsing stage;

[0109] The initial parsing module is used for collecting the network status data of the current node according to the first format to form the INT data of the current node if it is not the re-parsing stage; reverse parsing the data packet header, the INT data of each node and the service data to form a network data packet, and sending the formed network data packet to the input end of the current node;

[0110] The re-parsing module is used to parse the INT data of the current node into the network status data in the second format if it is in the re-parsing stage; compress the network status data in the second format of the current node and use the compressed network status data as the INT data of the current node; reversely parse the data packet header, the INT data of each node and the business data to form a network data packet, and send it to the next hop node.

[0111] Preferably, the second format is a format obtained by dividing each field in the first format into blocks; compressing the network status data of the current node includes:

[0112] Obtain the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node;

[0113] Compare each block of the second format network status data of the current node with the corresponding block in the second format network status data of the previous hop node of the current node, use the compression flag to record whether each block is the same, and delete the same blocks; the remaining blocks and the compression flag constitute the compressed network status data of the current node.

[0114] Preferably, obtaining the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node includes:

[0115] Block each field of the INT data of the first hop node to obtain the network status data of the first hop node in the second format;

[0116] If the previous hop node of the current node is not the first hop node, then:

[0117] The previous hop node from the second hop node to the current node is taken as the current traversal node in sequence, and the network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag in the INT data of the current traversal node, and the block data.

[0118] The above method embodiments and system embodiments are based on the same principle, and their related parts can be used for reference, and can achieve the same technical effect. The specific implementation process refers to the above embodiment, which will not be repeated here.

[0119] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0120] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A real-time compression method for telemetry data based on in-band network telemetry, characterized in that: The following steps are involved: Obtain network data packets and parse them to obtain the data packet header, INT data of each node, and business data; Determine whether the current phase is the re-parse phase; if not, collect the network status data of the current node in the first format to form the INT data of the current node; reverse parse the data packet header, the INT data of each node and the service data to form a network data packet, set the re-parse flag in the data packet header, if the current node is a source node, the re-parse flag is set to 0 or 1, if the current node is not a source node, the re-parse flag is set to 1; if the re-parse flag is 1, send the formed network data packet to the input end of the current node, if the re-parse flag is 0, send the formed network data packet to the next hop node; If it is the re-parsing stage, the INT data of the current node is parsed into the network status data of the second format; the network status data of the current node in the second format is compressed, and the compressed network status data is used as the INT data of the current node; the data packet header, the INT data of each node and the business data are reversely parsed to form a network data packet, the re-parsing flag in the data packet header is set to 0, and it is sent to the next hop node; the second format is a format obtained by dividing each field in the first format into blocks according to the preset byte length; Among them, a bit in the data packet header is used as a re-parsing flag, which is used to determine whether it is a re-parsing stage according to the re-parsing flag when the node receives the network data packet; the re-parsing flag value is 0 or 1, wherein 0 means no re-parsing, 1 means re-parsing, and the re-parsing flag is 0 initially.

2. The real-time compression method for telemetry data based on in-band network telemetry according to claim 1 is characterized in that: Compress the network status data of the current node, including: Obtain the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node; Compare each block of the second format network status data of the current node with the corresponding block in the second format network status data of the previous hop node of the current node, use the compression flag to record whether each block is the same, and delete the same blocks; the remaining blocks and the compression flag constitute the compressed network status data of the current node.

3. The real-time compression method for telemetry data based on in-band network telemetry according to claim 2 is characterized in that: XOR each block of the current node's second-format network status data with the corresponding block of the current node's previous-hop node's second-format network status data. If the result is 0, the corresponding compression flag position is 0, otherwise it is set to 1.

4. The real-time compression method for telemetry data based on in-band network telemetry according to claim 2 is characterized in that: The network status data of the previous hop node of the current node in the second format is obtained according to the INT data of the previous hop node of the current node, including: Block each field of the INT data of the first hop node to obtain the network status data of the first hop node in the second format; If the previous hop node of the current node is not the first hop node, then: The previous hop node from the second hop node to the current node is taken as the current traversal node in sequence, and the network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag in the INT data of the current traversal node, and the block data.

5. The real-time compression method for telemetry data based on in-band network telemetry according to claim 4 is characterized in that: The network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag bit in the INT data of the current traversal node, and the block data, including: Traverse each compression flag bit in the INT data of the current traversal node in turn. For the i-th flag bit, if it is 0, take the i-th block in the second format of the network status data of the previous hop node of the current traversal node as the i-th data block after the current traversal node is restored; if it is 1, take the frontmost block of the block data of the current traversal node as the i-th data block after the current traversal node is restored, and delete the frontmost block of the block data of the current traversal node; The restored data blocks of the current traversal node constitute the network status data of the current traversal node in the second format.

6. The real-time compression method for telemetry data based on in-band network telemetry according to claim 1, characterized in that: A bit in the TOS field of the IPv4 packet header or a bit in the Traffic Class field of the IPv6 packet header in the data packet header is used as a re-parse flag; it is used to determine whether it is the re-parse stage based on the re-parse flag when the node receives the network data packet.

7. The real-time compression method for telemetry data based on in-band network telemetry according to claim 1, characterized in that: Compress the network status data of the current node, including: Counting the frequency of each block in the second format of the network status data of the current node, constructing a Huffman tree according to the frequency of each block, and obtaining the code of each block according to the constructed Huffman tree; The network status data of the current node in the second format is encoded according to the encoding of each block to obtain the compressed network status data of the current node.

8. A real-time compression system for telemetry data based on in-band network telemetry, characterized in that: Includes the following modules: The data acquisition module is used to acquire network data packets and parse them to obtain the data packet header, INT data of each node, and business data; The judgment module is used to determine whether the current stage is the re-parsing stage; The initial parsing module is used for collecting the network status data of the current node in the first format to form the INT data of the current node if it is not the re-parsing stage; reverse parsing the data packet header, the INT data of each node and the service data to form a network data packet, setting the re-parsing flag in the data packet header, if the current node is a source node, the re-parsing flag is set to 0 or 1, if the current node is not a source node, the re-parsing flag is set to 1; if the re-parsing flag is 1, the formed network data packet is sent to the input end of the current node, if the re-parsing flag is 0, the formed network data packet is sent to the next hop node; The re-parsing module is used to parse the INT data of the current node into the network status data of the second format if it is in the re-parsing stage; compress the network status data of the second format of the current node, and use the compressed network status data as the INT data of the current node; reversely parse the data packet header, the INT data of each node and the business data to form a network data packet, set the re-parsing flag in the data packet header to 0, and send it to the next hop node; the second format is a format obtained by dividing each field in the first format into blocks according to a preset byte length; Among them, a bit in the data packet header is used as a re-parsing flag, which is used to determine whether it is a re-parsing stage according to the re-parsing flag when the node receives the network data packet; the re-parsing flag value is 0 or 1, wherein 0 means no re-parsing, 1 means re-parsing, and the re-parsing flag is 0 initially.

9. The telemetry data real-time compression system based on in-band network telemetry according to claim 8, characterized in that: The second format is a format obtained by dividing each field in the first format into blocks; Compress the network status data of the current node, including: Obtain the network status data of the previous hop node of the current node in the second format according to the INT data of the previous hop node of the current node; Compare each block of the second format network status data of the current node with the corresponding block in the second format network status data of the previous hop node of the current node, use the compression flag to record whether each block is the same, and delete the same blocks; the remaining blocks and the compression flag constitute the compressed network status data of the current node.

10. The telemetry data real-time compression system based on in-band network telemetry according to claim 9, characterized in that: The network status data of the previous hop node of the current node in the second format is obtained according to the INT data of the previous hop node of the current node, including: Block each field of the INT data of the first hop node to obtain the network status data of the first hop node in the second format; If the previous hop node of the current node is not the first hop node, then: The previous hop node from the second hop node to the current node is taken as the current traversal node in sequence, and the network status data in the second format of the current traversal node is restored according to the network status data in the second format of the previous hop node of the current traversal node, the compression flag in the INT data of the current traversal node, and the block data.