Communication method and device based on data link layer, equipment and medium
By setting preset target types and first-stream rule tables under the RoCEv2 protocol, the problem of low bandwidth utilization in data link layer transmission is solved, and higher bandwidth efficiency is achieved.
Patent Information
- Application Number
- CN202411418700.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-11
AI Technical Summary
Under the RoCEv2 protocol, in data transmission based on the data link layer, too many fields increase the packet length, resulting in a lower bandwidth utilization.
When constructing data transmission messages at the sending end, the Ethernet type is determined as the preset target type, and a first stream rule table containing the target type is created in advance at the receiving end, thereby reducing unnecessary unnecessaryness when transmitting messages at the data link layer. field.
It effectively reduces the total length of the message field, increases the proportion of load data, and thus increases the bandwidth utilization rate.
Smart Images

Figure CN119449869A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a communication method, device, equipment and medium based on a data link layer. Background Art
[0002] Remote Direct Memory Access (RDMA) is a high-performance network communication technology that allows a computer to directly access the memory of a remote computer. In order to implement remote direct memory access technology on an Ethernet network, the RoCEv2 (RDMA over Converged Ethernet version 2) protocol is usually required for communication.
[0003] In the related technology, under the RoCEv2 protocol, the data packets (also called messages) transmitted between networks contain fields at multiple levels, such as IP fields and UDP fields. However, in the process of data transmission based on the data link layer, too many fields increase the total length of the message, thereby reducing the proportion of payload data, resulting in low bandwidth utilization. Summary of the invention
[0004] The main purpose of the embodiments of the present disclosure is to propose a communication method, device, equipment and medium based on the data link layer, which can improve bandwidth utilization.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present disclosure proposes a communication method based on a data link layer, which is applied to a transmitting end. The communication method includes:
[0006] Send a network connection request to the receiving end;
[0007] In response to a network connection request reply message from the receiving end to the network connection request, establish a communication connection after shaking hands with the receiving end, and obtain a target queue pair sequence number and a target data packet sequence number required for a transmission process;
[0008] constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determining the Ethernet type in the data transmission message as a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end;
[0009] The data transmission message is sent to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification is passed.
[0010] In some embodiments, the target queue pair sequence number is a preset initial sequence number; and constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number includes:
[0011] Obtaining a source address in the sending end and a destination address in the receiving end;
[0012] Constructing a data transmission message based on the target queue pair sequence number, the target data packet sequence number, the source address and the destination address;
[0013] Among them, the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and obtains the target queue pair sequence number and the target data packet sequence number in the data transmission message after the identification is passed; if the target queue pair sequence number is the same as the preset initial sequence number, the target queue pair sequence number is adjusted based on the source address and the destination address, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
[0014] In some embodiments, the responding to the network connection request reply message of the receiving end to the network connection request, establishing a communication connection after handshaking with the receiving end, and obtaining the target queue pair sequence number and the target data packet sequence number required for the transmission process, includes:
[0015] In response to a network connection request reply message sent by the receiving end to the network connection request, sending a handshake request to the receiving end;
[0016] In response to a handshake request reply message from the receiving end to the handshake request, establish a communication connection after shaking hands with the receiving end, and exchange corresponding queue pair sequence numbers and data packet sequence numbers with the receiving end;
[0017] The queue pair sequence number and the data packet sequence number exchanged from the receiving end are used as the target queue pair sequence number and the target data packet sequence number required for the transmission process.
[0018] In some embodiments, the target type is determined by the following steps, including:
[0019] Determine an arbitrary fixed value of the Ethernet type as the target type;
[0020] Alternatively, an Ethernet type of any initial type is selected, an Ethernet type determination request is constructed based on the initial type, and the Ethernet type determination request is sent to the receiving end, and when an Ethernet type determination request reply message for the Ethernet type determination request sent by the receiving end is received, the initial type is determined to be the target type.
[0021] To achieve the above object, a second aspect of an embodiment of the present disclosure proposes a communication method based on a data link layer, which is applied to a receiving end. The communication method includes:
[0022] Receive a network connection request sent by a sender;
[0023] Sending a network connection request reply message for the network connection request to the sending end, and establishing a communication connection after shaking hands with the sending end;
[0024] Obtaining a preset target type and creating a first-stream rule table containing the target type;
[0025] Receiving a data transmission message sent by the sending end through a data link layer, wherein the data transmission message is constructed by the sending end based on a target queue pair sequence number and a target data packet sequence number, and an Ethernet type in the data transmission message is a preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sending end during a handshake operation;
[0026] The Ethernet type in the data transmission message is identified based on the first flow rule table, and the data transmission message is processed after the identification is successful.
[0027] In some embodiments, the identifying the Ethernet type in the data transmission message based on the first flow rule table, and processing the data transmission message after the identification is passed, includes:
[0028] Identifying the Ethernet type in the data transmission message based on the first flow rule table, and obtaining the target queue pair sequence number and the target data packet sequence number in the data transmission message after the identification is passed;
[0029] If the target queue pair sequence number is the same as the preset initial sequence number, the target queue pair sequence number is adjusted based on the source address and the destination address, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
[0030] In some embodiments, adjusting the target queue pair sequence number based on the source address and the destination address, and processing the data transmission message based on the target data packet sequence number and the adjusted target queue pair sequence number includes:
[0031] Obtain the source address and the destination address in the data transmission message, and obtain a corresponding target sequence number in the first flow rule table based on the source address and the destination address;
[0032] The target sequence number is used as the adjusted target queue pair sequence number, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
[0033] In some embodiments, the creating a first flow rule table containing the target type includes:
[0034] Acquire a source address in the sending end and a destination address in the receiving end, and assign corresponding target sequence numbers to the source address and the destination address;
[0035] A first flow rule table containing the target type is created, and the target sequence number is added to the first flow rule table using the source address and the destination address as indexes.
[0036] In some embodiments, adding the target sequence number to the first flow rule table using the source address and the destination address as indexes includes:
[0037] The source address is bound to the target sequence number, the destination address is stored in the address book of the target sequence number, and the target sequence number is added to the first flow rule table.
[0038] In some embodiments, the sending of a network connection request reply message for the network connection request to the sending end, and establishing a communication connection after shaking hands with the sending end, includes:
[0039] Generate a network connection request reply message based on the network connection request, and send the network connection request reply message to the sending end;
[0040] In response to the handshake request sent by the sender for the network connection request reply message, a handshake request reply message for the handshake request is sent to the sender, a communication connection is established after shaking hands with the sender, and the corresponding queue pair sequence number and data packet sequence number are exchanged with the sender, so that the sender uses the queue pair sequence number and the data packet sequence number obtained from the exchange from the receiving end as the target queue pair sequence number and the target data packet sequence number required for the transmission process.
[0041] In some embodiments, the target type is determined by the following steps, including:
[0042] Determine an arbitrary fixed value of the Ethernet type as the target type;
[0043] Alternatively, receiving an Ethernet type determination request sent by the transmitting end, extracting an initial type from the Ethernet type determination request, and sending an Ethernet type determination request reply message for the Ethernet type determination request to the transmitting end, and then using the initial type as the target type;
[0044] The Ethernet type determination request is constructed based on any initial type of Ethernet type after the sending end selects the initial type of Ethernet type.
[0045] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present disclosure proposes a communication device based on a data link layer, which is applied to a transmitting end, and the communication device includes:
[0046] A request sending module, used for sending a network connection request to a receiving end;
[0047] A first handshake module, configured to respond to a network connection request reply message from the receiving end to the network connection request, establish a communication connection after handshaking with the receiving end, and obtain a target queue pair sequence number and a target data packet sequence number required for a transmission process;
[0048] A message construction module, used for constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determining the Ethernet type in the data transmission message as a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end;
[0049] The message transmission module is used to send the data transmission message to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification is passed.
[0050] To achieve the above-mentioned purpose, a fourth aspect of an embodiment of the present disclosure proposes a communication device based on a data link layer, which is applied to a receiving end, and the communication device includes:
[0051] A request receiving module, used for receiving a network connection request sent by a sending end;
[0052] A second handshake module, configured to send a network connection request reply message for the network connection request to the sending end, and establish a communication connection after shaking hands with the sending end;
[0053] A flow rule creation module, used to obtain a preset target type and create a first flow rule table containing the target type;
[0054] A message receiving module, used for receiving a data transmission message sent by the sending end through a data link layer, wherein the data transmission message is constructed by the sending end based on a target queue pair sequence number and a target data packet sequence number, and the Ethernet type in the data transmission message is the preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sending end during a handshake operation;
[0055] The message processing module is used to identify the Ethernet type in the data transmission message based on the first flow rule table, and process the data transmission message after the identification is successful.
[0056] To achieve the above-mentioned purpose, the fifth aspect of the embodiments of the present disclosure proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the communication method based on the data link layer described in the first aspect embodiment, or the communication method based on the data link layer described in the second aspect embodiment.
[0057] To achieve the above-mentioned purpose, the sixth aspect of the embodiment of the present disclosure proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by the processor, it implements the communication method based on the data link layer described in the first aspect embodiment, or the communication method based on the data link layer described in the second aspect embodiment.
[0058] In the disclosed embodiment, a network connection request is sent from a transmitting end to a receiving end. After the receiving end sends a network connection request reply message to the transmitting end in response to the network connection request, a communication connection is established after shaking hands with the transmitting end, and then the target queue pair sequence number and the target data packet sequence number required for the transmission process can be obtained. Then, the transmitting end can construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number. Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. In order to facilitate the identification of the data transmission message, the transmitting end also determines that the Ethernet type in the data transmission message is a preset target type. A first flow rule table containing the target type is pre-created in the receiving end. When the transmitting end sends the data transmission message to the receiving end through the data link layer, the receiving end can identify the Ethernet type in the data transmission message based on the first flow rule table, so that the data transmission message can be normally identified even if it does not contain a UDP message. Finally, the receiving end can normally process the data transmission message after the identification is passed. Therefore, the data transmission message in the embodiment of the present disclosure does not contain the IP field and the UDP field, and can be transmitted at the data link layer, thereby reducing the total length of the message field, effectively increasing the proportion of load data, and thus improving the utilization of bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a schematic diagram of message fields in the prior art proposed by the embodiment of the present disclosure;
[0060] Figure 2 is a schematic diagram of a communication system provided by an embodiment of the present disclosure;
[0061] Figure 3 is a flow chart of a communication method based on a data link layer provided by an embodiment of the present disclosure;
[0062] Figure 4 yes Figure 3 A schematic diagram of a process flow further included in step S103;
[0063] Figure 5 yes Figure 3 A schematic diagram of a process flow further included in step S102;
[0064] Figure 6 is a schematic diagram of a data transmission process between a transmitting end and a receiving end provided by an embodiment of the present disclosure;
[0065] Figure 7 is a flowchart of a target type determination process in a sending end provided by an embodiment of the present disclosure;
[0066] Figure 8is a flow chart of a communication method based on a data link layer provided by another embodiment of the present disclosure;
[0067] Fig. 9 yes Figure 8 A schematic diagram of a process flow further included in step S505;
[0068] Fig.10 yes Fig. 9 A schematic diagram of a process flow further included in step S602;
[0069] Fig.11 yes Figure 8 A schematic diagram of a process flow further included in step S503;
[0070] Fig.12 yes Figure 8 A schematic diagram of a process flow further included in step S502;
[0071] Fig.13 is a flowchart of a target type determination process in a receiving end provided by an embodiment of the present disclosure;
[0072] Fig.14 is a schematic diagram of functional modules of a communication device based on a data link layer provided by an embodiment of the present disclosure;
[0073] Fig.15 is a functional module diagram of a communication device based on a data link layer provided by another embodiment of the present disclosure;
[0074] Fig.16 It is a schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present disclosure. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the embodiments of the present disclosure and are not intended to limit the present disclosure.
[0077] First, some nouns involved in this disclosure are analyzed:
[0078] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0079] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0080] Remote Direct Memory Access (RDMA) is a high-performance network communication technology that allows a computer to directly access the memory of a remote computer without copying data between the local and remote computers. RDMA has been widely used in data centers, high-performance computing, distributed storage, cloud computing and other fields due to its high performance, low latency and efficient data transmission capabilities.
[0081] RoCEv2 (RDMA over Converged Ethernet version 2) protocol is an advanced version of Ethernet-based remote direct memory access technology, which is designed to achieve high-performance, low-latency data transmission over Ethernet networks while overcoming some limitations of RoCEv1. RoCEv2 protocol allows data to be transferred directly from the memory of one computer to the memory of another computer without involving the host CPU, greatly reducing the overhead and latency of data transmission.
[0082] The IP field, also known as the Internet Protocol field, is used to identify the logical addresses of the sender and receiver in the IP network layer to ensure that the data packet can be correctly routed to the destination.
[0083] User Datagram Protocol (UDP) is a data packet mode that provides packet switching computer communication in a group of interconnected computer network environments. The protocol assumes the use of IP as the underlying protocol and works at the transport layer according to the OSI model.
[0084] In the related art, under the RoCEv2 protocol, the data packets (also called messages) transmitted between networks contain fields at multiple levels. Figure 1 , Figure 1 It is a schematic diagram of the message fields in the prior art proposed by the embodiment of the present disclosure. The message shown in the figure includes Eth L2 Header field, Ethertype field, IP Header field (IP field), Protocol field, UDP Header field (UDP field), Port field, IB BTH+ (L4 Hdr) field, IB Payload field, ICRC field and FCS field, etc. However, in the process of data transmission based on the data link layer, too many fields increase the total length of the message, thereby reducing the proportion of load data, resulting in low bandwidth utilization.
[0085] For example, the IP field is mainly used for routing-related operations in Ethernet applications, and the UDP field is used to identify messages. However, when data is transmitted based on the data link layer, routing-related operations are not required, so some fields can be deleted to further improve bandwidth utilization.
[0086] Based on this, the embodiments of the present disclosure provide a communication method, apparatus, device and medium based on a data link layer, which can improve bandwidth utilization.
[0087] The communication method based on the data link layer in the embodiment of the present disclosure can be described by the following embodiments. First, the communication system in the embodiment of the present disclosure is introduced.
[0088] See also Figure 2 , Figure 2 Schematic diagram of a communication system provided by an embodiment of the present disclosure. The communication system in the embodiment of the present disclosure is provided with a sending end (client end) and a receiving end (server end), and the sending end and the receiving end are connected in communication.
[0089] The sending end can send a network connection request to the receiving end; in response to the network connection request reply message of the receiving end for the network connection request, establish a communication connection after shaking hands with the receiving end, and obtain the target queue pair sequence number and the target data packet sequence number required for the transmission process; construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determine that the Ethernet type in the data transmission message is a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end; send the data transmission message to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification is passed.
[0090] The receiving end can receive a network connection request sent by a sending end; send a network connection request reply message for the network connection request to the sending end, and establish a communication connection after shaking hands with the sending end; obtain a preset target type, and create a first-flow rule table containing the target type; receive a data transmission message sent by the sending end through a data link layer, wherein the data transmission message is constructed by the sending end based on the target queue pair sequence number and the target data packet sequence number, and the Ethernet type in the data transmission message is the preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sending end during the handshake operation; identify the Ethernet type in the data transmission message based on the first-flow rule table, and process the data transmission message after the identification is passed.
[0091] The embodiments of the present disclosure can acquire and process relevant data based on artificial intelligence technology.
[0092] The transmitting end or receiving end provided by the embodiments of the present disclosure may be a terminal, a server end, or software in a terminal or a server end. In some embodiments, the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server end may be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software may be an application that implements a communication method based on the data link layer, etc., but is not limited to the above forms.
[0093] The present disclosure can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present disclosure can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present disclosure can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0094] It should be noted that in each specific embodiment of the present disclosure, when obtaining messages or other data for related processing, the user's permission or consent will be obtained first. Moreover, the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present disclosure needs to obtain messages or other data, the user's separate permission or separate consent can be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary messages or other data for the normal operation of the embodiment of the present disclosure can be obtained.
[0095] Figure 3 is a flow chart of a communication method based on a data link layer provided in an embodiment of the present disclosure, and the communication method can be applied in a transmitting end. Figure 3 The communication method may include but is not limited to steps S101 to S104.
[0096] Step S101, sending a network connection request to a receiving end;
[0097] Step S102, in response to the network connection request reply message of the receiving end to the network connection request, establish a communication connection after handshaking with the receiving end, and obtain the target queue pair sequence number and target data packet sequence number required for the transmission process;
[0098] Step S103, constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determining the Ethernet type in the data transmission message as a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end;
[0099] Step S104, sending the data transmission message to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification is successful.
[0100] With respect to the above step S101, in protocols such as RoCEv2, in order to achieve efficient data transmission, a stable network connection needs to be established first. In the disclosed embodiment, the sender is the party responsible for initiating data transmission and is also responsible for starting the network connection process, while the receiver is the party receiving data and needs to respond to the connection request of the sender and receive and process data after the connection is established.
[0101] A network connection request is a message or signal sent by a sender to a receiver to request a direct communication connection with the receiver. For example, a network connection request may include information for identity authentication, negotiation of connection parameters (such as queue pair sequence numbers, etc.), and necessary information to ensure that both parties can successfully exchange data. Furthermore, the network connection request may be a TCP request.
[0102] With respect to the above step S102, after receiving the network connection request, the receiving end will perform a series of checks and verifications to ensure that the network connection request is valid. If the receiving end agrees to establish the connection, it will send a network connection request reply message to the sending end for the network connection request. This reply message may include the receiving end's confirmation information, connection parameters and other information, or it may be a confirmation of the sending end's request.
[0103] A handshake is a two-way communication process used to establish a reliable connection between a sender and a receiver. In the RoCEv2 protocol, a handshake may correspond to a three-way handshake in the TCP / IP protocol and follows a similar principle, that is, both parties confirm each other's identity, connection parameters, etc. by exchanging a series of messages. In the handshake process of the disclosed embodiment, the sender and the receiver will confirm each other's requests and responses to ensure that both parties agree on all details of the connection.
[0104] Next, once the connection is established, the sender and receiver need to know how to send and receive data correctly. In the RoCEv2 protocol, queue pairs are used to manage the sending and receiving of data. Among them, the queue pair sequence number (QueuePair Number, QPN) is a unique identifier used to identify the sending and receiving queue pairs in the RoCEv2 protocol. During the data transmission process, each data packet carries a queue pair sequence number so that the receiving end can correctly put it into the corresponding receiving queue. The packet sequence number (Packet Sequence Number, PSN) is used to identify the order of data packets sent by the sender. The receiving end will ensure the order and integrity of the data packets based on the data packet sequence number. In the disclosed embodiment, the target queue pair sequence number and the target data packet sequence number are the QPN and PSN used in the subsequent message transmission process after confirmation by the sender and the receiver.
[0105] After the above steps, a reliable communication connection is established between the sender and the receiver in Ethernet, allowing both parties to exchange data through the data link layer.
[0106] For the above step S103, the sending end constructs a data transmission message according to the protocol specification and the parameters negotiated with the receiving end. Since the message is transmitted at the data link layer, it is not necessary to include network layer and transport layer fields such as IP fields and UDP fields. Furthermore, the data transmission message constructed in the embodiment of the present disclosure may include necessary control information, such as the target queue pair sequence number, the target data packet sequence number, length information and actual load data (i.e., data to be transmitted).
[0107] Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. To facilitate the identification of the data transmission message, the embodiment of the present disclosure can limit the Ethernet type in the data transmission message as the target type.
[0108] The Ethernet type field is located in the header of the Ethernet frame and is used to identify the type of data carried in the frame. In the RoCEv2 protocol, since messages are transmitted at the data link layer, a specific Ethernet type needs to be specified for these messages so that the receiving end can correctly identify and process them. Based on this, the transmitting end in the embodiment of the present disclosure determines a preset target type as the value of the Ethernet type and includes it in the data transmission message to identify that the message is a RoCEv2 message or other specific type of message.
[0109] The first flow rule table is created by the receiving end, and is the flow rule table that can be searched first when parsing and processing messages. It is also called a flow table or a classification table, and is used to store information related to flow rules so that the receiving end can classify and process received messages. Furthermore, in the first flow rule table, multiple entries (rules) may be included, each of which is associated with one or more matching conditions, such as Ethernet type, source MAC address, destination MAC address, etc., or associated with one or more actions, such as forwarding, discarding, modifying fields, etc. The first flow rule table in the embodiment of the present disclosure can store relevant information of the target type, which is helpful for subsequent identification of received messages based on the first flow rule table.
[0110] Furthermore, in the embodiment of the present disclosure, a second flow rule table may also be created in the sending end. The second flow rule table is created by the sending end, and is the flow rule table that can be first searched when parsing and processing messages. It is also called a flow table or a classification table, and is used to store information related to flow rules so that the sending end can classify and process received messages. Furthermore, the second flow rule table is similar to the first flow rule table, and will not be described in detail here.
[0111] With respect to the above step S104, in the RoCEv2 protocol, data transmission messages are transmitted through the data link layer. The data link layer is the second layer in the OSI model and is responsible for transmitting data frames (Frame) between adjacent network nodes.
[0112] After constructing the data transmission message, the transmitting end in the disclosed embodiment will encapsulate it into a data frame and send it to the receiving end through the data link layer. When the receiving end receives the data transmission message through the data link layer, it will first parse the header information of the frame. In this process, the receiving end will pay attention to the value of the Ethernet type (EtherType) field in the data transmission message. Then, after parsing the Ethernet type field, the receiving end will match its value with the entry in the first flow rule table pre-created in the receiving end. If the receiving end finds an entry in the flow rule table that matches the Ethernet type of the data transmission message, then it can determine that the message is a valid RoCEv2 message, determine that the data transmission message is recognized, and prepare for subsequent processing.
[0113] Once the receiving end determines the validity of the data transmission message, it can process the message normally. For example, the receiving end can extract the payload data in the data transmission message and perform further processing as needed, such as verifying the sequence number, reassembling the fragmented message, etc. Ultimately, the receiving end will successfully process the data transmission message and pass the data in it to the upper layer protocol or application for further use.
[0114] In summary, the embodiment of the present disclosure sends a network connection request to the receiving end through steps S101 to S104, and after the receiving end sends a network connection request reply message to the sending end in response to the network connection request, it establishes a communication connection after shaking hands with the sending end, and then can obtain the target queue pair sequence number and the target data packet sequence number required for the transmission process. Then, the sending end can construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number. Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. In order to facilitate the identification of the data transmission message, the sending end also determines that the Ethernet type in the data transmission message is a preset target type, and the receiving end pre-creates a first flow rule table containing the target type. When the sending end sends the data transmission message to the receiving end through the data link layer, the receiving end can identify the Ethernet type in the data transmission message based on the first flow rule table, so that the data transmission message can be normally identified even if it does not contain a UDP message, and finally the receiving end can process the data transmission message normally after the identification is passed. Therefore, the data transmission message in the embodiment of the present disclosure does not contain the IP field and the UDP field, and can be transmitted at the data link layer, thereby reducing the total length of the message field, effectively increasing the proportion of load data, and thus improving the utilization of bandwidth.
[0115] It should be noted that the RoCEv2 protocol also needs to perform handshake-related operations before RDMA transmission. One of the purposes of the handshake is to exchange queue pair sequence numbers and data packet sequence numbers for use in subsequent message transmission processes. The disclosed embodiment provides a variety of ways to determine queue pair sequence numbers and data packet sequence numbers, wherein the queue pair sequence numbers can be determined based on the source address and the destination address. Therefore, during the handshake process, it is not necessary to exchange the queue pair sequence numbers and the data packet sequence numbers. When the data transmission message is constructed, the queue pair sequence numbers and the data packet sequence numbers in the message are not empty. Therefore, for the queue pair sequence numbers in the message, a preset initial sequence number can be used to identify them.
[0116] See also Figure 4 , Figure 4 yes Figure 3 In some embodiments, the target queue pair sequence number is a preset initial sequence number, and the above step S103 may further include steps S201 to S202:
[0117] Step S201, obtaining a source address in a sending end and a destination address in a receiving end;
[0118] Step S202, constructing a data transmission message based on the target queue pair sequence number, the target data packet sequence number, the source address and the destination address;
[0119] Among them, the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and obtains the target queue pair sequence number and the target data packet sequence number in the data transmission message after the identification is passed; if the target queue pair sequence number is the same as the preset initial sequence number, the target queue pair sequence number is adjusted based on the source address and the destination address, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
[0120] In the above steps, in the embodiment of the present disclosure, the queue pair sequence number required in the subsequent message transmission process, that is, the target queue pair sequence number in the above embodiment is identified as a preset initial sequence number. The initial sequence number can be a value pre-agreed by both the sending end and the receiving end, so that the receiving end can determine whether it is necessary to readjust the target queue pair sequence number after identification. Exemplarily, the initial sequence number can be 0.
[0121] The source address is the source MAC address, and the destination address is the destination MAC address. Since the source MAC address and the destination MAC address between the two devices are unique during the message transmission process, they can be used to identify the communication message between the two devices. Specifically, at the sending end, the source address in the sending end and the destination address in the receiving end can be obtained, and when constructing the message, the data transmission message is constructed based on the target queue sequence number, the target data packet sequence number, the source address and the destination address, so that the data transmission message contains relevant information of the source address and the destination address.
[0122] When the receiving end receives the data transmission message and determines that the Ethernet type in the data transmission message is the target type, the target queue pair sequence number and the target data packet sequence number in the data transmission message can be obtained. Among them, the receiving end needs to determine the value of the target queue pair sequence number. If the target queue pair sequence number is the same as the preset initial sequence number, it indicates that the sending end and the receiving end did not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process. Therefore, the sending end pre-sets the target queue pair sequence number as the preset initial sequence number.
[0123] In the disclosed embodiment, if the sending end and the receiving end do not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process, the two parties can pre-negotiate a queue pair sequence number to be provided for the subsequent data transmission process. Further, the agreed queue pair sequence number can be the target sequence number, and for the target data packet sequence number, it can start from a fixed value, so it does not need to be confirmed in advance by an agreed manner. It is understandable that the target sequence number can be bound to the source address and the destination address. When the receiving end obtains the source address and the destination address, it can determine the unique corresponding target sequence number based on the source address and the destination address, and use the target sequence number as the adjusted target queue pair sequence number.
[0124] It should be noted that the target data packet sequence number can also be pre-configured as an original sequence number, which can be a fixed value, such as 0. In the subsequent data transmission process, the target data packet sequence number starts from the fixed value by default, and the embodiments of the present disclosure do not impose specific limitations on this.
[0125] For example, if the initial sequence number and the original sequence number are both 0, that is, the sender sets the target queue pair sequence number and the target data packet sequence number to 0 in advance, when the receiver recognizes that the target queue pair sequence number is 0, it can obtain the source MAC address and the destination MAC address in the data transmission message. Since the source MAC address and the destination MAC address are pre-bound to the target sequence number at the receiver, the receiver can determine the unique corresponding target sequence number based on the source MAC address and the destination MAC address, and replace 0 with the target sequence number to become the adjusted target queue pair sequence number, and the target data packet sequence number can start from 0.
[0126] Finally, the receiving end can process the data transmission message based on the target data packet sequence number and the adjusted target queue pair sequence number, so that subsequent data packets can be processed in the correct queue order, thereby improving the reliability of data transmission. In the disclosed embodiment, by binding the target sequence number with the source address and the destination address, the target queue pair sequence number can be adjusted when the sending end and the receiving end do not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process, so that the receiving end can distinguish data packets from different paths and process them separately, thereby supporting more efficient multi-path transmission.
[0127] See also Figure 5 , Figure 5 yes Figure 3 In some embodiments, the above step S102 may further include steps S301 to S303:
[0128] Step S301, in response to a network connection request reply message of the receiving end to the network connection request, sending a handshake request to the receiving end;
[0129] Step S302, in response to a handshake request reply message from the receiving end to the handshake request, establish a communication connection after shaking hands with the receiving end, and exchange corresponding queue pair sequence numbers and data packet sequence numbers with the receiving end;
[0130] Step S303: The queue pair sequence number and the data packet sequence number exchanged from the receiving end are used as the target queue pair sequence number and the target data packet sequence number required for the transmission process.
[0131] In the above steps, the queue pair sequence number and the data packet sequence number can be obtained after exchange between the sender and the receiver, that is, in the embodiment of the present disclosure, the required target queue pair sequence number and target data packet sequence number can also be determined by the sender and the receiver during the handshake process.
[0132] Specifically, after the sender sends a network connection request to the receiver, the receiver responds to the request and sends a network connection request reply message to the sender. The reply message indicates that the receiver has received the connection request and is ready to proceed to the next handshake process.
[0133] After receiving the network connection request reply message from the receiving end, the sending end will send a handshake request to the receiving end, which may contain some information for identity authentication, negotiation parameters, or confirmation that both parties are ready. In the RoCEv2 protocol, this handshake request may also contain some specific protocol fields to ensure that both parties can understand and respond to the request, which is not specifically limited in the embodiments of the present disclosure.
[0134] Subsequently, the receiving end responds to the handshake request of the sending end and sends a handshake request reply message, indicating that the receiving end is ready and can start formal data transmission. Therefore, after the two parties successfully exchange handshake requests and replies, the communication connection between them is formally established. At this time, the two parties will exchange a series of parameters, the most important of which is the queue pair sequence number and the data packet sequence number. Therefore, the sending end will save the queue pair sequence number and the data packet sequence number exchanged from the receiving end as the target queue pair sequence number and the target data packet sequence number required in the subsequent data transmission process. Finally, when constructing the data transmission message, the sending end will include these sequence numbers in the data transmission message so that the receiving end can correctly identify and process these messages. Further, the receiving end will also verify the order and integrity of the data transmission message based on these sequence numbers and put it into the correct receiving queue. Therefore, the sending end and the receiving end in the embodiment of the present disclosure can successfully establish a communication connection under the RoCEv2 protocol, and are ready for efficient data transmission, and the sending end and the receiving end will exchange the required sequence numbers with each other to ensure that the subsequent data transmission can proceed smoothly.
[0135] It should be noted that the sending end and the receiving end in the embodiment of the present disclosure may go through a three-way handshake. Figure 6 , Figure 6 Schematic diagram of the data transmission process between the sending end and the receiving end provided by the embodiment of the present disclosure. The information interaction between the sending end and the receiving end may include:
[0136] (1) TCP SYN: The sender sends a TCP SYN packet to the receiver to initiate a TCP connection request;
[0137] (2) SYN ACK: After the receiving end responds to the SYN packet, it sends a SYN ACK packet to the client, indicating that it has received the connection request and agrees to establish a connection;
[0138] (3) ACK: After receiving the SYN ACK, the sender sends an ACK packet to the receiver to complete the TCP three-way handshake;
[0139] (4) PSH: After the TCP connection is established, the sender and receiver exchange parameters through a specific RDMA handshake protocol, including the exchange of sequence numbers such as LID, QPN, PSN, and GID (logical ID, queue pair number, packet sequence number, global ID);
[0140] (5) PSH-done: The sender can also send a PSH-done packet to the receiver;
[0141] (6) FIN and ACK (if applicable): In some cases, the RDMA connection may be closed after the data transfer is completed. In this case, the sender can send a FIN packet to the receiver to request to close the connection, and the receiver will respond with an ACK packet to confirm the connection closure.
[0142] (7) RC Send First: The sender starts RDMA transmission and sends the first RDMA data packet, which is also the first data transmission message. This data packet marks the start of RDMA transmission.
[0143] (8) RC Send Middle (can be multiple times): If the amount of data transmitted by RDMA is large, it will be divided into multiple data packets for transmission. These intermediate data packets, that is, the data transmission messages sent in the middle, are marked as RC Send Middle until the last data packet;
[0144] (9) RC Send Last: The last RDMA data packet sent by the sender to the receiver, that is, the last data transmission message. This data packet indicates the end of the RDMA transmission.
[0145] (10) RC ACK: After the receiving end has processed any data transmission message, it can send the relevant processing results or reply information to the sending end.
[0146] It is understandable that, in the process of transmitting data transmission messages multiple times, the PSH in each data transmission message will increase accordingly, for example, gradually increasing from a fixed value (such as 0), and the embodiments of the present disclosure do not impose specific limitations on this.
[0147] It should be noted that in the embodiment of the present disclosure, the corresponding service level can be configured for the current data transmission task in the sender, that is, the corresponding service level is configured for different senders. When the sender detects a specific service level, it chooses to use the socket to establish a link and retains the handshake operation to exchange relevant information such as QPN and PSN. In the subsequent RDMA transmission process (such as Figure 6 In the process below the middle dotted line), the IP and UDP fields in the data transmission message are deleted, and the transmission method in the data link layer is used for communication, and a specific type (target type) is used in the Ethernet type to realize the recognition of the data transmission message in the receiving end.
[0148] On the contrary, if the sender and the receiver do not exchange QPN and PSN through handshake, the user needs to specify the Ethernet type (target type), source MAC address and destination MAC address when calling the RDMA transmission function at the sender and the receiver. When the program detects that the user has used the specified Ethernet type, source MAC address and destination MAC address, both parties generate corresponding flow rule tables (first flow rule table and second flow rule table) to record the source MAC address and original type, and the destination MAC address is saved in the address book of the target serial number bound to the flow rule table, and the data packet receiving method of the specific Ethernet type (target type) is registered. The subsequent transmission process is the same as Figure 6 The process below the middle dashed line is the same.
[0149] See also Figure 7 , Figure 7 4 is a flow chart of a target type determination process in a transmitting end provided by an embodiment of the present disclosure. In some embodiments, the target type is determined by the following steps, which may include steps S401 to S402:
[0150] Step S401, determining any fixed value Ethernet type as the target type;
[0151] Step S402, alternatively, any initial type of Ethernet type is selected, an Ethernet type determination request is constructed based on the initial type, and the Ethernet type determination request is sent to the receiving end. When an Ethernet type determination request reply message for the Ethernet type determination request sent by the receiving end is received, the initial type is determined as the target type.
[0152] In the above embodiment, there are multiple ways to select the Ethernet type in the data transmission message, that is, there can be multiple processes for determining the target type. For example, any Ethernet type with a fixed value can be determined as the target type. This value can be a value that is not occupied by other protocols in the Ethernet standard to ensure its uniqueness and identifiability. The embodiment of the present disclosure determines any Ethernet type with a fixed value as the target type, which is simple and direct, and does not require an additional communication process to determine the Ethernet type. It should be noted that at the receiving end, the same Ethernet type with a fixed value is also used as the target type, so that the data transmission message sent by the sending end can be identified later.
[0153] In addition, in the embodiment of the present disclosure, any initial type of Ethernet type can be determined as the target type by a method agreed upon between the sender and the receiver. Specifically, the negotiation process can be initiated by the sender, and the sender can select an initial type as a candidate, build an Ethernet type determination request based on the initial type, and send it to the receiver. After receiving the determination message, the receiver will check its Ethernet type and decide whether to accept this type according to its own configuration or policy. Then, the receiver will send an Ethernet type determination request reply message to the sender to indicate whether to accept the Ethernet type. After receiving the reply message from the receiver, the sender determines whether to use the initial type as the target type according to the content of the reply. The embodiment of the present disclosure determines the target type by a method agreed upon between the sender and the receiver, which can adapt to different network environments and receiver configurations, and can ensure the compatibility between the sender and the receiver. It should be noted that in the receiver, the initial type is also used as the target type so that the data transmission message sent by the sender can be identified later.
[0154] Figure 8 is a flow chart of a communication method based on a data link layer provided by another embodiment of the present disclosure, and the communication method can be applied in a receiving end. Figure 8 The communication method may include but is not limited to steps S501 to S505.
[0155] Step S501, receiving a network connection request sent by a sending end;
[0156] Step S502, sending a network connection request reply message to the sending end in response to the network connection request, and establishing a communication connection after shaking hands with the sending end;
[0157] Step S503, obtaining a preset target type, and creating a first-stream rule table containing the target type;
[0158] Step S504, receiving a data transmission message sent by the sender through the data link layer, wherein the data transmission message is constructed by the sender based on the target queue pair sequence number and the target data packet sequence number, and the Ethernet type in the data transmission message is a preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sender during the handshake operation;
[0159] Step S505: Identify the Ethernet type in the data transmission message based on the first flow rule table, and process the data transmission message after the identification is successful.
[0160] With respect to the above step S501, in protocols such as RoCEv2, in order to achieve efficient data transmission, a stable network connection needs to be established first. In the disclosed embodiment, the sender is the party responsible for initiating data transmission and is also responsible for starting the network connection process, while the receiver is the party receiving data and needs to respond to the connection request of the sender and receive and process data after the connection is established.
[0161] A network connection request is a message or signal sent by a sender to a receiver to request a direct communication connection with the receiver. For example, a network connection request may include information for identity authentication, negotiation of connection parameters (such as queue pair sequence numbers, etc.), and necessary information to ensure that both parties can successfully exchange data. Furthermore, the network connection request may be a TCP request.
[0162] Regarding the above step S502, after receiving the network connection request, the receiving end will perform a series of checks and verifications to ensure that the network connection request is valid. If the receiving end agrees to establish the connection, it will send a network connection request reply message to the sending end for the network connection request. This reply message may include the receiving end's confirmation information, connection parameters and other information, or it may be a confirmation of the sending end's request.
[0163] A handshake is a two-way communication process used to establish a reliable connection between a sender and a receiver. In the RoCEv2 protocol, a handshake may correspond to a three-way handshake in the TCP / IP protocol and follows a similar principle, that is, both parties confirm each other's identity, connection parameters, etc. by exchanging a series of messages. In the handshake process of the disclosed embodiment, the sender and the receiver will confirm each other's requests and responses to ensure that both parties agree on all details of the connection.
[0164] Next, once the connection is established, the sender and receiver need to know how to send and receive data correctly. In the RoCEv2 protocol, queue pairs are used to manage the sending and receiving of data. Among them, the queue pair sequence number (QueuePair Number, QPN) is a unique identifier used to identify the sending and receiving queue pairs in the RoCEv2 protocol. During the data transmission process, each data packet carries a queue pair sequence number so that the receiving end can correctly put it into the corresponding receiving queue. The packet sequence number (Packet Sequence Number, PSN) is used to identify the order of data packets sent by the sender. The receiving end will ensure the order and integrity of the data packets based on the data packet sequence number. In the disclosed embodiment, the target queue pair sequence number and the target data packet sequence number are the QPN and PSN used in the subsequent message transmission process after confirmation by the sender and the receiver.
[0165] After the above steps, a reliable communication connection is established between the sender and the receiver in Ethernet, allowing both parties to exchange data through the data link layer.
[0166] For the above step S503, the first flow rule table is created by the receiving end, and can be the flow rule table that is first searched when parsing and processing the message, also known as a flow table or classification table, which is used to store information related to the flow rules so that the receiving end can classify and process the received message. Further, in the first flow rule table, multiple entries (rules) can be included, each entry is associated with one or more matching conditions, such as Ethernet type, source MAC address, destination MAC address, etc., or associated with one or more actions, such as forwarding, discarding, modifying fields, etc. The first flow rule table in the embodiment of the present disclosure can store relevant information of the target type, which is helpful for subsequent identification of the received message based on the first flow rule table.
[0167] For the above step S504, the sending end constructs a data transmission message according to the protocol specification and the parameters negotiated with the receiving end. Since the message is transmitted at the data link layer, it is not necessary to include network layer and transport layer fields such as IP fields and UDP fields. Furthermore, the data transmission message constructed in the embodiment of the present disclosure may include necessary control information, such as the target queue pair sequence number, the target data packet sequence number, length information and actual load data (i.e., data to be transmitted).
[0168] Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. To facilitate the identification of the data transmission message, the embodiment of the present disclosure can limit the Ethernet type in the data transmission message as the target type.
[0169] The Ethernet type field is located in the header of the Ethernet frame and is used to identify the type of data carried in the frame. In the RoCEv2 protocol, since messages are transmitted at the data link layer, a specific Ethernet type needs to be specified for these messages so that the receiving end can correctly identify and process them. Based on this, the transmitting end in the embodiment of the present disclosure determines a preset target type as the value of the Ethernet type and includes it in the data transmission message to identify that the message is a RoCEv2 message or other specific type of message.
[0170] In the RoCEv2 protocol, data transmission messages are transmitted through the data link layer. The data link layer is the second layer in the OSI model and is responsible for transmitting data frames between adjacent network nodes.
[0171] With respect to the above step S505, after constructing the data transmission message, the transmitting end in the embodiment of the present disclosure will encapsulate it into a data frame and send it to the receiving end through the data link layer. When the receiving end receives the data transmission message through the data link layer, it will first parse the header information of the frame. In this process, the receiving end will pay attention to the value of the Ethernet type (EtherType) field in the data transmission message. Then, after parsing the Ethernet type field, the receiving end will match its value with the entry in the first flow rule table pre-created in the receiving end. If the receiving end finds an entry in the flow rule table that matches the Ethernet type of the data transmission message, then it can determine that the message is a valid RoCEv2 message, determine that the data transmission message is recognized, and prepare for subsequent processing.
[0172] Once the receiving end determines the validity of the data transmission message, it can process the message normally. For example, the receiving end can extract the payload data in the data transmission message and perform further processing as needed, such as verifying the sequence number, reassembling the fragmented message, etc. Ultimately, the receiving end will successfully process the data transmission message and pass the data in it to the upper layer protocol or application for further use.
[0173] In summary, the embodiment of the present disclosure sends a network connection request to the receiving end through steps S501 to S505, and after the receiving end sends a network connection request reply message to the sending end for the network connection request, it establishes a communication connection after shaking hands with the sending end, and then can obtain the target queue pair sequence number and the target data packet sequence number required for the transmission process. Then, the sending end can construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number. Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. In order to facilitate the identification of the data transmission message, the sending end also determines that the Ethernet type in the data transmission message is a preset target type, and the receiving end pre-creates a first flow rule table containing the target type. When the sending end sends the data transmission message to the receiving end through the data link layer, the receiving end can identify the Ethernet type in the data transmission message based on the first flow rule table, so that the data transmission message can be normally identified even if it does not contain a UDP message, and finally the receiving end can normally process the data transmission message after the identification is passed. Therefore, the data transmission message in the embodiment of the present disclosure does not contain the IP field and the UDP field, and can be transmitted at the data link layer, thereby reducing the total length of the message field, effectively increasing the proportion of load data, and thus improving the utilization of bandwidth.
[0174] It should be noted that the RoCEv2 protocol also needs to perform handshake-related operations before RDMA transmission. One of the purposes of the handshake is to exchange queue pair sequence numbers and data packet sequence numbers for use in subsequent message transmission processes. The disclosed embodiment provides a variety of ways to determine queue pair sequence numbers and data packet sequence numbers, wherein the queue pair sequence numbers can be determined based on the source address and the destination address. Therefore, during the handshake process, it is not necessary to exchange the queue pair sequence numbers and the data packet sequence numbers. When the data transmission message is constructed, the queue pair sequence numbers and the data packet sequence numbers in the message are not empty. Therefore, for the queue pair sequence numbers in the message, a preset initial sequence number can be used to identify them.
[0175] See also Fig. 9 , Fig. 9 yes Figure 8 In some embodiments, the above step S505 may further include steps S601 to S602:
[0176] Step S601, identifying the Ethernet type in the data transmission message based on the first flow rule table, and obtaining the target queue pair sequence number and the target data packet sequence number in the data transmission message after the identification is passed;
[0177] Step S602: If the target queue pair sequence number is the same as the preset initial sequence number, the target queue pair sequence number is adjusted based on the source address and the destination address, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
[0178] In the above steps, in the embodiment of the present disclosure, the queue pair sequence number required in the subsequent message transmission process, that is, the target queue pair sequence number in the above embodiment is identified as a preset initial sequence number. The initial sequence number can be a value pre-agreed by both the sending end and the receiving end, so that the receiving end can determine whether it is necessary to readjust the target queue pair sequence number after identification. Exemplarily, the initial sequence number can be 0.
[0179] The source address is the source MAC address, and the destination address is the destination MAC address. Since the source MAC address and the destination MAC address between the two devices are unique during the message transmission process, they can be used to identify the communication message between the two devices. Specifically, at the sending end, the source address in the sending end and the destination address in the receiving end can be obtained, and when constructing the message, the data transmission message is constructed based on the target queue sequence number, the target data packet sequence number, the source address and the destination address, so that the data transmission message contains relevant information of the source address and the destination address.
[0180] When the receiving end receives the data transmission message and determines that the Ethernet type in the data transmission message is the target type, the target queue pair sequence number and the target data packet sequence number in the data transmission message can be obtained. Among them, the receiving end needs to determine the value of the target queue pair sequence number. If the target queue pair sequence number is the same as the preset initial sequence number, it indicates that the sending end and the receiving end did not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process. Therefore, the sending end pre-sets the target queue pair sequence number as the preset initial sequence number.
[0181] In the disclosed embodiment, if the sending end and the receiving end do not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process, the two parties can pre-negotiate a queue pair sequence number to be provided for the subsequent data transmission process. Further, the agreed queue pair sequence number can be the target sequence number, and for the target data packet sequence number, it can start from a fixed value, so it does not need to be confirmed in advance by an agreed manner. It is understandable that the target sequence number can be bound to the source address and the destination address. When the receiving end obtains the source address and the destination address, it can determine the unique corresponding target sequence number based on the source address and the destination address, and use the target sequence number as the adjusted target queue pair sequence number.
[0182] It should be noted that the target data packet sequence number can also be pre-configured as an original sequence number, which can be a fixed value, such as 0. In the subsequent data transmission process, the target data packet sequence number starts from the fixed value by default, and the embodiments of the present disclosure do not impose specific limitations on this.
[0183] For example, if the initial sequence number and the original sequence number are both 0, that is, the sender sets the target queue pair sequence number and the target data packet sequence number to 0 in advance, when the receiver recognizes that the target queue pair sequence number is 0, it can obtain the source MAC address and the destination MAC address in the data transmission message. Since the source MAC address and the destination MAC address are pre-bound to the target sequence number at the receiver, the receiver can determine the unique corresponding target sequence number based on the source MAC address and the destination MAC address, and replace 0 with the target sequence number to become the adjusted target queue pair sequence number, and the target data packet sequence number can start from 0.
[0184] Finally, the receiving end can process the data transmission message based on the target data packet sequence number and the adjusted target queue pair sequence number, so that subsequent data packets can be processed in the correct queue order, thereby improving the reliability of data transmission. In the disclosed embodiment, by binding the target sequence number with the source address and the destination address, the target queue pair sequence number can be adjusted when the sending end and the receiving end do not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process, so that the receiving end can distinguish data packets from different paths and process them separately, thereby supporting more efficient multi-path transmission.
[0185] See also Fig.10 , Fig.10 yes Fig. 9 In some embodiments, the above step S602 may further include steps S701 to S702:
[0186] Step S701, obtaining a source address and a destination address in a data transmission message, and obtaining a corresponding target sequence number in a first flow rule table based on the source address and the destination address;
[0187] Step S702: Using the target sequence number as the adjusted target queue pair sequence number, and processing the data transmission message based on the target data packet sequence number and the adjusted target queue pair sequence number.
[0188] In the above steps, the target sequence number can be pre-stored in the first flow rule table, and the source address and the destination address will be used as the index of the target sequence number in the first flow rule table. Specifically, after the receiving end obtains the source address and the destination address in the data transmission message, the source address and the destination address are used as indexes to find the corresponding target sequence number in the first flow rule table.
[0189] After the receiving end obtains the target sequence number corresponding to the source address and the destination address by indexing the first flow rule table. The target sequence number is used as the adjusted target queue pair sequence number, and the receiving end can process the data transmission message based on the target data packet sequence number and the adjusted target queue pair sequence number, so that subsequent data packets can be processed in the correct queue order, thereby improving the reliability of data transmission. In the disclosed embodiment, by binding the target sequence number to the source address and the destination address, the target queue pair sequence number can be adjusted when the sending end and the receiving end do not exchange the corresponding queue pair sequence number and data packet sequence number during the handshake process, so that the receiving end can distinguish data packets from different paths and process them separately, thereby supporting more efficient multi-path transmission.
[0190] See also Fig.11 , Fig.11 yes Figure 8In some embodiments, the above step S503 may further include steps S801 to S802:
[0191] Step S801, obtaining a source address in a transmitting end and a destination address in a receiving end, and assigning corresponding target sequence numbers to the source address and the destination address;
[0192] Step S802: Create a first flow rule table containing the target type, and add the target sequence number to the first flow rule table using the source address and the destination address as indexes.
[0193] In the above steps, the embodiment of the present disclosure can pre-add the target sequence number to the first flow rule table. Specifically, before the communication starts, the receiving end needs to know the source address of the sending end and its own destination address. Then, in order to distinguish data streams from different sending ends or different sessions, the receiving end needs to assign a unique target sequence number to each source address and destination address pair, such as assigning an empty QP as the target sequence number, so as to identify each data stream in the subsequent data transmission process.
[0194] Next, the receiving end needs to maintain a first-flow rule table. After creating the first-flow rule table, the assigned target sequence number needs to be added to the table, with the source address and destination address as the index. In this way, when the receiving end receives a data transmission message, it can use the source address and destination address in the message as the index to find the corresponding target sequence number in the first-flow rule table.
[0195] In some embodiments, the above step S802 may further include the following steps:
[0196] The source address is bound to the target sequence number, and the destination address is stored in the address book of the target sequence number, and the target sequence number is added to the first flow rule table.
[0197] In the above steps, in network communication, each data packet (or message) contains a source address (sender's address) and a destination address (receiver's address). In the disclosed embodiment, in order to improve the efficiency and accuracy of data transmission, the receiving end needs to associate the source address with the target sequence number to ensure that each source address has a unique identifier for subsequent data packet processing and flow management. Then, the destination address is stored in the address book of the target sequence number, and the target sequence number is added to the first flow rule table, thereby realizing the storage of the target sequence number.
[0198] See also Fig.12 , Fig.12 yes Figure 8In some embodiments, the above step S502 may further include steps S901 to S902:
[0199] Step S901, generating a network connection request reply message based on the network connection request, and sending the network connection request reply message to the sending end;
[0200] Step S902, in response to the handshake request sent by the sender for the network connection request reply message, sends a handshake request reply message for the handshake request to the sender, establishes a communication connection after shaking hands with the sender, and exchanges the corresponding queue pair sequence number and data packet sequence number with the sender, so that the sender uses the queue pair sequence number and data packet sequence number exchanged from the receiving end as the target queue pair sequence number and target data packet sequence number required for the transmission process.
[0201] In the above steps, the queue pair sequence number and the data packet sequence number can be obtained after exchange between the sender and the receiver, that is, in the embodiment of the present disclosure, the required target queue pair sequence number and target data packet sequence number can also be determined by the sender and the receiver during the handshake process.
[0202] Specifically, after the sender sends a network connection request to the receiver, the receiver responds to the request and sends a network connection request reply message to the sender. The reply message indicates that the receiver has received the connection request and is ready to proceed to the next handshake process.
[0203] After receiving the network connection request reply message from the receiving end, the sending end will send a handshake request to the receiving end, which may contain some information for identity authentication, negotiation parameters, or confirmation that both parties are ready. In the RoCEv2 protocol, this handshake request may also contain some specific protocol fields to ensure that both parties can understand and respond to the request, which is not specifically limited in the embodiments of the present disclosure.
[0204] Subsequently, the receiving end responds to the handshake request of the sending end and sends a handshake request reply message, indicating that the receiving end is ready and can start formal data transmission. Therefore, after the two parties successfully exchange handshake requests and replies, the communication connection between them is formally established. At this time, the two parties will exchange a series of parameters, the most important of which is the queue pair sequence number and the data packet sequence number. Therefore, the sending end will save the queue pair sequence number and the data packet sequence number exchanged from the receiving end as the target queue pair sequence number and the target data packet sequence number required in the subsequent data transmission process. Finally, when constructing the data transmission message, the sending end will include these sequence numbers in the data transmission message so that the receiving end can correctly identify and process these messages. Further, the receiving end will also verify the order and integrity of the data transmission message based on these sequence numbers and put it into the correct receiving queue. Therefore, the sending end and the receiving end in the embodiment of the present disclosure can successfully establish a communication connection under the RoCEv2 protocol, and are ready for efficient data transmission, and the sending end and the receiving end will exchange the required sequence numbers with each other to ensure that the subsequent data transmission can proceed smoothly.
[0205] See also Fig.13 , Fig.13 1001 to 1002:
[0206] Step S1001, determining any Ethernet type with a fixed value as a target type;
[0207] Step S1002, or, receiving an Ethernet type determination request sent by the transmitting end, extracting the initial type from the Ethernet type determination request, and sending an Ethernet type determination request reply message for the Ethernet type determination request to the transmitting end, and then using the initial type as the target type;
[0208] The Ethernet type determination request is constructed based on the initial type after the sender selects any initial Ethernet type.
[0209] In the above embodiment, there are multiple ways to select the Ethernet type in the data transmission message, that is, there can be multiple processes for determining the target type. For example, any Ethernet type with a fixed value can be determined as the target type. This value can be a value that is not occupied by other protocols in the Ethernet standard to ensure its uniqueness and identifiability. The embodiment of the present disclosure determines any Ethernet type with a fixed value as the target type, which is simple and direct, and does not require an additional communication process to determine the Ethernet type. It should be noted that at the receiving end, the same Ethernet type with a fixed value is also used as the target type, so that the data transmission message sent by the sending end can be identified later.
[0210] In addition, in the embodiment of the present disclosure, any initial type of Ethernet type can be determined as the target type by a method agreed upon between the sender and the receiver. Specifically, the negotiation process can be initiated by the sender, and the sender can select an initial type as a candidate, build an Ethernet type determination request based on the initial type, and send it to the receiver. After receiving the determination message, the receiver will check its Ethernet type and decide whether to accept this type according to its own configuration or policy. Then, the receiver will send an Ethernet type determination request reply message to the sender to indicate whether to accept the Ethernet type. After receiving the reply message from the receiver, the sender determines whether to use the initial type as the target type according to the content of the reply. The embodiment of the present disclosure determines the target type by a method agreed upon between the sender and the receiver, which can adapt to different network environments and receiver configurations, and can ensure the compatibility between the sender and the receiver. It should be noted that in the receiver, the initial type is also used as the target type so that the data transmission message sent by the sender can be identified later.
[0211] See also Fig.14 The embodiment of the present disclosure further provides a communication device based on a data link layer, which is applied to a transmitting end and can implement the communication method based on a data link layer in the above-mentioned application end. The communication device based on a data link layer includes:
[0212] The request sending module 1401 is used to send a network connection request to the receiving end;
[0213] The first handshake module 1402 is used to respond to the network connection request reply message of the receiving end to the network connection request, establish a communication connection after handshaking with the receiving end, and obtain the target queue pair sequence number and target data packet sequence number required for the transmission process;
[0214] The message construction module 1403 is used to construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determine the Ethernet type in the data transmission message as a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end;
[0215] The message transmission module 1404 is used to send the data transmission message to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification.
[0216] In summary, the communication device based on the data link layer executes the communication method based on the data link layer, sends a network connection request to the receiving end through the sending end, and after the receiving end sends a network connection request reply message to the sending end in response to the network connection request, it establishes a communication connection after shaking hands with the sending end, and then can obtain the target queue pair sequence number and the target data packet sequence number required for the transmission process. Then, the sending end can construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number. Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. In order to facilitate the identification of the data transmission message, the sending end also determines that the Ethernet type in the data transmission message is a preset target type, and the receiving end pre-creates a first flow rule table containing the target type. When the sending end sends the data transmission message to the receiving end through the data link layer, the receiving end can identify the Ethernet type in the data transmission message based on the first flow rule table, so that the data transmission message can be normally identified even if it does not contain a UDP message, and finally the receiving end can process the data transmission message normally after the identification is passed. Therefore, the data transmission message in the embodiment of the present disclosure does not contain the IP field and the UDP field, and can be transmitted at the data link layer, thereby reducing the total length of the message field, effectively increasing the proportion of load data, and thus improving the utilization of bandwidth.
[0217] The specific implementation of the data link layer-based communication device is basically the same as the specific implementation of the data link layer-based communication method applied in the transmitting end, and will not be repeated here. On the premise of meeting the requirements of the embodiments of the present disclosure, the data link layer-based communication device can also be provided with other functional modules to implement the data link layer-based communication method in the above-mentioned embodiments.
[0218] See also Fig.15 The embodiment of the present disclosure further provides a communication device based on a data link layer, which is applied to a receiving end and can implement the communication method based on a data link layer in the above-mentioned receiving end. The communication device based on a data link layer includes:
[0219] The request receiving module 1501 is used to receive a network connection request sent by a sending end;
[0220] The second handshake module 1502 is used to send a network connection request reply message to the sending end for the network connection request, and establish a communication connection after shaking hands with the sending end;
[0221] The flow rule creation module 1503 is used to obtain a preset target type and create a first flow rule table containing the target type;
[0222] The message receiving module 1504 is used to receive the data transmission message sent by the sending end through the data link layer, wherein the data transmission message is constructed by the sending end based on the target queue pair sequence number and the target data packet sequence number, and the Ethernet type in the data transmission message is a preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sending end during the handshake operation;
[0223] The message processing module 1505 is used to identify the Ethernet type in the data transmission message based on the first flow rule table, and process the data transmission message after the identification is successful.
[0224] In summary, the communication device based on the data link layer executes the communication method based on the data link layer, sends a network connection request to the receiving end through the sending end, and after the receiving end sends a network connection request reply message to the sending end in response to the network connection request, it establishes a communication connection after shaking hands with the sending end, and then can obtain the target queue pair sequence number and the target data packet sequence number required for the transmission process. Then, the sending end can construct a data transmission message based on the target queue pair sequence number and the target data packet sequence number. Since the data transmission message is transmitted at the data link layer, the data transmission message does not contain an IP field, and further, the data transmission message does not contain a UDP field. In order to facilitate the identification of the data transmission message, the sending end also determines that the Ethernet type in the data transmission message is a preset target type, and the receiving end pre-creates a first flow rule table containing the target type. When the sending end sends the data transmission message to the receiving end through the data link layer, the receiving end can identify the Ethernet type in the data transmission message based on the first flow rule table, so that the data transmission message can be normally identified even if it does not contain a UDP message, and finally the receiving end can process the data transmission message normally after the identification is passed. Therefore, the data transmission message in the embodiment of the present disclosure does not contain the IP field and the UDP field, and can be transmitted at the data link layer, thereby reducing the total length of the message field, effectively increasing the proportion of load data, and thus improving the utilization of bandwidth.
[0225] The specific implementation of the data link layer-based communication device is basically the same as the specific implementation of the data link layer-based communication method applied in the receiving end, and will not be repeated here. On the premise of meeting the requirements of the embodiments of the present disclosure, the data link layer-based communication device can also be provided with other functional modules to implement the data link layer-based communication method in the above-mentioned embodiment.
[0226] The embodiment of the present disclosure also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned communication method based on the data link layer when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0227] See also Fig.15 , Fig.15 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0228] The processor 1601 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure;
[0229] The memory 1602 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1602 may store operating devices and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1602, and the processor 1601 calls and executes the communication method based on the data link layer of the embodiments of this disclosure;
[0230] Input / output interface 1603, used to implement information input and output;
[0231] The communication interface 1604 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0232] A bus 1605 that transmits information between various components of the device (e.g., the processor 1601, the memory 1602, the input / output interface 1603, and the communication interface 1604);
[0233] The processor 1601 , the memory 1602 , the input / output interface 1603 and the communication interface 1604 are connected to each other in communication within the device via the bus 1605 .
[0234] The embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned communication method based on the data link layer is implemented.
[0235] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0236] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0237] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present disclosure, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0238] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0239] Those skilled in the art will appreciate that all or some of the steps, devices, and functional modules / units in the above disclosed methods may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0240] The terms "first", "second", "initial", "original", "target", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0241] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0242] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0243] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0244] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0245] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method of each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0246] The preferred embodiments of the present disclosure are described above with reference to the accompanying drawings, but the scope of the rights of the present disclosure is not limited thereto. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present disclosure should be within the scope of the rights of the present disclosure.
Claims
1. A communication method based on a data link layer, characterized in that: Applied in the transmitting end, the communication method includes: Send a network connection request to the receiving end; In response to a network connection request reply message from the receiving end to the network connection request, establish a communication connection after shaking hands with the receiving end, and obtain a target queue pair sequence number and a target data packet sequence number required for a transmission process; constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determining the Ethernet type in the data transmission message as a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end; The data transmission message is sent to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification is passed.
2. The communication method based on the data link layer according to claim 1, characterized in that: The target queue pair sequence number is a preset initial sequence number; The constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number includes: Obtaining a source address in the sending end and a destination address in the receiving end; Constructing a data transmission message based on the target queue pair sequence number, the target data packet sequence number, the source address and the destination address; Among them, the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and obtains the target queue pair sequence number and the target data packet sequence number in the data transmission message after the identification is passed; if the target queue pair sequence number is the same as the preset initial sequence number, the target queue pair sequence number is adjusted based on the source address and the destination address, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
3. The communication method based on the data link layer according to claim 1, characterized in that: The method of responding to the network connection request reply message of the receiving end to the network connection request, establishing a communication connection after shaking hands with the receiving end, and obtaining a target queue pair sequence number and a target data packet sequence number required for the transmission process includes: In response to a network connection request reply message sent by the receiving end to the network connection request, sending a handshake request to the receiving end; In response to a handshake request reply message from the receiving end to the handshake request, establish a communication connection after shaking hands with the receiving end, and exchange corresponding queue pair sequence numbers and data packet sequence numbers with the receiving end; The queue pair sequence number and the data packet sequence number exchanged from the receiving end are used as the target queue pair sequence number and the target data packet sequence number required for the transmission process.
4. The communication method based on the data link layer according to claim 1, characterized in that: The target type is determined by the following steps, including: Determine an arbitrary fixed value of the Ethernet type as the target type; Alternatively, an Ethernet type of any initial type is selected, an Ethernet type determination request is constructed based on the initial type, and the Ethernet type determination request is sent to the receiving end, and when an Ethernet type determination request reply message for the Ethernet type determination request sent by the receiving end is received, the initial type is determined to be the target type.
5. A communication method based on a data link layer, characterized in that: Applied in a receiving end, the communication method includes: Receive a network connection request sent by a sender; Sending a network connection request reply message for the network connection request to the sending end, and establishing a communication connection after shaking hands with the sending end; Obtaining a preset target type and creating a first-stream rule table containing the target type; Receiving a data transmission message sent by the sending end through a data link layer, wherein the data transmission message is constructed by the sending end based on a target queue pair sequence number and a target data packet sequence number, and an Ethernet type in the data transmission message is a preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sending end during a handshake operation; The Ethernet type in the data transmission message is identified based on the first flow rule table, and the data transmission message is processed after the identification is successful.
6. The communication method based on the data link layer according to claim 5, characterized in that: The identifying the Ethernet type in the data transmission message based on the first flow rule table, and processing the data transmission message after the identification is passed, includes: Identifying the Ethernet type in the data transmission message based on the first flow rule table, and obtaining the target queue pair sequence number and the target data packet sequence number in the data transmission message after the identification is passed; If the target queue pair sequence number is the same as the preset initial sequence number, the target queue pair sequence number is adjusted based on the source address and the destination address, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
7. The communication method based on the data link layer according to claim 6, characterized in that: The step of adjusting the target queue pair sequence number based on the source address and the destination address, and processing the data transmission message based on the target data packet sequence number and the adjusted target queue pair sequence number, comprises: Obtain the source address and the destination address in the data transmission message, and obtain a corresponding target sequence number in the first flow rule table based on the source address and the destination address; The target sequence number is used as the adjusted target queue pair sequence number, and the data transmission message is processed based on the target data packet sequence number and the adjusted target queue pair sequence number.
8. The communication method based on the data link layer according to claim 6, characterized in that: The creating a first-stream rule table containing the target type includes: Acquire a source address in the sending end and a destination address in the receiving end, and assign corresponding target sequence numbers to the source address and the destination address; A first flow rule table containing the target type is created, and the target sequence number is added to the first flow rule table using the source address and the destination address as indexes.
9. The communication method based on the data link layer according to claim 8, characterized in that: The adding the target sequence number to the first flow rule table by taking the source address and the destination address as indexes includes: The source address is bound to the target sequence number, the destination address is stored in the address book of the target sequence number, and the target sequence number is added to the first flow rule table.
10. The communication method based on the data link layer according to claim 5, characterized in that: The sending of a network connection request reply message for the network connection request to the sending end, and establishing a communication connection after shaking hands with the sending end, comprises: Generate a network connection request reply message based on the network connection request, and send the network connection request reply message to the sending end; In response to the handshake request sent by the sender for the network connection request reply message, a handshake request reply message for the handshake request is sent to the sender, a communication connection is established after shaking hands with the sender, and the corresponding queue pair sequence number and data packet sequence number are exchanged with the sender, so that the sender uses the queue pair sequence number and the data packet sequence number obtained from the exchange from the receiving end as the target queue pair sequence number and the target data packet sequence number required for the transmission process.
11. The communication method based on the data link layer according to claim 5, characterized in that: The target type is determined by the following steps, including: Determine an arbitrary fixed value of the Ethernet type as the target type; Alternatively, receiving an Ethernet type determination request sent by the transmitting end, extracting an initial type from the Ethernet type determination request, and sending an Ethernet type determination request reply message for the Ethernet type determination request to the transmitting end, and then using the initial type as the target type; The Ethernet type determination request is constructed based on any initial type of Ethernet type after the sending end selects the initial type of Ethernet type.
12. A communication device based on a data link layer, characterized in that: Applied in a transmitting end, the communication device comprises: A request sending module, used for sending a network connection request to a receiving end; A first handshake module, configured to respond to a network connection request reply message from the receiving end to the network connection request, establish a communication connection after handshaking with the receiving end, and obtain a target queue pair sequence number and a target data packet sequence number required for a transmission process; A message construction module, used for constructing a data transmission message based on the target queue pair sequence number and the target data packet sequence number, and determining the Ethernet type in the data transmission message as a preset target type, wherein a first flow rule table containing the target type is pre-created in the receiving end; The message transmission module is used to send the data transmission message to the receiving end through the data link layer, so that the receiving end identifies the Ethernet type in the data transmission message based on the first flow rule table, and processes the data transmission message after the identification is passed.
13. A communication device based on a data link layer, characterized in that: Applied in a receiving end, the communication device comprises: A request receiving module, used for receiving a network connection request sent by a sending end; A second handshake module, configured to send a network connection request reply message for the network connection request to the sending end, and establish a communication connection after shaking hands with the sending end; A flow rule creation module, used to obtain a preset target type and create a first flow rule table containing the target type; A message receiving module, used for receiving a data transmission message sent by the sending end through a data link layer, wherein the data transmission message is constructed by the sending end based on a target queue pair sequence number and a target data packet sequence number, and the Ethernet type in the data transmission message is the preset target type, and the target queue pair sequence number and the target data packet sequence number are determined by the sending end during a handshake operation; The message processing module is used to identify the Ethernet type in the data transmission message based on the first flow rule table, and process the data transmission message after the identification is successful.
14. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the communication method based on the data link layer as described in any one of claims 1 to 4, or the communication method based on the data link layer as described in any one of claims 5 to 11.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data link layer-based communication method described in any one of claims 1 to 4 or the data link layer-based communication method described in any one of claims 5 to 11 is implemented.
Citation Information
Patent Citations
Method and device for realizing reliable multicast of RDMA network, storage medium and equipment
CN115442318A
Network node-to-node connectivity verification including data path processing of packets within packet switching device
CN118140460A
Data transmission method and system for edge computing
CN118590444A
Communication method and device, electronic equipment and storage medium
CN118714107A
System and method for implementing mesh network communications using a mesh network protocol
US20100061272A1
Cited By
Data transmission method, request system, response system, electronic equipment and medium
CN121187980A