Packet loss detection method and apparatus for messages

By decrypting the encrypted message sequence number of audio and video applications and utilizing the OTP encryption characteristics and the increasing sequence number pattern, the plaintext sequence number is calculated to detect the packet loss rate. This solves the accuracy problem of packet loss rate detection in encrypted audio and video applications and achieves efficient packet loss rate detection.

WO2025260803A1PCT designated stage Publication Date: 2025-12-26HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/078315
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-17
Filing Date
2025-02-20
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

Existing packet loss detection methods cannot effectively detect packet loss rates in encrypted audio and video applications, especially in online audio and video conferencing, where accurate packet loss rate calculations cannot be performed directly based on ciphertext sequence numbers.

Method used

By obtaining the ciphertext sequence number of encrypted messages from audio and video applications, and utilizing the characteristics of OTP encryption and the increasing pattern of message sequence numbers, the plaintext sequence number is decrypted. The packet loss rate is then calculated based on the plaintext sequence number, and QoS strategies are combined to improve the accuracy and robustness of detection.

Benefits of technology

It achieves accurate and robust detection of packet loss rate for encrypted audio and video application data streams, is applicable to various network systems, and improves the accuracy and efficiency of packet loss rate detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025078315_26122025_PF_FP_ABST
    Figure CN2025078315_26122025_PF_FP_ABST
Patent Text Reader

Abstract

A packet loss detection method and apparatus for messages, which method and apparatus relate to the technical field of communications, and are used for measuring the packet loss rate of an encrypted data stream of an audio and video application. The method comprises: acquiring a plurality of messages of a first data stream of an audio and video application, wherein each of the plurality of messages is encrypted by means of a one-time pad (OTP); on the basis of a serial number position of each message in the first data stream, acquiring a ciphertext serial number of each of the plurality of messages, so as to obtain a plurality of ciphertext serial numbers; on the basis of an increment pattern for the serial numbers of the messages of the first data stream, and values of ciphertext serial numbers of a plurality of groups of two adjacent messages among the plurality of messages, decrypting the plurality of ciphertext serial numbers, so as to obtain a plurality of plaintext serial numbers corresponding to the plurality of messages; and on the basis of the plurality of plaintext serial numbers, determining the packet loss rate of the first data stream.
Need to check novelty before this filing date? Find Prior Art

Description

Packet loss detection method and device

[0001] The present application claims priority from the Chinese patent application No. 202410784208.0 filed on June 17, 2024, and entitled "Packet loss detection method and device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of communication technology, and in particular to a packet loss detection method and device. BACKGROUND

[0003] In a packet switching network, a data flow is a series of packets from a source computer to a destination, which can be another host, a multicast group or a broadcast domain. During the transmission of the data flow, part of the packets of the data flow will be lost due to various factors, and this phenomenon of part of the packets being lost is called packet loss. Packet loss rate can be used to describe the severity of packet loss, and is an important reference index for network operation and maintenance personnel to locate network faults, which can usually be detected based on the sequence numbers in the packets of the same data flow.

[0004] In addition, with the rapid development of communication technology, online audio and video conferencing has become a major form of office work. Online audio and video conferencing is an efficient, convenient and low-cost conference form based on cloud computing technology, and users create and join a conference through a conference application to realize data synchronization sharing between multiple users through the conference. Currently, some conference applications encrypt the packets of the data flow, so that the sequence numbers in the packets are ciphertext sequence numbers, which causes the network device receiving the data flow to be unable to directly detect packet loss based on the ciphertext sequence numbers in the packets. SUMMARY

[0005] The present application provides a packet loss detection method and device for detecting the packet loss rate of the data flow of an encrypted audio and video application.

[0006] To achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions:

[0007] In a first aspect, a packet loss detection method is provided. The method comprises: obtaining a plurality of packets of a first data stream of an audio / video application, each packet of the plurality of packets being encrypted by an OTP; obtaining a plurality of ciphertext sequence numbers of the plurality of packets according to sequence number positions of the packets in the first data stream; decrypting the plurality of ciphertext sequence numbers according to an increment rule of the sequence numbers of the packets in the first data stream and values of the ciphertext sequence numbers of a plurality of groups of adjacent two packets in the plurality of packets, to obtain a plurality of plaintext sequence numbers corresponding to the plurality of packets; and determining a packet loss rate of the first data stream according to the plurality of plaintext sequence numbers. Optionally, the audio / video application is a conference application, and the first data stream is any data stream of the conference application.

[0008] In the above technical solution, the plurality of packets of the first data stream of the audio / video application are obtained, each packet of the plurality of packets is encrypted by the OTP, and the plurality of ciphertext sequence numbers corresponding to the plurality of packets are obtained according to the sequence number positions of the packets in the first data stream and are decrypted to obtain the plurality of plaintext sequence numbers corresponding to the plurality of packets. Then, the packet loss rate of the first data stream is determined based on the plurality of plaintext sequence numbers, and the packet loss rate of the encrypted first data stream of the audio / video application can be detected.

[0009] As a possible implementation, the decrypting the plurality of ciphertext sequence numbers according to the increment rule of the sequence numbers of the packets in the first data stream and the values of the ciphertext sequence numbers of the plurality of groups of adjacent two packets in the plurality of packets to obtain the plurality of plaintext sequence numbers corresponding to the plurality of packets comprises: determining a key of the first data stream according to the increment rule of the sequence numbers of the packets in the first data stream and the values of the ciphertext sequence numbers of the plurality of groups of adjacent two packets in the plurality of packets, wherein the key comprises a plurality of bits, and the values of the plurality of bits are determined by values of bits that have bit flips in the values of the ciphertext sequence numbers of the plurality of groups of adjacent two packets; and decrypting the plurality of ciphertext sequence numbers according to the key to obtain the plurality of plaintext sequence numbers corresponding to the plurality of packets. Optionally, the increment rule of the sequence numbers of the packets is that the sequence numbers of the packets are incremented by 1. In this implementation, an implementation of decrypting the plurality of ciphertext sequence numbers corresponding to the plurality of packets is provided. Then, when the plurality of plaintext sequence numbers corresponding to the plurality of packets are obtained by decryption, the packet loss rate of the first data stream is determined based on the plurality of plaintext sequence numbers, and the packet loss rate of the encrypted first data stream of the audio / video application can be detected.

[0010] As a possible implementation manner, the determining the packet loss rate of the first data stream according to the plurality of plaintext sequence numbers comprises: determining a QoS policy corresponding to the first data stream according to the plurality of plaintext sequence numbers and the receiving time of the plurality of messages; and determining the packet loss rate of the first data stream according to the plurality of plaintext sequence numbers and the QoS policy. In this implementation manner, when different audio and video applications adopt different QoS policies, the QoS policy corresponding to the first data stream can be determined according to the plurality of plaintext sequence numbers and the receiving time of the plurality of messages, and the packet loss rate of the first data stream under the corresponding QoS policy can be determined, thereby improving the robustness and accuracy of packet loss rate detection.

[0011] As a possible implementation manner, if the interval between the receiving time of the messages corresponding to any two plaintext sequence numbers satisfying the message sequence number increasing rule in the plurality of plaintext sequence numbers is less than a preset interval, the first data stream corresponds to a QoS policy of active disorder; or, if the redundancy of one or more plaintext sequence numbers located in a preset time window in the plurality of plaintext sequence numbers is greater than a preset redundancy in the ordering according to the receiving time of the plurality of messages, the first data stream corresponds to a QoS policy of message redundancy. In this implementation manner, several ways of determining the QoS policy corresponding to the first data stream are provided, so that after the corresponding QoS policy is determined, the packet loss rate of the first data stream is determined based on the plurality of plaintext sequence numbers and the QoS policy, thereby improving the accuracy of packet loss rate detection.

[0012] As a possible implementation manner, the method further comprises: obtaining data of the first N bytes in the payload of each message in the plurality of messages, N being an integer greater than or equal to 1; and determining the sequence number position according to the data of the first N bytes corresponding to at least two messages in the plurality of messages. In this implementation manner, a way of determining the sequence number position in an online manner is provided, in which the network device can determine the sequence number position according to the data of the first N bytes corresponding to at least two messages, thereby ensuring that the network device can accurately obtain the ciphertext sequence number in the message according to the sequence number position.

[0013] As a possible implementation manner, the determining the sequence number position according to the data of the first N bytes corresponding to at least two messages in the plurality of messages comprises: when the data of the first byte position in the data of the first N bytes corresponding to any adjacent two messages in the at least two messages satisfies a preset condition, determining the first byte position as the sequence number position; wherein the data of the first byte position in the data of the first N bytes corresponding to the adjacent two messages are first data and second data respectively, and the first data and the second data satisfying the preset condition comprises: the result of the exclusive or operation of the first data and the second data being equal to 2 P-1, P is a positive integer. In this implementation, the network device determines the first byte position of the first data or the second data as the sequence number position by determining that the first data and the second data satisfy the preset condition, so as to ensure that the network device can accurately obtain the ciphertext sequence number in the message according to the sequence number position.

[0014] As a possible implementation, N is greater than or equal to 12 and less than or equal to 200, for example, N = 60. In this implementation, by reasonably setting the length of the data of the first N bytes obtained by the network device, the data amount processed by the network device can be reduced as much as possible while ensuring that the network device can obtain the sequence number of the message, and the processing efficiency is improved.

[0015] As a possible implementation, the length of the field in which the ciphertext sequence number is located is two bytes. In this implementation, the network device can reasonably determine the length of the key according to the length of the field in which the ciphertext sequence number is located, so as to reduce the data amount processed by the network device as much as possible and improve the processing efficiency.

[0016] As a possible implementation, the method for obtaining the plurality of messages of the first data stream of the audio / video application comprises: obtaining a plurality of messages of the audio / video application, wherein the plurality of messages belong to at least one data stream respectively; extracting feature information of each message in the plurality of messages to obtain a plurality of feature information corresponding to the plurality of messages; and determining a plurality of messages belonging to the first data stream from the plurality of messages according to the plurality of feature information, wherein the plurality of messages belonging to the first data stream have the same feature information. In this implementation, the network device can group the messages of different data streams of the audio / video application to determine the plurality of messages belonging to the first data stream.

[0017] In a second aspect, a message packet loss detection device is provided, which comprises: a receiving unit configured to obtain a plurality of messages of a first data stream of an audio / video application, wherein each message in the plurality of messages is encrypted by using an OTP (One-Time Password); and a processing unit configured to obtain a ciphertext sequence number of each message in the plurality of messages according to a sequence number position of the message in the first data stream, so as to obtain a plurality of ciphertext sequence numbers; the processing unit is further configured to decrypt the plurality of ciphertext sequence numbers according to a sequence number increment rule of the message in the first data stream and values of the ciphertext sequence numbers of a plurality of groups of adjacent two messages in the plurality of messages, so as to obtain a plurality of plaintext sequence numbers corresponding to the plurality of messages; and the processing unit is further configured to determine a packet loss rate of the first data stream according to the plurality of plaintext sequence numbers. Optionally, the length of the field in which the ciphertext sequence number is located is two bytes.

[0018] As a possible implementation manner, the processing unit is further configured to: determine a key of the first data stream according to the increment rule of the packet sequence numbers of the first data stream and values of the ciphertext sequence numbers of the multiple groups of adjacent two packets in the multiple packets, wherein the key comprises multiple bits, and values of the multiple bits are determined by values of bit positions at which bit flips occur in the values of the ciphertext sequence numbers of the multiple groups of adjacent two packets; and decrypt the multiple ciphertext sequence numbers according to the key to obtain multiple plaintext sequence numbers corresponding to the multiple packets.

[0019] As a possible implementation manner, the processing unit is further configured to: determine a quality of service (QoS) policy corresponding to the first data stream according to the multiple plaintext sequence numbers and receiving times of the multiple packets; and determine a packet loss rate of the first data stream according to the multiple plaintext sequence numbers and the QoS policy.

[0020] As a possible implementation manner, if there exist any two plaintext sequence numbers in the multiple plaintext sequence numbers corresponding to packets whose receiving times have an interval smaller than a preset interval, the first data stream corresponds to a QoS policy of active disorder; or, if there exist one or more plaintext sequence numbers in the multiple plaintext sequence numbers that are located within a preset time window and have a redundancy greater than a preset redundancy in an order according to the receiving times of the multiple packets, the first data stream corresponds to a QoS policy of packet redundancy.

[0021] As a possible implementation manner, the processing unit is further configured to: obtain data of the first N bytes in a payload of each packet in the multiple packets, N being an integer greater than or equal to 1; and determine the sequence number position according to the data of the first N bytes corresponding to at least two packets in the multiple packets.

[0022] As a possible implementation manner, the processing unit is further configured to: when data of a first byte position in the data of the first N bytes corresponding to any two adjacent packets in the at least two packets satisfies a preset condition, determine the first byte position as the sequence number position; wherein the data of the first byte position in the data of the first N bytes corresponding to the two adjacent packets are first data and second data respectively, and the first data and the second data satisfy the preset condition, which includes that a result of an exclusive or operation of the first data and the second data is equal to 2 P -1, and P is a positive integer.

[0023] As a possible implementation manner, N is greater than or equal to 12 and smaller than or equal to 200, for example, N = 60.

[0024] As a possible implementation manner,

[0025] As a possible implementation manner, the receiving unit is further configured to acquire a plurality of packets of the audio / video application, the plurality of packets belonging to at least one data stream respectively; the processing unit is further configured to extract feature information of each packet in the plurality of packets to obtain a plurality of feature information corresponding to the plurality of packets; and the processing unit is further configured to determine, according to the plurality of feature information, a plurality of packets belonging to the first data stream from the plurality of packets, the plurality of packets belonging to the first data stream having the same feature information.

[0026] In another aspect of the present application, a packet loss detection apparatus is provided, which comprises a processor and a memory, the memory storing instructions which, when executed by the processor, cause the apparatus to perform the packet loss detection method provided in the first aspect or any possible implementation manner of the first aspect.

[0027] In another aspect of the present application, a chip is provided, which comprises a processor and an interface circuit, the processor and the interface circuit being configured to support the chip to perform the packet loss detection method provided in the first aspect or any possible implementation manner of the first aspect.

[0028] In another aspect of the present application, a computer readable storage medium is provided, which stores a computer program or instructions, when the computer program or instructions are executed, the packet loss detection method provided in the first aspect or any possible implementation manner of the first aspect is implemented.

[0029] In another aspect of the present application, a computer program product is provided, which comprises a computer program (or code, or instructions), when the computer program is executed, the computer program causes a computer to perform the packet loss detection method provided in the first aspect or any possible implementation manner of the first aspect.

[0030] It can be understood that the packet loss detection apparatus, the chip, the computer readable storage medium and the computer program product provided above can achieve the beneficial effects corresponding to the beneficial effects of the packet loss detection method provided above, which will not be described herein again. BRIEF DESCRIPTION OF DRAWINGS

[0031] FIG. 1 is a schematic diagram of determining a packet loss rate through passive single-end measurement according to an embodiment of the present application;

[0032] FIG. 2 is a schematic diagram of packet loss according to an embodiment of the present application;

[0033] FIG. 3 is a schematic diagram of determining a packet loss rate through passive double-end measurement according to an embodiment of the present application;

[0034] FIG. 4 is a schematic diagram of an exchange for determining a packet loss rate by passive two-end measurement according to an embodiment of the present application;

[0035] FIG. 5 is a schematic diagram of an exchange for determining a packet loss rate by active one-end measurement according to an embodiment of the present application;

[0036] FIG. 6 is a schematic diagram of an exchange for determining a packet loss rate by active two-end measurement according to an embodiment of the present application;

[0037] FIG. 7 is a schematic diagram of a network system according to an embodiment of the present application;

[0038] FIG. 8 is a schematic diagram of a packet loss detection method according to an embodiment of the present application;

[0039] FIG. 9 is a schematic diagram of a packet according to an embodiment of the present application;

[0040] FIG. 10 is a schematic diagram of a packet grouping according to an embodiment of the present application;

[0041] FIG. 11 is a schematic diagram of the first 60 bytes of data in a payload according to an embodiment of the present application;

[0042] FIG. 12 is a schematic diagram of a plaintext sequence number, a key, and a ciphertext sequence number according to an embodiment of the present application;

[0043] FIG. 13 is a schematic diagram of a network device according to an embodiment of the present application;

[0044] FIG. 14 is a schematic diagram of another network device according to an embodiment of the present application;

[0045] FIG. 15 is a schematic diagram of yet another network device according to an embodiment of the present application;

[0046] FIG. 16 is a schematic diagram of another network device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] The making and using of various embodiments are discussed in detail below. It should be appreciated that the specific embodiments discussed are merely illustrative of specific ways to make and use the application and this technology and do not limit the scope of the present application.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0049] Circuits or other components can be described as or said to be "configured to" perform one or more tasks. In this context, "configured to" is used to mean that the circuit / component includes electrical and / or structural changes (e.g., the circuitry being a particular structure, including one or more electrical components in a particular configuration) that, when in operation, enable the circuit / component to perform the task(s). Constructions described as or said to be "configured to" perform task(s) include constructions that are suitable for performing the task(s) without consideration of whether the circuit / component would actually operate to perform an implementation of the task(s) when in operation. In this context, "configured to" can refer to a practical construction that would perform the task(s) in a real-world sense. Constructions described as or said to be "configured to" perform task(s) include constructions that would not perform the task(s) at all, unless the task(s) are performed to enable the circuit / component to operate in a particular manner, even if the task(s) are not actually performed. In this context, "configured to" can refer to an abstract construction that would not perform the task(s) unless the task(s) are performed to enable the circuit / component to operate in the particular manner, even if the task(s) are not actually performed.

[0050] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the present application, "at least one" means one or more, and "multiple" means two or more. The association relationship of the associated objects is described using "and / or", indicating that there are three kinds of relationships, for example, A and / or B, indicating that A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c means a, b, c, a and b, a and c, b and c, a, b and c; where a, b and c can be single or multiple.

[0051] The embodiments of the present application use "first" and "second" and the like to distinguish objects with similar names or functions or roles. Those skilled in the art can understand that "first" and "second" and the like do not limit the number and execution order. The word "coupled" is used to represent electrical connection, including direct connection through wires or connection terminals or indirect connection through other devices. Therefore, "coupled" should be regarded as a broad sense of electronic communication connection.

[0052] It should be noted that in the present application, the words "exemplarily" or "for example" are used to represent an example, illustration or explanation. Any embodiment or design scheme described as "exemplarily" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplarily" or "for example" are used to present the relevant concept in a specific manner.

[0053] Before introducing the embodiments of the present application, first, the related background involved in the present application is introduced and explained.

[0054] In a packet switching network, a data flow is a series of packets from a source computer to a destination, which can be another host, a multicast group or a broadcast domain. During the transmission of the data flow, partial packet loss may occur due to various factors, which is referred to as packet loss. Packet loss rate can be used to describe the severity of packet loss, and is an important reference index for network operation personnel to locate network faults. Packet loss rate can be detected based on sequence numbers in packets of the same data flow.

[0055] In addition, with the rapid development of communication technology, online audio and video conferencing has become a major form of office work. Online audio and video conferencing is an efficient, convenient and low-cost conference form based on cloud computing technology. Users create and join a conference through a conference application to share data synchronization between multiple users through the conference. Currently, some conference applications encrypt the packets of the data flow, so that the sequence numbers in the packets are ciphertext sequence numbers, which makes it impossible for network devices receiving the data flow to directly detect packet loss based on the ciphertext sequence numbers in the packets. The application (or application program) corresponding to the above online audio and video conference can be referred to as an audio and video application, and the conference application is a typical audio and video application.

[0056] Several methods for determining packet loss rate are provided below, but these methods are difficult to detect packet loss rate of the data flow of the conference application, i.e., difficult to be applied to the scene of online audio and video conference, which is described in detail below.

[0057] In a first possible embodiment, a method for determining packet loss rate by a device through passive single-ended measurement is provided. As shown in FIG. 1, during the transmission of the data flow, the device receiving the data flow calculates the packet loss rate according to the continuity of the sequence numbers of the received adjacent packets. For example, the device receives a plurality of packets of a data flow in sequence, the sequence numbers of the plurality of packets are 1, 2, 4, 5 and 6 respectively, and the packet with sequence number 3 is not received. The device calculates the packet loss rate according to the maximum sequence number 6 of the plurality of packets and the sequence numbers of the two adjacent packets with sequence number difference greater than 1 (i.e., sequence numbers 2 and 4), and the packet loss rate is equal to (4-2-1) / 6=1 / 6.

[0058] The first embodiment above uses the increasing property of the sequence number of the packet in the data stream to calculate the packet loss rate. However, the conference application will encrypt the packet of the data stream, and the sequence number of the encrypted packet does not have the increasing property, so the packet loss rate cannot be calculated according to the sequence number in the encrypted packet. (a) of FIG. 2 shows a diagram of the sequence number in a plurality of packets before and after encryption, the sequence number of the plurality of packets before encryption is 1, 2, 3, 4, 5, 6, 7, 8, and the sequence number of the plurality of packets after encryption is 3, 0, 1, 6, 7, 4, 5, 10. In addition, when the transmission of the data stream adopts a quality of service (QoS) strategy, such as a QoS strategy using packet redundancy, the packet loss rate calculated by the first embodiment above is not accurate enough. (b) of FIG. 2 shows a diagram of a plurality of packets transmitted using a QoS strategy with packet redundancy, the sequence number of the plurality of packets is 1, 2, 3, 2, 4, 3, 5, 4, 6, 7, 8 in turn, wherein the packet with sequence number 3 in the second transmission has a packet loss.

[0059] In a second possible embodiment, a method for determining the packet loss rate by a device is provided by passively double-end measurement, and the number of colored packets is counted. As shown in FIG. 3, during the transmission of the data stream, the device 1 periodically marks the bit at a specific position in a plurality of packets of the data stream as 0, 1 (for example, 1 represents a colored packet), and the colored packet after coloring reaches the device 2 through the network, and the device 2 periodically counts the number of colored packets, and determines the packet loss rate based on the counted number. For example, the device 1 takes 6 colored packets as a period, and the device 2 counts 5 colored packets, and the packet loss rate is equal to (6-5) / 6 = 1 / 6.

[0060] The second embodiment above needs to be deployed in double ends; in addition, as shown in FIG. 4, for the packet loss detection of the terminal device to the device 1 and the device 2 to the server, the configuration of the terminal device and the server is needed, so it is difficult to implement in actual application.

[0061] In a third possible embodiment, a method for determining the packet loss rate by a device is provided by actively single-end measurement. As shown in FIG. 5, the device 1 sends a plurality of probe packets to the device 2 through the network, and the device 2 returns a response packet to the device 1 when receiving each probe packet, so that the device 1 determines the packet loss rate according to the number of received response packets. For example, the number of probe packets sent by the device 1 is 6, and the number of received response packets is 5, and the packet loss rate is equal to (6-5) / 6 = 1 / 6.

[0062] The third embodiment above is for detecting round-trip packet loss, and cannot reflect one-way packet loss. Moreover, the probe packet and the response packet are not real service flow packets, and the corresponding probe path is different from the real network path of the service flow, so the packet loss of the service flow cannot be accurately reflected. In addition, the probe packet and the response packet belong to additional traffic, and will also have a certain impact on the network.

[0063] In a fourth possible embodiment, a device is provided for determining a packet loss rate by an active two-end measurement method. As shown in FIG. 6, the device 1 sends a plurality of probe packets to the device 2 through the network, the device 2 counts the number of received probe packets, and determines the packet loss rate according to the number of received probe packets. For example, the number of probe packets sent by the device 1 is 6, and the number of probe packets received by the device 2 is 5, so the packet loss rate is equal to (6-5) / 6 = 1 / 6.

[0064] The fourth embodiment above also needs to be deployed at both ends, which is difficult to implement in actual applications. In addition, the probe packet is not a real service flow packet, and the corresponding probe path is different from the real network path of the service flow, so the packet loss of the service flow cannot be accurately reflected, and will also have a certain impact on the network.

[0065] Therefore, an embodiment of the present application provides a packet loss detection method, which can be used to obtain a plurality of packets of a data stream of an audio / video application, decrypt a plurality of ciphertext sequence numbers corresponding to the plurality of packets to obtain a plurality of plaintext sequence numbers corresponding to the plurality of packets, and determine a packet loss rate of the data stream based on the plurality of plaintext sequence numbers. That is, the method can realize detection of the packet loss rate of the encrypted data stream of the audio / video application, and can improve the accuracy of the packet loss rate detection. The method can be applied to various network systems with network devices, and the network system can also be referred to as a switching network. The structure of the network system will be described below.

[0066] FIG. 7 is a structural schematic diagram of a network system provided by an embodiment of the present application, which includes a terminal device 10, a network device 20, and a server 30. The terminal device 10 is connected to the server 30 through the network device 20. The terminal device 10 and the network device 20 are connected through a network, and the network device 10 and the server 30 are also connected through a network. In FIG. 7, only the network between the network device 10 and the server is shown.

[0067] Optionally, the terminal device 10 includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (MID), a camera, a wearable device, a vehicle-mounted device, a virtual reality (VR) device, an augmented reality (AR) device, or a smart robot, etc. Optionally, the network device 20 includes, but is not limited to, an access point (AP), a switch, a router, or a gateway, etc.

[0068] In a possible embodiment, the terminal device 10 sends a data stream to the server 30 through the network device 20, and the server 30 also sends a data stream to the terminal device 10 through the network device 20. For example, a plurality of terminal devices 10 are included in the network system, and a certain terminal device 10 among the plurality of terminal devices 10 sends a data stream to the server 30 through the network device 20, and the server 30 sends the received data stream to another terminal device 10 through the network device 20 to realize data exchange between different terminal devices 10.

[0069] Optionally, the transmitted data stream in the network system is an encrypted data stream. For example, an audio / video application is installed on the terminal device 10, and the terminal device 10 encrypts the packet of the data stream of the audio / video application using a one time pad (OTP) when transmitting the data stream of the audio / video application through the network system. The OTP encryption uses a key with the same length as the plaintext, and only one XOR operation is required for encryption and decryption. Optionally, the audio / video application is an online audio / video application, for example, the audio / video application includes a conference application.

[0070] In the embodiments of the present application, the network device 20 can have the following functions: application identification, feature extraction, packet grouping, sequence number position identification, sequence number decryption, adaptive packet loss calculation, and packet forwarding, etc. on the received plurality of packets. The application identification refers to identifying the application to which the packet belongs, for example, whether it belongs to an audio / video application; the feature extraction refers to extracting the feature information of the packet, for example, the feature information includes a five-tuple; the packet grouping refers to dividing the packets belonging to the same data stream into a group and dividing the packets belonging to different data streams into different groups; the sequence number position identification refers to identifying the position of the sequence number in the packet; the sequence number decryption refers to decrypting the encrypted sequence number in the packet into a plaintext sequence number; the adaptive packet loss calculation refers to adaptively calculating the packet loss rate based on the decrypted plaintext sequence number; and the packet forwarding is used to forward the received packet to the corresponding server or terminal device.

[0071] In actual application, the network system includes one or more terminal devices 10, one or more network devices 20, and one or more servers 30. In FIG. 7, only one terminal device 10, one network device 20, and one server 30 are taken as an example for illustration.

[0072] FIG. 8 is a flowchart of a packet loss detection method provided by an embodiment of the present application. The method is applied to a network device in the network system provided above. The method includes the following steps.

[0073] S201: Obtain a plurality of packets of a first data stream of an audio / video application, each packet in the plurality of packets being encrypted by OTP.

[0074] The audio / video application refers to an application providing online audio / video services. In an example, the audio / video application includes a conference application, or other applications related to online audio / video services, etc. In the embodiment of the present application, the conference application is taken as an example for illustration.

[0075] In addition, the first data stream is a data stream of the audio / video application, and the plurality of packets of the first data stream includes a plurality of packets of the first data stream received by the network device within a time period. Each packet includes a packet header and a payload, and each packet is encrypted by OTP, which means that the payload of each packet is encrypted by OTP.

[0076] Optionally, the plurality of packets are user datagram protocol (UDP) packets or transmission control protocol (TCP) packets. The payload encrypted by OTP refers to the payload of the UDP packet or the payload of the TCP packet. As an example, taking the packet as a UDP packet or a TCP packet, as shown in FIG. 9, the packet includes a packet header and a payload. The packet header includes an Ethernet header, an IP header, and one of a UDP header or a TCP header.

[0077] In actual application, the network device receives packets of different applications sent by different devices. The network device first obtains the packets of the audio / video application from the received packets, and the packets of the audio / video application include the packets of at least one data stream. Then, the network device obtains the plurality of packets of the first data stream from the packets of the audio / video application, and the first data stream is any data stream in the at least one data stream.

[0078] In a possible embodiment, the obtaining the plurality of packets of the first data stream of the audio / video application specifically includes: obtaining the plurality of packets of the audio / video application, the plurality of packets belonging to at least one data stream respectively; extracting feature information of each packet in the plurality of packets to obtain a plurality of feature information corresponding to the plurality of packets; and determining, according to the plurality of feature information, the plurality of packets belonging to the first data stream in the plurality of packets, the plurality of packets belonging to the first data stream having the same feature information.

[0079] In an example, the network device obtains the plurality of packets of the audio / video application from all the received packets through application identification. For example, the network device performs application identification based on a service IP address and a port corresponding to the audio / video application, or based on deep packet inspection (DPI) technology or deep flow inspection (DFI) technology, and the like. The specific process of application identification based on the DPI technology and the DFI technology is described in the related art, and the embodiments of the present application do not make a detailed elaboration.

[0080] Optionally, the feature information includes part or all of a five-tuple of the packet, and the five-tuple includes a source IP address, a source port, a transmission protocol, a destination IP address, and a destination port. Alternatively, the feature information includes flow identification information in the packet, and the flow identification information in each packet can be used to indicate the data stream to which the packet belongs.

[0081] In an example, as shown in FIG. 10, taking the feature information including the five-tuple of the packet as an example, it is assumed that the number of the plurality of packets of the audio / video application obtained by the network device is 10, the network device extracts the five-tuple of each packet in the 10 packets, and the five-tuple of 5 packets in the 10 packets is five-tuple 1, and the five-tuple of the other 5 packets is five-tuple 2, then the 5 packets corresponding to the five-tuple 1 form a group, and the 5 packets corresponding to the five-tuple 2 form another group.

[0082] S202: Obtain the ciphertext sequence number of each packet in the plurality of packets according to the sequence number position of the packet in the first data stream, to obtain a plurality of ciphertext sequence numbers.

[0083] The sequence number of the packet is included in the packet of the first data stream, and the sequence number is located in the payload of the packet, such as the payload of the UDP packet or the TCP packet shown in FIG. 10. The ciphertext sequence number of each packet is obtained by encrypting the plaintext sequence number of the packet using OTP encryption, and the length of the field in which the plaintext sequence number is located is the same as the length of the field in which the ciphertext sequence number is located.

[0084] In addition, the sequence number position is used to indicate a position of a sequence number in a packet of the first data stream. Optionally, the sequence number position is determined in an offline manner, such as, by offline packet analysis, open source application code analysis, and the like to obtain the sequence number position of the packet in the data stream of the audio / video application, and store the sequence number position in the network device. Alternatively, the sequence number position is determined in an online manner, such as, by the network device determining the sequence number position online according to the obtained multiple packets of the first data stream.

[0085] Optionally, in a possible embodiment, determining the sequence number position of the packet in the first data stream includes: obtaining data of the first N bytes in a payload of each of the multiple packets, N being an integer greater than or equal to 1; and determining the sequence number position according to the data of the first N bytes corresponding to at least two of the multiple packets. For example, analyzing whether the data at the same byte position in the data of the first N bytes corresponding to the at least two packets satisfies an exclusive-OR encryption relationship corresponding to OTP encryption.

[0086] In an example, determining the sequence number position according to the data of the first N bytes corresponding to at least two of the multiple packets includes: when the data at a first byte position in the data of the first N bytes corresponding to any two adjacent packets of the at least two packets satisfies a preset condition, determining the first byte position as the sequence number position; wherein the data at the first byte position in the data of the first N bytes corresponding to the two adjacent packets are first data and second data respectively, and the first data and the second data satisfying the preset condition includes: a result of an exclusive-OR operation of the first data and the second data being equal to 2 P -1, and P is a positive integer.

[0087] Optionally, the N is greater than or equal to 12 and less than or equal to 200, such as N = 60.

[0088] Exemplarily, assuming that the number of the plurality of messages is W, N=60, the length of the field in which the ciphertext sequence number is located is 2 bytes, and the first byte position is the i th byte to the i+1 th byte, the network device acquires data of the first 60 bytes in the payload of each message in the W messages, and a schematic diagram of data of the first 60 bytes in the payload of the W messages is shown in FIG. 11; then, the network device compares the data of the first 60 bytes of two adjacent messages in turn according to the receiving order of the W messages; wherein, if there are first data D1 and second data D2 located at the i th byte to the i+1 th byte in the data of the first 60 bytes of the two adjacent messages, the first data D1 and the second data D2 satisfy the following formula (1), and there are X messages in the W messages that satisfy the preset condition with adjacent messages, it is determined that the i th byte to the i+1 th byte is the sequence number position. In FIG. 11, W=100 (i.e., from message 1 to message 100), and the data of each byte corresponds to two digits as an example.

[0089] In the formula, D1 and D2 represent data of the i th byte to the i+1 th byte in the data of the first 60 bytes of two adjacent messages, represents XOR operation, and P is a positive integer. The value range of i is 1 to 59, and thus the value range of i+1 is 2 to 60.

[0090] Optionally, the number of the at least two messages is greater than or equal to one half of the number of the plurality of messages. Wherein, if the number of the plurality of messages is W, and the number of the at least two messages is X, X≥W / 2. Exemplarily, W=100, and X=80 or X=70.

[0091] S203: decrypt the plurality of ciphertext sequence numbers according to the message sequence number increment rule of the first data stream and the values of the ciphertext sequence numbers of the plurality of groups of adjacent two messages in the plurality of messages, to obtain a plurality of plaintext sequence numbers corresponding to the plurality of messages.

[0092] Optionally, the message sequence number increment rule of the first data stream is: an increment rule of the plaintext sequence numbers of the messages in the first data stream. For example, the plaintext sequence numbers of the messages in the first data stream increment according to the rule of adding 1. For example, the plaintext sequence numbers of two adjacent messages in the first data stream are j and j+1 respectively, j represents the plaintext sequence number of the former one of the two messages, and j is a natural number.

[0093] In addition, the ciphertext sequence numbers of the messages in the first data stream are obtained by OTP encryption, and the OTP encryption satisfies the feature of XOR encryption, so that the network device analyzes the change relationship of the values of the ciphertext sequence numbers of the plurality of groups of adjacent two messages in the plurality of messages by using the message sequence number increment rule of the first data stream and the feature of the XOR encryption to decrypt.

[0094] Optionally, the characteristics of the XOR encryption include: (1) 0Xor K=K, XOR represents XOR operation, and K represents a key, that is, if the value of a certain bit in the sequence number before encryption is 0, then the value of the bit in the sequence number after encryption is the corresponding key; (2) if the two sequence numbers before encryption are the same, the two sequence numbers after encryption are also the same, and if the two sequence numbers before encryption are different, the two sequence numbers after encryption are also different. Therefore, finding a message whose bit value is 0 in the sequence number before encryption, the value of the bit in the sequence number after encryption of the message is the corresponding key; in addition, the key is identified according to the bit granularity of the sequence number, and the key of the low bit is determined by the flip of the high bit. For example, if the adjacent two bits of the ciphertext sequence numbers of the two adjacent messages are 10 and 01 respectively, then the key corresponding to the latter bit of the two bits is 1.

[0095] In a possible embodiment, S203 includes: determining a key of the first data stream according to the sequence number increment rule of the messages of the first data stream and the values of the ciphertext sequence numbers of the multiple groups of adjacent two messages in the multiple messages; and decrypting the multiple ciphertext sequence numbers according to the key to obtain multiple plaintext sequence numbers corresponding to the multiple messages. The key includes multiple bits, and the values of the multiple bits are determined by the values of the bits that have occurred bit flip in the values of the ciphertext sequence numbers of the multiple groups of adjacent two messages.

[0096] For ease of understanding, as shown in FIG. 12, the following takes an example of the sequence number of each message in the multiple messages including two binary numbers, the multiple plaintext sequence numbers corresponding to the multiple messages being 00, 01, 10 and 11 respectively, the multiple ciphertext sequence numbers being 11, 10, 01 and 00 respectively, and the key during OTP encryption being 11 to illustrate the process of determining the key and decrypting the multiple ciphertext sequence numbers.

[0097] In the multiple ciphertext sequence numbers, the high bit of the second ciphertext sequence number is 1, and the high bit of the third ciphertext sequence number is 0, that is, the high bit has occurred flip. At this time, according to (2) in the characteristics of the XOR encryption, the high bits of the second plaintext sequence number and the third plaintext sequence number will also occur flip in the multiple plaintext sequence numbers, and the flip is caused by the carry of the low bits, so the low bit of the third plaintext sequence number must be 0. According to (1) in the characteristics of the XOR encryption, when the low bit of the third plaintext sequence number is 0, the value of the low bit of the third ciphertext sequence number is the value of the low bit in the key, so the value of the low bit in the key is determined to be 1. Further, when the sequence number includes more bits, the values of the other bits in the key are determined in the above similar manner, so the key is determined.

[0098] Optionally, the length of the field in which the ciphertext serial number (or plaintext serial number) is located is 2 bytes, i.e., the ciphertext serial number (or plaintext serial number) includes 16 bits. In addition, in actual applications, when the values of part of the bits in the key are obtained by decryption, the values of the part of the bits are used to decrypt the ciphertext serial number. For example, the number of the part of the bits is greater than or equal to 4 and less than or equal to 12, and embodiments of the present application do not make specific limitations thereto.

[0099] In actual applications, the network device stores the five-tuple, the data of the first N bytes in the payload, the serial number position in the packet, and the determined key of each packet in the plurality of packets in the form of a flow tag, such as the flow tag shown in Table 1. If the serial number position of the current data flow has been identified, the serial number position is a specific number; if the serial number position of the current data flow has not been identified, other characters can be used to represent it, such as none. Similarly, if the current key has been identified, the key is a specific number; otherwise, other characters are used to represent it, such as none. Optionally, in order to save space, the flow table can be specified to have a certain length, such as a maximum length of 5, i.e., the earliest record is overwritten when more than 5 records are recorded.

[0100] Table 1

[0101] S204: determining the packet loss rate of the first data flow according to the plurality of plaintext serial numbers.

[0102] In a possible embodiment, when the plurality of plaintext serial numbers corresponding to the plurality of packets are determined, the network device determines the packet loss rate of the first data flow according to the continuity of the serial numbers of the adjacent packets received in the plurality of packets. For example, the network device determines the packet loss rate of the first data flow in the manner described in FIG. 1 above.

[0103] Further, the transmission of the first data flow can adopt a certain QoS policy, and at this time, the network device determines the packet loss rate of the first data flow according to the following embodiments. In a possible embodiment, S204 includes: determining the QoS policy corresponding to the first data flow according to the plurality of plaintext serial numbers and the receiving times of the plurality of packets; and determining the packet loss rate of the first data flow according to the plurality of plaintext serial numbers and the QoS policy.

[0104] Optionally, the network device records or counts the occurrence times and receiving times of the packets with different sequence numbers in a period of time or a certain number of packets by using a sliding window, and determines the QoS policy corresponding to the first data flow according to the related information. For example, as shown in Table 2, the network device records the related information of the latest L packets by using a sliding window, the related information includes the plaintext sequence number, occurrence time and receiving time, etc. In Table 2, L=4, the sequence numbers of the L packets are 1 to 4, and the receiving times of the L packets are T1 to T4.

[0105] Table 2 L packets

[0106] In actual application, different audio and video applications may use different QoS policies, such as packet redundancy or active disordering QoS policy, that is, the transmission of the first data flow uses multiple different QoS policies, and the embodiments of the present application do not make specific limitation on the multiple different QoS policies. In the following, only the QoS policy including the active disordering QoS policy and the packet redundancy QoS policy is taken as an example to illustrate the process of determining the QoS policy corresponding to the first data flow.

[0107] In an embodiment, if the interval between the receiving times of the packets corresponding to any two plaintext sequence numbers satisfying the packet sequence number increasing rule in the multiple plaintext sequence numbers is less than a preset interval, the first data flow corresponds to the active disordering QoS policy. For example, the network device receives the sequence numbers of the multiple packets as 1, 2, 3, 5, 6, 4, 7, 8, 9, 10, and the network device records the receiving times and sequence numbers of the latest L (for example, L=4) packets by using a sliding window; when the interval between the receiving times of any two adjacent packets is less than a preset interval (20 ms), for example, the interval between the packet with sequence number 4 and the packet with sequence number 5 is less than 20 ms, it is determined that the first data flow corresponds to the active disordering QoS policy; when the interval between the receiving times of a certain adjacent packet is greater than or equal to the preset interval, for example, the interval between the packet with sequence number 4 and the packet with sequence number 5 is greater than 20 ms, it is determined that the packet with sequence number 4 is lost.

[0108] In another example, in the sorting according to the receiving time of the plurality of messages, if the redundancy of one or more plaintext sequence numbers in the plurality of plaintext sequence numbers located in the preset time window is greater than the preset redundancy, the first data flow corresponds to the QoS policy of message redundancy. For example, the network device receives the sequence numbers of the plurality of messages as 1, 2, 3, 2, 4, 5, 4, 6, 7, and 8, wherein the messages with sequence numbers 2, 3, and 4 are sent twice. In the embodiment of the present application, the network device records the redundancy of the sequence numbers of the messages in real time through a sliding window, and the redundancy can also be referred to as the number of occurrences. For example, the preset redundancy is 1, which can also be referred to as the default redundancy, indicating that the number of occurrences of the message is 1. If the network device detects that the redundancy of a certain message is 2 in the preset time window, it means that the subsequent plurality of messages are sent twice from the current message. Assuming that the sequence numbers and redundancies of the plurality of messages are as shown in Table 3, the QoS policy of message redundancy corresponding to the first data flow is determined according to the sequence numbers and redundancies of the plurality of messages. In Table 3 below, one message with sequence number 3 has a packet loss.

[0109] Table 3

[0110] In a possible embodiment, in order to implement the method described in the embodiments of the present application, as shown in FIG. 13 and FIG. 14, the network device includes the following functions: application identification, feature extraction, message grouping, sequence number position identification, sequence number decryption, adaptive packet loss calculation, and message forwarding. Among them, the application identification can be used to identify the application to which the message belongs, such as whether it belongs to an audio and video application; the feature extraction can be used to extract the feature information of the message, such as the five-tuple; the message grouping can be used to divide the messages belonging to the same data flow into a group, and divide the messages belonging to different data flows into different groups; the sequence number position identification can be used to identify the position of the sequence number in the message; the sequence number decryption can be used to decrypt the encrypted sequence number in the message into a plaintext sequence number; the adaptive packet loss calculation can be used to adaptively calculate the packet loss rate according to a plurality of plaintext sequence numbers; and the message forwarding can be used to forward the received message to the corresponding server or terminal device.

[0111] Optionally, as shown in FIG. 13, the above-mentioned multiple functions are deployed in the forwarding plane of the network device; or as shown in FIG. 14, the above-mentioned application identification, feature extraction and packet forwarding are deployed in the forwarding plane of the network device, and the above-mentioned packet grouping, sequence number position identification, sequence number decryption and packet loss calculation are deployed in the control plane of the network device. The difference between the two deployment manners is that the packet loss calculation and packet forwarding in the first deployment manner are executed in series, which increases the packet forwarding delay, but does not need to send data to the control plane, and can be applied to single-thread forwarding devices such as APs; the packet loss calculation and packet forwarding in the second deployment manner are executed in parallel, which is lower in packet forwarding delay and higher in processing efficiency, and the network device can process multiple data streams simultaneously, and can be applied to multi-thread forwarding devices such as switches. In addition, in the second deployment manner, multiple packets are processed together, for example, the related information of a certain number (for example, 256) of packets is buffered first, and then the number of packet losses of the certain number of packets is calculated at one time.

[0112] In the embodiment of the present application, the network device obtains multiple packets of the first data stream of the audio / video application, each packet of the multiple packets is encrypted by using the OTP, and the network device obtains multiple ciphertext sequence numbers corresponding to the multiple packets according to the sequence number positions of the packets in the first data stream and decrypts to obtain multiple plaintext sequence numbers corresponding to the multiple packets. In this way, the network device determines the packet loss rate of the first data stream based on the multiple plaintext sequence numbers, and then the detection of the packet loss rate of the encrypted first data stream of the audio / video application can be realized. In addition, the QoS strategy corresponding to the first data stream can also be determined, and the packet loss rate is determined according to the multiple plaintext sequence numbers and the QoS strategy. In this way, when different audio / video applications use different QoS strategies, the scheme can improve the accuracy of the packet loss rate detection, thereby having good robustness. In this way, after the packet loss rate is determined, the network operation and maintenance personnel can timely and accurately locate the network fault according to the packet loss rate, and the performance of the network is improved.

[0113] The above mainly introduces the scheme provided by the embodiment of the present application from the perspective of the network device as a whole. It can be understood that the network device includes the corresponding hardware structure and / or software module for executing each function in order to realize the above-mentioned functions. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0114] The embodiments of the present application can divide the function modules of the network device according to the above method examples. For example, each function module can be divided according to each function, or two or more functions can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division manner can be used. The following will be described by taking the division of each function module according to each function as an example.

[0115] In the case of using an integrated unit, FIG. 15 shows a structural schematic diagram of a packet loss detection device involved in the above embodiments. Alternatively, the device is a network device or a chip applied to a network device, and the device includes a receiving unit 301 and a processing unit 302. The receiving unit 301 can be used to support the device to perform part or all of S201 in the above method embodiments. The processing unit 302 is used to support the device to perform one or more of S202-S204 in the above method embodiments. Further, the device further includes a sending unit 303, which can be used to support the device to forward the received packet. All related contents of each step involved in the above method embodiments can be cited to the function description of the corresponding function module, which will not be described herein again.

[0116] On the basis of using hardware, the processing unit 302 in the embodiments of the present application is a processor of the device, the receiving unit 301 is a receiver of the device, and the sending unit 303 is a transmitter of the device. The transmitter is usually integrated with the receiver to serve as a transceiver. The specific transceiver can also be referred to as a communication interface or an interface circuit.

[0117] As shown in FIG. 16, a structural schematic diagram of another packet loss detection device involved in the above embodiments is provided in the embodiments of the present application. The device is a network device or a chip in a network device. The device includes a processor 311, a memory 312, a communication interface 313 and a bus 314. The processor 311, the memory 312 and the communication interface 313 are connected through the bus 314.

[0118] The processor 311 is used to control and manage the actions of the device. In one possible embodiment, the processor 311 can be used to support the device to receive one or more steps of S201-S204 in the above method embodiments and / or other technical processes described herein.

[0119] In the embodiments of the present application, the processor 311 includes a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Alternatively, the processor is a combination of a plurality of computing units, such as one or more microprocessors, a combination of a DSP and a microprocessor, and so on. The bus 314 includes an address bus, a data bus, a control bus, and so on.

[0120] In embodiments of the application, the memory 312 includes volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Nonvolatile memory includes read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), flash memory, or the like. Volatile memory includes random access memory (RAM), which acts as the external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic RAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). It is noted that the memory of the systems and methods described herein is intended to include, without being limited to, these and any other suitable types of memory.

[0121] In another embodiment of the present application, a network system is provided, which includes a terminal device, a network device and a server; wherein the network device is the packet loss detection apparatus provided above, and is configured to perform one or more steps of the method embodiments provided above.

[0122] In yet another aspect of the present application, a chip is provided, which includes a processor and an interface circuit, and the processor and the interface circuit are configured to support the chip to perform one or more steps of the method embodiments provided above.

[0123] It can be understood that all relevant contents of the steps involved in the above method embodiments are incorporated into the embodiments of the packet loss detection apparatus and the embodiments of the network system, and the embodiments of the present application will not be repeated here.

[0124] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be optionally implemented in other manners. For example, the described apparatus embodiments are merely illustrative, and the division of the modules or units can be changed, for example, the division of the modules or units can be combined or integrated into another apparatus, or some features can be ignored or not executed.

[0125] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, located in one place or distributed to multiple different places. Select some or all of the units to achieve the purpose of the embodiment scheme according to the actual needs.

[0126] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a readable storage medium, including: a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and various storage medium that can store program codes. Based on such understanding, the technical scheme of the embodiment of the present application is essentially or says that the part of the prior art or the whole or part of the technical scheme in the form of a software product.

[0127] In another embodiment of the present application, a readable storage medium is also provided, which stores computer execution instructions, and when a device (for example, a single-chip microcomputer, a chip, etc.) or a processor executes the steps in the above method embodiment.

[0128] In still another embodiment of the present application, a computer program product is also provided, which includes computer instructions stored in a readable storage medium; at least one processor of a device reads the computer instructions from the readable storage medium, and the at least one processor executes the computer instructions to make the device execute the steps in the above method embodiment.

[0129] Finally, it should be noted that: the above is merely a specific implementation manner of the present application, but the protection scope of the present application is not limited to this, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for detecting packet loss, characterized in that, The method includes: Acquire multiple messages of the first data stream of the audio / video application, each of the multiple messages being encrypted using a one-time password book (OTP). Based on the sequence number position of the message in the first data stream, the ciphertext sequence number of each message in the plurality of messages is obtained, thereby obtaining a plurality of ciphertext sequence numbers; Based on the increasing sequence number of the first data stream and the values ​​of the ciphertext sequence numbers of multiple adjacent pairs of messages in the multiple messages, the multiple ciphertext sequence numbers are decrypted to obtain the multiple plaintext sequence numbers corresponding to the multiple messages. The packet loss rate of the first data stream is determined based on the plurality of plaintext sequence numbers.

2. The method according to claim 1, characterized in that, The step of decrypting the multiple ciphertext sequence numbers to obtain multiple plaintext sequence numbers corresponding to the multiple messages, based on the increasing sequence number pattern of the first data stream and the values ​​of the ciphertext sequence numbers of multiple adjacent pairs of messages in the multiple messages, includes: Based on the increasing sequence number of the first data stream and the values ​​of the ciphertext sequence numbers of multiple adjacent pairs of messages in the multiple messages, the key of the first data stream is determined. The key includes multiple bits, and the values ​​of the multiple bits are determined by the values ​​of the bits that undergo bit flipping in the values ​​of the ciphertext sequence numbers of the multiple adjacent pairs of messages. The multiple ciphertext sequence numbers are decrypted using the key to obtain the multiple plaintext sequence numbers corresponding to the multiple messages.

3. The method according to claim 1 or 2, characterized in that, Determining the packet loss rate of the first data stream based on the plurality of plaintext sequence numbers includes: Based on the plurality of plaintext sequence numbers and the reception time of the plurality of messages, determine the Quality of Service (QoS) policy corresponding to the first data stream; The packet loss rate of the first data stream is determined based on the plurality of plaintext sequence numbers and the QoS policy.

4. The method according to claim 3, characterized in that, If any two plaintext sequence numbers among the plurality of plaintext sequence numbers satisfy the message sequence number increment rule and the interval between the message reception times is less than a preset interval, then the first data stream corresponds to an active out-of-order QoS policy. or, In the sorting according to the reception time of the multiple messages, if the redundancy of one or more plaintext sequence numbers within a preset time window is greater than the preset redundancy, then the QoS policy for message redundancy in the first data stream is applied.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtain the first N bytes of data from the payload of each of the multiple messages, where N is an integer greater than or equal to 1; The sequence number position is determined based on the first N bytes of data corresponding to at least two of the plurality of messages.

6. The method according to claim 5, characterized in that, Determining the sequence number position based on the first N bytes of data corresponding to at least two of the plurality of messages includes: When the data at the first byte position of the first N bytes of data corresponding to any two adjacent messages in the at least two messages meets the preset condition, the first byte position is determined to be the sequence number position. Wherein, the data at the first byte position of the first N bytes of data corresponding to two adjacent messages are respectively the first data and the second data, and the first data and the second data satisfy the preset condition including: the result of the XOR operation of the first data and the second data is equal to 2. P -1, where P is a positive integer.

7. The method according to claim 5 or 6, characterized in that, The N is greater than or equal to 12 and less than or equal to 200.

8. The method according to claim 7, characterized in that, The value of N is 60.

9. The method according to any one of claims 1-8, characterized in that, The length of the field containing the ciphertext sequence number is two bytes.

10. The method according to any one of claims 1-9, characterized in that, The multiple messages for obtaining the first data stream of the audio / video application include: Obtain multiple messages from the audio / video application, wherein each of the multiple messages belongs to at least one data stream; Extract the feature information of each message from the plurality of messages to obtain the plurality of feature information corresponding to the plurality of messages; Based on the multiple feature information, multiple packets belonging to the first data stream are identified from among the multiple packets, and the multiple packets belonging to the first data stream have the same feature information.

11. A packet loss detection device, characterized in that, The device includes: The receiving unit is used to acquire multiple messages of the first data stream of the audio and video application, wherein each message is encrypted using a one-time password book (OTP). The processing unit is configured to obtain the ciphertext sequence number of each of the plurality of packets based on the sequence number position of the packets in the first data stream, thereby obtaining a plurality of ciphertext sequence numbers; The processing unit is further configured to decrypt the multiple ciphertext sequence numbers according to the increasing pattern of the message sequence number of the first data stream and the values ​​of the ciphertext sequence numbers of multiple adjacent pairs of messages in the multiple messages, so as to obtain multiple plaintext sequence numbers corresponding to the multiple messages. The processing unit is further configured to determine the packet loss rate of the first data stream based on the plurality of plaintext sequence numbers.

12. The apparatus according to claim 11, characterized in that, The processing unit is also used for: Based on the increasing sequence number of the first data stream and the values ​​of the ciphertext sequence numbers of multiple adjacent pairs of messages in the multiple messages, the key of the first data stream is determined. The key includes multiple bits, and the values ​​of the multiple bits are determined by the values ​​of the bits that undergo bit flipping in the values ​​of the ciphertext sequence numbers of the multiple adjacent pairs of messages. The multiple ciphertext sequence numbers are decrypted using the key to obtain the multiple plaintext sequence numbers corresponding to the multiple messages.

13. The apparatus according to claim 11 or 12, characterized in that, The processing unit is also used for: Based on the plurality of plaintext sequence numbers and the reception time of the plurality of messages, determine the Quality of Service (QoS) policy corresponding to the first data stream; The packet loss rate of the first data stream is determined based on the plurality of plaintext sequence numbers and the QoS policy.

14. The apparatus according to claim 13, characterized in that, If any two plaintext sequence numbers among the plurality of plaintext sequence numbers satisfy the message sequence number increment rule and the interval between the message reception times is less than a preset interval, then the first data stream corresponds to an active out-of-order QoS policy. or, In the sorting according to the reception time of the multiple messages, if the redundancy of one or more plaintext sequence numbers within a preset time window is greater than the preset redundancy, then the QoS policy for message redundancy in the first data stream is applied.

15. The apparatus according to any one of claims 11-14, characterized in that, The processing unit is also used for: Obtain the first N bytes of data from the payload of each of the multiple messages, where N is an integer greater than or equal to 1; The sequence number position is determined based on the first N bytes of data corresponding to at least two of the plurality of messages.

16. The apparatus according to claim 15, characterized in that, The processing unit is also used for: When the data at the first byte position of the first N bytes of data corresponding to any two adjacent messages in the at least two messages meets the preset condition, the first byte position is determined to be the sequence number position. Wherein, the data at the first byte position of the first N bytes of data corresponding to two adjacent messages are respectively the first data and the second data, and the first data and the second data satisfy the preset condition including: the result of the XOR operation of the first data and the second data is equal to 2. P -1, where P is a positive integer.

17. The apparatus according to claim 15 or 16, characterized in that, The N is greater than or equal to 12 and less than or equal to 200.

18. The apparatus according to claim 17, characterized in that, The value of N is 60.

19. The apparatus according to any one of claims 11-18, characterized in that, The length of the field containing the ciphertext sequence number is two bytes.

20. The apparatus according to any one of claims 11-19, characterized in that, The receiving unit is further configured to acquire multiple messages from the audio / video application, wherein each of the multiple messages belongs to at least one data stream; The processing unit is further configured to extract feature information of each of the plurality of messages to obtain multiple feature information corresponding to the plurality of messages; The processing unit is further configured to determine, based on the plurality of feature information, a plurality of packets belonging to the first data stream, wherein the plurality of packets belonging to the first data stream have the same feature information.

21. A packet loss detection device, characterized in that, The device includes a processor and a memory, the memory storing instructions that, when executed by the processor, cause the device to perform the method as described in any one of claims 1-10.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on the device, cause the device to perform the method as described in any one of claims 1-10.

23. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a device, causes the device to perform the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Face payment method and system

    CN108510278A

  • Message encryption and decryption method, and network equipment and system

    CN109428867A

  • Message forwarding method and device, equipment and storage medium

    CN116405443A

  • Replay attack processing method and system, electronic equipment and storage medium

    CN117336084A

  • PSN-based RDMA network packet loss detection method and apparatus

    WO2022135542A1