Delay measurement method and related apparatus

Through the data interaction between the kernel module and the forwarding server, the forwarding delay is directly measured, which solves the problems of low efficiency and high cost of delay measurement in the existing technology, and achieves high-precision and low-cost delay measurement, which is suitable for 5G network technology. high stress testing requirements.

WO2024183338A1PCT designated stage expired Publication Date: 2024-09-12CHINA INTERNET NETWORK INFORMATION CENTER
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/133222
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-03
Filing Date
2023-11-22
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

Existing delay measurement methods are inefficient and costly. Especially with the demand for improved delay accuracy in 5G network technology, traditional evaluation software and chartered machine measurement methods have bottlenecks and high costs.

Method used

Through data interaction between the kernel module and the forwarding server, the target test message is sent, the reception time is determined, and the forwarding delay is calculated. This avoids frequent data copies and system calls caused by user mode operation, and reduces measurement costs.

Benefits of technology

It improves the efficiency of delay measurement, reduces measurement costs, and enables high-precision forwarding delay measurement in the kernel state without the need to configure additional hardware equipment. It supports the measurement requirements of high-stress test traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023133222_12092024_PF_FP_ABST
    Figure CN2023133222_12092024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a delay measurement method and a related apparatus. When a forwarding delay is measured, a target test message is sent to a forwarding server by means of a kernel module, and the target test message is then forwarded to the kernel module by means of the forwarding server. Since the target test message comprises a sending time at which the target test message is sent by the kernel module, a receiving time at which the target test message is received may be determined by means of the kernel module, and the forwarding delay may then be determined according to the receiving time and the sending time. On this basis, a measurement of a forwarding delay can be completed by means of data interaction between a kernel module and a forwarding server, without additionally configuring a hardware device, such that the measurement cost is low. Moreover, compared with a delay measurement method in the related art in which evaluation software is run in a user mode, since a kernel module is run in a kernel mode for a measurement of a forwarding delay, the problem of frequently performing data copying and system calling caused by the running in the user mode can be avoided, thereby improving the delay measurement efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

A time delay measurement method and related device Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a delay measurement method and related devices. Background Art

[0002] Latency is the total transmission time for a data frame from its source to its destination. This includes the time it takes for network nodes to process the data frame and the time it takes to propagate through the transmission medium. A data frame can be a message, for example, and a network node can refer to the network devices and programs that process the data frame, such as a DNS forwarding server.

[0003] With the rapid development of network technology, latency accuracy has increased. This is especially true in 5G networks, where latency accuracy has entered the sub-millisecond era, significantly shortening latency compared to 4G networks. Consequently, higher latency requirements are placed on network equipment and applications. Accurate latency measurement is crucial for latency accuracy in practical applications.

[0004] In related technologies, latency measurement is typically performed using evaluation software or hardware devices such as packet generators. However, using evaluation software for measurement suffers from measurement bottlenecks, resulting in low latency measurement efficiency. Using packet generators for measurement requires hardware configuration, resulting in high measurement costs.

[0005] Summary of the Invention

[0006] In order to solve the above technical problems, the present application provides a delay measurement method and related devices, which can complete forwarding delay measurement through data interaction between the kernel module and the forwarding server. The measurement cost is low and the delay measurement efficiency can be improved.

[0007] The embodiments of this application disclose the following technical solutions:

[0008] On the one hand, an embodiment of the present application provides a delay measurement method, characterized in that the method includes:

[0009] Sending a target test message to a forwarding server through a kernel module; the target test message includes a sending time of the target test message sent by the kernel module, and the kernel module runs in kernel state;

[0010] forwarding the target test message to the kernel module through the forwarding server;

[0011] Determining a receiving time of the target test message by the kernel module;

[0012] A forwarding delay is determined by the kernel module according to the receiving time and the sending time.

[0013] On the other hand, an embodiment of the present application provides a delay measurement device, characterized in that the device includes a sending unit, a forwarding unit, and a determining unit:

[0014] The sending unit is configured to send a target test message to a forwarding server through a kernel module; the target test message includes a sending time of the target test message sent by the kernel module, and the kernel module runs in a kernel state;

[0015] The forwarding unit is configured to forward the target test message to the kernel module via the forwarding server;

[0016] The determining unit is configured to determine, through the kernel module, a receiving time of the target test message;

[0017] The determining unit is further configured to determine a forwarding delay through the kernel module according to the receiving time and the sending time.

[0018] In another aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory:

[0019] The memory is used to store program code and transmit the program code to the processor;

[0020] The processor is configured to execute the delay measurement method described above according to the instructions in the program code.

[0021] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the delay measurement method described in the above aspects.

[0022] It can be seen from the above technical solution that when measuring the forwarding delay, the target test message is sent to the forwarding server through the kernel module, and then the target test message is forwarded to the kernel module through the forwarding server. Since the target test message includes the sending time of the target test message sent by the kernel module, the receiving time of the target test message can be determined by the kernel module, and then the forwarding delay is determined based on the receiving time and the sending time. Based on this, the forwarding delay measurement can be completed through the data interaction between the kernel module and the forwarding server, without the need for additional hardware configuration, and the measurement cost is low. At the same time, compared with the delay measurement method in the related art where the evaluation software runs in the user state, since the kernel module runs in the kernel state and is used for forwarding delay measurement, it can avoid problems such as frequent data copying and system calls caused by running in the user state, thereby improving the delay measurement efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] FIG1 is a flow chart of a delay measurement method provided in an embodiment of the present application;

[0024] FIG2 is a structural diagram of a test network topology diagram provided in an embodiment of the present application;

[0025] FIG3 is a timing diagram of a forwarding delay measurement provided in an embodiment of the present application;

[0026] FIG4 is a schematic diagram of a measurement result of a forwarding delay provided in an embodiment of the present application;

[0027] FIG5 is a structural diagram of a delay measurement device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The latency measurement method provided in the embodiments of the present application can be implemented by a computer device, which can be a terminal device or a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, and vehicle-mounted terminals. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this.

[0029] Specifically described by the following examples:

[0030] FIG1 is a flowchart of a latency measurement method provided in an embodiment of the present application, which is illustrated by taking a server as the aforementioned computer device as an example. The method includes:

[0031] S101: Send a target test message to a forwarding server through a kernel module.

[0032] When measuring the forwarding delay, a target test message may be sent to the forwarding server through the kernel module. The target test message may include the sending time of the target test message sent by the kernel module. The kernel module runs in kernel state.

[0033] In actual applications, the target test message's sending time can be determined by a kernel module. Specifically, the kernel module can obtain the time at which the target test message will be sent and fill the target test message's timestamp field with the time as the sending time. After filling the sending time, the target test message can be sent to the forwarding server. For example, the kernel module can perform Base32 encoding on the time at which the target test message will be sent and fill the encoding into the target test message's timestamp field. After the filling is completed, the target test message can also be updated and verified to confirm that the sending time has been successfully filled into the timestamp field. Typically, the timestamp field can be a reserved field to facilitate the kernel module to fill in the sending time.

[0034] It should be noted that this application does not impose any restrictions on the type of forwarding server. For example, the forwarding server may be a DNS forwarding server.

[0035] In order to meet the testing requirements of high-stress test traffic, in one possible implementation, the target test message can be determined as follows: first, the initial test message can be obtained through the kernel module. The initial test message can include a test traffic amplification factor. Then, according to the test traffic amplification factor, the initial test message can be amplified by the kernel module to obtain the target test message. Among them, the test traffic amplification factor can be used to instruct the kernel module to amplify the test traffic by a certain multiple to meet the testing requirements of high-stress test traffic. Based on this, the test traffic amplification factor can be set according to the actual test requirements, thereby determining the target test message that can meet the high-stress test traffic. At the same time, there is no need to add other test hardware equipment. Instead, the test traffic is amplified through the kernel space, which can break through the performance bottleneck of the test software in the relevant technology and save testing costs.

[0036] In actual applications, the kernel module can clone the initial test message according to the test traffic amplification factor, thereby achieving the purpose of amplifying the initial test message and obtaining the target test message. In specific implementation, the eBPF kernel module can be used to capture the initial test message. When it is determined that the test traffic amplification factor is M times, the initial test message can be cloned by cyclically calling the bpf_clone_redirect function, and cloned a total of (M-1) times, so that the target test message is amplified M times compared to the initial test message to meet the test requirements of high-pressure test traffic. It can be seen that the application module can multiply the test traffic of the initial test message received each time by the test traffic amplification factor to obtain the actual test traffic sent to the forwarding server, that is, the test traffic of the target test message, thereby meeting the test requirements of high-pressure test traffic.

[0037] In one possible implementation, a specific implementation method for obtaining an initial test message through a kernel module may include: first, constructing an initial test message through an application module according to the query message format corresponding to the forwarding server, and then obtaining the initial test message from the application module through the kernel module. Among them, the application module and the kernel module can together constitute a test machine for forwarding delay measurement, the kernel module runs in kernel state and is used for forwarding delay measurement, and the application module can run in user state and be used to construct the initial test message. Based on this, the forwarding delay measurement part can be responsible for the kernel module running in kernel state, while the construction of the initial test message is still constructed by the application module running in user state, which can avoid problems such as frequent data copying and system calls caused by running in user state, thereby improving the efficiency of delay measurement. Usually, when constructing the initial test message, the message information can be encoded and processed using the RFC specification to make it compatible with various forwarding servers.

[0038] In actual applications, the test traffic amplification factor can be determined by the application module. Specifically, the application module can perform Base32 encoding on the test traffic amplification factor based on test requirements and then insert the encoded value into the amplification factor field of the initial test message. After this encoding is completed, the initial test message containing the test traffic amplification factor is obtained. In actual measurements, the application module can send the initial test message to the kernel module at a fixed frequency, allowing the kernel module to measure forwarding latency at the fixed frequency.

[0039] S102: Forward the target test message to the kernel module through the forwarding server.

[0040] After the forwarding server receives the target test message sent by the kernel module, the target test message may be forwarded to the kernel module via the forwarding server, so that the kernel module can determine the forwarding delay.

[0041] In practical applications, a forwarding server can parse the target test message to obtain its test traffic identifier. This identifier reflects the test type of the target test message and can be matched with the forwarding server's forwarding rules, allowing the forwarding server to determine which module to forward the target test message to. Furthermore, based on the test traffic identifier and the forwarding server's corresponding forwarding rules, the forwarding server can forward the target test message to the kernel module.

[0042] Typically, the test traffic identifier is determined by parsing the target test message and identifying its suffix field. In actual applications, the suffix fields of the initial test message and the target test message are the same, both of which are determined when the application module constructs the initial test message.

[0043] S103: Determine the receiving time of the target test message through the kernel module.

[0044] S104: Determine the forwarding delay through the kernel module according to the receiving time and the sending time.

[0045] When the kernel module receives the target test message, it can determine the reception time of the target test message. Furthermore, the kernel module can determine the forwarding delay based on the reception time and the transmission time. Based on this, the kernel module can be used to measure the forwarding delay.

[0046] In one possible implementation, a kernel module can determine the difference between the receive and send times as the forwarding delay, thereby measuring the forwarding delay. In practical applications, the kernel module can obtain the send time from the timestamp field of the target test message to facilitate forwarding delay determination.

[0047] It should be noted that in actual applications, module A typically sends a message to forwarding server B, which then forwards the message to module C. Accordingly, forwarding latency is the time difference between the time module A sends the message and the time module C receives the message. However, in this application, by configuring the forwarding server's forwarding rules and the test traffic identifier of the target test message, the aforementioned kernel module is used to both send and receive the target test message. In other words, in this application, module A and module C are identical, simplifying the forwarding latency measurement process.

[0048] As can be seen, the forwarding delay is determined by the kernel module, which runs in kernel mode. To facilitate measurement engineers viewing forwarding delay measurement results, one possible implementation involves storing the forwarding delay in shared memory via the kernel module. This shared memory can be used to store the forwarding delay, and the application module can access the shared memory, allowing the application module to access the shared memory and view the measurement results during the measurement process. After the forwarding delay is stored, the kernel module can delete the target test packet, freeing up computer resources and facilitating the next forwarding delay measurement.

[0049] In actual applications, when a measurement engineer wants to view measurement results, they can initiate a latency acquisition request through the application module. In response to the latency acquisition request, the application module can retrieve the forwarding latency from shared memory. The application module runs in user mode, making it easier for measurement engineers to view measurement results. Since forwarding latency can be measured at a fixed frequency, the forwarding latency can also be stored in a target file within the application module. This target file can be used to store multiple forwarding latency measurements taken at a fixed frequency, making it easier for measurement engineers to view multiple forwarding latency measurements at once.

[0050] It can be seen from the above technical solution that when measuring the forwarding delay, the target test message is sent to the forwarding server through the kernel module, and then the target test message is forwarded to the kernel module through the forwarding server. Since the target test message includes the sending time of the target test message sent by the kernel module, the receiving time of the target test message can be determined by the kernel module, and then the forwarding delay is determined based on the receiving time and the sending time. Based on this, the forwarding delay measurement can be completed through the data interaction between the kernel module and the forwarding server, without the need for additional hardware configuration, and the measurement cost is low. At the same time, compared with the delay measurement method in the related art where the evaluation software runs in the user state, since the kernel module runs in the kernel state and is used for forwarding delay measurement, it can avoid problems such as frequent data copying and system calls caused by running in the user state, thereby improving the delay measurement efficiency.

[0051] For ease of understanding, the embodiment of the present application takes the DNS forwarding server as an example and provides a test network topology diagram as shown in FIG2 , including a test machine and a DNS forwarding server. The test machine may include an application module and a kernel module. Specifically:

[0052] The application module, running in user mode, can construct an initial test message based on the DNS forwarding server query message format. For example, the format of the initial test message can be <prefix>.<test traffic amplification factor>.<timestamp>.<suffix>. The <timestamp> field can be reserved for the kernel module to fill in the target test message send time. For the DNS forwarding server, the <suffix> can be text. For example, the initial test message can be *.M.{000…000}.test, where M is the test traffic amplification factor. In actual applications, the application module can send initial test messages to the kernel module at a fixed frequency, as shown in step 1.

[0053] The kernel module, running in kernel mode, amplifies the initial test message based on the test traffic amplification factor to obtain the target test message and fills the send time in the <timestamp> field. In actual applications, the kernel module can also send the target test message to the DNS forwarding server at a fixed frequency, as shown in step 2.

[0054] The DNS forwarding server can forward the target test message to the kernel module based on the <suffix> text and its corresponding forwarding rules, see step ③.

[0055] Furthermore, when the kernel module receives the target test message, it can obtain the base code of the sending time from the target test message, decode it to determine the sending time T1, and simultaneously obtain the receiving time T2 of the received target test message. Furthermore, the forwarding delay T = T2 - T1 can be calculated.

[0056] In actual applications, the kernel module can store the forwarding delay T in shared memory, and the application module can retrieve the forwarding delay from the shared memory. In other words, after determining the forwarding delay, the forwarding delay measurement results can be viewed through data exchange between the application module and the kernel module (see step 4).

[0057] Correspondingly, the embodiment of the present application further provides a forwarding delay measurement timing diagram as shown in FIG3 , specifically:

[0058] Step 1: The application module can construct an initial test message in the format of <prefix>.<test traffic magnification factor>.<timestamp>.<suffix>, and send the initial test message to the kernel module;

[0059] Step 2: Message cloning can be performed through the kernel module to amplify the test traffic amplification multiple of the initial test message to obtain the target test message;

[0060] Step 3: The Base32 encoding of the sending time can be filled into the <timestamp> field through the application module;

[0061] Step 4: After filling the sending time, the target test message can be obtained through the application module update verification and sent to the DNS forwarding server;

[0062] Step 5: The target test message can be forwarded to the kernel module through the DNS forwarding server response;

[0063] Step 6: The forwarding delay can be determined by the kernel module and stored in the shared memory;

[0064] Step 7: The forwarding delay can be obtained from the shared memory through the application module.

[0065] In actual applications, in order to test the delay measurement effect provided by the embodiment of the present application, five different test traffic groups were constructed, namely 0Gbps, 205Gbps, 5G, 7.5G, and 10G. The forwarding delay was measured using two different byte test messages of 128Bytes and 256Bytes. The measurement results can be seen in Figure 4. It can be seen that with the increase of test traffic, the forwarding delay increases. However, the delay measurement method provided by the embodiment of the present application can support the forwarding delay measurement requirements of high-stress test traffic. At the same time, the measurement accuracy of the forwarding delay can reach the microsecond level, which can better meet the high requirements for forwarding delay measurement under the development of network technology.

[0066] It can be understood that it basically corresponds to the method embodiment, so relevant points can refer to the partial description of the method embodiment.

[0067] FIG5 is a structural diagram of a delay measurement device provided in an embodiment of the present application, wherein the device includes a sending unit 501, a forwarding unit 502, and a determining unit 503.

[0068] The sending unit 501 is configured to send a target test message to a forwarding server through a kernel module; the target test message includes a sending time of the target test message sent by the kernel module, and the kernel module runs in kernel state;

[0069] The forwarding unit 502 is configured to forward the target test message to the kernel module via the forwarding server;

[0070] The determining unit 503 is configured to determine, through the kernel module, a receiving time of the target test message;

[0071] The determining unit 503 is further configured to determine a forwarding delay through the kernel module according to the receiving time and the sending time.

[0072] In a possible implementation, the target test message is determined in the following manner:

[0073] Obtaining an initial test message through the kernel module; the initial test message includes a test traffic amplification factor;

[0074] According to the test traffic amplification factor, the initial test message is amplified by the kernel module to obtain the target test message.

[0075] In a possible implementation, the apparatus further includes a construction unit and an acquisition unit:

[0076] The construction unit is configured to construct the initial test message through an application module according to the query message format corresponding to the forwarding server;

[0077] The acquiring unit is configured to acquire the initial test message from the application module through the kernel module.

[0078] In a possible implementation, the forwarding unit is further configured to:

[0079] Parsing the target test message through the forwarding server to obtain a test flow identifier of the target test message;

[0080] According to the test traffic identifier and the forwarding rule corresponding to the forwarding server, the target test message is forwarded to the kernel module through the forwarding server.

[0081] In a possible implementation, the device further includes a storage unit and a deletion unit:

[0082] The storage unit is configured to store the forwarding delay in a shared memory through the kernel module;

[0083] The deleting unit is configured to delete the target test message through the kernel module after completing the storage of the forwarding delay.

[0084] In a possible implementation, the acquisition unit is further configured to, in response to a delay acquisition request, acquire the forwarding delay from the shared memory through an application module; the application module runs in a user state;

[0085] The storage unit is further configured to store the forwarding delay via a target file in the application module.

[0086] In a possible implementation manner, the determining unit is further configured to:

[0087] The kernel module determines the difference between the receiving time and the sending time as the forwarding delay.

[0088] It can be seen from the above technical solution that when measuring the forwarding delay, the target test message is sent to the forwarding server through the kernel module, and then the target test message is forwarded to the kernel module through the forwarding server. Since the target test message includes the sending time of the target test message sent by the kernel module, the receiving time of the target test message can be determined by the kernel module, and then the forwarding delay is determined based on the receiving time and the sending time. Based on this, the forwarding delay measurement can be completed through the data interaction between the kernel module and the forwarding server, without the need for additional hardware configuration, and the measurement cost is low. At the same time, compared with the delay measurement method in the related art where the evaluation software runs in the user state, since the kernel module runs in the kernel state and is used for forwarding delay measurement, it can avoid problems such as frequent data copying and system calls caused by running in the user state, thereby improving the delay measurement efficiency.

[0089] In another aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory:

[0090] The memory is used to store program code and transmit the program code to the processor;

[0091] The processor is configured to execute the delay measurement method provided in the above embodiment according to the instructions in the program code.

[0092] The computer device may include a terminal device or a server, and the aforementioned delay measurement apparatus may be configured in the computer device.

[0093] On the other hand, an embodiment of the present application further provides a storage medium, which is used to store a computer program, and the computer program is used to execute the delay measurement method provided by the above embodiment.

[0094] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: Read-only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc., various media that can store program codes.

Claims

1. A delay measurement method, characterized in that: The method comprises: Sending a target test message to a forwarding server through a kernel module; the target test message includes a sending time when the kernel module sends the target test message, and the kernel module runs in a kernel state; Forwarding the target test message to the kernel module through the forwarding server; Determining, by means of the kernel module, a receiving time of receiving the target test message; A forwarding delay is determined by the kernel module according to the receiving time and the sending time.

2. The method according to claim 1, characterized in that The target test message is determined in the following manner: Obtaining an initial test message through the kernel module; the initial test message includes a test flow magnification factor; According to the test traffic amplification factor, the initial test message is amplified by the kernel module to obtain the target test message.

3. The method according to claim 2, characterized in that The obtaining of the initial test message through the kernel module includes: According to the query message format corresponding to the forwarding server, construct the initial test message through the application module; The initial test message is obtained from the application module through the kernel module.

4. The method according to claim 1, characterized in that: The forwarding of the target test message to the kernel module through the forwarding server includes: Parsing the target test message through the forwarding server to obtain a test flow identifier of the target test message; According to the test traffic identifier and the forwarding rule corresponding to the forwarding server, the target test message is forwarded to the kernel module through the forwarding server.

5. The method according to claim 1, characterized in that The method further comprises: Storing the forwarding delay in a shared memory through the kernel module; After completing the storage of the forwarding delay, the target test message is deleted through the kernel module.

6. The method according to claim 5, characterized in that The method further comprises: In response to a delay acquisition request, acquiring the forwarding delay from the shared memory through an application module; the application module runs in a user state; The forwarding delay is stored via a target file in the application module.

7. The method according to any one of claims 1 to 6, characterized in that: Determining the forwarding delay by the kernel module according to the receiving time and the sending time includes: The kernel module determines the difference between the receiving time and the sending time as the forwarding delay.

8. A delay measurement device, characterized in that: The device comprises a sending unit, a forwarding unit and a determining unit: The sending unit is used to send a target test message to the forwarding server through the kernel module; the target test message includes the sending time of the target test message sent by the kernel module, and the kernel module runs in the kernel state; The forwarding unit is used to forward the target test message to the kernel module through the forwarding server; The determining unit is used to determine the receiving time of the target test message through the kernel module; The determining unit is further configured to determine a forwarding delay through the kernel module according to the receiving time and the sending time.

9. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method according to any one of claims 1 to 7 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Network delay measuring method and system for eliminating position errors

    CN103427935A

  • Transmission delay probing method, device and system

    CN108737207A

  • Time delay measurement method and related device

    CN116192694A

  • Data Transmission Method, Apparatus, and Device

    US20200259738A1