A network quality detection method, apparatus, device and medium
By determining the network architecture among detection nodes and using specific tools and protocols, the network architecture incompatibility problem of RDMA and TCP/IP networks is resolved, and quality detection of both types of networks is achieved.
Patent Information
- Application Number
- CN202410705306.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-05-31
AI Technical Summary
Existing network testing tools are incompatible with RDMA and TCP/IP network architectures, making it impossible to perform network quality testing on both types of networks simultaneously.
By determining the network architecture supported by the nodes to be tested, the RDMA network is tested for connectivity, latency, and performance using the rping tool and RoCE protocol, while the TCP/IP network is tested using the ping and netperf tools, ensuring the matching of the testing order and indicators.
It enables simultaneous quality inspection of RDMA and TCP/IP networks, providing test results for network connectivity, latency, and performance, and resolves the issue of network architecture incompatibility.
Smart Images

Figure CN118337661B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, in particular to a network quality detection method and device, equipment and medium. BACKGROUND
[0002] With the development of hyper-converged, cloud computing and other technologies, more and more businesses begin to be deployed in such systems, and these businesses often require high data transmission rate and data reliability. Traditional TCP / IP (Transmission Control Protocol / Internet Protocol) communication requires the message to enter the kernel protocol stack for message header encapsulation and analysis. This process not only causes the entire forwarding process to be lengthened, the forwarding efficiency to be lowered, and the message delay to be increased. It also consumes a large amount of host CPU (Central Processing Unit), memory and other resources due to interrupts, context switching and other processes in this process. The RDMA (Remote Direct Memory Access) technology can bypass the kernel, and data can be read and written directly from the application program to the sending or receiving cache area without going through the protocol stack, thereby improving the forwarding efficiency, reducing the communication delay, and reducing the consumption of host resources.
[0003] However, the interfaces of these two types of network architectures are completely different, which will cause various applications, including network quality and network performance detection applications, to be incompatible due to the completely different networks they face. Some fusion technologies in recent years, such as SMC-R (Shared Memory Communication over RDMA, a kernel network protocol based on RDMA technology and compatible with socket (network programming interface) interface), have realized the technology of transparently replacing TCP type sockets with AF_SMC type sockets, thereby enabling upper-layer applications to use RDMA networks to improve forwarding efficiency without sensing. However, this type of network can only forward TCP traffic through the RDMA link. This also causes some commonly used network testing tools, such as ping (Packet Internet Groper, Internet packet explorer) and other tools, to be unable to be used to test network connectivity or communication delay.
[0004] In summary, how to simultaneously detect the network quality of RDMA networks and TCP / IP networks is a problem to be solved at present. SUMMARY
[0005] Therefore, the present application aims to provide a network quality detection method, device, equipment and medium, which can simultaneously detect the network quality of RDMA network and TCP / IP network.
[0006] In the first aspect, the present application discloses a network quality detection method, comprising:
[0007] determining a network architecture supported by the to-be-detected node; the network architecture comprises a first network architecture based on remote direct data access technology and a second network architecture based on a network communication protocol; the network communication protocol is a transmission control protocol or an Internet Protocol;
[0008] if the to-be-detected node supports the first network architecture and the second network architecture, determining a detection order between the first network architecture and the second network architecture;
[0009] based on the detection order and according to a preset network quality detection index, respectively detecting the network quality of the first network architecture and the second network architecture between the to-be-detected nodes to obtain corresponding network quality detection results; the preset network quality detection index is any one or several indexes of network connectivity, network delay and network performance.
[0010] Optionally, the to-be-detected node comprises a first target node as a server and a second target node as a client.
[0011] Correspondingly, according to the preset network quality detection index, the network quality of the first network architecture is detected between the to-be-detected nodes, comprising:
[0012] using an rping tool and a preset monitoring program to test the network connectivity of the first network architecture between the first target node and the second target node;
[0013] and / or, based on a routable RoCE protocol and a preset delay test interaction message, testing the network delay of the first network architecture between the first target node and the second target node;
[0014] and / or, based on a routable RoCE protocol and a preset performance test interaction message, testing the network performance of the first network architecture between the first target node and the second target node.
[0015] Optionally, the network connectivity of the first network architecture is tested between the first target node and the second target node using an rping tool and a preset monitoring program, comprising:
[0016] running the preset monitoring program in the first target node;
[0017] monitoring the received data packet sent by the second target node based on the rping tool by using the preset monitoring program, and counting data length and test times of the data packet;
[0018] judging whether the data length and test times of the data packet are consistent with original data length and original test times preset by the second target node;
[0019] if consistent, determining that the test result of network connectivity of the first network architecture is passed;
[0020] if inconsistent, determining that the test result of network connectivity of the first network architecture is failed.
[0021] Optionally, the packet structure of the data packet set based on the routable RoCE protocol comprises a packet identifier, a sending end identifier, a packet type, a sending end physical address, a random number and a time value; the delay test interaction packet comprises a first time test packet, a second time test packet, a third time test packet and a fourth time test packet corresponding to a preset delay test packet type; the performance test interaction packet comprises a first performance test packet, a second performance test packet, a third performance test packet, a fourth performance test packet and a fifth performance test packet corresponding to a preset performance test packet type.
[0022] Optionally, the network delay of the first network architecture between the first target node and the second target node is tested based on the routable RoCE protocol and the preset delay test interaction packet, comprising:
[0023] the first target node sends the first time test packet and the second time test packet to the second target node in sequence, wherein the time value in the first time test packet is empty, and the time value in the second time test packet is a first sending time of the first time test packet;
[0024] the second target node records a first receiving time of the first time test packet, and records a server physical address and a first random number carried in the first time test packet;
[0025] the second target node acquires a server physical address and a second random number carried in the second time test packet, and performs a physical address checking operation and a random number checking operation, and after the checking is passed, the second target node sends the third time test packet to the first target node, and records a second sending time of the third time test packet;
[0026] The first target node records a second receiving time of the third time test packet, and obtains a client physical address and a third random number carried in the third time test packet, and then performs a physical address checking operation and a random number checking operation, and after the checking passes, the first target node sends the fourth time test packet to the second target node; the time value in the fourth time test packet is the second receiving time;
[0027] The second target node calculates a network delay of the first network architecture based on the first sending time, the first receiving time, the second sending time and the second receiving time; wherein the first random number, the second random number, the third random number and the fourth random number satisfy a preset relationship.
[0028] Optionally, the calculation of the network delay of the first network architecture based on the first sending time, the first receiving time, the second sending time and the second receiving time comprises:
[0029] calculating a first difference value between the first receiving time and the first sending time;
[0030] calculating a second difference value between the second receiving time and the second sending time;
[0031] calculating an average value between an absolute value of the first difference value and an absolute value of the second difference value, and taking the average value as a time difference value between a server and a client;
[0032] if the first difference value is greater than the second difference value, determining a client time based on a sum value of a server time and the time difference value;
[0033] if the first difference value is not greater than the second difference value, determining a client time based on a difference value of a server time and the time difference value;
[0034] determining a difference value between the first difference value and the client time as a network delay from a server to a client in the first network architecture, and determining a difference value between the second difference value and the client time as a network delay from a client to a server in the first network architecture.
[0035] Optionally, the testing of the network performance of the first network architecture between the first target node and the second target node based on the routable RoCE protocol and the pre-set performance test interaction packet comprises:
[0036] sending the first performance test packet to the first target node by the second target node, so that the first target node enters a data receiving preparation state, and the second target node replies the second performance test packet for representing preparation readiness;
[0037] sending the third performance test packet to the first target node by the second target node after receiving the second performance test packet;
[0038] performing timing operation by the first target node after receiving the third performance test packet, and continuously counting data amount of the third performance test packet until the fourth performance test packet for representing test end sent by the second target node is acquired, and calculating packet rate based on total data amount and total timing time;
[0039] sending the fifth performance test packet carrying the packet rate to the second target node by the first target node, so as to complete client test operation.
[0040] Optionally, the nodes to be detected include a first target node as a server and a second target node as a client.
[0041] Correspondingly, network quality of the second network architecture is detected between the nodes to be detected according to preset network quality detection indexes, including:
[0042] Internet packet explorer is used to test network connectivity of the second network architecture between the first target node and the second target node.
[0043] And / or, Internet packet explorer is used to test network delay of the second network architecture between the first target node and the second target node.
[0044] And / or, preset performance test tool is used to test network performance of the second network architecture between the first target node and the second target node.
[0045] In a second aspect, the application discloses a network quality detection device, including:
[0046] a network architecture determination module, used for determining network architecture supported by nodes to be detected; the network architecture includes a first network architecture based on remote direct data access technology and a second network architecture based on network communication protocol; the network communication protocol is transmission control protocol or Internet interconnection protocol;
[0047] a detection sequence determination module configured to determine a detection sequence between the first network architecture and the second network architecture if the to-be-detected nodes support the first network architecture and the second network architecture;
[0048] a detection module configured to perform network quality detection on the first network architecture and the second network architecture respectively between the to-be-detected nodes based on the detection sequence and according to a preset network quality detection index to obtain corresponding network quality detection results, wherein the preset network quality detection index is any one or several of network connectivity, network latency and network performance.
[0049] In a third aspect, the present application discloses an electronic device, comprising:
[0050] a memory configured to save a computer program;
[0051] a processor configured to execute the computer program to implement the steps of the network quality detection method disclosed above.
[0052] In a fourth aspect, the present application discloses a computer readable storage medium configured to store a computer program; wherein the computer program is executed by a processor to implement the steps of the network quality detection method disclosed above.
[0053] It can be seen that the present application determines the network architectures supported by to-be-detected nodes; the network architectures include a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol; the network communication protocol is a transmission control protocol or an internet interconnection protocol; if the to-be-detected nodes support the first network architecture and the second network architecture, a detection sequence between the first network architecture and the second network architecture is determined; network quality detection is performed on the first network architecture and the second network architecture respectively between the to-be-detected nodes based on the detection sequence and according to a preset network quality detection index to obtain corresponding network quality detection results; wherein the preset network quality detection index is any one or several of network connectivity, network latency and network performance.
[0054] Beneficial effects: The application first determines the network architecture supported by the to-be-detected nodes, the network architecture including a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol, the network communication protocol being specifically a transmission control protocol or an Internet interconnection protocol. If the to-be-detected nodes support the first network architecture and the second network architecture, the network quality of the first network architecture and the second network architecture is detected according to the determined detection sequence and according to preset network quality detection indexes between the to-be-detected nodes, to obtain corresponding network quality detection results. That is, the application provides a network quality detection method for a fusion network. When the to-be-detected nodes support an RDMA network architecture and a TCP / IP network architecture, the application can simultaneously detect the network quality of the RDMA network and the TCP / IP network, and obtain respective corresponding network quality detection results, thereby solving the problem that network test tools in the prior art are incompatible due to different network architectures. Further, the preset network quality detection indexes in the application are any one or several indexes of network connectivity, network delay and network performance. That is, the application specifically discloses a method for detecting network quality from three different dimensions of network connectivity, delay and performance. BRIEF DESCRIPTION OF DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.
[0056] Figure 1 A network quality detection method flow chart disclosed by the present application;
[0057] Figure 2 A network quality detection flow chart disclosed by the present application;
[0058] Figure 3 A network quality detection topology structure chart disclosed by the present application;
[0059] Figure 4 A network delay detection method flow chart disclosed by the present application;
[0060] Figure 5 A communication diagram between a server and a client disclosed by the present application;
[0061] Figure 6 A network quality detection device structure diagram disclosed by the present application;
[0062] Figure 7A structure diagram of an electronic device is disclosed in the present application. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0064] Currently, the interfaces of the RDMA network architecture and the TCP / IP network architecture are completely different, which causes various applications, including network quality and network performance detection applications, to be incompatible due to the completely different networks. Some fusion technologies in recent years, such as SMC-R, have realized the technology of transparently replacing a TCP type socket with an AF_SMC type socket, so that when an upper-layer application communicates, the RDMA network can be used to improve the forwarding efficiency without sensing. However, this type of network can only forward TCP traffic through the RDMA link. This also causes some commonly used network test tools, such as the ping (Packet Internet Groper, Internet packet explorer) tool, to be unable to be used to test network connectivity or communication delay. Therefore, the embodiments of the present application disclose a network quality detection method, device, equipment and medium, which can simultaneously detect the network quality of the RDMA network and the TCP / IP network.
[0065] Referring to Figure 1 The embodiments of the present application disclose a network quality detection method, which comprises the following steps:
[0066] Step S11: determining a network architecture supported by a to-be-detected node; the network architecture comprises a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol, and the network communication protocol is a transmission control protocol or an Internet interconnection protocol.
[0067] In the embodiments, first, the network architecture supported by the to-be-detected node is determined, and the network architecture comprises the first network architecture constructed based on the remote direct data access technology and the second network architecture constructed based on the network communication protocol, and the network communication protocol is specifically the transmission control protocol or the Internet interconnection protocol. That is, it is determined whether the to-be-detected node supports the RDMA network and the TCP / IP network.
[0068] Step S12: if the to-be-detected node supports the first network architecture and the second network architecture, determining a detection order between the first network architecture and the second network architecture.
[0069] In this embodiment, if the node to be detected supports the first network architecture and the second network architecture, the detection order between the first network architecture and the second network architecture is determined. It can be understood that, since the RDMA link and the TCP / IP link are different, the testing methods and principles are also different, and different testing methods need to be taken for the two. For example, the connectivity of the TCP / IP network can be tested by the ping tool, but this method is not suitable for RDMA. Because the ping application itself uses the TCP / IP protocol stack to encapsulate, send and receive messages, its messages cannot be forwarded through the network that communicates through the RDMA technology. Since the detection method is mainly aimed at the network that combines RDMA and TCP, both networks need to be detected, and the detection needs to be carried out one by one to avoid mutual influence on the results.
[0070] It should be noted that the detection order between the first network architecture and the second network architecture can be set by the user, that is, in the case where it is determined that the node to be detected supports both the first network architecture and the second network architecture, an information input interface can be provided to receive the order setting instruction input by the user, so as to detect the first network architecture and the second network architecture according to the detection order set by the user. In addition, detection can also be carried out according to the default detection order, for example, the default order is set to first detect the RDMA network, and then detect the TCP / IP network, and the application does not limit the detection order between the first network architecture and the second network architecture. In addition, it should be noted that, if the node to be detected only supports the first network architecture or only supports the second network architecture, the information input interface does not need to be provided to the user, and the node to be detected can be automatically detected according to the preset network quality detection index. The information input interface can be in the form of a selection button in the front-end interface, so that the user can select which network to detect first.
[0071] The overall flow of detection is as shown in Figure 2 Assuming that the RDMA network is detected first, and then the TCP / IP network is detected. Then, after the detection starts, the RDMA link detection is carried out first, and the detection items mainly include three, which are network connectivity test, delay test, and performance test; when the three tests are completed, the TCP / IP network test is started (as shown by the dashed line). The items of the TCP / IP network test are the same as those of the network described above, but since the two network architectures are different, the contents of the test are completely different. When detecting, each detection node will first detect the TCP network of itself, and then detect whether the node supports the RDMA network. If it supports, the node to be detected will notify the other node that it supports. When both nodes support the RDMA network, the connection of the RDMA can be established, and the test of each item can be carried out.
[0072] Step S13: performing network quality detection on the first network architecture and the second network architecture between each of the to-be-detected nodes according to the preset network quality detection index based on the detection sequence, to obtain corresponding network quality detection results; the preset network quality detection index is any one or several of network connectivity, network latency, and network performance.
[0073] In this embodiment, network quality detection is performed on the first network architecture and the second network architecture between each to-be-detected node according to the determined detection sequence and the preset network quality detection index, to obtain corresponding network quality detection results. That is, the network communication quality of the RDMA link in the converged network can be detected according to the actual network situation, and the network communication quality of the normal TCP / IP link can also be detected. Moreover, because the detection is based on in-band detection, the detection result is more meaningful for actual services, and the in-band detection means that the detection network and the actual running network have the same transmission medium and transmission path.
[0074] That is, the present application provides a network quality detection method for a converged network. When the to-be-detected nodes support the RDMA network architecture and the TCP / IP network architecture, the present application can simultaneously perform network quality detection on the RDMA network and the TCP / IP network, and obtain corresponding network quality detection results, thereby solving the problem of incompatibility of network test tools in the prior art due to different network architectures. Further, the preset network quality detection index in the present application is any one or several of network connectivity, network latency, and network performance, that is, the present application specifically discloses a method for detecting network quality from three different dimensions of network connectivity, latency, and performance.
[0075] It should be noted that the to-be-detected nodes include a first target node as a server and a second target node as a client. In this embodiment, the control node specifies whether the to-be-detected nodes are servers or clients, as shown in Figure 3 The control node is used to issue detection instructions to the to-be-detected nodes, such as instructions for establishing connections between nodes, and the dashed lines in the figure represent links between the to-be-detected nodes, and the number of dashed lines represents the number of detections. For example, in Figure 3 the selected server node is the to-be-detected node 1, and the links between the to-be-detected node 1 and the to-be-detected node 2 and the links between the to-be-detected node 1 and the to-be-detected node 3 need to be detected, a total of twice, and the to-be-detected node 2 and the to-be-detected node 3 act as clients.
[0076] In the specific embodiment, the network quality of the first network architecture is detected according to a preset network quality detection index between each of the nodes to be detected, including: testing the network connectivity of the first network architecture between the first target node and the second target node by using an rping tool and a preset monitoring program; and / or testing the network latency of the first network architecture between the first target node and the second target node based on a routable RoCE protocol and a preset latency test interaction message; and / or testing the network performance of the first network architecture between the first target node and the second target node based on a routable RoCE protocol and a preset performance test interaction message. That is, when testing the connectivity of the communication parties, for the RDMA network, ping cannot be used, and the rping tool and the preset monitoring program are used to test the connectivity of the RDMA network, and the rping is a tool for testing the RDMA connectivity. When testing the latency of the RDMA network, the data part based on the routable RoCE protocol (Routable RDMA over Converged Ethernet, RRoCE) is reasonably designed, the latency test interaction message is designed, and by using the message, the communication between the two parties is implemented multiple times, and the accurate calculation of the latency is implemented even if there is a time difference between the server and the client. In the RDMA network, in order to better test the performance, the performance test interaction message based on the routable RoCE protocol is designed to implement the interaction between the server and the client during the performance detection, and the result is calculated by the server, and then returned to the client by the designed message, and so on until all the nodes to be detected are detected.
[0077] In a specific implementation, network quality testing of the second network architecture is performed between each of the nodes to be tested according to preset network quality testing indicators. This includes: testing the network connectivity of the second network architecture between the first target node and the second target node using an Internet packet explorer; and / or testing the network latency of the second network architecture between the first target node and the second target node using an Internet packet explorer; and / or testing the network performance of the second network architecture between the first target node and the second target node using a preset performance testing tool. That is, when testing the connectivity between the communicating parties, for TCP / IP networks, this embodiment uses the existing ping tool for testing. As mentioned above, after selecting a node to be tested as the server, two ping tests are initiated against other nodes. The connectivity is judged based on the test results returned by the ping. If both tests are successful, the connectivity test is considered passed; otherwise, it fails. There are many methods for testing the latency of TCP / IP networks, such as using ping and netperf (a network performance measurement tool). This method uses the existing ping tool for testing. Figure 3 After selecting a node to be tested as the server node, this node initiates 10 ping tests to other nodes. After the ping tests are completed, latency statistics are generated. The average of these statistics is then taken as the latency test value. It should be noted that the latency here is the round-trip time (RTT) of an ICMP (Internet Control Message Protocol) message. When testing the network performance of communicating parties, in TCP / IP networks, tools such as netperf and iperf (a network performance testing tool) can be used. This embodiment specifically uses iperf to test the performance between nodes. Figure 3 In the topology shown, node 1 to be tested is used as the server and the other nodes are used as clients. Tests are started one by one to obtain the test results.
[0078] Further, the network connectivity of the first network architecture is tested by using the rping tool and the preset monitoring program between the first target node and the second target node, which comprises: running the preset monitoring program on the first target node; monitoring the received data packet sent by the second target node based on the rping tool by using the preset monitoring program, and counting the data length and test times of the data packet; judging whether the data length and test times of the data packet are consistent with the original data length and original test times set by the second target node in advance; if consistent, determining that the test result of the network connectivity of the first network architecture is passed; if inconsistent, determining that the test result of the network connectivity of the first network architecture is failed. That is, when testing the network connectivity of the first network architecture by using the rping tool and the preset monitoring program, since the rping tool itself does not have the function of counting information, the preset monitoring program is run on the first target node as the server, and the monitoring program is used to monitor the received data packet sent by the client, mainly monitoring the following contents: which node the received data comes from, the number and length of the received data, and the test times, etc. The second target node as the client sends the rping packet to the server in turn, and sets the data length and test times of the packet, for example, the data length is 1400, and the test times is 2. After all nodes are detected, the data counted by the monitoring program of the server is viewed, and it is judged whether the data length and test times of the recorded data packet are consistent with the original data length and original test times set by the second target node in advance; if consistent, determining that the test result of the network connectivity of the first network architecture is passed; if inconsistent, determining that the test result of the network connectivity of the first network architecture is failed. For example, the data counted by the monitoring program of the server can obtain Table 1:
[0079] Table 1
[0080]
[0081] In the above detection node 3 test, only 1 test data is received, but the client tests twice, so it is determined that the test is failed.
[0082] It should be pointed out that the packet structure of the data packet set based on the routable RoCE protocol comprises a packet identifier, a sending end identifier, a packet type, a sending end physical address, a random number and a time value; the delay test interaction packet comprises a first time test packet, a second time test packet, a third time test packet and a fourth time test packet corresponding to a preset delay test packet type; and the performance test interaction packet comprises a first performance test packet, a second performance test packet, a third performance test packet, a fourth performance test packet and a fifth performance test packet corresponding to a preset performance test packet type.
[0083] The message structure of the data message set based on the routable RoCE protocol includes message identification, sending end identification, message type, sending end physical address, random number and time value.
[0084] When performing the delay test, since the RDMA delay itself is much smaller than the TCP / IP network, in the design process, the error caused by the time difference of the devices of the two communication parties is fully considered, and a time difference compensation method is proposed to eliminate the influence of the error on the detection result. For this purpose, four types of delay test interaction messages are designed based on the RRoCE message for the network using the RDMA technology, and it is specified that 20 bytes (160 bits) are divided from the data part of the message to carry the fields required for detecting the network, as shown in Table 2:
[0085] Table 2
[0086]
[0087] The first byte in the above 20 bytes (160 bits) is used to represent the message identification: 0xf1 is used to indicate that the message is used for delay detection, the first bit of the second byte is used to represent the role, i.e. the sending end identification: 0 represents the server and 1 represents the client, the second to fourth bits are temporarily reserved for standby, and the fifth to eighth bits are used to represent the message type. For delay detection, there are four types according to the preset delay test message type, as shown in Table 3:
[0088] Table 3
[0089]
[0090] The third to eighth bytes of the above 16 bytes are used to identify the sender, the mac (physical address) address is used here, the ninth to twelfth bytes are used to carry the message random number (or specified value), and the thirteenth to twentieth bytes represent the time, the first four bytes represent the time unit in seconds, and the last four bytes represent the unit in nanoseconds. The eight bytes together describe a time accurate to nanoseconds. In the application, the message format carried by the above four types of messages follows the above rules, but the content is slightly different according to the application.
[0091] When performing the performance test, a new message is designed based on the RRoCE message, and it is specified that the first message at the beginning of the test uses this message as a control message to indicate to the two communication parties that this is a traffic performance test message and to inform the server to start counting the received messages. The message format is as follows: 16 bytes (128 bits) are divided from the data part of the RRoCE message to carry the fields required for detecting the network performance, as shown in Table 4:
[0092] Table 4
[0093]
[0094] The first byte of the 16 bytes (128 bits) is used to represent the message identification: 0xf2 is used to indicate that the message is used as performance detection, the first bit of the second byte is used to represent the role, i.e., the sender identification: 0 code server, 1 represents the client, and the second to fourth bits represent the message type. For performance detection, five types are set according to the preset performance test message type, as shown in Table 5:
[0095] Table 5
[0096]
[0097] The fifth to eighth bits of the second byte are temporarily reserved. The third to eighth bytes of the above 16 bytes are used to identify the sender, and the physical address is used to represent it. The ninth to twelfth bytes are used to carry the message random number (or specified value). In the application, the message format carried by the above five types of messages follows the above rules, but the content is slightly different according to the different applications.
[0098] Further, as shown in Figure 4 , the network delay of the first network architecture is tested between the first target node and the second target node based on the routable RoCE protocol and the pre-set delay test interaction message, including the following steps:
[0099] Step S21: The first target node sends the first time test message and the second time test message to the second target node in turn, the time value in the first time test message is empty, and the time value in the second time test message is the first sending time of the first time test message.
[0100] In this embodiment, first of all, it needs to be pointed out that, as shown in Figure 5 , one end of the detection party is used as a server, and the other end is used as a client. First, two ends create sockets, and the socket type depends on the user's choice. If the user wants to test the ordinary TCP network connection, then create an AF_INET type socket. If the user tests the RRoCE network using RDMA technology, then create an AF_SMC type socket. The AF_INET type socket is a socket used by the current network device supporting the TCP / IP protocol. The AF_SMC type socket is a socket provided by the aforementioned SMC-R to replace the AF_INET, which uses the RDMA technology to realize data transmission.
[0101] After the server application is started, the AF_SMC type socket is initialized, and the 5921 port is started to listen, waiting for the connection of the client. The AF_SMC type socket of the client is bound to the 5921 port, and subsequent messages such as three-way handshake messages are sent through the 5921 port. The client and the server exchange their own memory remote memory block buffers and control information used to determine that the region can be safely accessed through the three-way handshake (proposal, Accept, Confirm) of SMC-R, and establish an RDMA connection for the two ends of the detection process to allow direct reading of the memory data to prepare for the subsequent detection process.
[0102] The first target node as the server sends a time_prepare message to the second target node as the client first. The message content is filled as described above, but does not carry any data in the time period of 13-20 bytes. When the server sends this message, it will also record the exact time when the message is sent, that is, the first sending time Tp s , which is: 1624502865.689805184 seconds, where 1624502865 represents the number of seconds experienced since 00:00:00 on January 1, 1970, that is, June 24, 2021 23:54:25. The decimal part 689805184 represents 689805184 nanoseconds after the above time.
[0103] After the server sends the time_prepare message, it will send a time_send message again. In this message, the random number field will not be randomly generated, but will be incremented by 1 using the last sent random number, so that the random numbers sent twice satisfy the preset relationship, thereby indicating that the current message is related to the last random number message. In the time field of 13-20 bytes, the first sending time Tp s recorded above will be filled. This is different from the timestamp of the ordinary message, because the timestamp of the ordinary message records the time when the current message is encapsulated, and the subsequent messages will be encapsulated again in the ip layer and the mac layer, which will consume time, thereby affecting the judgment of the transmission delay.
[0104] Step S22: record the first receiving time of the first time test message obtained by the second target node, and record the server physical address and the first random number carried in the first time test message.
[0105] In this embodiment, after receiving the time_prepare message, the client will immediately record the current time, that is, the first receiving time Tpr, and obtain the server physical address, the first random number, etc. from the message and record them.
[0106] Step S23: The second target node acquires the service end physical address and the second random number carried in the second time test message, and performs physical address checking operation and random number checking operation, and after the checking passes, the second target node sends the third time test message to the first target node, and records the second sending time of the third time test message.
[0107] In this embodiment, the client will subsequently receive the time_send message sent by the service end, acquire the service end physical address and the second random number from the time_send message, and then according to these data, extract the previously recorded message in the recorded data buffer, and perform physical address checking and random number checking. After the checking passes, it is proved that the Tp r recorded before and the Tp s received by the client this time are a set of useful data. Otherwise, wait for the record timeout time to come, and clean up the data. Considering that there may be a time difference between the two communication parties, it is obviously unreasonable to simply use this Tp r -Tp s to calculate the time difference between the two. Further, the client sends the time_prepare2 message to the service end, and the random number is +1 based on the received time_send, so that the random numbers satisfy the preset relationship, and the accurate sending time, i.e. the second sending time Tp2 s , is recorded locally.
[0108] Step S24: The first target node records the second receiving time of the third time test message, acquires the client physical address and the third random number carried in the third time test message, and then performs physical address checking operation and random number checking operation, and after the checking passes, the first target node sends the fourth time test message to the second target node; the time value in the fourth time test message is the second receiving time.
[0109] In this embodiment, after the service end receives the time_prepare2 message, the second receiving time Tp2 r is recorded, and the client physical address and the third random number are extracted, and after the checking passes, it is recorded. Then the service end sends the time_send2 message, and the random number in this message is time_prepare2 random number +1, so that the random numbers satisfy the preset relationship, and the second sending time Tp2 r is filled in the time field.
[0110] Step S25: calculating, by the second target node, a network delay of the first network architecture based on the first sending time, the first receiving time, the second sending time and the second receiving time; wherein the first random number, the second random number, the third random number and the fourth random number satisfy a preset relationship.
[0111] In the embodiment, after the client receives the time_send2 packet, the network delay of the first network architecture is calculated based on the first sending time, the first receiving time, the second sending time and the second receiving time.
[0112] Specifically, the calculation of the network delay of the first network architecture based on the first sending time, the first receiving time, the second sending time and the second receiving time includes: calculating a first difference value between the first receiving time and the first sending time; calculating a second difference value between the second receiving time and the second sending time; calculating an average value between an absolute value of the first difference value and an absolute value of the second difference value, and taking the average value as a time difference value between the server and the client; if the first difference value is greater than the second difference value, determining a client time based on a sum value of the server time and the time difference value; if the first difference value is not greater than the second difference value, determining the client time based on a difference value of the server time and the time difference value; determining a difference value between the first difference value and the client time as a network delay of the server to the client in the first network architecture, and determining a difference value between the second difference value and the client time as a network delay of the client to the server in the first network architecture.
[0113] That is, the time difference value ΔT between the server and the client can be calculated by the following formula in the embodiment:
[0114] ;
[0115] wherein, Tp r is the first receiving time, Tp s is the first sending time, Tp 2r is the second receiving time, and Tp2 s is the second sending time.
[0116] If Tp r -Tp s >Tp2 r -Tp2 s , then:
[0117] t c =t s +ΔT.
[0118] Otherwise:
[0119] t c =t s -∆T;
[0120] wherein t c represents the client time, t s represents the server time;
[0121] At this time, the network delay t d1 from the server to the client in the RDMA network can be calculated.
[0122] t d1 = (Tp r -Tp s )-t c ;
[0123] The network delay t d2 from the client to the server is:
[0124] t d2 = (Tp2 r -Tp2 s )-t c ;
[0125] Thus, the network delay of the RDMA network can be calculated.
[0126] Specifically, the method for testing the network performance of the first network architecture between the first target node and the second target node based on the routable RoCE protocol and the pre-set performance test interaction message comprises the following steps: sending, by the second target node, the first performance test message to the first target node, so that the first target node enters a data receiving preparation state, and replying, by the first target node, the second performance test message to the second target node for representing preparation readiness; sending, by the second target node, the third performance test message to the first target node after receiving the second performance test message; performing, by the first target node, a timing operation after receiving the third performance test message, and continuously counting the data amount of the third performance test message until the fourth performance test message representing test completion sent by the second target node is acquired, and then calculating the message rate based on the total data amount and the total timing time; and sending, by the first target node, the fifth performance test message carrying the message rate to the second target node, so as to complete the test operation of the client.
[0127] It should be noted that the RDMA connection establishment process corresponds to the same steps as the network delay detection, which will not be described here. After the connection establishment is completed, the detection is initiated by the client according to the instruction issued by the control node:
[0128] First, the client sends speed_first message, which carries a random number and its own MAC address as identity. After receiving the message, the server starts to establish the receiving preparation of the client, mainly to calculate the total size of the data volume by counting the length and number of messages. And reply to the second target node Speed_first_ack message to indicate that the preparation is ready. After receiving the message, the client will initiate speed_test message. After receiving the speed_test message, the server starts timing and counting the messages, and no longer responds to the client until the test is completed. When the test is completed, the client sends speed_last message to inform the server that the test has been completed. The server divides the total data volume by the total timing time to get the message rate, and sends it to the client through the speedlast message. The random number field is no longer sent with a random number, but the calculated rate result will be saved in the random number field of the speed_last_ack message. Thus, the test of the client is completed. The controller then detects the next node to be detected, and the method is the same as above, until all the checks are completed.
[0129] It can be seen that the application determines the network architecture supported by the to-be-detected node; the network architecture includes a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol; the network communication protocol is a transmission control protocol or an Internet protocol; if the to-be-detected node supports the first network architecture and the second network architecture, a detection order between the first network architecture and the second network architecture is determined; based on the detection order and according to a preset network quality detection index, network quality detection is performed on the first network architecture and the second network architecture respectively between the to-be-detected nodes to obtain corresponding network quality detection results; wherein the preset network quality detection index is any one or several indexes in network connectivity, network delay and network performance.
[0130] Beneficial effects: The application first determines the network architecture supported by the to-be-detected nodes, the network architecture including a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol, the network communication protocol being specifically a transmission control protocol or an Internet interconnection protocol. If the to-be-detected nodes support the first network architecture and the second network architecture, network quality detection is performed on the first network architecture and the second network architecture respectively according to the determined detection order and according to preset network quality detection indexes between the to-be-detected nodes, so as to obtain corresponding network quality detection results. That is, the application provides a network quality detection method for a fusion network. When the to-be-detected nodes support an RDMA network architecture and a TCP / IP network architecture, the application can simultaneously perform network quality detection on an RDMA network and a TCP / IP network, and obtain respective corresponding network quality detection results, thereby solving the problem that network test tools in the prior art are incompatible due to different network architectures. Further, the preset network quality detection indexes in the application are any one or several indexes in network connectivity, network delay and network performance. That is, the application specifically discloses a method for detecting network quality from three different dimensions of network connectivity, delay and performance.
[0131] Referring to Figure 6 As shown in the drawings, the embodiment of the application discloses a network quality detection device, which comprises:
[0132] A network architecture determination module 11 is configured to determine the network architecture supported by the to-be-detected nodes. The network architecture includes a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol. The network communication protocol is a transmission control protocol or an Internet interconnection protocol.
[0133] A detection order determination module 12 is configured to determine the detection order between the first network architecture and the second network architecture if the to-be-detected nodes support the first network architecture and the second network architecture.
[0134] A detection module 13 is configured to perform network quality detection on the first network architecture and the second network architecture respectively according to the detection order and according to preset network quality detection indexes between the to-be-detected nodes, so as to obtain corresponding network quality detection results. The preset network quality detection indexes are any one or several indexes in network connectivity, network delay and network performance.
[0135] Since the embodiments of the device part correspond to the above-described embodiments, the embodiments of the device part are described with reference to the above-described embodiments of the method part, and will not be described herein.
[0136] It can be seen that the application determines the network architecture supported by the to-be-detected node, the network architecture includes a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol, the network communication protocol is a transmission control protocol or an Internet interconnection protocol, if the to-be-detected node supports the first network architecture and the second network architecture, a detection order between the first network architecture and the second network architecture is determined, and network quality of the first network architecture and the second network architecture is detected based on the detection order and according to a preset network quality detection index between the to-be-detected nodes respectively to obtain corresponding network quality detection results, wherein the preset network quality detection index is any one or several indexes in network connectivity, network delay and network performance. It can be seen that the application first determines the network architecture supported by the to-be-detected node, the network architecture includes a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol, the network communication protocol is a transmission control protocol or an Internet interconnection protocol. If the to-be-detected node supports the first network architecture and the second network architecture, network quality of the first network architecture and the second network architecture is detected based on the determined detection order and according to a preset network quality detection index between the to-be-detected nodes respectively to obtain corresponding network quality detection results. That is, the application provides a network quality detection method for a fusion network, when the to-be-detected node supports an RDMA network architecture and a TCP / IP network architecture, the application can simultaneously detect network quality of an RDMA network and a TCP / IP network and obtain respective corresponding network quality detection results, and the problem that network test tools in the prior art are not compatible due to different network architectures is solved. Further, the preset network quality detection index in the application is any one or several indexes in network connectivity, network delay and network performance, that is, the application specifically discloses a method for detecting network quality from three different dimensions of network connectivity, delay and performance.
[0137] Figure 7 A structural schematic diagram of an electronic device is provided for an embodiment of the application. Specifically, it can include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is used to store a computer program, the computer program is loaded and executed by the processor 21 to implement the related steps in the network quality detection method performed by the electronic device disclosed in any of the preceding embodiments.
[0138] In this embodiment, the power supply 23 is configured to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 is configured to create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which will not be specifically limited herein; the input and output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which will not be specifically limited herein.
[0139] The processor 21 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 can also include a main processor and a coprocessor. The main processor is a processor for processing data in a wake-up state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 can also include an AI (Artificial Intelligence) processor configured to process machine learning-related computing operations.
[0140] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a magnetic disk, or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223, etc. The storage mode can be temporary storage or permanent storage.
[0141] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the network quality detection method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.
[0142] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, implements the network quality detection method steps disclosed in any of the foregoing embodiments.
[0143] Furthermore, embodiments of this application also disclose a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the network quality detection method disclosed in any of the foregoing embodiments.
[0144] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0146] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in Random Access Memory (RAM), flash memory, Read-Only Memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is tangible.
[0147] Finally, it should be noted that, in the specification, relational terms such as first and second, and the like, can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0148] The above describes in detail a network quality detection method, device, equipment and storage medium provided by the present application. The principles and implementation manners of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A network quality detection method characterized by, The application comprises the following steps: determining the network architecture supported by the node to be detected; the network architecture comprises a first network architecture based on remote direct data access technology and a second network architecture based on a network communication protocol, the network communication protocol being a transmission control protocol or an internet protocol; if the node to be detected supports the first network architecture and the second network architecture, determining the detection order between the first network architecture and the second network architecture; based on the detection order and according to preset network quality detection indicators, performing network quality detection on the first network architecture and the second network architecture between the nodes to be detected respectively to obtain corresponding network quality detection results; wherein the preset network quality detection indicators are any one or several indicators of network connectivity, network latency and network performance.
2. The network quality detection method of claim 1, wherein, the node to be detected comprises a first target node as a server and a second target node as a client; correspondingly, according to the preset network quality detection indicators, performing network quality detection on the first network architecture between the nodes to be detected comprises: using an rping tool and a preset monitoring program to test the network connectivity of the first network architecture between the first target node and the second target node; and / or, based on a routable RoCE protocol and a preset latency test interaction message, testing the network latency of the first network architecture between the first target node and the second target node; and / or, based on a routable RoCE protocol and a preset performance test interaction message, testing the network performance of the first network architecture between the first target node and the second target node.
3. The network quality detection method of claim 2, wherein, the step of using an rping tool and a preset monitoring program to test the network connectivity of the first network architecture between the first target node and the second target node comprises: running a preset monitoring program on the first target node; using the preset monitoring program to monitor the data message received by the second target node based on the rping tool and to count the data length and test times of the data message; determining whether the data length and test times of the data message are consistent with the original data length and original test times preset by the second target node; if consistent, determining that the test result of the network connectivity of the first network architecture is passed; if inconsistent, determining that the test result of the network connectivity of the first network architecture is failed.
4. The network quality detection method of claim 2, wherein, the message structure of the data message based on the routable RoCE protocol comprises message identification, sender identification, message type, sender physical address, random number and time value; the latency test interaction message comprises a first time test message, a second time test message, a third time test message and a fourth time test message corresponding to a preset latency test message type; the performance test interaction message comprises a first performance test message, a second performance test message, a third performance test message, a fourth performance test message and a fifth performance test message corresponding to a preset performance test message type.
5. The network quality detection method of claim 4, wherein, The method comprises the following steps: sending the first time test packet and the second time test packet to the second target node in sequence by the first target node, wherein the time value in the first time test packet is empty, and the time value in the second time test packet is the first sending time of the first time test packet; recording the first receiving time of the first time test packet by the second target node, and recording the server physical address and the first random number carried in the first time test packet; acquiring the server physical address and the second random number carried in the second time test packet by the second target node, and performing a physical address verification operation and a random number verification operation, and sending the third time test packet to the first target node by the second target node after the verification is passed, and recording the second sending time of the third time test packet; recording the second receiving time of the third time test packet by the first target node, and acquiring the client physical address and the third random number carried in the third time test packet, and then performing a physical address verification operation and a random number verification operation, and sending the fourth time test packet to the second target node by the first target node after the verification is passed, wherein the time value in the fourth time test packet is the second receiving time; calculating the network latency of the first network architecture based on the first sending time, the first receiving time, the second sending time and the second receiving time by the second target node.
6. The network quality detection method of claim 5, wherein, The method comprises the following steps: calculating the first difference value between the first receiving time and the first sending time; calculating the second difference value between the second receiving time and the second sending time; calculating the average value between the absolute value of the first difference value and the absolute value of the second difference value, and taking the average value as the time difference value between the server and the client; if the first difference value is greater than the second difference value, determining the client time based on the sum of the server time and the time difference value; if the first difference value is not greater than the second difference value, determining the client time based on the difference between the server time and the time difference value; determining the network latency from the server to the client in the first network architecture as the difference value between the first difference value and the client time, and determining the network latency from the client to the server in the first network architecture as the difference value between the second difference value and the client time.
7. The network quality detection method of claim 4, wherein, The method comprises the following steps: sending the first performance test packet to the first target node by the second target node, so that the first target node enters a data receiving preparation state, and replies to the second target node with the second performance test packet for representing preparation readiness; sending the third performance test packet to the first target node by the second target node after receiving the second performance test packet; performing a timing operation by the first target node after receiving the third performance test packet, and continuously counting the data amount of the third performance test packet until the fourth performance test packet for representing test end sent by the second target node is acquired, and then calculating a packet rate based on the total data amount and the total timing time; sending the fifth performance test packet carrying the packet rate to the second target node by the first target node, so as to complete the test operation of the client.
8. The network quality detection method according to any one of claims 1 to 7, characterized by, The nodes to be detected include a first target node as a server and a second target node as a client. Correspondingly, the second network architecture is subjected to network quality detection according to preset network quality detection indexes between the nodes to be detected, including: testing the network connectivity of the second network architecture by an Internet packet explorer between the first target node and the second target node; and / or testing the network latency of the second network architecture by an Internet packet explorer between the first target node and the second target node; and / or testing the network performance of the second network architecture by a preset performance test tool between the first target node and the second target node.
9. A network quality detection apparatus characterized by comprising: including: a network architecture determination module for determining the network architecture supported by the nodes to be detected; the network architecture includes a first network architecture constructed based on a remote direct data access technology and a second network architecture constructed based on a network communication protocol, and the network communication protocol is a transmission control protocol or an Internet interconnection protocol; a detection sequence determination module for determining the detection sequence between the first network architecture and the second network architecture if the nodes to be detected support the first network architecture and the second network architecture; a detection module for respectively performing network quality detection on the first network architecture and the second network architecture based on the detection sequence and according to preset network quality detection indexes between the nodes to be detected, so as to obtain corresponding network quality detection results; wherein the preset network quality detection indexes are any one or several indexes of network connectivity, network latency and network performance.
10. An electronic device, comprising: including: a memory for saving a computer program; a processor for executing the computer program to realize the steps of the network quality detection method according to any one of claims 1 to 8.
11. A computer readable storage medium, characterized in that, for storing a computer program; wherein the computer program is executed by a processor to realize the steps of the network quality detection method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Matching processing method and device, equipment, storage medium and program product
CN116800776A
Flow control method, apparatus, and device, and readable storage medium
WO2022121469A1