Delay measurement method, apparatus, device, storage medium, and program product

By introducing an extension header carrying a timestamp into the RoCEv2 protocol, the problem of low loopback delay calculation frequency is solved, enabling real-time calculation of loopback delay and improving the accuracy and efficiency of network quality measurement.

CN119109830BActive Publication Date: 2026-03-27CHINA MOBILE COMM LTD RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

The low frequency of loopback delay calculation in the RoCEv2 protocol cannot meet the real-time calculation requirements in network quality measurement.

Method used

The RoCEv2 protocol introduces an extended header to carry a timestamp in the request message and fills the sending timestamp in the response message. The loopback delay is calculated by calculating the difference between the timestamps of the request message and the response message.

Benefits of technology

The calculation frequency of loopback latency was increased, enabling real-time calculation in the network quality measurement process and improving the performance of the RoCEv2 protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109830B_ABST
    Figure CN119109830B_ABST
Patent Text Reader

Abstract

The application discloses a kind of time delay measurement method, device, equipment, storage medium and program product, the method includes: first request message is sent to second terminal;Wherein, first request message carries first extension header and second extension header;First extension header carries the first timestamp indicating the sending time of first request message;Second extension header carries first indication information, and first indication information is used to indicate that second terminal carries out message response;First response message sent by second terminal is received;Wherein, first response message carries third extension header, and third extension header carries the first timestamp in the first extension header;According to the second timestamp indicating the arrival time of first response message and the first timestamp in third extension header, the loopback delay of first request message is calculated;The application can improve the calculation frequency of loopback delay, satisfy the demand of loopback delay real-time calculation in network quality measurement process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, and in particular to a time delay measurement method, device, equipment, storage medium and program product. BACKGROUND

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

[0003] Currently, the RoCEv2 protocol sends a request message by the request end, and the response end feeds back an ACK message (Acknowledge message, abbreviated as ACK message), and then the request end calculates the round trip time according to the difference between the sending time of the request message and the receiving time of the response message. However, the response end of the RoCEv2 protocol does not reply an ACK message for each request message, for example, in the write operation mode, only the request tail packet (RDMA WRITE Last Packet) sets ACKREQ to 1, and the response end only replies an ACK message to the request packet, and does not reply an ACK message to the first packet (RDMA WRITE First Packet) and the middle packet (RDMA WRITE MiddlePacket), so that the round trip time is calculated only once for multiple data packets, the frequency of calculating the round trip time is very low, and the real-time calculation requirement of the round trip time in the network quality measurement process cannot be met. SUMMARY

[0004] In view of the problems in the prior art, the embodiments of the present application provide a time delay measurement method, device, equipment, storage medium and program product, which can improve the calculation frequency of the round trip time and meet the real-time calculation requirement of the round trip time in the network quality measurement process.

[0005] In a first aspect, the embodiments of the present application provide a time delay measurement method applied to a first terminal, comprising:

[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; and the second extension header carries first indication information, the first indication information being used to instruct the second terminal to respond to the 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] calculating a loopback delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

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

[0010] As an improvement of the above scheme, the method further comprises:

[0011] a first function module of the first terminal sends a loopback delay measurement request to a message encapsulation module;

[0012] the message encapsulation module, after receiving the loopback delay measurement request, splits a transmission message according to a 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 scheme, the second request message is a message based on a RoCEv2 protocol, and a message type of the second request message includes a tail packet split from the transmission message when the length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal.

[0014] As an improvement of the above scheme, the method further comprises:

[0015] before sending the first request message, the message encapsulation module obtains a first timestamp of a local time of the first terminal as a sending time of a 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 a first field in the second extension header in the first request message as the first indication information.

[0017] As an improvement of the above scheme, the method further comprises:

[0018] sending a second request message to the second terminal; wherein a 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] calculating a loopback delay of the second request message according to a third timestamp indicating an arrival time of the second response message and a fourth timestamp indicating a sending time of the second request message.

[0021] As an improvement of the above-mentioned solution, the method further comprises:

[0022] Before sending the first request message or the second request message, the message encapsulation module sets a 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 a 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 application provides a time delay measurement method applied to a second terminal, comprising:

[0025] receiving 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 respond to a message;

[0026] sending 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 a loopback delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

[0027] As an improvement of the above-mentioned solution, the method further comprises:

[0028] receiving a second request message sent by the first terminal; wherein the second request message comprises 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 a loopback delay of the second request message according to a third timestamp indicating an arrival time of the second response message and a fourth timestamp indicating a sending time of the second request message.

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

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

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

[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; and the second extension header carries first indication information, which is used to instruct the second terminal to respond to a message;

[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] a first loopback delay calculating module, configured to calculate a loopback delay of the first request message according to a second timestamp indicating an 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 application provides a delay measurement device, applied to a second terminal, and comprising:

[0037] The first request message receiving module 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; and the second extension header carries first indication information, which is used to instruct the second terminal to respond to the message.

[0038] The first message responding module is configured 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; and the first response message is used to instruct the first terminal to calculate a loopback time delay of the first request message according to a second timestamp indicating an 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 application provides a time delay measurement device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the time delay measurement method according to any one of the first aspect or the time delay measurement method according to any one of the second aspect when the computer program is executed.

[0040] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, wherein the computer program controls a device where the computer readable storage medium is located to execute the time delay measurement method according to any one of the first aspect or the time delay measurement method according to any one of the second aspect when the computer program is executed.

[0041] In a seventh aspect, an embodiment of the present application provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions implement the time delay measurement method according to any one of the first aspect or the time delay measurement method according to any one of the second aspect when executed by a processor.

[0042] The time delay measurement method, device, equipment, storage medium and program product provided by the embodiment of the application have the following advantages over the prior art. The first request message is sent to the second terminal. 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, which is used to instruct the second terminal to respond to the message. The first response message sent by the second terminal is received. The first response message carries a third extension header, and the third extension header carries the first timestamp. The loopback time 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 extension header. In the embodiment of the application, the first extension header is added to the first request message, and the first timestamp of the sending time of the first request message is stored in the first extension header. After the second terminal receives the first request message, the second terminal responds to the message immediately. Then, the first terminal can calculate the loopback time delay based on the message responded by the second terminal. Compared with the prior art in which the second terminal responds to the message only for the tail packet, the calculation frequency of the loopback time delay can be improved, and the real-time calculation requirement of the loopback time delay in the network quality measurement process can be met. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the present application, the drawings used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative effort.

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

[0045] Figure 2 is a flowchart of a time delay measurement method provided by the embodiment of the present application;

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

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

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

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

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

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

[0052] Figure 9 is another structural block diagram of a time delay measurement device provided by an embodiment of the present application;

[0053] Figure 10 is a structural block diagram of a time delay measurement device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0055] It can be understood that the various numbers involved in the embodiments of the present application are only distinguished for the convenience of description, and do not limit the scope of the present application. The size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic.

[0056] In the embodiments of the present application, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. The terms "include", "contain" 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 not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or device including the elements. The term "a plurality of or several" refers to two or more. The "and / or" describes the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can represent three cases of A alone, A and B together, and B alone. The character " / " generally represents an "or" relationship between the front and rear associated objects.

[0057] Some related technologies involved in the embodiments of the present application are explained below.

[0058] The unit of RoCEv2 protocol data transmission is a message. When the message length is large, the request end will split the message into multiple data packets according to the MTU (Maximum Transmission Unit) that the network device can transmit. The first one is the first packet, the last one is the last packet, and the others are middle packets. Figure 1 As shown in the first request message and response message processing flow under the RoCEv2 protocol write operation, the request end splits the write operation request into a write operation first packet, a plurality of write operation middle packets, and a write operation last packet, and sends them to the response end. The response end only replies to the write operation last packet with an acknowledgement packet (ACK Packet), so only the last packet will calculate the loopback delay, so that only multiple data packets will calculate the loopback delay once. For example, a 2MB message needs to be divided into more than 1300 data packets for transmission under the condition that the maximum transmission unit is 1500B, that is, the loopback delay is calculated once after more than 1300 data packets, which leads to a very low loopback delay calculation frequency. Moreover, the RoCEv2 protocol supports a maximum message length of 2GB, which further reduces the loopback delay calculation frequency.

[0059] Currently, the congestion control algorithm and other functions of the request end need to calculate the loopback delay in real time to evaluate the network congestion degree, so as to adjust the sending rate of the first request message in time. The current implementation scheme of the RoCEv2 protocol, in which only the last packet calculates the loopback delay, cannot meet the real-time loopback delay calculation requirement.

[0060] In view of the problem in the prior art that only the last packet calculates the loopback delay, resulting in a low loopback delay calculation frequency and failing to meet the real-time loopback delay calculation requirement in the network quality measurement process, the embodiment of the present application proposes a delay measurement method based on the RoCEv2 protocol, which solves the problem of real-time loopback delay calculation. The delay measurement method related to the embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0061] It should be noted that the term "first terminal" can also be described as "request end", and the two can be used interchangeably. The term "second terminal" can also be described as "response end", and the two can be used interchangeably, which is not limited in the embodiment of the present application.

[0062] Referring to Figure 2 , Figure 2is a flow chart of a time delay measurement method provided by an embodiment of the present application. The time delay measurement method is applied to a first terminal and includes the following steps.

[0063] S11: 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 a sending time of the first request message; and the second extension header carries first indication information, which is used to instruct the second terminal to respond to a message;

[0064] S12: 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;

[0065] S13: calculating a loopback time delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

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

[0067] The present embodiment defines a new RoCEv2 extension header, such as the first extension header / third extension header, for storing the first timestamp indicating the sending time of the corresponding first request message. In the present embodiment, 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 tail of the second extension header, and the length is 4 bytes. The message format of the first request message is as shown in Figure 3 After the second terminal receives the first request message carrying the first extension header, the first 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 feeds back to the first terminal. In the present embodiment, the position and length of the third extension header in the first response message are not specifically limited, and the message format of the first response message is as shown in Figure 4 .

[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 are as follows:

[0069] MAC / IP / UDP: second layer to fourth layer message encapsulation; for example, the second layer to the fourth layer uses MAC (Media Access Control protocol), IP (Internet Protocol), and UDP (User Datagram Protocol) for message encapsulation, respectively.

[0070] The first extension header (which can also be described as a TSTH (Time Stamp Transport Header)) has a length of 4 bytes and stores a first time stamp indicating the sending time of the first request message.

[0071] It should be understood that the third extension header described in the embodiments of the present application has the same structure and stored content as the first extension header described above, and can also be described as a TSTH.

[0072] The second extension header (which can also be described as a BTH (Base Transport Header)) is a basic transport message header of the RoCEv2 message and includes a first field and a second field.

[0073] The first field can also be described as an ACKREQ field, and the first field is used to set an identification indication. When the first field is set to a first identification (such as 1), it indicates that the second terminal needs to perform a message response. When the first field is set to a non-first identification (such as 0) or is empty, it indicates that the second terminal does not need to perform a message response. The length of the first field is 1 bit. The second field is used to set an opcode, and the length of the opcode is 8 bits.

[0074] In the embodiments of the present application, the first field (i.e., the ACKREQ field) is set to 1 in the first request message with a requirement for a calculation of a loopback delay, and is used to indicate that the second terminal needs to perform a message response to the first request message.

[0075] In the embodiments of the present application, the first request message (including the first packet, the intermediate packet and the single packet) carrying the first extension header TSTH and the ACK message define a new operation code. 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 intermediate 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), and so on. The operation code of the ACK message (ACK with TSTH) carrying the extension header TSTH is set to 0x1B (00011011).

[0076] Other extension headers: different types of request messages contain different extension headers, for example, the request message under the write operation includes the RETH (RDMA Extended Transport Header).

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

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

[0079] Specifically, the method further comprises:

[0080] The first function module of the first terminal sends a loopback delay measurement request to the message encapsulation module;

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

[0082] Further, 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 a first field in the second extension header in the first request message to the first indication information.

[0085] In this embodiment of the invention, the first functional module may be a functional module related to network quality measurement, such as a congestion control module. When the first terminal needs to send a transmission message to the second terminal, the congestion control module may request a loopback delay measurement from the message encapsulation module, so that when the message encapsulation module encapsulates the transmission message, it first splits the transmission message 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] For example, when the length of the transmitted message is greater than the maximum transmission unit of the first terminal, the transmitted message can be split into a first packet and a last packet, or a first packet, at least one intermediate packet, and a last packet. In this case, since the first field ACKREQ in the last packet is set to 1, the second terminal will automatically respond to the last packet. Therefore, in this embodiment of the invention, the first timestamp of the corresponding sending time can be filled into the first extended header added to the first packet and intermediate packet split from the transmitted message, and the first field ACKREQ in the second extended header can be set to 1, and the second field can be set to the opcode of the corresponding message type, so that the second terminal will respond to the first request message that is not the last packet. After receiving the first response message, the first terminal calculates the loopback delay based on the second timestamp of the arrival time of the first response message and the first timestamp in its third extended header, and feeds back the calculated loopback delay to the first functional module.

[0087] Taking a write operation as an example, the congestion control module requests a loopback delay measurement from the message encapsulation module. Figure 5 As shown, in the first terminal, the message encapsulation module encapsulates the write message by obtaining the current local time as the first timestamp of the send time of the write message to be encapsulated and sent, and filling it into the TSTH extension header. The encapsulated write message is sent to the second terminal. After receiving the write message, the second terminal performs message parsing, extracts the first timestamp from the TSTH extension header of the write message, and fills the first timestamp into the TSTH extension header of the ACK message for ACK message encapsulation. Then, the ACK message is fed back to the first terminal. The first terminal performs message parsing on the currently received ACK message carrying the TSTH extension header, extracts the first timestamp from the TSTH extension header of the ACK message, and obtains the second timestamp of the time when the ACK message was received. Based on these two timestamps, the loopback delay is calculated, and the calculated loopback delay is fed back to the congestion control module for use.

[0088] For the case that 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 as a single packet, and the first extension header can also be added in the single packet, and then the first timestamp of the corresponding sending time is filled in the first extension header of the single packet, and 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 the second terminal performs message response when receiving the first request message belonging to the single packet.

[0089] In some embodiments, the single packet can also be regarded as the head packet and / or the tail packet, the first field ACKREQ of which is set to 1, and the first extension header can also not be carried, and the second terminal can automatically perform message response on the single packet.

[0090] Then, the first terminal calculates the corresponding loopback delay based on the second timestamp of the arrival time of the first response message (i.e., the ACK message) returned by the second terminal and the first timestamp of the sending time of the first request message in the third extension header in the first response message.

[0091] 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 length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal.

[0092] Further, 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] calculating the loopback delay of the second request message 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 the embodiments of the application, for the second request message belonging to the tail packet or the single packet, the first extension header can not be carried, and the first field ACKREQ in the second extension header is set to 1, and the second terminal performs message response when receiving the second request message belonging to the single packet or the tail packet. Then, the first terminal calculates the corresponding loopback delay based on the fourth timestamp of the arrival time of the second response message (i.e., the ACK message) returned by the second terminal and the third timestamp of the sending time of the second request message.

[0097] It should be noted that calculating loopback delay based on the sending time of the request message and the arrival time of the response message is existing technology and will not be elaborated on 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 extended header of the first request message or the second request message to a preset defined opcode according to the message type of the first request message or the second request message;

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

[0101] In this embodiment of the invention, different message types predefine different opcodes. For example, when the first terminal sends a first request message belonging to the first packet, the second field of its second extended header is set to 0x18 (00011000); when sending a first request message belonging to the intermediate packet, the second field of its second extended header is set to 0x19 (00011001); and when sending a first request message belonging to a single packet, the second field of its second extended header is set to 0x1A (00011010). The second field in the second extended header of the first response message is set to 0x1B (00011011). Through the predefined opcodes, the second terminal can identify the message type of the currently received first or second request message. Similarly, the first terminal can identify that the currently received first response message carries a third extended header and requires loopback delay calculation.

[0102] like Figure 6 The flowchart shown illustrates the message exchange between the first and second terminals under a RoCEv2 protocol write operation. In this embodiment, for request messages that belong to the first packet or intermediate packet and carry the TSTH extension header, the second terminal responds with an ACK message. The ACK message carries the TSTH extension header. Loopback delay can be calculated based on the first timestamp in the TSTH extension header and the second timestamp of receiving the ACK message. For request messages that belong to the last packet and do not carry the TSTH extension header, the second terminal automatically responds with an ACK message under the RoCEv2 protocol, and loopback delay can also be calculated. The ACK message in this case also does not carry the TSTH extension header.

[0103] Compared with the prior art, the embodiment of the application defines an extension header TSTH of a RoCEv2 message carrying a timestamp, records the sending time of a request message, and defines the format of a request message and a response message carrying the extension header TSTH; the request end sends the request message with the extension header TSTH, the response 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 request end completes the loop delay calculation operation based on the timestamp carried by the extension header TSTH of the corresponding message, and the response end does not need to calculate, thereby the real-time on-demand measurement of the network loop delay can be implemented, the problem of untimely RoCEv2 protocol loop delay calculation is solved, and the RoCEv2 protocol performance is improved.

[0104] Meanwhile, the request message carries the timestamp through the extension header TSTH, so that the request end does not need to record the sending time of the request message locally, and the storage space of the request end is saved.

[0105] Referring to Figure 7 , Figure 7 is another flowchart of a delay measurement method provided by the embodiment of the application. The delay measurement method is applied to a second terminal and includes the following steps.

[0106] S21: receiving 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; and the second extension header carries first indication information, which is used to instruct the second terminal to respond to the message.

[0107] S22: sending 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; and the first response message is used to instruct the first terminal to calculate the loop delay of the first request message according to a 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 the following steps.

[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; wherein the second response message is used to instruct the first terminal to calculate the loop delay of the second request message 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.

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

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

[0113] It should be noted that the working process of the time delay measurement method applied to the second terminal according to the embodiments of the present application can refer to the working process of the time delay measurement method applied to the first terminal according to the above-mentioned embodiments, and the technical effects achieved are the same as those of the time delay measurement method applied to the first terminal according to the above-mentioned embodiments, which will not be described here in detail.

[0114] Referring to Figure 8 , Figure 8 is a structural block diagram of a time delay measurement device provided by the embodiments of the present application, and the time delay measurement device is applied to a first terminal and includes:

[0115] The first request message sending module 11 is 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 the sending time of the first request message; and the second extension header carries first indication information, which is used to instruct the second terminal to respond to a message.

[0116] The first response message receiving module 12 is 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.

[0117] The first loopback time delay calculation module 13 is configured to calculate the loopback time delay of the first request message according to a 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 a transmission message when the length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal.

[0119] In an optional embodiment, the apparatus further comprises a first function module and a message encapsulation module.

[0120] The first function module is configured to send a loopback delay measurement request to the message encapsulation module.

[0121] The message encapsulation module is configured to, after receiving the loopback delay measurement request, split a 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.

[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 length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message 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, a first timestamp of the local time of the first terminal is obtained as the sending time of the corresponding first request message, and the first timestamp is written into the first extension header of the first request message.

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

[0126] In an optional embodiment, the apparatus further comprises:

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

[0128] A second response message receiving module is configured to receive a second response message sent by the second terminal.

[0129] The second loopback delay calculation module is configured to calculate a loopback delay of the second request packet according to a third timestamp indicating an arrival time of the second response packet and a fourth timestamp indicating a sending time of the second request packet.

[0130] As an improvement of the above scheme, the packet encapsulation module is further configured to perform the following operation:

[0131] Before sending the first request packet or the second request packet, the second field in the second extension header of the first request packet or the second request packet is set to a preset defined operation code according to a packet type of the first request packet or the second request packet.

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

[0133] It should be noted that the working processes of the various modules in the time delay measurement device applied to the first terminal described in the embodiments of the present application can refer to the working processes of the time delay measurement method applied to the first terminal described in the above embodiments, and the technical effects achieved are the same as those of the time delay measurement method applied to the first terminal described in the above embodiments, which will not be described here again.

[0134] Referring to Figure 9 , Figure 9 is another structural block diagram of a time delay measurement device provided by the embodiments of the present application, the time delay measurement device is applied to a second terminal, and includes:

[0135] The first request packet receiving module 21 is configured to receive a first request packet sent by a first terminal, wherein the first request packet 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 packet; and the second extension header carries first indication information, which is used to instruct the second terminal to respond to a packet.

[0136] The first packet response module 22 is configured to send a first response packet to the first terminal, wherein the first response packet carries a third extension header, and the third extension header carries the first timestamp; and the first response packet is used to instruct the first terminal to calculate a loopback delay of the first request packet according to a second timestamp indicating an arrival time of the first response packet 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, configured to receive a second request message sent by the first terminal, wherein the second request message comprises the second extension header, and the second extension header carries the first indication information;

[0139] a second message response module, configured to send a second response message to the first terminal, wherein the second response message is used to instruct the first terminal to calculate the loopback delay of the second request message 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.

[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 comprises a first packet and an intermediate packet split from a transmission message when the length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message 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 comprises a tail packet split from a transmission message when the length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal.

[0142] It should be noted that the working processes of the various modules in the time delay measurement device applied to the second terminal according to the embodiments of the present application can refer to the working processes of the time delay measurement method applied to the second terminal according to the embodiments described above, and the technical effects achieved are the same as those of the time delay measurement method applied to the second terminal according to the embodiments described above, which will not be described herein again.

[0143] Referring to Figure 10 , Figure 10 is a structural block diagram of a time delay measurement device provided by the embodiments of the present application. The time delay measurement device comprises a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. The processor 31 implements the steps in each of the time delay measurement method embodiments described above, such as steps S11-S13 or steps S21-S22, when executing the computer program.

[0144] For example, the computer program can 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 application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the time delay measurement device.

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

[0146] The processor 31 can be a central processing unit (CPU), and can also be 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. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor 31 is the control center of the time delay measurement device, and connects various parts of the time delay measurement device through various interfaces and lines.

[0147] The memory 32 can be used to store the computer programs and / or modules, and the processor 31 realizes various functions of the time delay measurement device by running or executing the computer programs and / or modules 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, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), and the like. In addition, the memory 32 can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.

[0148] The modules / units integrated in the time delay measurement device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor 31 executes the computer program, the steps of the above-mentioned various method embodiments can be realized. The computer program includes computer program code, which can be in the form of source code, object code, an executable file, or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0149] It should be noted that the apparatus embodiments described above are merely illustrative, and the units described as separate units can or can not be physically separate, and the units shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. In addition, the connection relationship between the modules in the apparatus embodiment provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.

[0150] The above is the preferred embodiment of the present application. It should be noted that those skilled in the art can make many improvements and refinements without departing from the principles of the present application, and these improvements and refinements are also considered within the scope of protection of the present application.

Claims

1. A method of measuring a time delay, characterized by, Applied to a first terminal, the first terminal and a second terminal communicate based on a RoCEv2 protocol, comprising: sending a first request message to the 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, the first indication information being used to instruct the second terminal to respond to a message; the first request message is a message based on the RoCEv2 protocol, and a message type of the first request message includes a first packet and a middle packet split from a transmission message when a length of the transmission message is greater than a maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal; 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 a loopback delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

2. The method of claim 1, wherein, The method further comprises: a first function module of the first terminal sends a loopback delay measurement request to a message encapsulation module; after receiving the loopback delay measurement request, the message encapsulation module splits a transmission message according to a maximum transmission unit of the first terminal to obtain at least one first request message and / or second request message.

3. The method of claim 2, wherein the time delay is measured by: The second request message is a message based on the RoCEv2 protocol, and a message type of the second request message includes a tail packet split from the transmission message when a length of the transmission message is greater than the maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal.

4. The method of claim 2, wherein the time delay is measured by: The method further comprises: before sending the first request message, the message encapsulation module obtains a first timestamp of a local time of the first terminal as a sending time of a corresponding first request message, and writes the first timestamp into the first extension header of the first request message; the message encapsulation module sets a first field in the second extension header in the first request message as the first indication information.

5. The method of claim 2, wherein the time delay is measured by: The method further comprises: sending a second request message to the second terminal; wherein a second extension header in the second request message carries the first indication information; receiving a second response message sent by the second terminal; calculating a loopback delay of the second request message according to a third timestamp indicating an arrival time of the second response message and a fourth timestamp indicating a sending time of the second request message.

6. The method of claim 4 or 5, wherein, The method further comprises: before sending the first request message or the second request message, the message encapsulation module sets a second field in a second extension header of the first request message or the second request message as a preset defined operation code according to a message type of the first request message or the second request message; The operation code is used to indicate a message type of the first request message or the second request message.

7. A method of measuring a time delay, characterized by, The first terminal and the second terminal communicate based on a RoCEv2 protocol. The first terminal sends a first request message to the 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, the first indication information being used to instruct the second terminal to respond to a message; the first request message is a message based on the RoCEv2 protocol, and a message type of the first request message includes a first packet and a middle packet split from a transmission message when a length of the transmission message is greater than a maximum transmission unit of the first terminal, or a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal. The first terminal sends a first response message to the second 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 a loopback delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

8. The method of claim 7, wherein the time delay is measured by, The method further includes: The first terminal sends a second request message to the second terminal, wherein the second request message includes the second extension header; and the second extension header carries the first indication information. The first terminal sends a second response message to the second terminal, wherein the second response message is used to instruct the first terminal to calculate a loopback delay of the second request message according to a third timestamp indicating an arrival time of the second response message and a fourth timestamp indicating a sending time of the second request message.

9. The method of claim 8, wherein the time delay is measured by, The second request message is a message based on the RoCEv2 protocol, and a message type of the second request message includes a last packet split from a transmission message when a length of the transmission message is greater than a maximum transmission unit of the first terminal, or a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal.

10. A time delay measurement apparatus characterized by comprising: The first terminal and the second terminal communicate based on a RoCEv2 protocol. The first terminal sends a first request message to the 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, the first indication information being used to instruct the second terminal to respond to a message; the first request message is a message based on the RoCEv2 protocol, and a message type of the first request message includes a first packet and a middle packet split from a transmission message when a length of the transmission message is greater than a maximum transmission unit of the first terminal, or a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal. The first response message receiving module is 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 loopback delay calculating module is configured to calculate a loopback delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

11. A time delay measurement apparatus, characterized by comprising: The application is applied to a second terminal, and a first terminal and the second terminal communicate based on a RoCEv2 protocol, and includes: The first request message receiving module 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 respond to a message; the first request message is a message based on a RoCEv2 protocol, and a message type of the first request message includes a first packet and a middle packet split from a transmission message when a length of the transmission message is greater than a maximum transmission unit of the first terminal, and a single packet containing the transmission message when the length of the transmission message is not greater than the maximum transmission unit of the first terminal; The first message responding module is configured 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; and the first response message is used to instruct the first terminal to calculate a loopback delay of the first request message according to a second timestamp indicating an arrival time of the first response message and the first timestamp in the third extension header.

12. A time delay measurement device, characterized by The application includes: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the time delay measurement method in any one of claims 1 to 6 or the time delay measurement method in any one of claims 7 to 9 when executing the computer program.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and when the computer program runs, controls a device where the computer readable storage medium is located to execute the time delay measurement method in any one of claims 1 to 6 or the time delay measurement method in any one of claims 7 to 9.

14. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the time delay measurement method in any one of claims 1 to 6 or the time delay measurement method in any one of claims 7 to 9.

Citation Information

Patent Citations

  • TSN network time delay monitoring method, device and system, electronic equipment and storage medium

    CN117354201A