WO2022105884A1 - Data transmission method and apparatus, network device, and storage medium - Google Patents

Data transmission method and apparatus, network device, and storage medium Download PDF

Info

Publication number
WO2022105884A1
WO2022105884A1 PCT/CN2021/131823 CN2021131823W WO2022105884A1 WO 2022105884 A1 WO2022105884 A1 WO 2022105884A1 CN 2021131823 W CN2021131823 W CN 2021131823W WO 2022105884 A1 WO2022105884 A1 WO 2022105884A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
memory space
target
information
network node
Prior art date
Application number
PCT/CN2021/131823
Other languages
French (fr)
Chinese (zh)
Inventor
金浩
屠要峰
韩银俊
郭斌
许军宁
杨洪章
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2022105884A1 publication Critical patent/WO2022105884A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details

Definitions

  • the embodiments of the present application relate to the field of storage data transmission, and in particular, to a data transmission method, apparatus, network device, and storage medium.
  • the network device When the source network transmits data to the target network, but the protocol stacks of the source network and the target network are not equal, the network device needs to process the transmitted data to meet the data requirements of the target network. It is transmitted to the network device, the data is copied from the user mode in the network device to the operating system protocol stack of the kernel mode, and the data is processed through the operating system protocol stack, so that the processed data satisfies the transmission protocol of the target network, and then the The processed data is sent to the target network.
  • the embodiment of the present application provides a data transmission method, including: reading data from a source network node to a memory space through a source network card; forwarding information in the memory space to a target user mode protocol stack, and the target user mode protocol stack is based on the memory space.
  • the space information constructs the message of the target network protocol type, the message carries the data address in the memory space, and the data in the memory space is sent to the target network node through the target network card based on the message of the target network protocol type.
  • An embodiment of the present application also provides a data transmission device, including: a data reading module, used for reading data from a source network node to a memory space through a source network card; a data forwarding module, used for forwarding information in the memory space to The target user mode protocol stack, the target user mode protocol stack constructs the message of the target network protocol type according to the information of the memory space, and the message carries the data address in the memory space; the data sending module is used to pass the target network card based on the target network protocol type. The message sends the data in the memory space to the target network node.
  • An embodiment of the present application further provides a network device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a program that can be executed by the at least one processor Instructions that are executed by the at least one processor to enable the at least one processor to perform the above-described data transfer method.
  • Embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned data transmission method is implemented.
  • FIG. 1 is a schematic diagram of a data transmission network according to the related art
  • FIG. 2 is a flowchart of a data transmission method according to the first embodiment of the present application.
  • FIG. 3 is a schematic diagram of a data transmission network according to the first embodiment of the present application.
  • FIG. 4 is a flowchart of a data transmission method according to a second embodiment of the present application.
  • FIG. 5 is a schematic diagram of a data transmission network according to a second embodiment of the present application.
  • FIG. 6 is a schematic diagram of a data transmission apparatus according to a third embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a network device according to a fourth embodiment of the present application.
  • the related technology uses the operating system protocol stack to convert the protocol. During the conversion process, multiple data copies and system state switching are required. Resource overhead is high.
  • the following takes the source network, that is, the sending end network is a Remote Direct Memory Access (RDMA) network, the target network, that is, the receiving end network is ordinary Ethernet, and the remote read operation of the client in the distributed storage scenario is used as an example to illustrate the description.
  • RDMA Remote Direct Memory Access
  • node1 and node2 are network nodes in RDMA, namely source network nodes
  • Ethernet network interface card (ENIC) is a common Ethernet network card
  • RNIC a network adapter that can realize RDMA function
  • the client connects to the master node of the distributed file system through the Transmission Control Protocol (TCP) link.
  • TCP Transmission Control Protocol
  • the master node reads the required target data from other nodes through RDMA, writes into the local RDMA memory, may also need to be written to the local storage, and then return data to the client through the TCP link, the process is as follows;
  • Step 1 The master node of the storage system reads data from other nodes in the cluster to the MR (Memeory Regin) space of this node through the RNIC network card.
  • Step 2 The master node of the storage system copies the data in the MR to the socket, and then sends it to the buffer TxBuf. If necessary, it can be written to the local cache storage.
  • Step 3 Send the buffer data to the operating system protocol stack OS protocol stack.
  • the data in the buffer TxBuf belongs to the application layer. To send it to the operating system protocol stack, it needs to copy the data and switch the user state to the kernel state.
  • Step 4 The operating system protocol stack sends the TCP packet to the network card queue.
  • Step 5 Finally, the ENIC network card sends the TCP packet to the network. Sent over the network to the target node.
  • the first embodiment of the present application proposes a data transmission method, which can be applied to network devices such as gateways.
  • This embodiment includes: reading data from a source network node to a memory space through a source network card; transferring information in the memory space It is transmitted to the target user mode protocol stack, and the target user mode protocol stack constructs the message of the target network protocol type according to the information of the memory space; the data in the memory is sent to the target network node through the target network card.
  • the network stacks are not equal and protocol conversion is required, there is no need to go through the kernel mode protocol stack, but the memory is the center.
  • the user mode protocol stack shares the same memory data, and forwards the data in the memory in the user mode, reducing the memory data.
  • FIG. 2 A flowchart of the data transmission method according to the first embodiment of the present application is shown in FIG. 2 .
  • Step 201 Read data from the source network node to the memory space through the source network card.
  • a forwarding rule for data in the memory is configured according to the link between the source network node and the target network node, wherein the forwarding rule includes: source network node information and target network node information, that is, data matching the source network node information will be sent to the target network node.
  • the forwarding rule includes: memory space information, input information, and output information; the input information includes source network node information, and the output information includes: target network information; the source network node information includes: protocol, source information, and target network information Including protocol, action, target information.
  • the server port 80 provides a web network access service externally, and requests data from the source network.
  • the data gateway Enable the data gateway service according to the configuration.
  • the data gateway is compatible with RDMA and TCP protocols, and supports forwarding memory data to two target systems and allocating memory buffers.
  • the memory space information in the configured forwarding rule is that the memory space address is 0x12323455, the memory space size is 16MB, the input information includes the source network node information, the source network node information includes the source network protocol RDMA, and the source information, namely nodes node1, node2 , the output information includes the protocol tcp protocol of the target network, the action "trans", that is to say, data conversion is performed, the target information: 1000, and the data is forwarded to the tcp link numbered 1000.
  • the above forwarding rules are configured by the json file.
  • the forwarding rules of the memory , the configured forwarding rules are as follows:
  • the rule specifies the corresponding memory space and size. As shown in Figure 3, data is read from node1 and node2 into the memory space, and the output stream is 1: forward data to the tcp link numbered 1000.
  • the link is established in advance. After the link is established, the forwarding rule is configured. When the data needs to be forwarded, it can be forwarded directly according to the forwarding rule, thereby improving the forwarding efficiency.
  • This embodiment creates a memory space according to the configured forwarding rules, obtains data from the source network node node1 or node2 through the source network card RNIC, and reads a memory space with an address of 0x12323455 and a size of 16MB.
  • Step 202 Determine the target transmission protocol of the next hop according to the preset logic, and directly transmit the information of the memory space to the next hop data transmission protocol stack, that is, obtain the target network matching the source network node according to the preset forwarding rule node information, and determine the target user mode protocol stack according to the matching target network node information, forward the memory space information to the determined target user mode protocol stack, and the target user mode protocol stack constructs the target network protocol type according to the memory space information.
  • the message carries the data address in the memory space.
  • the data information (including source address and protocol type) in the memory is passed to the data gateway service of the user-mode protocol stack, and the next-hop routing information (including destination address and protocol type) of the data is obtained for subsequent Forwards the data in memory to the destination address according to the new protocol.
  • the target user-mode TCP/IP protocol stack in this embodiment refers to the realization of the RDMA software stack, and based on the DPDK (Data Plane Development Kit) framework, the user-mode TCP/IP protocol stack is customized and transformed.
  • the data gateway service executes the write_cmd command to send messages to SQ, carrying memory information, target information, etc.
  • the software protocol stack that is, the user-mode TCP/IP protocol stack reads the SQ queues and runs them one by one, and the write_cmd instruction triggers the TCP sending process.
  • the customized user-mode TCP/IP protocol stack uses header and data separation to construct TCP packets.
  • Each mbuf packet carries the header content and data pointer, and data points to the memory data to be sent.
  • the network card detects the to-be-sent message, and sends the header and data into a complete message to the network.
  • the protocol stack stores the completion event CE (complet event) in the CQ queue, and the gateway service checks the CQ queue to obtain the sending command.
  • CE compute event
  • DB Door Bell
  • Step 203 Send the data in the memory space to the target network node through the target network card based on the message of the target network protocol type.
  • an end event is stored in the completion queue; the sending result is obtained according to the end event in the completion queue.
  • the data is sent to the ENIC network node through the target network card ENIC. That is to say, the network card detects the message to be sent, and sends the complete message composed of header and data to the network, and transmits it to the ENIC network node through the network.
  • the protocol stack stores the completion event CE (complete event) in the CQ queue, and the gateway service checks the CQ queue to obtain the result of sending the command.
  • DB Door Bell
  • a completion queue storage end event is defined in the user protocol stack.
  • this embodiment can synchronously perform transmission and asynchronous acquisition of the transmission result.
  • the defined user-mode TCP/IP protocol stack is implemented with reference to the RDMA software stack, so that the custom user-mode TCP/IP protocol stack and the RDMA protocol stack are more compatible.
  • the data transmission is bidirectional, and the configuration file can also be changed.
  • the source network card is an ENIC network card
  • the source network node is an Ethernet node
  • the target network card is an RNIC network card
  • the target network node is an RDMA network node
  • the data obtained by the ENIC network card is passed through
  • the data gateway After processing by the data gateway, it is transmitted to the RDMA network node. That is to say, after reading the data from the Ethernet node to the memory space through the ENIC network card, the information of the memory space is passed to the user-mode RDMA protocol stack, and the user-mode RDMA protocol stack constructs RDMA packets to carry the data in the memory space. The address is then transmitted to the Ethernet node through the RNIC network card.
  • This embodiment implements multiple user-mode protocol stacks, ie, RDMA protocol stacks, and shares data in the memory with the user-mode TCP/IP protocol stacks. It solves the problem that the current RDMA protocol network element cannot be connected with the traditional Ethernet node.
  • the completed data of data forwarding in the memory space is obtained. If the completed data of the data in the memory space is equal to the number of data output streams, the The memory space is recovered, and the number of output streams is determined according to the output information in the forwarding rule, and the output information includes the target network node information.
  • the created memory space is regarded as a directed graph node, and the input and output streams of the data node are configured according to business characteristics, that is, input information and output information.
  • the data node is configured with an in-degree of 1 and an out-degree of 1
  • the input stream is the RDMA network
  • the output stream is the TCP network
  • the data gateway records the number of forwarding completions of the node.
  • the number of node forwarding is equal to When the degree value is out, the memory space of the node can be recycled and reused. The memory space can be reclaimed in time.
  • the source network card is used to read data from the source network node into the memory space; the information in the memory space is transmitted to the target user mode protocol stack, and the message of the target network protocol type constructed by the target user mode protocol stack is obtained. Carry the data address in the memory space, and send the data in the memory to the target network node through the target network card based on the message of the target network protocol type, so that there is no need to go through the kernel mode protocol stack.
  • the memory data is forwarded in the user mode, reducing the CPU overhead caused by copying the memory data to the operating system protocol stack and switching the kernel mode from the user mode, and has better data forwarding performance.
  • the second embodiment of the present application relates to a data transmission method.
  • the second embodiment of the present application is roughly the same as the first embodiment, and the main difference is that: the forwarding rule further includes local storage information, and according to the local storage information configured in the forwarding rule Information transfers the data to local storage.
  • the data gateway can be compatible with the conversion of multiple protocols, and multiple user mode protocol stacks share the memory space, which can realize both local storage and data forwarding in the network.
  • the flow chart of the second embodiment of the present application is shown in FIG. 4 . .
  • Step 401 Read data from the source network node to the memory space through the source network card.
  • the server port 80 before reading data from the source network node to the memory space through the source network card, taking the mobile phone client remotely downloading data as an example, the server port 80 provides web access services externally, and requests data from the source network.
  • the data gateway service is enabled according to the configuration.
  • the data gateway is compatible with three protocols: RDMA, TCP, and nvme (Non-Volatile Memory Express, non-volatile memory standard). Data is forwarded to three target systems.
  • the forwarding rules configured in the data gateway include memory space information, and the memory buffer is allocated according to the memory space information.
  • Buffer, forwarding rules also include input information and output information, input information includes protocol RDMA, source information is node1, node2; output information includes local storage information, such as protocol nvme, action write, target information nvme, and output information also includes target information Network node information, for example, the protocol is tcp protocol, the action is trans, the target information is 1000, and the forwarding rules of the memory are configured by the json file, as follows:
  • the rule specifies that the corresponding memory reads data from node1 and node2, and the output stream is divided into two channels: forwarding to the tcp link numbered 1000, writing to the nvme device, and the file system needs to provide address information.
  • the output information includes two kinds of information, one is the output information for transmitting data to the network node, and the other is the output information for writing the data to the local storage, for example, the nvme device.
  • step 402 the data in the memory is transferred to the NVMe protocol stack according to the local storage information configured in the forwarding rule, and then written to the local storage.
  • this embodiment transmits data according to the local storage information configured in the forwarding rule, that is, "protocol”: “nvme”, “action”: “write”, and "target information”: “nvme” configured in the output. to local storage nvme.
  • Step 403 transfer the data in the memory to the user-mode TCP protocol stack, and then send the processed data to the target network node through the target network card.
  • step 402 and step 403 may be performed in parallel.
  • Step 403 is substantially the same as steps 202 to 203 in the first embodiment of the present application, and details are not repeated here.
  • the completed data of data forwarding in the memory space is obtained. If the completed data of the data in the memory space is equal to the number of data output streams, the The memory space is reclaimed, and the number of output streams is determined according to the output information in the forwarding rule, and the output information includes the target network node information and the local storage information.
  • the created memory space is regarded as a directed graph node, and the input and output streams of the data node are configured according to business characteristics, that is, input information and output information.
  • the master node needs to read data from other nodes. , forwarded to the client, so the data node is configured with an in-degree of 1 and an out-degree of 2, the input stream is the RDMA network, the output stream is the TCP network and nvme storage, and the service gateway records the number of forwarding completions of the node.
  • the memory space of the node can be recycled and reused.
  • the memory space can be reclaimed in time.
  • the data source in this embodiment is any one of Ethernet network ENIC and RDMA network RNIC, and the data target is any one of Ethernet, RDMA network, and NVMe storage devices, including but not limited to other types of transmission protocols, such as : iSCSI, NVMe-oF, VirtIO, etc.
  • the schematic diagram of the data transmission network in this embodiment is shown in Figure 5.
  • the data gateway synchronizes data from other nodes in the cluster to the MR (Memeory Regin) space of the node through the RNIC; the data gateway forwards the data to the user-mode TCP protocol stack and User-mode nvme protocol stack, write the data processed by the user-mode nvme protocol stack into the nvme storage device, and transmit the packets processed by the user-mode TCP/IP protocol stack to the nodes of the Ethernet network. Obtain data through the network card and process the obtained data.
  • the data gateway in this embodiment includes: a source network card, a target network card, and a user-mode protocol stack; the source network card is used to read data from the source network node to the memory space, and the target user-mode protocol stack is used to encapsulate the data in the memory into a target protocol message, the target network card is used to send the data encapsulated by the target user mode protocol stack to the target network node.
  • the data transmission method in this embodiment customizes the user-mode transmission protocol stack.
  • the memory is the operation object, which can be seamlessly connected to the data gateway service, so that the memory data can be directly connected to the ENIC network card channel, and the network card hardware DMA method reads the data and completes the sending process.
  • the data transmission method in this embodiment is compatible with network protocols and local storage protocols, and can realize zero-copy forwarding of data between network nodes and local storage according to rules.
  • the third embodiment of the present application relates to a data transmission device, as shown in FIG. 6 , including: a data reading module 601 for reading data from a source network node to a memory space through a source network card; a data forwarding module 602 for using For forwarding the information in the memory space to the target user mode protocol stack, the target user mode protocol stack constructs a message of the target network protocol type according to the information in the memory space, and the message carries the data address in the memory space; the data sending module 603, using It is used to send the data in the memory space to the target network node through the target network card based on the message of the target network protocol type.
  • the data reading module 601 is further configured to configure a forwarding rule for data in memory according to the link between the source network node and the target network node, wherein the forwarding rule includes: source network node information and target network node information Network node information.
  • the data forwarding module 602 is further configured to obtain the target network node information matching the source network node according to the forwarding rule, and determine the target user mode protocol stack according to the matched target network node information, and forward the information of the memory space to the determined target user mode. protocol stack.
  • the forwarding rule further includes: local storage information
  • the data sending module 603 is further configured to transmit the data in the memory space to the local storage according to the local storage information configured in the forwarding rule.
  • the data sending module is further configured to obtain the number of completed data forwarding in the memory space; if the number of completed data forwarding in the memory space is equal to the number of data output streams, the memory space For recycling, the number of the output streams is obtained according to the number of target network nodes and the number of local storage nodes.
  • the source network card is an RNIC network card
  • the source network node is an RDMA network node
  • the target network card is an ENIC network card
  • the target network node is an Ethernet node
  • the data processing module 602 is further configured to The information is transmitted to the user-mode TCP/IP protocol stack, and the user-mode TCP/IP protocol stack constructs the TCP message to carry the data address in the memory space.
  • the source network card is an ENIC network card
  • the source network node is an Ethernet node
  • the target network card is an RNIC network card
  • the target network node is an RDMA network node
  • the data processing module 602 is further configured to transmit the information of the memory space.
  • the user-mode RDMA protocol stack constructs an RDMA message to carry the data address in the memory space.
  • the user-mode TCP/IP protocol stack includes: a completion queue; the data sending module 603 is further configured to store an end event in the completion queue after sending the data in the memory space to the target network node through the target network card; The sending result is acquired according to the end event in the completion queue.
  • this embodiment is a system example corresponding to the first embodiment, and this embodiment can be implemented in cooperation with the first embodiment.
  • the relevant technical details mentioned in the first embodiment are still valid in this embodiment, and are not repeated here in order to reduce repetition.
  • the related technical details mentioned in this embodiment can also be applied to the first embodiment.
  • each module involved in this embodiment is a logical module.
  • a logical unit may be a physical unit, a part of a physical unit, or multiple physical units.
  • a composite implementation of the unit in order to highlight the innovative part of the present application, this embodiment does not introduce units that are not closely related to solving the technical problem raised by the present application, but this does not mean that there are no other units in this embodiment.
  • the fourth embodiment of the present application relates to a network device, as shown in FIG. 7 , including: at least one processor 701; and,
  • memory 702 in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one
  • the processor is capable of executing the above-described data transmission method.
  • the memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory.
  • the bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein.
  • the bus interface provides the interface between the bus and the transceiver.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium.
  • the data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.
  • the processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory may be used to store data used by the processor in performing operations.
  • the fifth embodiment of the present application relates to a computer-readable storage medium storing a computer program.
  • the above method embodiments are implemented when the computer program is executed by the processor.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

Abstract

Embodiments of the present application relate to the field of storage data transmission, and in particular to a data transmission method and apparatus, a network device, and a storage medium. In the embodiments of the present application, the data transmission method comprises: reading data from a source network node to a memory space by means of a source network card; forwarding information of the memory space to a target user mode protocol stack, and constructing a message of a target network protocol type by the target user mode protocol stack according to the information of the memory space, the message carrying a data address in the memory space; and sending the data in the memory space to a target network node by means of a target network card on the basis of the message of the target network protocol type.

Description

数据传输方法、装置、网络设备、存储介质Data transmission method, device, network device, storage medium
交叉引用cross reference
本申请基于申请号为“202011323780.5”、申请日为2020年11月23日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。This application is based on the Chinese patent application with the application number "202011323780.5" and the filing date is November 23, 2020, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated by way of reference. Application.
技术领域technical field
本申请实施例涉及存储数据传输领域,特别涉及一种数据传输方法、装置、网络设备、存储介质。The embodiments of the present application relate to the field of storage data transmission, and in particular, to a data transmission method, apparatus, network device, and storage medium.
背景技术Background technique
当源网络向目标网络传输数据,而源网络和目标网络的协议栈不对等时,网络设备需要将传输的数据进行处理,以满足目标网络对数据的需求,相关技术将源网络中得到的数据传输到网络设备中,从网络设备中的用户态将数据拷贝到内核态的操作系统协议栈中,经操作系统协议栈对数据进行处理,使得处理后的数据满足目标网络的传输协议,然后将处理后的数据发送到目标网络。When the source network transmits data to the target network, but the protocol stacks of the source network and the target network are not equal, the network device needs to process the transmitted data to meet the data requirements of the target network. It is transmitted to the network device, the data is copied from the user mode in the network device to the operating system protocol stack of the kernel mode, and the data is processed through the operating system protocol stack, so that the processed data satisfies the transmission protocol of the target network, and then the The processed data is sent to the target network.
然而,数据处理时,将数据从用户态拷贝到内核态的操作系统协议栈中需要经过系统态切换和数据拷贝,使得系统CPU资源开销大。However, during data processing, system state switching and data copying are required to copy data from the user state to the operating system protocol stack of the kernel state, resulting in a large system CPU resource overhead.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种数据传输方法,包括:通过源网卡从源网络节点中读取数据到内存空间;将内存空间的信息转发到目标用户态协议栈,由目标用户态协议栈根据内存空间的信息构造目标网络协议类型的报文,报文携带内存空间中的数据地址,通过目标网卡基于目标网络协议类型的报文将内存空间中的数据发送至目标网络节点。The embodiment of the present application provides a data transmission method, including: reading data from a source network node to a memory space through a source network card; forwarding information in the memory space to a target user mode protocol stack, and the target user mode protocol stack is based on the memory space. The space information constructs the message of the target network protocol type, the message carries the data address in the memory space, and the data in the memory space is sent to the target network node through the target network card based on the message of the target network protocol type.
本申请实施例还提供了一种数据传输装置,包括:数据读取模块,用于通过源网卡从源网络节点中读取数据到内存空间;数据转发模块,用于将内存空间的信息转发到目标用户态协议栈,由目标用户态协议栈根据内存空间的信息构造目标网络协议类型的报文,报文携带内存空间中的数据地址;数据发送模块,用于通过目标网卡基于目标网络协议类型的报文将内存空间中的数据发送至目标网络节点。An embodiment of the present application also provides a data transmission device, including: a data reading module, used for reading data from a source network node to a memory space through a source network card; a data forwarding module, used for forwarding information in the memory space to The target user mode protocol stack, the target user mode protocol stack constructs the message of the target network protocol type according to the information of the memory space, and the message carries the data address in the memory space; the data sending module is used to pass the target network card based on the target network protocol type. The message sends the data in the memory space to the target network node.
本申请实施例还提供了一种网络设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的数据传输方法。An embodiment of the present application further provides a network device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a program that can be executed by the at least one processor Instructions that are executed by the at least one processor to enable the at least one processor to perform the above-described data transfer method.
本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述的数据传输方法。Embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned data transmission method is implemented.
附图说明Description of drawings
图1是根据相关技术的数据传输网络的示意图;1 is a schematic diagram of a data transmission network according to the related art;
图2是根据本申请第一实施例中的数据传输方法的流程图;2 is a flowchart of a data transmission method according to the first embodiment of the present application;
图3是根据本申请第一实施例中的数据传输网络的示意图;3 is a schematic diagram of a data transmission network according to the first embodiment of the present application;
图4是根据本申请第二实施例中的数据传输方法的流程图;4 is a flowchart of a data transmission method according to a second embodiment of the present application;
图5是根据本申请第二实施例中的数据传输网络的示意图;5 is a schematic diagram of a data transmission network according to a second embodiment of the present application;
图6是根据本申请第三实施例中的数据传输装置的示意图;6 is a schematic diagram of a data transmission apparatus according to a third embodiment of the present application;
图7是根据本申请第四实施例中的网络设备的结构示意图。FIG. 7 is a schematic structural diagram of a network device according to a fourth embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施例进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可 以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the embodiments of the present application more clear, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that, in each embodiment of the present application, many technical details are provided for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized. The following division of each embodiment is for the convenience of description, and should not constitute any limitation to the specific implementation of the present application, and each embodiment may be combined with each other and referenced on the premise of not contradicting each other.
在数据传输过程中,可能会出现收发双发网络栈不对等的情况,相关技术会使用操作系统协议栈对协议进行转换,在转换过程中,需要经过多次数据拷贝,以及系统态切换,系统资源开销大。下面以源网络,即发送端网络为远程直接内存存取(Remote Direct Memory Access,RDMA)网络,目标网络,即接收端网络为普通以太网,分布式存储场景客户端远程读操作为例,说明相关技术的数据传输过程。如图1所示,node1和node2为RDMA中的网络节点,即源网络节点,以太网卡(Ethernet Network Interface Card,ENIC)为普通以太网网卡,RNIC(可以实现RDMA功能的网络适配器,RDMA enable network interface controller)网卡为RDMA网卡,具有RDMA引擎,客户端通过传输控制协议(Transmission Control Protocol,TCP)链接接入分布式文件系统主节点,主节点通过RDMA从其他节点读取需要的目标数据,写入本地RDMA内存,也可能需要写入本地存储,再通过TCP链路向客户端返回数据,流程如下;In the process of data transmission, there may be a situation where the network stacks of the transceiver and transmission are not equal. The related technology uses the operating system protocol stack to convert the protocol. During the conversion process, multiple data copies and system state switching are required. Resource overhead is high. The following takes the source network, that is, the sending end network is a Remote Direct Memory Access (RDMA) network, the target network, that is, the receiving end network is ordinary Ethernet, and the remote read operation of the client in the distributed storage scenario is used as an example to illustrate the description. The data transmission process of the related art. As shown in Figure 1, node1 and node2 are network nodes in RDMA, namely source network nodes, Ethernet network interface card (ENIC) is a common Ethernet network card, RNIC (a network adapter that can realize RDMA function, RDMA enable network interface controller) network card is an RDMA network card with an RDMA engine. The client connects to the master node of the distributed file system through the Transmission Control Protocol (TCP) link. The master node reads the required target data from other nodes through RDMA, writes into the local RDMA memory, may also need to be written to the local storage, and then return data to the client through the TCP link, the process is as follows;
步骤1:存储系统主节点通过RNIC网卡从集群内其他节点读取数据到本节点MR(Memeory Regin)空间。Step 1: The master node of the storage system reads data from other nodes in the cluster to the MR (Memeory Regin) space of this node through the RNIC network card.
步骤2:存储系统主节点将MR中的数据拷贝到套接字socket,然后发送至缓冲区TxBuf,如有需要,可写入本地cache存储。Step 2: The master node of the storage system copies the data in the MR to the socket, and then sends it to the buffer TxBuf. If necessary, it can be written to the local cache storage.
步骤3:将缓冲区数据发送至操作系统协议栈OS协议栈。缓冲区TxBuf的数据属于应用层,要发送至操作系统协议栈,需要经过数据拷贝,还需要把用户态切换为内核态。Step 3: Send the buffer data to the operating system protocol stack OS protocol stack. The data in the buffer TxBuf belongs to the application layer. To send it to the operating system protocol stack, it needs to copy the data and switch the user state to the kernel state.
步骤4:操作系统协议栈发送TCP报文到网卡队列。Step 4: The operating system protocol stack sends the TCP packet to the network card queue.
步骤5:最终由ENIC网卡将TCP报文发送到网络。通过网络发送到目标节点。Step 5: Finally, the ENIC network card sends the TCP packet to the network. Sent over the network to the target node.
上述的整个过程需要经过系统态切换,数据拷贝,系统CPU资源开销大,客户端响应时延显著,该转发流程成为整个存储系统的瓶颈。The whole process described above requires system state switching, data copying, high system CPU resource overhead, and significant client response delay. This forwarding process becomes the bottleneck of the entire storage system.
因此,本申请第一实施例提出一种数据传输方法,可应用于网关等网络设备,本实施例包括:通过源网卡从源网络节点中读取数据到内存空间;将所述内存空间的信息传输到目标用户态协议栈,由目标用户态协议栈根据内存空间的信息构造目标网络协议类型的报文;通过目标网卡将内存中的数据发送至目 标网络节点。在网络栈不对等,需要进行协议转换时,无需经过内核态协议栈,而是以内存为中心,用户态协议栈共享相同的内存数据,在用户态对内存中数据进行转发,减少了内存数据拷贝到操作系统协议栈以及从用户态切换内核态导致的CPU开销。下面对本实施方式的数据传输方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。本申请第一实施例的数据传输方法的流程图如图2所示。Therefore, the first embodiment of the present application proposes a data transmission method, which can be applied to network devices such as gateways. This embodiment includes: reading data from a source network node to a memory space through a source network card; transferring information in the memory space It is transmitted to the target user mode protocol stack, and the target user mode protocol stack constructs the message of the target network protocol type according to the information of the memory space; the data in the memory is sent to the target network node through the target network card. When the network stacks are not equal and protocol conversion is required, there is no need to go through the kernel mode protocol stack, but the memory is the center. The user mode protocol stack shares the same memory data, and forwards the data in the memory in the user mode, reducing the memory data. CPU overhead caused by copying to the operating system protocol stack and switching from user mode to kernel mode. The implementation details of the data transmission method of this embodiment will be specifically described below. The following content is only provided for the convenience of understanding, and is not necessary for implementing this solution. A flowchart of the data transmission method according to the first embodiment of the present application is shown in FIG. 2 .
步骤201,通过源网卡从源网络节点中读取数据到内存空间。Step 201: Read data from the source network node to the memory space through the source network card.
在一个例子中,通过源网卡从源网络节点中读取数据到内存空间之前,根据源网络节点和目标网络节点的链路配置内存中数据的转发规则,其中,转发规则包括:源网络节点信息和目标网络节点信息,即匹配源网络节点信息的数据会被发送到目标网络节点。In an example, before reading data from the source network node to the memory space through the source network card, a forwarding rule for data in the memory is configured according to the link between the source network node and the target network node, wherein the forwarding rule includes: source network node information and target network node information, that is, data matching the source network node information will be sent to the target network node.
在一个例子中,转发规则中包括:内存空间信息,输入信息,输出信息;输入信息包括源网络节点信息,输出信息包括:目标网络信息;源网络节点信息包括:协议,源信息;目标网络信息包括协议,动作,目标信息。In one example, the forwarding rule includes: memory space information, input information, and output information; the input information includes source network node information, and the output information includes: target network information; the source network node information includes: protocol, source information, and target network information Including protocol, action, target information.
示例性的,以手机客户端远程下载数据为例,服务端80端口对外提供web网络接入服务,向源网络请求数据,当请求的数据传输到配置有数据网关服务的数据网关时,数据网关根据配置启用数据网关服务,数据网关兼容RDMA、TCP两种协议,支持将内存数据转发到两种目标系统,分配内存缓冲区。例如配置的转发规则中内存空间信息为内存空间地址为0x12323455,内存空间大小16MB,输入信息中包括源网络节点信息,源网络节点信息包括源网络的协议RDMA,以及源信息,即节点node1,node2,输出信息包括目标网络的协议tcp协议,动作“trans”,也就是说进行数据转换,目标信息:1000,向编号为1000的tcp链路转发数据,上述转发规则由json文件配置内存的转发规则,配置的转发规则如下:Exemplarily, taking the mobile phone client remotely downloading data as an example, the server port 80 provides a web network access service externally, and requests data from the source network. When the requested data is transmitted to the data gateway configured with the data gateway service, the data gateway Enable the data gateway service according to the configuration. The data gateway is compatible with RDMA and TCP protocols, and supports forwarding memory data to two target systems and allocating memory buffers. For example, the memory space information in the configured forwarding rule is that the memory space address is 0x12323455, the memory space size is 16MB, the input information includes the source network node information, the source network node information includes the source network protocol RDMA, and the source information, namely nodes node1, node2 , the output information includes the protocol tcp protocol of the target network, the action "trans", that is to say, data conversion is performed, the target information: 1000, and the data is forwarded to the tcp link numbered 1000. The above forwarding rules are configured by the json file. The forwarding rules of the memory , the configured forwarding rules are as follows:
{{
"内存空间":{"地址":"0x12323455","大小":16MB},"Memory Space":{"Address":"0x12323455","Size":16MB},
"输入":"enter":
{"协议":"rdma","源信息":["node1","node2"]},{"Protocol":"rdma","Source Information":["node1","node2"]},
"输出":"output":
[[
{"协议":"tcp","动作":"trans","目标信息":1000},{"protocol":"tcp","action":"trans","target information":1000},
]]
}}
规则指定对应内存空间和大小,如图3所示,从node1、node2节点读入数据到该内存空间,输出流为1路:向编号为1000的tcp链路转发数据。链路是提前建立的,链路建立好之后,配置转发规则,当有需要对数据进行转发时,可直接根据转发规则进行转发,从而提高了转发效率。The rule specifies the corresponding memory space and size. As shown in Figure 3, data is read from node1 and node2 into the memory space, and the output stream is 1: forward data to the tcp link numbered 1000. The link is established in advance. After the link is established, the forwarding rule is configured. When the data needs to be forwarded, it can be forwarded directly according to the forwarding rule, thereby improving the forwarding efficiency.
本实施例根据配置的转发规则创建内存空间,通过源网卡RNIC,从源网络节点node1或node2获取数据,读取到地址为0x12323455,大小为16MB的内存空间。This embodiment creates a memory space according to the configured forwarding rules, obtains data from the source network node node1 or node2 through the source network card RNIC, and reads a memory space with an address of 0x12323455 and a size of 16MB.
步骤202,根据预设的逻辑判断下一跳的目标传输协议,将内存空间的信息直接传给下一跳数据传输协议栈,即根据预设的转发规则,获取与源网络节点匹配的目标网络节点信息,并根据匹配的目标网络节点信息确定目标用户态协议栈,将内存空间的信息转发到确定的目标用户态协议栈,由目标用户态协议栈根据内存空间的信息构造目标网络协议类型的报文,报文携带内存空间中的数据地址。在一个例子中,将内存中的数据信息(包括源地址、协议类型)传递到用户态协议栈的数据网关服务,获取该数据的下一跳路由信息(包括目标地址、协议类型),以便后续根据新的协议转发内存中的数据到目标地址。Step 202: Determine the target transmission protocol of the next hop according to the preset logic, and directly transmit the information of the memory space to the next hop data transmission protocol stack, that is, obtain the target network matching the source network node according to the preset forwarding rule node information, and determine the target user mode protocol stack according to the matching target network node information, forward the memory space information to the determined target user mode protocol stack, and the target user mode protocol stack constructs the target network protocol type according to the memory space information. The message carries the data address in the memory space. In one example, the data information (including source address and protocol type) in the memory is passed to the data gateway service of the user-mode protocol stack, and the next-hop routing information (including destination address and protocol type) of the data is obtained for subsequent Forwards the data in memory to the destination address according to the new protocol.
示例性的,本实施例中的目标用户态TCP/IP协议栈参照RDMA软件栈的实现,基于DPDK(数据平面开发套件,DataPlane Development Kit)框架,对用户态TCP/IP协议栈定制化改造。定义发送队列SQ(Send Queue)队列、CQ(Complet Queue)队列及相关内存指令,数据网关服务执行write_cmd指令发送消息到SQ,携带内存信息、目标信息等。软件协议栈,即用户态TCP/IP协议栈读取SQ队列并逐一运行,write_cmd指令触发TCP发送流程。定制的用户态TCP/IP协议栈采用header、data分离方式构造TCP报文,每个mbuf报文携带header内容和data指针,data指向待发送的内存数据。网卡检测到待发送报文,将header、data组成完整报文发送到网络,内存数据发送完成后,协议栈向CQ队列存入结束事件CE(complet event),网关服务检查CQ队列获取 发送指令的结果,此处支持DB(Door Bell)信号通知。Exemplarily, the target user-mode TCP/IP protocol stack in this embodiment refers to the realization of the RDMA software stack, and based on the DPDK (Data Plane Development Kit) framework, the user-mode TCP/IP protocol stack is customized and transformed. Define the send queue SQ (Send Queue) queue, CQ (Complet Queue) queue and related memory commands. The data gateway service executes the write_cmd command to send messages to SQ, carrying memory information, target information, etc. The software protocol stack, that is, the user-mode TCP/IP protocol stack reads the SQ queues and runs them one by one, and the write_cmd instruction triggers the TCP sending process. The customized user-mode TCP/IP protocol stack uses header and data separation to construct TCP packets. Each mbuf packet carries the header content and data pointer, and data points to the memory data to be sent. The network card detects the to-be-sent message, and sends the header and data into a complete message to the network. After the memory data is sent, the protocol stack stores the completion event CE (complet event) in the CQ queue, and the gateway service checks the CQ queue to obtain the sending command. As a result, DB (Door Bell) signaling is supported here.
步骤203,通过目标网卡基于目标网络协议类型的报文将内存空间中的数据发送至目标网络节点。Step 203: Send the data in the memory space to the target network node through the target network card based on the message of the target network protocol type.
在一个例子中,通过目标网卡将数据发送至目标网络节点之后,向完成队列中存入结束事件;根据所述完成队列中的结束事件获取发送结果。In an example, after the data is sent to the target network node through the target network card, an end event is stored in the completion queue; the sending result is obtained according to the end event in the completion queue.
承上例,根据携带的目标消息,例如上述配置的转发规则中的目标信息“1000”,通过目标网卡ENIC将数据发送至ENIC网络节点。也就是说,网卡检测到待发送报文,将header、data组成完整报文发送到网络,通过网络传输到ENIC网络节点。内存数据发送完成后,协议栈向CQ队列存入结束事件CE(complet event),网关服务检查CQ队列获取发送指令的结果,此处支持DB(Door Bell)信号通知。Following the above example, according to the carried target message, for example, the target information "1000" in the forwarding rule configured above, the data is sent to the ENIC network node through the target network card ENIC. That is to say, the network card detects the message to be sent, and sends the complete message composed of header and data to the network, and transmits it to the ENIC network node through the network. After the memory data is sent, the protocol stack stores the completion event CE (complete event) in the CQ queue, and the gateway service checks the CQ queue to obtain the result of sending the command. DB (Door Bell) signal notification is supported here.
本实施例在用户协议栈中定义完成队列存储结束事件,相较于相关技术需要在网卡发送完成之后等待返回发送结果,本实施例可以同步进行发送和发送结果的异步获取。另外,定义的用户态TCP/IP协议栈参照RDMA软件栈的方式实现,使得自定义用户态TCP/IP协议栈和RDMA协议栈契合度更高。In this embodiment, a completion queue storage end event is defined in the user protocol stack. Compared with the related art, which needs to wait for the transmission result to be returned after the network card transmission is completed, this embodiment can synchronously perform transmission and asynchronous acquisition of the transmission result. In addition, the defined user-mode TCP/IP protocol stack is implemented with reference to the RDMA software stack, so that the custom user-mode TCP/IP protocol stack and the RDMA protocol stack are more compatible.
上述均以源网卡为RNIC网卡,源网络节点为RDMA网络节点,目标网卡为ENIC网卡,目标网络节点为以太网节点为例,即RDMA网络节点通过RNIC网卡传输数据,数据经数据网关处理之后,通过ENIC网卡传输到以太网节点。也就是说,在通过RNIC网卡从RDMA网络节点中读取数据到内存空间后,将内存空间的信息传递到用户态TCP/IP协议栈,由用户态TCP/IP协议栈构造TCP报文携带内存空间中的数据地址,然后通过ENIC网卡传输到以太网节点。The above all take the source network card as the RNIC network card, the source network node as the RDMA network node, the target network card as the ENIC network card, and the target network node as the Ethernet node as an example, that is, the RDMA network node transmits data through the RNIC network card, and after the data is processed by the data gateway, Transmission to the Ethernet node through the ENIC network card. That is to say, after reading the data from the RDMA network node to the memory space through the RNIC network card, the information of the memory space is transmitted to the user-mode TCP/IP protocol stack, and the user-mode TCP/IP protocol stack constructs the TCP message to carry the memory. The data address in the space is then transmitted to the Ethernet node through the ENIC network card.
而数据传输是双向的,也可以改变配置文件,在源网卡为ENIC网卡,源网络节点为以太网节点,目标网卡为RNIC网卡,目标网络节点为RDMA网络节点时,将ENIC网卡获取的数据通过数据网关处理之后,将其传输给RDMA网络节点。也就是说,在通过ENIC网卡从以太网节点中读取数据到内存空间后,将内存空间的信息传递到用户态RDMA协议栈,由用户态RDMA协议栈构造RDMA报文携带内存空间中的数据地址,然后通过RNIC网卡传输到以太网节点。The data transmission is bidirectional, and the configuration file can also be changed. When the source network card is an ENIC network card, the source network node is an Ethernet node, the target network card is an RNIC network card, and the target network node is an RDMA network node, the data obtained by the ENIC network card is passed through After processing by the data gateway, it is transmitted to the RDMA network node. That is to say, after reading the data from the Ethernet node to the memory space through the ENIC network card, the information of the memory space is passed to the user-mode RDMA protocol stack, and the user-mode RDMA protocol stack constructs RDMA packets to carry the data in the memory space. The address is then transmitted to the Ethernet node through the RNIC network card.
本实施例实现了多个用户态协议栈,即RDMA协议栈,和用户态TCP/IP 协议栈共享内存中的数据。解决了目前RDMA协议网元与传统以太网节点无法对接的问题。This embodiment implements multiple user-mode protocol stacks, ie, RDMA protocol stacks, and shares data in the memory with the user-mode TCP/IP protocol stacks. It solves the problem that the current RDMA protocol network element cannot be connected with the traditional Ethernet node.
在一个例子中,通过目标网卡将处理后的数据发送至目标网络节点之后,获取内存空间中的数据转发完成的数据,若内存空间中的数据完成的数据等于数据输出流的个数,则将内存空间回收,输出流的个数根据转发规则中的输出信息确定,输出信息包括目标网络节点信息。In one example, after the processed data is sent to the target network node through the target network card, the completed data of data forwarding in the memory space is obtained. If the completed data of the data in the memory space is equal to the number of data output streams, the The memory space is recovered, and the number of output streams is determined according to the output information in the forwarding rule, and the output information includes the target network node information.
承上例的,将创建的内存空间视为一个有向图节点,根据业务特征配置数据节点的输入、输出流,即输入信息,输出信息,本实施例中数据网关作为一个节点需要从其他节点读取数据,转发到客户端,因此该数据节点配置入度为1、出度为1,输入流为RDMA网络,输出流为TCP网络、数据网关记录节点的转发完成数,当节点转发数量等于出度值时,该节点内存空间可回收复用。能够实现及时回收内存空间。Continuing from the above example, the created memory space is regarded as a directed graph node, and the input and output streams of the data node are configured according to business characteristics, that is, input information and output information. Read the data and forward it to the client, so the data node is configured with an in-degree of 1 and an out-degree of 1, the input stream is the RDMA network, the output stream is the TCP network, and the data gateway records the number of forwarding completions of the node. When the number of node forwarding is equal to When the degree value is out, the memory space of the node can be recycled and reused. The memory space can be reclaimed in time.
本实施例通过源网卡从源网络节点中读取数据到内存空间;将内存空间的信息传输到目标用户态协议栈,获取经目标用户态协议栈构造的目标网络协议类型的报文,报文携带内存空间中的数据地址,通过目标网卡基于目标网络协议类型的报文将内存中的数据发送至目标网络节点,从而无需经过内核态协议栈,实现以内存为中心,通过用户协议栈共享相同的内存数据,在用户态对数据进行转发,减少内存数据拷贝到操作系统协议栈以及从用户态切换内核态导致的CPU开销,具有更好的数据转发性能。In this embodiment, the source network card is used to read data from the source network node into the memory space; the information in the memory space is transmitted to the target user mode protocol stack, and the message of the target network protocol type constructed by the target user mode protocol stack is obtained. Carry the data address in the memory space, and send the data in the memory to the target network node through the target network card based on the message of the target network protocol type, so that there is no need to go through the kernel mode protocol stack. The memory data is forwarded in the user mode, reducing the CPU overhead caused by copying the memory data to the operating system protocol stack and switching the kernel mode from the user mode, and has better data forwarding performance.
本申请第二实施例涉及一种数据传输方法,本申请第二实施例与第一实施例大致相同,主要区别同之处在于:转发规则还包括本地存储信息,根据转发规则中配置的本地存储信息将数据传输到本地存储中。数据网关可以兼容多种协议的转换,多种用户态协议栈共享该内存空间,既可以实现本地存储,也可以实现网络中的数据转发,本申请第二实施例的流程图如图4所示。The second embodiment of the present application relates to a data transmission method. The second embodiment of the present application is roughly the same as the first embodiment, and the main difference is that: the forwarding rule further includes local storage information, and according to the local storage information configured in the forwarding rule Information transfers the data to local storage. The data gateway can be compatible with the conversion of multiple protocols, and multiple user mode protocol stacks share the memory space, which can realize both local storage and data forwarding in the network. The flow chart of the second embodiment of the present application is shown in FIG. 4 . .
步骤401,通过源网卡从源网络节点中读取数据到内存空间。Step 401: Read data from the source network node to the memory space through the source network card.
示例性的,在通过源网卡从源网络节点中读取数据到内存空间之前,以手机客户端远程下载数据为例,服务端80端口对外提供web接入服务,向源网络请求数据,当请求的数据传输到配置有数据网关服务的数据网关时,根据配置启用数据网关服务,数据网关兼容RDMA、TCP、nvme(Non-Volatile Memory  Express,非易失性存储器标准)三种协议,支持将内存数据转发到三种目标系统。数据网关中配置的转发规则包括内存空间信息,根据内存空间信息分配内存缓冲区,例如内存空间信息为地址“0x12323455”,大小16MB,则分配起始地址为“0x12323455”,大小为16MB的内存空间缓冲区,转发规则中还包括输入信息和输出信息,输入信息包括协议RDMA,源信息为node1,node2;输出信息包括本地存储信息,例如协议nvme,动作write,目标信息nvme,输出信息还包括目标网络节点信息,例如协议为tcp协议,动作trans,目标信息1000,由json文件配置内存的转发规则,如下:Exemplarily, before reading data from the source network node to the memory space through the source network card, taking the mobile phone client remotely downloading data as an example, the server port 80 provides web access services externally, and requests data from the source network. When the data is transmitted to the data gateway configured with the data gateway service, the data gateway service is enabled according to the configuration. The data gateway is compatible with three protocols: RDMA, TCP, and nvme (Non-Volatile Memory Express, non-volatile memory standard). Data is forwarded to three target systems. The forwarding rules configured in the data gateway include memory space information, and the memory buffer is allocated according to the memory space information. For example, if the memory space information is the address "0x12323455" and the size is 16MB, then the starting address is "0x12323455" and the memory space is 16MB in size. Buffer, forwarding rules also include input information and output information, input information includes protocol RDMA, source information is node1, node2; output information includes local storage information, such as protocol nvme, action write, target information nvme, and output information also includes target information Network node information, for example, the protocol is tcp protocol, the action is trans, the target information is 1000, and the forwarding rules of the memory are configured by the json file, as follows:
{{
"内存空间":{"地址":"0x12323455","大小":16MB},"Memory Space":{"Address":"0x12323455","Size":16MB},
"输入":"enter":
{"协议":"rdma","源信息":["node1","node2"]},{"Protocol":"rdma","Source Information":["node1","node2"]},
"输出":"output":
[[
{"协议":"tcp","动作":"trans","目标信息":1000},{"protocol":"tcp","action":"trans","target information":1000},
{"协议":"nvme","动作":"write","目标信息":"nvme"}{"protocol":"nvme","action":"write","target information":"nvme"}
]]
}}
规则指定对应内存从node1、node2节点读入数据,输出流分为2路:向编号为1000的tcp链路转发,向nvme设备写入,需要文件系统提供地址信息。在输出信息中包括两种信息,一个是将数据传输到网络节点的输出信息,一个是将数据写入到本地存储的输出信息,例如,nvme设备。The rule specifies that the corresponding memory reads data from node1 and node2, and the output stream is divided into two channels: forwarding to the tcp link numbered 1000, writing to the nvme device, and the file system needs to provide address information. The output information includes two kinds of information, one is the output information for transmitting data to the network node, and the other is the output information for writing the data to the local storage, for example, the nvme device.
步骤402,根据转发规则中配置的本地存储信息将内存中的数据传递到NVMe协议栈,进而写入本地存储。In step 402, the data in the memory is transferred to the NVMe protocol stack according to the local storage information configured in the forwarding rule, and then written to the local storage.
示例性的,本实施例根据转发规则中配置的本地存储信息,即输出中配置的"协议":"nvme","动作":"write","目标信息":"nvme",将数据传输到本地存储nvme。Exemplarily, this embodiment transmits data according to the local storage information configured in the forwarding rule, that is, "protocol": "nvme", "action": "write", and "target information": "nvme" configured in the output. to local storage nvme.
步骤403,根据转发规则将内存中数据传递到用户态TCP协议栈,进而通过目标网卡将处理后的数据发送至目标网络节点。 Step 403 , according to the forwarding rule, transfer the data in the memory to the user-mode TCP protocol stack, and then send the processed data to the target network node through the target network card.
在一个例子中,步骤402与步骤403可以并行执行。In one example, step 402 and step 403 may be performed in parallel.
步骤403与本申请第一实施例步骤202至203大致相同,此处不再赘述。Step 403 is substantially the same as steps 202 to 203 in the first embodiment of the present application, and details are not repeated here.
在一个例子中,通过目标网卡将处理后的数据发送至目标网络节点之后,获取内存空间中的数据转发完成的数据,若内存空间中的数据完成的数据等于数据输出流的个数,则将内存空间回收,输出流的个数根据转发规则中的输出信息确定,输出信息包括目标网络节点信息和本地存储信息。In one example, after the processed data is sent to the target network node through the target network card, the completed data of data forwarding in the memory space is obtained. If the completed data of the data in the memory space is equal to the number of data output streams, the The memory space is reclaimed, and the number of output streams is determined according to the output information in the forwarding rule, and the output information includes the target network node information and the local storage information.
承上例的,将创建的内存空间视为一个有向图节点,根据业务特征配置数据节点的输入、输出流,即输入信息,输出信息,本实施例中主节点需要从其他节点读取数据,转发到客户端,因此该数据节点配置入度为1、出度为2,输入流为RDMA网络,输出流为TCP网络和nvme存储、服务网关记录节点的转发完成数,当节点转发数量等于出度值时,即内存空间中的数据转发完成的数量等于数据输出流的个数时,该节点内存空间可回收复用。能够实现及时回收内存空间。Continuing from the above example, the created memory space is regarded as a directed graph node, and the input and output streams of the data node are configured according to business characteristics, that is, input information and output information. In this embodiment, the master node needs to read data from other nodes. , forwarded to the client, so the data node is configured with an in-degree of 1 and an out-degree of 2, the input stream is the RDMA network, the output stream is the TCP network and nvme storage, and the service gateway records the number of forwarding completions of the node. When the number of node forwarding is equal to When the out-degree value is reached, that is, when the number of completed data forwarding in the memory space is equal to the number of data output streams, the memory space of the node can be recycled and reused. The memory space can be reclaimed in time.
本实施例中的数据源为以太网络ENIC、RDMA网络RNIC中的任意一种,数据目标为以太网、RDMA网络、NVMe存储设备中的任意一种,包括但不限于其他类型的传输协议,如:iSCSI、NVMe-oF、VirtIO等。The data source in this embodiment is any one of Ethernet network ENIC and RDMA network RNIC, and the data target is any one of Ethernet, RDMA network, and NVMe storage devices, including but not limited to other types of transmission protocols, such as : iSCSI, NVMe-oF, VirtIO, etc.
本实施例的数据传输网络的示意图如图5所示,数据网关通过RNIC从集群内其他节点同步数据到本节点MR(Memeory Regin)空间;数据网关根据配置将数据转发到用户态TCP协议栈和用户态nvme协议栈,并将经用户态nvme协议栈处理的数据写入nvme存储设备,将经用户态TCP/IP协议栈处理后得到的报文传输到以太网络的节点,以太网网络节点的通过网卡获取数据,并对获取到的数据进行处理。The schematic diagram of the data transmission network in this embodiment is shown in Figure 5. The data gateway synchronizes data from other nodes in the cluster to the MR (Memeory Regin) space of the node through the RNIC; the data gateway forwards the data to the user-mode TCP protocol stack and User-mode nvme protocol stack, write the data processed by the user-mode nvme protocol stack into the nvme storage device, and transmit the packets processed by the user-mode TCP/IP protocol stack to the nodes of the Ethernet network. Obtain data through the network card and process the obtained data.
本实施例中的数据网关包括:源网卡,目标网卡,用户态协议栈;源网卡用于从源网络节点读取数据到内存空间,目标用户态协议栈用于将内存中数据封装成目标协议报文,目标网卡用于将目标用户态协议栈封装的数据发送至目标网络节点。The data gateway in this embodiment includes: a source network card, a target network card, and a user-mode protocol stack; the source network card is used to read data from the source network node to the memory space, and the target user-mode protocol stack is used to encapsulate the data in the memory into a target protocol message, the target network card is used to send the data encapsulated by the target user mode protocol stack to the target network node.
需要说明的是,传统的以太网传输协议TCP、UDP面向数据包定义,无法通过数据网关服务转发,本实施例的数据传输方法对用户态传输协议栈进行定制化改造,RDMA、NVMe协议都以内存为操作对象,可以无缝接入数据网关 服务,实现内存数据直达ENIC网卡通道,由网卡硬件DMA方式读取数据、完成发送流程。It should be noted that the traditional Ethernet transmission protocols TCP and UDP are defined for data packets and cannot be forwarded through the data gateway service. The data transmission method in this embodiment customizes the user-mode transmission protocol stack. The memory is the operation object, which can be seamlessly connected to the data gateway service, so that the memory data can be directly connected to the ENIC network card channel, and the network card hardware DMA method reads the data and completes the sending process.
本实施例的数据传输方法兼容网络协议,本地存储协议,能够实现数据在网络节点和本地存储之间按规则,零拷贝转发。The data transmission method in this embodiment is compatible with network protocols and local storage protocols, and can realize zero-copy forwarding of data between network nodes and local storage according to rules.
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the above various methods are divided only for the purpose of describing clearly. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent. ;Adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
本申请第三实施例涉及一种数据传输装置,如图6所示,包括:数据读取模块601,用于通过源网卡从源网络节点中读取数据到内存空间;数据转发模块602,用于将内存空间的信息转发到目标用户态协议栈,由目标用户态协议栈根据内存空间的信息构造目标网络协议类型的报文,报文携带内存空间中的数据地址;数据发送模块603,用于通过目标网卡基于目标网络协议类型的报文将内存空间中的数据发送至目标网络节点。The third embodiment of the present application relates to a data transmission device, as shown in FIG. 6 , including: a data reading module 601 for reading data from a source network node to a memory space through a source network card; a data forwarding module 602 for using For forwarding the information in the memory space to the target user mode protocol stack, the target user mode protocol stack constructs a message of the target network protocol type according to the information in the memory space, and the message carries the data address in the memory space; the data sending module 603, using It is used to send the data in the memory space to the target network node through the target network card based on the message of the target network protocol type.
在一个例子中,数据读取模块601进一步用于根据所述源网络节点和所述目标网络节点的链路配置内存中数据的转发规则,其中,所述转发规则包括:源网络节点信息和目标网络节点信息。数据转发模块602进一步用于根据转发规则,获取与源网络节点匹配的目标网络节点信息,并根据匹配的目标网络节点信息确定目标用户态协议栈,将内存空间的信息转发到确定的目标用户态协议栈。In an example, the data reading module 601 is further configured to configure a forwarding rule for data in memory according to the link between the source network node and the target network node, wherein the forwarding rule includes: source network node information and target network node information Network node information. The data forwarding module 602 is further configured to obtain the target network node information matching the source network node according to the forwarding rule, and determine the target user mode protocol stack according to the matched target network node information, and forward the information of the memory space to the determined target user mode. protocol stack.
在一个例子中,转发规则还包括:本地存储信息,数据发送模块603进一步用于根据转发规则中配置的所述本地存储信息将内存空间中的数据传输到本地存储。In an example, the forwarding rule further includes: local storage information, and the data sending module 603 is further configured to transmit the data in the memory space to the local storage according to the local storage information configured in the forwarding rule.
在一个例子中,数据发送模块进一步用于获取所述内存空间中的数据转发完成的数量;若所述内存空间中的数据转发完成的数量等于数据输出流的个数,则将所述内存空间回收,所述输出流的个数根据目标网络节点的个数和本地存储节点的个数获取。In one example, the data sending module is further configured to obtain the number of completed data forwarding in the memory space; if the number of completed data forwarding in the memory space is equal to the number of data output streams, the memory space For recycling, the number of the output streams is obtained according to the number of target network nodes and the number of local storage nodes.
在一个例子中,源网卡为RNIC网卡,所述源网络节点为RDMA网络节点,所述目标网卡为ENIC网卡,所述目标网络节点为以太网节点,数据处理模块 602进一步用于将内存空间的信息传递到用户态TCP/IP协议栈,由用户态TCP/IP协议栈构造TCP报文携带内存空间中的数据地址。In one example, the source network card is an RNIC network card, the source network node is an RDMA network node, the target network card is an ENIC network card, the target network node is an Ethernet node, and the data processing module 602 is further configured to The information is transmitted to the user-mode TCP/IP protocol stack, and the user-mode TCP/IP protocol stack constructs the TCP message to carry the data address in the memory space.
在一个例子中,源网卡为ENIC网卡,源网络节点为以太网节点,所述目标网卡为RNIC网卡,所述目标网络节点为RDMA网络节点,数据处理模块602进一步用于将内存空间的信息传递到用户态RDMA协议栈,由用户态RDMA协议栈构造RDMA报文携带内存空间中的数据地址。In one example, the source network card is an ENIC network card, the source network node is an Ethernet node, the target network card is an RNIC network card, the target network node is an RDMA network node, and the data processing module 602 is further configured to transmit the information of the memory space. To the user-mode RDMA protocol stack, the user-mode RDMA protocol stack constructs an RDMA message to carry the data address in the memory space.
在一个例子中,用户态TCP/IP协议栈包括:完成队列;数据发送模块603进一步用于在通过目标网卡将内存空间中的数据发送至目标网络节点之后,向完成队列中存入结束事件;根据所述完成队列中的结束事件获取发送结果。In one example, the user-mode TCP/IP protocol stack includes: a completion queue; the data sending module 603 is further configured to store an end event in the completion queue after sending the data in the memory space to the target network node through the target network card; The sending result is acquired according to the end event in the completion queue.
不难发现,本实施方式为与第一实施方式相对应的系统实施例,本实施方式可与第一实施方式互相配合实施。第一实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一实施方式中。It is not difficult to find that this embodiment is a system example corresponding to the first embodiment, and this embodiment can be implemented in cooperation with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and are not repeated here in order to reduce repetition. Correspondingly, the related technical details mentioned in this embodiment can also be applied to the first embodiment.
值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本申请的创新部分,本实施方式中并没有将与解决本申请所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit may be a physical unit, a part of a physical unit, or multiple physical units. A composite implementation of the unit. In addition, in order to highlight the innovative part of the present application, this embodiment does not introduce units that are not closely related to solving the technical problem raised by the present application, but this does not mean that there are no other units in this embodiment.
本申请第四实施例涉及一种网络设备,如图7所示,包括:至少一个处理器701;以及,The fourth embodiment of the present application relates to a network device, as shown in FIG. 7 , including: at least one processor 701; and,
与所述至少一个处理器通信连接的存储器702;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的数据传输方法。 memory 702 in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one The processor is capable of executing the above-described data transmission method.
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的 单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。The memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory. The bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface between the bus and the transceiver. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory may be used to store data used by the processor in performing operations.
本申请第五实施例涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。The fifth embodiment of the present application relates to a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
本领域的普通技术人员可以理解,上述各实施方式是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present application, and in practical applications, various changes in form and details can be made without departing from the spirit and the spirit of the present application. scope.

Claims (10)

  1. 一种数据传输方法,包括:A method of data transmission, comprising:
    通过源网卡从源网络节点中读取数据到内存空间;Read data from the source network node to the memory space through the source network card;
    将所述内存空间的信息转发到目标用户态协议栈,由所述目标用户态协议栈根据所述内存空间的信息构造目标网络协议类型的报文;所述报文携带所述内存空间中的数据地址;The information of the memory space is forwarded to the target user mode protocol stack, and the target user mode protocol stack constructs a message of the target network protocol type according to the information of the memory space; the message carries the data in the memory space. data address;
    通过目标网卡基于所述目标网络协议类型的报文将所述内存空间中的数据发送至目标网络节点。The data in the memory space is sent to the target network node through the target network card based on the message of the target network protocol type.
  2. 根据权利要求1所述的数据传输方法,其中,所述通过源网卡从源网络节点中读取数据到内存空间之前,还包括:The data transmission method according to claim 1, wherein before the data is read from the source network node to the memory space through the source network card, the method further comprises:
    根据所述源网络节点和所述目标网络节点的链路配置内存中数据的转发规则,其中,所述转发规则包括:源网络节点信息和目标网络节点信息;Configure a forwarding rule for data in memory according to the link between the source network node and the target network node, wherein the forwarding rule includes: source network node information and target network node information;
    所述将所述内存空间的信息转发到目标用户态协议栈,包括:The forwarding of the information of the memory space to the target user mode protocol stack includes:
    根据所述转发规则,获取与所述源网络节点匹配的目标网络节点信息,并根据所述匹配的目标网络节点信息确定目标用户态协议栈;According to the forwarding rule, obtain target network node information that matches the source network node, and determine a target user mode protocol stack according to the matched target network node information;
    将所述内存空间的信息转发到所述确定的目标用户态协议栈。The information of the memory space is forwarded to the determined target user mode protocol stack.
  3. 根据权利要求2所述的数据传输方法,其中,所述转发规则,还包括:本地存储信息;The data transmission method according to claim 2, wherein the forwarding rule further comprises: storing information locally;
    所述通过源网卡从源网络节点中读取数据到内存空间之后,还包括:After the data is read from the source network node to the memory space through the source network card, the method further includes:
    根据所述转发规则中配置的所述本地存储信息将所述内存空间中的数据传输到本地存储。The data in the memory space is transmitted to the local storage according to the local storage information configured in the forwarding rule.
  4. 根据权利要求3所述的数据传输方法,其中,所述通过目标网卡将所述处理后的数据发送至目标网络节点之后,还包括:The data transmission method according to claim 3, wherein after sending the processed data to the target network node through the target network card, the method further comprises:
    获取所述内存空间中的数据转发完成的数量;Obtain the number of completed data forwarding in the memory space;
    若所述内存空间中的数据转发完成的数量等于数据输出流的个数,则将所述内存空间回收,其中,所述数据输出流的个数根据所述转发规则中的输出信 息确定,所述输出信息包括:所述目标网络节点信息和所述本地存储信息。If the number of completed data forwarding in the memory space is equal to the number of data output streams, the memory space is reclaimed, wherein the number of the data output streams is determined according to the output information in the forwarding rule, and the The output information includes: the target network node information and the local storage information.
  5. 根据权利要求1至4中任一项所述的数据传输方法,其中,所述源网卡为RNIC网卡,所述源网络节点为RDMA网络节点,所述目标网卡为ENIC网卡,所述目标网络节点为以太网节点;The data transmission method according to any one of claims 1 to 4, wherein the source network card is an RNIC network card, the source network node is an RDMA network node, the target network card is an ENIC network card, and the target network node is an Ethernet node;
    或者,所述源网卡为ENIC网卡,所述源网络节点为以太网节点,所述目标网卡为RNIC网卡,所述目标网络节点为RDMA网络节点。Alternatively, the source network card is an ENIC network card, the source network node is an Ethernet node, the target network card is an RNIC network card, and the target network node is an RDMA network node.
  6. 根据权利要求5所述的数据传输方法,其中,所述用户态协议栈包括:RDMA协议栈和用户态TCP/IP协议栈;The data transmission method according to claim 5, wherein the user mode protocol stack comprises: an RDMA protocol stack and a user mode TCP/IP protocol stack;
    若所述源网卡为RNIC网卡,所述源网络节点为RDMA网络节点,所述目标网卡为ENIC网卡,所述目标网络节点为以太网节点,则所述将所述内存空间的信息转发到目标用户态协议栈,由所述目标用户态协议栈根据所述内存空间的信息构造目标网络协议类型的报文,包括:If the source network card is an RNIC network card, the source network node is an RDMA network node, the target network card is an ENIC network card, and the target network node is an Ethernet node, then the information of the memory space is forwarded to the target network User mode protocol stack, the target user mode protocol stack constructs the message of the target network protocol type according to the information of the memory space, including:
    将所述内存空间的信息传递到用户态TCP/IP协议栈,由所述用户态TCP/IP协议栈构造TCP报文携带所述内存空间中的数据地址;The information of the memory space is delivered to the user state TCP/IP protocol stack, and the user state TCP/IP protocol stack constructs a TCP message to carry the data address in the memory space;
    若所述源网卡为ENIC网卡,所述源网络节点为以太网节点,所述目标网卡为RNIC网卡,所述目标网络节点为RDMA网络节点,则所述将所述内存空间的信息转发到目标用户态协议栈,由所述目标用户态协议栈根据所述内存空间的信息构造目标网络协议类型的报文,包括:If the source network card is an ENIC network card, the source network node is an Ethernet node, the target network card is an RNIC network card, and the target network node is an RDMA network node, the forwarding of the memory space information to the target User mode protocol stack, the target user mode protocol stack constructs the message of the target network protocol type according to the information of the memory space, including:
    将所述内存空间的信息传递到用户态RDMA协议栈,由所述用户态RDMA协议栈构造RDMA报文携带所述内存空间中的数据地址。The information of the memory space is transferred to the user-mode RDMA protocol stack, and an RDMA message is constructed by the user-mode RDMA protocol stack to carry the data address in the memory space.
  7. 根据权利要求6所述的数据传输方法,其中,所述用户态TCP/IP协议栈包括:完成队列;The data transmission method according to claim 6, wherein the user-mode TCP/IP protocol stack comprises: a completion queue;
    所述通过目标网卡基于所述目标网络协议类型的报文将所述内存空间中的数据发送至目标网络节点之后,还包括:After sending the data in the memory space to the target network node through the target network card based on the message of the target network protocol type, the method further includes:
    向完成队列中存入结束事件;Store the end event into the completion queue;
    根据所述完成队列中的结束事件获取发送结果。The sending result is acquired according to the end event in the completion queue.
  8. 一种数据传输装置,包括:A data transmission device, comprising:
    数据读取模块,用于通过源网卡从源网络节点中读取数据到内存空间;The data reading module is used to read data from the source network node to the memory space through the source network card;
    数据转发模块,用于将所述内存空间的信息转发到目标用户态协议栈,由所述目标用户态协议栈根据所述内存空间的信息构造目标网络协议类型的报文,所述报文携带所述内存空间中的数据地址;A data forwarding module, configured to forward the information of the memory space to the target user mode protocol stack, and the target user mode protocol stack constructs a message of the target network protocol type according to the information of the memory space, and the message carries a data address in the memory space;
    数据发送模块,用于通过目标网卡基于所述目标网络协议类型的报文将所述内存空间中的数据发送至目标网络节点。The data sending module is configured to send the data in the memory space to the target network node through the target network card based on the message of the target network protocol type.
  9. 一种网络设备,包括:A network device comprising:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至7中任一所述的数据传输方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any one of claims 1 to 7 data transfer method.
  10. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的数据传输方法。A computer-readable storage medium storing a computer program, when the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented.
PCT/CN2021/131823 2020-11-23 2021-11-19 Data transmission method and apparatus, network device, and storage medium WO2022105884A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011323780.5 2020-11-23
CN202011323780.5A CN113485823A (en) 2020-11-23 2020-11-23 Data transmission method, device, network equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022105884A1 true WO2022105884A1 (en) 2022-05-27

Family

ID=77932626

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/131823 WO2022105884A1 (en) 2020-11-23 2021-11-19 Data transmission method and apparatus, network device, and storage medium

Country Status (2)

Country Link
CN (1) CN113485823A (en)
WO (1) WO2022105884A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115296956A (en) * 2022-07-29 2022-11-04 广东浪潮智慧计算技术有限公司 Tunnel forwarding method and device of kernel, electronic equipment and storage medium
CN115460470A (en) * 2022-08-19 2022-12-09 武汉烽火技术服务有限公司 Multicast data forwarding method, device, equipment and readable storage medium
CN115499332A (en) * 2022-09-13 2022-12-20 科东(广州)软件科技有限公司 Network message monitoring method, device, equipment and medium
CN115665073A (en) * 2022-12-06 2023-01-31 江苏为是科技有限公司 Message processing method and device
CN115834665A (en) * 2023-02-08 2023-03-21 天翼云科技有限公司 Network communication method and device
CN115904253A (en) * 2023-01-09 2023-04-04 苏州浪潮智能科技有限公司 Data transmission method and device, storage system and equipment and medium
CN116455612A (en) * 2023-03-23 2023-07-18 京信数据科技有限公司 Privacy calculation intermediate data stream zero-copy device and method
CN116450058A (en) * 2023-06-19 2023-07-18 浪潮电子信息产业股份有限公司 Data transfer method, device, heterogeneous platform, equipment and medium
CN116781650A (en) * 2023-07-11 2023-09-19 中科驭数(北京)科技有限公司 Data processing method and system
CN117097779A (en) * 2023-10-16 2023-11-21 之江实验室 Network communication method and device, storage medium and electronic equipment
CN117692416A (en) * 2024-02-04 2024-03-12 苏州元脑智能科技有限公司 Network message processing method, device, computer equipment and storage medium
CN117857660A (en) * 2024-03-07 2024-04-09 济南浪潮数据技术有限公司 Data transmission protocol self-adaption method, system, equipment and medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485823A (en) * 2020-11-23 2021-10-08 中兴通讯股份有限公司 Data transmission method, device, network equipment and storage medium
CN114024910A (en) * 2021-10-29 2022-02-08 上海广策信息技术有限公司 Extremely-low-delay reliable communication system and method for financial transaction system
CN114363428B (en) * 2022-01-06 2023-10-17 齐鲁空天信息研究院 Socket-based data transmission method
CN115314159B (en) * 2022-08-02 2023-08-04 成都爱旗科技有限公司 Method and device for transmitting data between chips
CN115623018B (en) * 2022-11-30 2023-03-14 苏州浪潮智能科技有限公司 Sharing system based on multiple equipment nodes

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302199A (en) * 2016-08-10 2017-01-04 成都广达新网科技股份有限公司 A kind of User space protocol stack realization method and system based on L3 Switching machine equipment
CN106850565A (en) * 2016-12-29 2017-06-13 河北远东通信系统工程有限公司 A kind of network data transmission method of high speed
WO2018107433A1 (en) * 2016-12-15 2018-06-21 华为技术有限公司 Information processing method and device
CN109547580A (en) * 2019-01-22 2019-03-29 网宿科技股份有限公司 A kind of method and apparatus handling data message
US20190141169A1 (en) * 2016-07-04 2019-05-09 Huawei Technologies Co., Ltd. User-plane protocol stack determining method, control-plane network element, and system
CN111294293A (en) * 2018-12-07 2020-06-16 网宿科技股份有限公司 Network isolation method and device based on user mode protocol stack
CN113485823A (en) * 2020-11-23 2021-10-08 中兴通讯股份有限公司 Data transmission method, device, network equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190141169A1 (en) * 2016-07-04 2019-05-09 Huawei Technologies Co., Ltd. User-plane protocol stack determining method, control-plane network element, and system
CN106302199A (en) * 2016-08-10 2017-01-04 成都广达新网科技股份有限公司 A kind of User space protocol stack realization method and system based on L3 Switching machine equipment
WO2018107433A1 (en) * 2016-12-15 2018-06-21 华为技术有限公司 Information processing method and device
CN106850565A (en) * 2016-12-29 2017-06-13 河北远东通信系统工程有限公司 A kind of network data transmission method of high speed
CN111294293A (en) * 2018-12-07 2020-06-16 网宿科技股份有限公司 Network isolation method and device based on user mode protocol stack
CN109547580A (en) * 2019-01-22 2019-03-29 网宿科技股份有限公司 A kind of method and apparatus handling data message
CN113485823A (en) * 2020-11-23 2021-10-08 中兴通讯股份有限公司 Data transmission method, device, network equipment and storage medium

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115296956A (en) * 2022-07-29 2022-11-04 广东浪潮智慧计算技术有限公司 Tunnel forwarding method and device of kernel, electronic equipment and storage medium
CN115296956B (en) * 2022-07-29 2024-03-22 广东浪潮智慧计算技术有限公司 Kernel tunnel forwarding method and device, electronic equipment and storage medium
CN115460470A (en) * 2022-08-19 2022-12-09 武汉烽火技术服务有限公司 Multicast data forwarding method, device, equipment and readable storage medium
CN115460470B (en) * 2022-08-19 2024-03-26 烽火通信科技股份有限公司 Multicast data forwarding method, device, equipment and readable storage medium
CN115499332A (en) * 2022-09-13 2022-12-20 科东(广州)软件科技有限公司 Network message monitoring method, device, equipment and medium
CN115499332B (en) * 2022-09-13 2023-12-15 科东(广州)软件科技有限公司 Method, device, equipment and medium for monitoring network message
CN115665073A (en) * 2022-12-06 2023-01-31 江苏为是科技有限公司 Message processing method and device
CN115904253B (en) * 2023-01-09 2023-06-13 苏州浪潮智能科技有限公司 Data transmission method, device, storage system, equipment and medium
CN115904253A (en) * 2023-01-09 2023-04-04 苏州浪潮智能科技有限公司 Data transmission method and device, storage system and equipment and medium
CN115834665B (en) * 2023-02-08 2023-06-23 天翼云科技有限公司 Network communication method and device
CN115834665A (en) * 2023-02-08 2023-03-21 天翼云科技有限公司 Network communication method and device
CN116455612A (en) * 2023-03-23 2023-07-18 京信数据科技有限公司 Privacy calculation intermediate data stream zero-copy device and method
CN116455612B (en) * 2023-03-23 2023-11-28 京信数据科技有限公司 Privacy calculation intermediate data stream zero-copy device and method
CN116450058A (en) * 2023-06-19 2023-07-18 浪潮电子信息产业股份有限公司 Data transfer method, device, heterogeneous platform, equipment and medium
CN116450058B (en) * 2023-06-19 2023-09-19 浪潮电子信息产业股份有限公司 Data transfer method, device, heterogeneous platform, equipment and medium
CN116781650A (en) * 2023-07-11 2023-09-19 中科驭数(北京)科技有限公司 Data processing method and system
CN116781650B (en) * 2023-07-11 2024-03-19 中科驭数(北京)科技有限公司 Data processing method and system
CN117097779B (en) * 2023-10-16 2024-01-30 之江实验室 Network communication method and device, storage medium and electronic equipment
CN117097779A (en) * 2023-10-16 2023-11-21 之江实验室 Network communication method and device, storage medium and electronic equipment
CN117692416A (en) * 2024-02-04 2024-03-12 苏州元脑智能科技有限公司 Network message processing method, device, computer equipment and storage medium
CN117692416B (en) * 2024-02-04 2024-05-03 苏州元脑智能科技有限公司 Network message processing method, device, computer equipment and storage medium
CN117857660A (en) * 2024-03-07 2024-04-09 济南浪潮数据技术有限公司 Data transmission protocol self-adaption method, system, equipment and medium

Also Published As

Publication number Publication date
CN113485823A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
WO2022105884A1 (en) Data transmission method and apparatus, network device, and storage medium
US9378068B2 (en) Load balancing for a virtual networking system
KR100687659B1 (en) Network interface of controlling lock operation in accordance with axi protocol, packet data communication on-chip interconnect system of including the network interface, and method of operating the network interface
CN106411767B (en) Pass through method, system and the medium of the transmission operation that Remote Direct Memory accesses
US8583755B2 (en) Method and system for communicating between memory regions
WO2018137217A1 (en) Data processing system, method, and corresponding device
US9294569B2 (en) Cell fabric hardware acceleration
JP5353278B2 (en) Communication device
US11025564B2 (en) RDMA transport with hardware integration and out of order placement
US11068412B2 (en) RDMA transport with hardware integration
JP2004534311A (en) Configuration to create multiple virtual queue pairs from compressed queue pairs based on shared attributes
CN111277616A (en) RDMA (remote direct memory Access) -based data transmission method and distributed shared memory system
US10609125B2 (en) Method and system for transmitting communication data
US9515963B2 (en) Universal network interface controller
US10162775B2 (en) System and method for efficient cross-controller request handling in active/active storage systems
CN112953967A (en) Network protocol unloading device and data transmission system
CN111541624B (en) Space Ethernet buffer processing method
CN113179228A (en) Method, device, equipment and medium for improving switch stacking reliability
JP2017184195A (en) Communication management device, communication management method and program
CN113778937A (en) System and method for performing transaction aggregation in a network on chip (NoC)
CN112463680A (en) Data transfer method and device
US11570257B1 (en) Communication protocol, and a method thereof for accelerating artificial intelligence processing tasks
CN116760504B (en) Session synchronization method, device, service node, terminal and readable storage medium
CN115904253B (en) Data transmission method, device, storage system, equipment and medium
WO2023202241A1 (en) Communication method and related product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21894031

Country of ref document: EP

Kind code of ref document: A1

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112023009990

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 112023009990

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20230523

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.10.2023)