Time delay measurement method, device, equipment, storage medium and program product

By adding a timestamp extension header to the request packet of the RoCEv2 protocol and responding immediately at the second terminal, the problem of low loopback delay calculation frequency is solved, real-time calculation of loopback delay and network quality measurement requirements are realized.

CN119109830AActive Publication Date: 2024-12-10CHINA MOBILE COMM LTD RES INST +1

Patent Information

Application Number
CN202411090824.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-10
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

The RoCEv2 protocol only responds to the end packet when calculating loopback delay, resulting in low loopback delay calculation frequency and cannot meet the real-time computing requirements in network quality measurement.

Method used

The first extension header is added to the first request message, carrying the sending time stamp of the request message, and immediately responding to the message after the second terminal receives the request message, allowing the first terminal to use the time of the response message Stamp calculates the loopback delay and improves the calculation frequency of the loopback delay.

Benefits of technology

By adding extension headers and timestamps, real-time calculation of loopback delay is achieved, which meets the high frequency requirements in network quality measurement and improves the performance of the RoCEv2 protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109830A_ABST
    Figure CN119109830A_ABST
Patent Text Reader

Abstract

The invention discloses a time delay measurement method and device, equipment, a storage medium and a program product. The method comprises the following steps: sending a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used for indicating the second terminal to perform message response; receiving a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; calculating the loopback delay of the first request message according to a second timestamp indicating the arrival time of the first response message and a first timestamp in the third extension header; according to the method, the calculation frequency of the loopback time delay can be improved, and the requirement for real-time calculation of the loopback time delay in the network quality measurement process is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a delay measurement method, device, equipment, storage medium and program product. Background Art

[0002] RoCEv2 (RDMA over Converged Ethernet v2) is an RDMA (Remote Direct Memory Access) protocol based on Ethernet convergence, which can achieve low-latency and high-throughput data transmission and is widely used in high-performance computing scenarios in data centers. Round Trip Time (RTT) is a key indicator for measuring network quality. For example, round trip time is used to determine whether the network is congested, providing a basis for rate adjustment of congestion control algorithms.

[0003] At present, the RoCEv2 protocol sends a request message through the request end, and the responder feeds back a response message (Acknowledge message, referred to as ACK message). Then the requester calculates the round-trip delay based on the difference between the sending time of the request message and the receiving time of the response message. However, the responder of the RoCEv2 protocol will not reply with an ACK message to each request message. For example, in the write operation mode, only the request last packet (RDMA WRITE Last Packet) will set ACKREQ to 1, and the responder will only reply with an ACK message to the request packet, and will not reply with an ACK message to the first packet (RDMA WRITE First Packet) and the middle packet (RDMA WRITE MiddlePacket). As a result, the round-trip delay is calculated once for multiple data packets, and the frequency of calculating the round-trip delay is very low, which cannot meet the real-time calculation requirements of the round-trip delay in the process of network quality measurement. Summary of the invention

[0004] In view of the problems existing in the prior art, the embodiments of the present invention provide a delay measurement method, apparatus, device, storage medium and program product, which can increase the calculation frequency of the round-trip delay and meet the demand for real-time calculation of the round-trip delay in the process of network quality measurement.

[0005] In a first aspect, an embodiment of the present invention provides a delay measurement method, which is applied to a first terminal and includes:

[0006] Sending a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to a message;

[0007] receiving a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp;

[0008] The round-trip delay of the first request message is calculated according to a second timestamp indicating the arrival time of the first response message and the first timestamp in the third extended header.

[0009] As an improvement of the above-mentioned scheme, the first request message is a message based on the RoCEv2 protocol, and the message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0010] As an improvement of the above solution, the method further includes:

[0011] The first functional module of the first terminal sends a round-trip delay measurement request to the message encapsulation module;

[0012] After receiving the round-trip delay measurement request, the message encapsulation module splits the transmission message according to the maximum transmission unit of the first terminal to obtain at least one first request message and / or second request message.

[0013] As an improvement of the above-mentioned scheme, the second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0014] As an improvement of the above solution, the method further includes:

[0015] Before sending the first request message, the message encapsulation module obtains a first timestamp of the local time of the first terminal as the sending time of the corresponding first request message, and writes the first timestamp into the first extension header of the first request message;

[0016] The message encapsulation module sets the first field in the second extension header in the first request message as the first indication information.

[0017] As an improvement of the above solution, the method further includes:

[0018] Sending a second request message to the second terminal; wherein the second extension header in the second request message carries the first indication information;

[0019] receiving a second response message sent by the second terminal;

[0020] The round-trip delay of the second request message is calculated according to a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

[0021] As an improvement of the above solution, the method further includes:

[0022] Before sending the first request message or the second request message, the message encapsulation module sets the second field in the second extension header of the first request message or the second request message to a preset defined operation code according to the message type of the first request message or the second request message;

[0023] The operation code is used to indicate the message type of the first request message or the second request message.

[0024] In a second aspect, an embodiment of the present invention provides a delay measurement method, which is applied to a second terminal, including:

[0025] Receive a first request message sent by a first terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to a message;

[0026] A first response message is sent to the first terminal; wherein the first response message carries a third extended header, and the third extended header carries the first timestamp; the first response message is used to instruct the first terminal to calculate the round-trip delay of the first request message based on a second timestamp indicating the arrival time of the first response message and the first timestamp in the third extended header.

[0027] As an improvement of the above solution, the method further includes:

[0028] receiving a second request message sent by the first terminal; wherein the second request message includes the second extension header; and the second extension header carries the first indication information;

[0029] Sending a second response message to the first terminal; the second response message is used to instruct the first terminal to calculate the round-trip delay of the second request message based on a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

[0030] As an improvement of the above-mentioned scheme, the first request message is a message based on the RoCEv2 protocol, and the message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0031] As an improvement of the above-mentioned scheme, the second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0032] In a third aspect, an embodiment of the present invention provides a delay measurement device, applied to a first terminal, including:

[0033] A first request message sending module, configured to send a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating a sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to make a message response;

[0034] A first response message receiving module, configured to receive a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp;

[0035] The first round-trip delay calculation module is used to calculate the round-trip delay of the first request message according to the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

[0036] In a fourth aspect, an embodiment of the present invention provides a delay measurement device, applied to a second terminal, including:

[0037] A first request message receiving module, configured to receive a first request message sent by a first terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating a sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to make a message response;

[0038] A first message response module is used to send a first response message to the first terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; the first response message is used to instruct the first terminal to calculate the round-trip delay of the first request message based on a second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

[0039] In a fifth aspect, an embodiment of the present invention provides a delay measurement device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the delay measurement method as described in any one of the first aspect or the delay measurement method as described in any one of the second aspect is implemented.

[0040] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to perform the delay measurement method described in any one of the first aspect or the delay measurement method described in any one of the second aspect.

[0041] In the seventh aspect, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the delay measurement method as described in any one of the first aspect or the delay measurement method as described in any one of the second aspect.

[0042] Compared with the prior art, a delay measurement method, apparatus, device, storage medium and program product according to an embodiment of the present invention sends a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond with a message; a first response message sent by the second terminal is received; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; and the round-trip delay of the first request message is calculated according to the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header. In the embodiment of the present invention, a first extension header is added to the first request message, and a first timestamp of the time when the first request message is sent is stored in the first extension header. After receiving the first request message, the second terminal immediately responds to the message. Subsequently, the first terminal can calculate the round-trip delay based on the message responded by the second terminal. Compared with the situation in the prior art where the second terminal only responds to the tail packet, the calculation frequency of the round-trip delay can be increased, thereby meeting the demand for real-time calculation of the round-trip delay in the process of network quality measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solution of the present invention, the drawings used in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 It is a flow chart of the response processing under the RoCEv2 protocol write operation provided by the prior art;

[0045] Figure 2 is a flow chart of a delay measurement method provided by an embodiment of the present invention;

[0046] Figure 3 is a schematic diagram of the format of a first request message provided by an embodiment of the present invention;

[0047] Figure 4 is a schematic diagram of the format of a first response message provided by an embodiment of the present invention;

[0048] Figure 5 It is a flowchart of the response message interaction between the first terminal and the second terminal under the RoCEv2 protocol write operation provided by an embodiment of the present invention;

[0049] Figure 6 is a schematic diagram of delay measurement between a first terminal and a second terminal provided by an embodiment of the present invention;

[0050] Figure 7 is another flow chart of a delay measurement method provided by an embodiment of the present invention;

[0051] Figure 8 is a structural block diagram of a delay measurement device provided by an embodiment of the present invention;

[0052] Fig. 9 is another structural block diagram of a delay measurement device provided by an embodiment of the present invention;

[0053] Fig.10 It is a structural block diagram of a delay measurement device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] It is understood that the various numbers involved in the embodiments of the present invention are only for the convenience of description and are not intended to limit the scope of the present application. The size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.

[0056] In embodiments of the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The term "multiple or several" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0057] The following is an explanation of some related technologies involved in the embodiments of the present invention.

[0058] The unit of data transmission in the RoCEv2 protocol is message (Massage). When the message length is very large, the requester will split the message into multiple data packets according to the MTU (Maximum Transmission Unit) that the network device can transmit. The first packet is the first packet (First Packet), the last packet is the last packet (Last Packet), and the others are middle packets (Middle Packets). Figure 1 In the processing flow of the first request message and response message under the RoCEv2 protocol write operation shown in the figure, the requesting end divides the write operation request into a write operation first packet (WRITE First Packet), several write operation middle packets (WRITE Middle Packets) and a write operation last packet (WRITE Last Packet) and sends them to the responding end. The responding end only replies with an ACK packet to the write operation last packet, so that only the last packet will calculate the round-trip delay, resulting in the round-trip delay being calculated once for multiple data packets; for example, a 2MB message needs to be divided into more than 1300 data packets for transmission when the maximum transmission unit is 1500B, that is, the round-trip delay is calculated once after more than 1300 data packets, resulting in a very low frequency of round-trip delay calculation; and the maximum length of the message supported by the RoCEv2 protocol is 2GB, which further leads to a lower frequency of round-trip delay calculation.

[0059] At present, functions such as the congestion control algorithm on the request side need to calculate the round-trip delay in real time to evaluate the degree of network congestion, so as to adjust the sending rate of the first request message in time. The current implementation of the RoCEv2 protocol only calculates the round-trip delay for the tail packet, which cannot meet the real-time calculation requirements of the round-trip delay.

[0060] In view of the problem that only the tail packet in the prior art calculates the round-trip delay, resulting in a low frequency of round-trip delay calculation, which cannot meet the real-time calculation requirements of the round-trip delay in the network quality measurement process, the embodiment of the present invention proposes a delay measurement method based on the RoCEv2 protocol to solve the problem of real-time calculation of the round-trip delay. The delay measurement method involved in the embodiment of the present invention will be described in detail below in conjunction with the accompanying drawings.

[0061] It should be noted that the term "first terminal" can also be described as a "requesting end", and the two can be used interchangeably. The term "second terminal" can also be described as a "responding end", and the two can be used interchangeably, and no specific limitation is made in the embodiments of the present invention.

[0062] See also Figure 2 , Figure 21 is a flow chart of a delay measurement method provided by an embodiment of the present invention. The delay measurement method is applied to a first terminal and includes:

[0063] S11: Send a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to the message;

[0064] S12: Receive a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp;

[0065] S13: Calculate the round-trip delay of the first request message according to the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

[0066] Among them, the first request message is a message based on the RoCEv2 protocol, and the message type of the first request message includes the first packet and the intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and the single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0067] The embodiment of the present invention defines a new RoCEv2 extension header, such as a first extension header / third extension header, for storing a first timestamp indicating the sending time of the corresponding first request message. In the embodiment of the present invention, the position and length of the first extension header in the first request message are not specifically limited. For example, it can be set at the end of the second extension header with a length of 4 bytes. The message format of the first request message is as follows: Figure 3 After receiving the first request message carrying the first extension header, the second terminal fills the first timestamp in the first extension header into the third extension header of the first response message (i.e., ACK message) and then feeds it back to the first terminal. In the embodiment of the present invention, the position and length of the third extension header in the first response message are not specifically limited. The message format of the first response message is as follows: Figure 4 shown.

[0068] Taking the message format of the first request message as an example, Figure 2 The definitions of the fields in the first request message shown are as follows:

[0069] MAC / IP / UDP: Layer 2 to Layer 4 message encapsulation; for example, Layer 2 to Layer 4 use MAC (Media Access Control protocol), IP (Internet Protocol), and UDP (User Datagram Protocol) for message encapsulation respectively.

[0070] The first extended header (also described as TSTH (Time Stamp Transport Header)): 4 bytes in length, storing a first timestamp indicating the sending time of the first request message.

[0071] It should be understood that the third extension head described in the embodiment of the present invention has the same structure and storage content as the first extension head described above, and can also be described as TSTH.

[0072] The second extended header (can also be described as BTH (Base Transport Header): the basic transport header of the RoCEv2 message, including the first field and the second field and other contents.

[0073] The first field can also be described as an ACKREQ field. The first field is used to set an indication flag. When it is set to the first flag (for example, 1), it indicates that the second terminal needs to respond to a message. When it is set to a non-first flag (for example, 0) or a null value, it indicates that the second terminal does not need to respond to a message. The length of the first field is 1 bit. The second field is used to set an operation code (operation code, opcode), and the length is 8 bits.

[0074] In the embodiment of the present invention, the first field (ie, the ACKREQ field) is set to 1 in the first request message with the requirement to calculate the round-trip delay, to indicate that the second terminal needs to make a message response to the first request message.

[0075] In an embodiment of the present invention, a new operation code is defined for the first request message (including the first packet, the middle packet, and the single packet) and the ACK message carrying the first extension header TSTH. For example, taking the write operation as an example, the operation code of the write operation first packet (WRITE First Packet with TSTH) carrying the extension header TSTH is set to 0x18 (00011000), the operation code of the write operation middle packet (WRITE middle Packet with TSTH) carrying the extension header TSTH is set to 0x19 (00011001), the operation code of the write operation single packet (WRITE Only Packet with TSTH) carrying the extension header TSTH is set to 0x1A (00011010), etc., and the operation code of the response message (ACK with TSTH) carrying the extension header TSTH is set to 0x1B (00011011).

[0076] Other extended headers: Different types of request messages include different extended headers. For example, the request message under a write operation includes RETH (RDMA Extended Transport Header).

[0077] Payload data: valid data in the message to be transmitted;

[0078] CRC (Cyclic Redundancy Check): used to verify the correctness of payload data.

[0079] Specifically, the method further includes:

[0080] The first functional module of the first terminal sends a round-trip delay measurement request to the message encapsulation module;

[0081] After receiving the round-trip delay measurement request, the message encapsulation module splits the transmission message according to the maximum transmission unit of the first terminal to obtain at least one first request message and / or second request message.

[0082] Furthermore, the method further comprises:

[0083] Before sending the first request message, the message encapsulation module obtains a first timestamp of the local time of the first terminal as the sending time of the corresponding first request message, and writes the first timestamp into the first extension header of the first request message;

[0084] The message encapsulation module sets the first field in the second extension header in the first request message as the first indication information.

[0085] In the embodiment of the present invention, the first functional module may be a functional module related to network quality measurement, such as a congestion control module, etc. When the first terminal needs to send a transmission message to the second terminal, the congestion control module may make a round trip delay measurement request to the message encapsulation module, so that when the message encapsulation module performs message encapsulation on the transmission message, the transmission message is first split according to the maximum transmission unit of the first terminal to obtain at least one first request message and / or a second request message.

[0086] Exemplarily, in the case where the length of the transmission message is greater than the maximum transmission unit of the first terminal, the transmission message can be split into a first packet and a tail packet, or a first packet, at least one middle packet and a tail packet. At this time, since the first field ACKREQ in the tail packet will be set to 1, the second terminal will automatically respond to the tail packet with a message. Therefore, the embodiment of the present invention can fill in the first timestamp of the corresponding sending time in the newly added first extension header in the first packet and the middle packet split from the transmission message, and at the same time set the first field ACKREQ in the second extension header to 1, and the second field to the operation code of the corresponding message type, so that the second terminal responds to the first request message of the non-tail packet when receiving it. After receiving the first response message, the first terminal calculates the round-trip delay based on the second timestamp of the arrival time of the first response message and the first timestamp in its third extension header, and feeds back the calculated round-trip delay to the first functional module for use.

[0087] Take the case where the congestion control module makes a request for loop delay measurement to the message encapsulation module during a write operation. Figure 5 As shown, in the first terminal, the message encapsulation module encapsulates the write message, that is, obtains the current local time as the first timestamp of the sending time of the write message that needs to be encapsulated and sent, and fills it into the extended header TSTH, and the encapsulated write message is sent to the second terminal. After receiving the write message, the second terminal parses the message, extracts the first timestamp in the extended header TSTH of the write message, and fills the first timestamp into the extended header TSTH of the ACK message for ACK message encapsulation, and then feeds back the ACK message to the first terminal; the first terminal parses the currently received ACK message carrying the extended header TSTH, and then extracts the first timestamp in the extended header TSTH of the ACK message, and simultaneously obtains the second timestamp of the time when the ACK message is received, calculates the round-trip delay based on the two timestamps, and feeds back the calculated round-trip delay to the congestion control module for use.

[0088] In the case where the length of the transmission message is not greater than the maximum transmission unit of the first terminal, the transmission message can be directly encapsulated into a single packet. Similarly, a new first extension header can be added to the single packet, and then the first timestamp of the corresponding sending time can be filled in the first extension header of the single packet. At the same time, the first field ACKREQ in the second extension header is set to 1, and the second field is set to the operation code of the corresponding message type, so that when the second terminal receives the first request message belonging to the single packet, it can respond to it with a message.

[0089] In some embodiments, a single packet may also be regarded as the first packet and / or the last packet at the same time, its first field ACKREQ may be set to 1, and may not carry the first extension header, and the second terminal may automatically send a message response to the single packet.

[0090] Afterwards, the first terminal calculates the corresponding round-trip delay based on the second timestamp of the arrival time of the first response message (ie, ACK message) replied by the second terminal and the first timestamp indicating the sending time of the first request message in the third extension header of the first response message.

[0091] Among them, the second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0092] Furthermore, the method further comprises:

[0093] Sending a second request message to the second terminal; wherein the second extension header in the second request message carries the first indication information;

[0094] receiving a second response message sent by the second terminal;

[0095] The round-trip delay of the second request message is calculated according to a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

[0096] In an embodiment of the present invention, for the second request message belonging to the tail packet or the single packet, the first extension header may not be carried, and the first field ACKREQ in the second extension header is set to 1. When the second terminal receives the second request message belonging to the single packet or the tail packet, it responds to the message. Then the first terminal calculates the corresponding round-trip delay based on the fourth timestamp of the arrival time of the second response message (i.e., the ACK message) replied by the second terminal and the third timestamp of the sending time of the second request message.

[0097] It should be noted that the calculation of the round-trip delay based on the sending time of the request message and the arrival time of the response message belongs to the prior art and will not be described in detail here.

[0098] Specifically, the method further includes:

[0099] Before sending the first request message or the second request message, the message encapsulation module sets the second field in the second extension header of the first request message or the second request message to a preset defined operation code according to the message type of the first request message or the second request message;

[0100] The operation code is used to indicate the message type of the first request message or the second request message.

[0101] In an embodiment of the present invention, different operation codes are predefined for different message types. For example, when the first terminal sends a first request message belonging to the first packet, the second field of its second extension header is set to 0x18 (00011000), when sending a first request message belonging to an intermediate packet, the second field of its second extension header is set to 0x19 (00011001), and when sending a first request message belonging to a single packet, the second field of its second extension header is set to 0x1A (00011010). The second field in the second extension header of the first response message is set to 0x1B (00011011); through the predefined operation code, the second terminal can identify the message type of the currently received first request message or the second request message. Similarly, the first terminal can identify that the currently received first response message carries the third extension header and needs to perform a loopback delay calculation.

[0102] like Figure 6 The flowchart of the response message interaction between the first terminal and the second terminal under the RoCEv2 protocol write operation shown in the embodiment of the present invention, for the request message belonging to the first packet and the middle packet and carrying the extension header TSTH, the second terminal responds with an ACK message, and the ACK message at this time carries the extension header TSTH; the loop delay calculation can be performed based on the first timestamp in the extension header TSTH of the ACK message and the second timestamp received to the ACK message. For the request message belonging to the tail packet that does not carry the extension header TSTH, the second terminal will automatically respond with an ACK message under the RoCEv2 protocol, and the loop delay calculation can also be performed. The ACK message at this time also does not carry the extension header TSTH.

[0103] Compared with the prior art, the embodiment of the present invention defines an extension header TSTH of a RoCEv2 message carrying a timestamp, records the sending time of the request message, and defines the formats of the request message and the response message carrying the extension header TSTH; the requesting end sends a request message with the extension header TSTH, and the responding end fills the timestamp of the extension header TSTH into the extension header TSTH of the corresponding response message after receiving the request message, so that the requesting end completes the round-trip delay calculation operation based on the timestamp carried by the extension header TSTH of the corresponding message, and the responding end does not need to calculate, thereby realizing real-time on-demand measurement of the network round-trip delay, solving the problem of untimely calculation of the RoCEv2 protocol round-trip delay, and helping to improve the performance of the RoCEv2 protocol.

[0104] At the same time, the request message carries a timestamp through the extended header TSTH, so the requesting end does not need to record the sending time of the request message locally, saving storage space on the requesting end.

[0105] See also Figure 7 , Figure 7 is another flow chart of a delay measurement method provided by an embodiment of the present invention. The delay measurement method is applied to a second terminal, comprising:

[0106] S21: Receive a first request message sent by a first terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to a message;

[0107] S22: Send a first response message to the first terminal; wherein, the first response message carries a third extension header, and the third extension header carries the first timestamp; the first response message is used to instruct the first terminal to calculate the round-trip delay of the first request message based on the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

[0108] In an optional embodiment, the method further includes:

[0109] receiving a second request message sent by the first terminal; wherein the second request message includes the second extension header; and the second extension header carries the first indication information;

[0110] Sending a second response message to the first terminal; the second response message is used to instruct the first terminal to calculate the round-trip delay of the second request message based on a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

[0111] In an optional embodiment, the first request message is a message based on the RoCEv2 protocol, and the message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0112] In an optional embodiment, the second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0113] It should be noted that the working process of the delay measurement method applied to the second terminal described in the embodiment of the present invention can refer to the working process of the delay measurement method applied to the first terminal described in the above embodiment, and the technical effect achieved is the same as the delay measurement method applied to the first terminal described in the above embodiment, which will not be repeated here.

[0114] See also Figure 8 , Figure 8 : is a structural block diagram of a delay measurement device provided in an embodiment of the present invention, wherein the delay measurement device is applied to a first terminal and includes:

[0115] A first request message sending module 11 is used to send a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to the message;

[0116] A first response message receiving module 12 is used to receive a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp;

[0117] The first round-trip delay calculation module 13 is used to calculate the round-trip delay of the first request message according to the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

[0118] In an optional embodiment, the first request message is a message based on the RoCEv2 protocol, and the message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0119] In an optional embodiment, the device further includes: a first functional module, a message encapsulation module;

[0120] The first functional module is used to send a round-trip delay measurement request to the message encapsulation module;

[0121] The message encapsulation module is used to split the transmission message according to the maximum transmission unit of the first terminal after receiving the round-trip delay measurement request, so as to obtain at least one first request message and / or second request message.

[0122] In an optional embodiment, the second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0123] In an optional embodiment, the message encapsulation module is further configured to perform the following operations:

[0124] Before sending the first request message, obtain a first timestamp of the local time of the first terminal as the sending time of the corresponding first request message, and write the first timestamp into the first extension header of the first request message;

[0125] The first field in the second extended header in the first request message is set as the first indication information.

[0126] In an optional embodiment, the device further includes:

[0127] A second request message sending module, configured to send a second request message to the second terminal; wherein the second extension header in the second request message carries the first indication information;

[0128] A second response message receiving module, used to receive a second response message sent by the second terminal;

[0129] The second round-trip delay calculation module is used to calculate the round-trip delay of the second request message according to the third timestamp indicating the arrival time of the second response message and the fourth timestamp indicating the sending time of the second request message.

[0130] As an improvement of the above solution, the message encapsulation module is further used to perform the following operations:

[0131] Before sending the first request message or the second request message, according to the message type of the first request message or the second request message, setting the second field in the second extension header of the first request message or the second request message to a preset defined operation code;

[0132] The operation code is used to indicate the message type of the first request message or the second request message.

[0133] It should be noted that the working process of each module in the delay measurement device applied to the first terminal described in the embodiment of the present invention can refer to the working process of the delay measurement method applied to the first terminal described in the above embodiment, and the technical effect achieved is also the same as the delay measurement method applied to the first terminal described in the above embodiment, which will not be repeated here.

[0134] See also Fig. 9 , Fig. 9 : is another structural block diagram of a delay measurement device provided in an embodiment of the present invention, wherein the delay measurement device is applied to a second terminal and includes:

[0135] A first request message receiving module 21 is configured to receive a first request message sent by a first terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating a sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to make a message response;

[0136] The first message response module 22 is used to send a first response message to the first terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; the first response message is used to instruct the first terminal to calculate the round-trip delay of the first request message based on the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

[0137] In an optional embodiment, the device further includes:

[0138] A second request message receiving module is used to receive a second request message sent by the first terminal; wherein the second request message includes the second extension header; and the second extension header carries the first indication information;

[0139] A second message response module is used to send a second response message to the first terminal; the second response message is used to instruct the first terminal to calculate the round-trip delay of the second request message based on a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

[0140] In an optional embodiment, the first request message is a message based on the RoCEv2 protocol, and the message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0141] In an optional embodiment, the second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

[0142] It should be noted that the working process of each module in the delay measurement device applied to the second terminal described in the embodiment of the present invention can refer to the working process of the delay measurement method applied to the second terminal described in the above embodiment, and the technical effect achieved is the same as the delay measurement method applied to the second terminal described in the above embodiment, which will not be repeated here.

[0143] See also Fig.10 , Fig.10 3 is a block diagram of a delay measurement device provided in an embodiment of the present invention. The delay measurement device includes a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. When the processor 31 executes the computer program, the steps in the above-mentioned delay measurement method embodiments are implemented, such as steps S11 to S13 or steps S21 to S22.

[0144] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the delay measurement device.

[0145] The delay measurement device may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art may understand that the schematic diagram is only an example of a delay measurement device and does not constitute a limitation on the delay measurement device. The delay measurement device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the delay measurement device may also include an input and output device, a network access device, a bus, etc.

[0146] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 31 is the control center of the delay measurement device, and uses various interfaces and lines to connect various parts of the entire delay measurement device.

[0147] The memory 32 can be used to store the computer program and / or module, and the processor 31 realizes various functions of the delay measurement device by running or executing the computer program and / or module stored in the memory 32, and calling the data stored in the memory 32. The memory 32 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 32 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0148] Wherein, if the module / unit integrated in the delay measurement device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 31. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0149] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0150] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, many improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A delay measurement method, characterized in that: Applied to the first terminal, comprising: Sending a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to a message; receiving a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; The round-trip delay of the first request message is calculated according to a second timestamp indicating the arrival time of the first response message and the first timestamp in the third extended header.

2. The delay measurement method according to claim 1, characterized in that: The first request message is a message based on the RoCEv2 protocol. The message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

3. The delay measurement method according to claim 1, characterized in that: The method further comprises: The first functional module of the first terminal sends a round-trip delay measurement request to the message encapsulation module; After receiving the round-trip delay measurement request, the message encapsulation module splits the transmission message according to the maximum transmission unit of the first terminal to obtain at least one first request message and / or second request message.

4. The delay measurement method according to claim 3, characterized in that: The second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

5. The delay measurement method according to claim 3, characterized in that: The method further comprises: Before sending the first request message, the message encapsulation module obtains a first timestamp of the local time of the first terminal as the sending time of the corresponding first request message, and writes the first timestamp into the first extension header of the first request message; The message encapsulation module sets the first field in the second extension header in the first request message as the first indication information.

6. The delay measurement method according to claim 3, characterized in that: The method further comprises: Sending a second request message to the second terminal; wherein the second extension header in the second request message carries the first indication information; receiving a second response message sent by the second terminal; The round-trip delay of the second request message is calculated according to a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

7. The delay measurement method according to claim 5 or 6, characterized in that: The method further comprises: Before sending the first request message or the second request message, the message encapsulation module sets the second field in the second extension header of the first request message or the second request message to a preset defined operation code according to the message type of the first request message or the second request message; The operation code is used to indicate the message type of the first request message or the second request message.

8. A delay measurement method, characterized in that: Applied to the second terminal, including: Receive a first request message sent by a first terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating the sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to respond to a message; A first response message is sent to the first terminal; wherein the first response message carries a third extended header, and the third extended header carries the first timestamp; the first response message is used to instruct the first terminal to calculate the round-trip delay of the first request message based on a second timestamp indicating the arrival time of the first response message and the first timestamp in the third extended header.

9. The delay measurement method according to claim 8, characterized in that: The method further comprises: receiving a second request message sent by the first terminal; wherein the second request message includes the second extension header; and the second extension header carries the first indication information; Sending a second response message to the first terminal; the second response message is used to instruct the first terminal to calculate the round-trip delay of the second request message based on a third timestamp indicating the arrival time of the second response message and a fourth timestamp indicating the sending time of the second request message.

10. The delay measurement method according to claim 8, characterized in that: The first request message is a message based on the RoCEv2 protocol. The message type of the first request message includes a first packet and an intermediate packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

11. The delay measurement method according to claim 9, characterized in that: The second request message is a message based on the RoCEv2 protocol, and the message type of the second request message includes a tail packet split from the transmission message when the transmission message length is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the transmission message length is not greater than the maximum transmission unit of the first terminal.

12. A delay measurement device, characterized in that: Applied to the first terminal, comprising: A first request message sending module, configured to send a first request message to a second terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating a sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to make a message response; A first response message receiving module, configured to receive a first response message sent by the second terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; The first round-trip delay calculation module is used to calculate the round-trip delay of the first request message according to the second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

13. A delay measurement device, characterized in that: Applied to the second terminal, including: A first request message receiving module, configured to receive a first request message sent by a first terminal; wherein the first request message carries a first extension header and a second extension header; the first extension header carries a first timestamp indicating a sending time of the first request message; the second extension header carries first indication information, and the first indication information is used to instruct the second terminal to make a message response; A first message response module is used to send a first response message to the first terminal; wherein the first response message carries a third extension header, and the third extension header carries the first timestamp; the first response message is used to instruct the first terminal to calculate the round-trip delay of the first request message based on a second timestamp indicating the arrival time of the first response message and the first timestamp in the third extension header.

14. A delay measurement device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the delay measurement method according to any one of claims 1 to 7 or the delay measurement method according to any one of claims 8 to 11 is implemented.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the delay measurement method according to any one of claims 1 to 7 or the delay measurement method according to any one of claims 8 to 11.

16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the delay measurement method described in any one of claims 1 to 7 or the delay measurement method described in any one of claims 8 to 11 is implemented.

Citation Information

Patent Citations

  • Method and system for rapidly measuring end-to-end network performance of DiffServ region under IPv6

    CN101808016A

  • Ip network performance measurement method, apparatus and system

    CN102037683A

  • Time delay measurement method and device

    CN113824607A

  • Transmission method, network element and storage medium

    CN114095459A

  • Network interface card, controller, storage device and message sending method

    CN114490462A

Cited By

  • Message response method, storage medium, electronic device, and product

    WO2026189050A1