WO2023097903A1 - 报文传输方法、装置、电子设备和存储介质 - Google Patents

报文传输方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2023097903A1
WO2023097903A1 PCT/CN2022/077783 CN2022077783W WO2023097903A1 WO 2023097903 A1 WO2023097903 A1 WO 2023097903A1 CN 2022077783 W CN2022077783 W CN 2022077783W WO 2023097903 A1 WO2023097903 A1 WO 2023097903A1
Authority
WO
WIPO (PCT)
Prior art keywords
rdma
message
value information
key
destination address
Prior art date
Application number
PCT/CN2022/077783
Other languages
English (en)
French (fr)
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 WO2023097903A1 publication Critical patent/WO2023097903A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • the embodiments of the present application relate to the technical field of communications, and in particular, to a message transmission method, device, electronic equipment, and storage medium.
  • Remote Direct Memory Access is a technology implemented to reduce the consumption of the central processing unit (CPU) involved in the data transmission process, improve the performance of business processing and reduce delay.
  • RDMA Remote Direct Memory Access
  • the sender when it sends a message, it needs to be encapsulated into a specific RDMA format. Before sending, the sender needs to interact with various handshake protocols to know the receiving address of the receiver, and then encapsulate the address information into the RDMA message. transmission. The receiving end writes the corresponding memory area according to the address.
  • the above-mentioned RDMA technology must allocate a fixed memory size for each receiving end at the receiving end. Once the network topology is complex, for the receiving end as a large number of point-to-point connections, it is necessary to allocate a memory for each sending end connected to the receiving end. Receiving memory space will cause the memory management requirements of the receiving end to become very complicated, so traditional techniques are not suitable for a large number of connections.
  • the embodiment of the present application provides a message transmission method, which is applied at the sending end, including: receiving a remote direct data access RDMA data packet; parsing the RDMA data packet to obtain an RDMA message header and an RDMA message; according to The RDMA message header obtains key value information; obtains the destination address of the RDMA message from a preset hash table according to the key value information, and writes the RDMA message into a memory corresponding to the destination address in space.
  • the embodiment of the present application also provides a message transmission method, which is applied at the receiving end, including: constructing key value information according to the remote direct data access RDMA message to be sent; Obtain the RDMA message header; encapsulate the RDMA message header and the RDMA message to generate an RDMA data packet; send the RDMA data packet to the receiving end for the receiving end to use according to the RDMA report
  • the header obtains the key information, obtains the destination address of the RDMA message from a preset hash table according to the key information, and writes the RDMA message into a memory space corresponding to the destination address.
  • the embodiment of the present application also provides a message transmission device, which is applied at the receiving end, including: a receiving module, used to receive remote direct data access RDMA data packets; and an analysis module, used to analyze the RDMA data packets, and obtain RDMA message header and RDMA message; Obtaining module, used to obtain key value information according to the RDMA message header; Writing module, used to obtain the RDMA message from a preset hash table according to the key value information The destination address of the message, and write the RDMA message into the memory space corresponding to the destination address.
  • a receiving module used to receive remote direct data access RDMA data packets
  • an analysis module used to analyze the RDMA data packets, and obtain RDMA message header and RDMA message
  • Obtaining module used to obtain key value information according to the RDMA message header
  • Writing module used to obtain the RDMA message from a preset hash table according to the key value information The destination address of the message, and write the RDMA message into the memory space
  • the embodiment of the present application also provides an electronic device, including: at least one processor; and a memory connected in communication with the at least one processor; wherein, the memory stores information that can be executed by the at least one processor.
  • An instruction the instruction is executed by the at least one processor, so that the at least one processor can execute the above packet transmission method.
  • the embodiment of the present application also provides a computer-readable storage medium storing a computer program, and implementing the above message transmission method when the computer program is executed by a processor.
  • the message transmission method proposed by this application in the message transmission process of the receiving end, receives the remote direct data access RDMA data packet; parses the RDMA data packet, obtains the RDMA message header and the RDMA message; according to the RDMA message header Obtain key value information; obtain the destination address of the RDMA message from the preset hash table according to the key value information, and write the RDMA message into the memory space corresponding to the destination address. Since the key value information of the sending end and the destination address of the receiving end are stored in the receiving end in the form of a hash table, the receiving end does not need to manage the allocation of fixed receiving memory space for each sending end, but only needs to manage and maintain the hash table, which can Improve the flexibility of memory space management at the receiving end. The technical problem of complex memory space management caused by the receiving end needing to manage the allocation of fixed receiving memory space for each sending end is solved.
  • Fig. 1 is a flow chart of the message transmission method provided by the embodiment of the present application.
  • Fig. 2 is a flow chart of the message transmission method provided by the embodiment of the present application.
  • FIG. 3 is a flowchart of a message transmission method provided in an embodiment of the present application.
  • FIG. 4 is a flowchart of a message transmission method provided in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a receiving end and a sending end provided by an embodiment of the present application
  • FIG. 6 is a flowchart of a message transmission method provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a message transmission device provided in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a message transmission device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the main purpose of the embodiments of the present application is to provide a message transmission method, device, electronic equipment, and storage medium. It is designed to improve the flexibility of memory space management at the receiving end.
  • the embodiment of the present application relates to a message transmission method, which is applied at the receiving end, as shown in Figure 1, including:
  • Step 101 receiving a remote direct data access RDMA data packet.
  • the RDMA data packet received by the receiving end is an encapsulated Ethernet packet, and after obtaining the RDMA message that needs to be transmitted, the sending end generates the RDMA message header of the RDMA message, and The RDMA packet header and the RDMA packet are encapsulated into an RDMA packet and sent to the receiving end.
  • the embodiment of the present application does not limit the encapsulation method of RDMA packet header and RDMA message into RDMA data packet.
  • Any encapsulation method is acceptable, but after the sending end determines the encapsulation method, it needs to The decapsulation method corresponding to the encapsulation mode is sent to the receiving end, so that the receiving end can restore the RDMA message header and the RDMA message from the RDMA data packet.
  • Step 102 analyze the RDMA data packet, and obtain the RDMA message header and the RDMA message.
  • the receiving end after receiving the RDMA data packet, the receiving end first uses a preset decapsulation method to decapsulate the RDMA data packet, and parses the RDMA packet header and the RDMA packet from the RDMA packet, wherein , the preset decapsulation mode is the decapsulation mode corresponding to the encapsulation mode used by the sender.
  • Step 103 obtain key value information according to the RDMA packet header.
  • the RDMA message header is actually generated using key-value information, and the key-value information can be obtained directly from a specified position in the RDMA message header.
  • Step 104 obtain the destination address of the RDMA message from the preset hash table according to the key value information, and write the RDMA message into the memory space corresponding to the destination address.
  • the receiver pre-stores a hash table of the correspondence between key information and destination addresses. After determining the key information, it can search the destination address corresponding to the key information from the hash table according to the key information. Address, after the destination address of the RDMA message is determined, the receiving end will write the RDMA message into the memory space corresponding to the destination address. When all the RDMA messages are written, the message transmission work of the RDMA message That's it.
  • the remote direct data access RDMA data packet is received; the RDMA data packet is analyzed to obtain the RDMA message header and the RDMA message; and the key value information is obtained according to the RDMA message header ; Obtain the destination address of the RDMA message from the preset hash table according to the key value information, and write the RDMA message into the memory space corresponding to the destination address.
  • the receiving end Since the key value information of the sending end and the destination address of the receiving end are stored in the receiving end in the form of a hash table, the receiving end does not need to manage the allocation of fixed receiving memory space for each sending end, but only needs to manage and maintain the hash table, which can Improve the flexibility of memory space management at the receiving end.
  • the technical problem of complex memory space management caused by the receiving end needing to manage the allocation of fixed receiving memory space for each sending end is solved.
  • the embodiment of the present application relates to a message transmission method, which is applied at the receiving end, as shown in Figure 2, including:
  • Step 201 receiving a remote direct data access RDMA data packet.
  • this step is substantially the same as step 101 in the embodiment of the present application, and details are not repeated here.
  • Step 202 analyze the RDMA data packet, and obtain the RDMA message header and the RDMA message.
  • this step is substantially the same as step 102 in the embodiment of the present application, and details are not repeated here.
  • Step 203 obtain key value information according to the RDMA message header.
  • this step is substantially the same as step 103 in the embodiment of the present application, and details are not repeated here.
  • Step 204 performing a hash operation on the key-value information to obtain an entry index.
  • the key-value information is actually a character segment with an indefinite length
  • a hash operation can be performed on the key-value information to obtain a character segment with a fixed length
  • the character segment with a fixed length is used as a hash value
  • the hash value is actually the entry index of each hash schedule in the hash table.
  • Step 205 searching the preset hash table according to the entry index, obtaining the destination address in the hash table entry corresponding to the entry index, and writing the RDMA packet into the memory space corresponding to the destination address.
  • the hash table entry corresponding to the entry index is searched in the hash table, and after the hash table entry is found, the destination address is obtained from the hash table entry, and the hash table The destination address in the entry is the destination address of the received RDMA message.
  • the receiving end will write the RDMA message into the memory space corresponding to the destination address.
  • the hash table entry is composed of key information and destination address
  • the key information in the hash table entry and the key information received by the receiving end can be compared first. In contrast, it is detected whether the two key-value information are consistent, and only when the two key-value information are consistent, the RDMA message is written into the destination address.
  • the transmission address of the RDMA message can also be obtained by looking up the table, omitting the fact that the sender needs to interact with various handshake protocols before the RDMA message is transmitted.
  • the step of receiving the address of the receiving end improves the speed and efficiency of message transmission.
  • the embodiment of the present application relates to a message transmission method, which is applied at the receiving end, as shown in Figure 3, including:
  • Step 301 receiving a negotiation message from a sender, wherein the negotiation message includes key value information corresponding to each message type.
  • the sending end determines the correspondence between the message type of the RDMA message and the key value information, and the receiving end determines the RDMA The corresponding relationship between the key-value information of the message and the destination address; after the sending end constructs the key-value information for each message type of RDMA message, it encapsulates each key-value information into a negotiation message and sends it to the receiving end.
  • Step 302 Parse the negotiation message to obtain each key value information, and perform a hash operation on each key value information to obtain each hash value.
  • the receiving end after receiving the negotiation message sent by the sending end, the receiving end will parse out key value information from the negotiation message, such as key value information 1, key value information 2 and key value information 3; A hash operation is performed on each key value information to obtain each hash value, such as hash value 1, hash value 2, and hash value 3.
  • key value information such as key value information 1, key value information 2 and key value information 3
  • a hash operation is performed on each key value information to obtain each hash value, such as hash value 1, hash value 2, and hash value 3.
  • the receiving end only needs to obtain the key-value information, and does not pay attention to which message type the key-value information corresponds to.
  • the receiving end in addition to obtaining the key-value information, the receiving end also needs to obtain which message type the key-value information corresponds to, so as to assign a corresponding destination address to each key-value information according to the message type.
  • the destination address it can be allocated according to the memory space required by each message type.
  • Step 303 assign each destination address to each key-value information according to the memory space of the receiving end.
  • the receiving end after the receiving end obtains the key-value information, it can allocate corresponding memory space for each key-value information according to the current memory space of the receiving end. After the memory space is allocated, the obtained allocated The destination address of the memory space, such as destination address 1, destination address 2, and destination address 3.
  • Step 304 each hash value is used as each entry index of each key value information in the hash table, and each key value information and each destination address are stored as each hash table entry in the hash table.
  • the hash value is used as the entry index of the hash entry in the hash value, and the key value information and destination address are used as the entry index in the hash value Hash the entry content of the entry to form the hash table.
  • the identification of the sending end when receiving the negotiation message of the sending end, can also be received, and a hash subtable is respectively established for each sending end connected to the receiving end, and when the hash table is searched according to the key value information, it can be First determine the hash subtable from the hash table according to the sender identifier in the RDMA data packet, and then search the hash subtable to obtain the destination address.
  • the style of the hash table is shown in Table 1:
  • Table 1 The hash table of the receiving end
  • the first key value information to be modified can be determined first, and the first hash value is obtained according to the first key value information, and stored in the hash table Find the first hash entry corresponding to the first hash value in the first hash entry, and directly modify the key value information or destination address in the first hash entry; you can also delete the first hash entry corresponding to the first hash value entry, and re-construct a new hash entry for the first key-value information.
  • the receiving end may detect the usage frequency of each hash entry in the hash table, and delete the hash entry corresponding to the usage frequency when the usage frequency is lower than a preset threshold.
  • the receiving end can also negotiate with the sending end before receiving the RDMA message, determine the corresponding relationship between the key value information and the destination address, and store it in the hash table,
  • the receiving end increases the number of sending ends and message types connected to it, only a small amount of hash table size will be increased, and the management of the receiving data area will become more flexible, and when the corresponding relationship between the key value information and the destination address changes, Only the hash table needs to be modified, and there is no need to renegotiate with all senders, which avoids renegotiation from occupying a large amount of bandwidth.
  • the embodiment of the present application relates to a message transmission method, which is applied at the sending end, as shown in Figure 4, including:
  • Step 401 Construct key-value information according to the remote direct data access RDMA message to be sent.
  • the sender after determining the RDMA message to be transmitted, the sender first constructs a key-value information according to the RDMA message to be transmitted, and the constructed key-value information may be a segment of characters with a variable length.
  • FIG. 5 a schematic structural diagram of the sending end and the receiving end is shown in FIG. 5 , and the sending end and the receiving end are two systems or chips that can perform remote direct memory access to each other.
  • the sending end is composed of CPU, RDMA_TX and ETH
  • the receiving end is composed of CPU, RDMA_RX and ETH.
  • the CPU is responsible for the establishment of the connection between the sending end and the receiving end, the allocation of memory space, the designation of the message type of the RDMA message, and the maintenance of the hash table;
  • the function of RDMA_TX is to encapsulate the RDMA data packet according to the message type specified by the CPU and send it out;
  • RDMA_RX is responsible for receiving the RDMA data packet, and extracting the key value information from the RDMA data packet to perform a hash operation to search the hash table to obtain the destination address of the RDMA message, and then write the message into the corresponding memory space according to the destination address;
  • ETH is
  • the Ethernet interface implements the processing functions of the Ethernet L1 at the sending end and the Ethernet L1 at the receiving end.
  • Step 402 Obtain the RDMA message header from the preset message headers according to the key value information.
  • the sending end presets a mapping table of key value information and RDMA message headers, and after obtaining the key value information of the RDMA message to be transmitted, the sending end searches the mapping table according to the key value information, and obtains to the RDMA packet header corresponding to the key-value information.
  • Step 403 encapsulating the RDMA message header and the RDMA message to generate an RDMA data packet.
  • the RDMA message header and the RDMA message are encapsulated, and the RDMA message header and the RDMA message are encapsulated into an RDMA data packet.
  • This application does not specify the encapsulation method Any method for encapsulating data packets can be used.
  • the RDMA message to be transmitted by the sender when the RDMA message to be transmitted by the sender includes multiple message types, the RDMA message can be divided according to the message type, and a message type can be encapsulated into an RDMA data packet, or multiple key
  • the RDMA message header corresponding to the value information is merged into one RDMA message header, and the combined RDMA message header contains multiple key-value information, and then the combined RDMA message header and the RDMA message are encapsulated.
  • Step 404 send the RDMA data packet to the receiving end, so that the receiving end obtains the key value information according to the RDMA message header, obtains the destination address of the RDMA message from the preset hash table according to the key value information, and sends the RDMA message Write to the memory space corresponding to the destination address.
  • the RDMA data packet is transmitted to the receiving end according to the transmission protocol between the sending end and the receiving end, and the receiving end parses the RDMA packet header and the RDMA packet from it after receiving the RDMA data packet.
  • message and then obtain the key-value information from the RDMA message header, obtain the destination address corresponding to the key-value information from the preset hash table, and then write the RDMA message into the memory space corresponding to the destination address, Complete the transmission of RDMA packets.
  • the key value information is constructed according to the remote direct data access RDMA message to be sent; the RDMA message header is obtained from the preset message header according to the key value information; The RDMA message header and the RDMA message are encapsulated to generate an RDMA data packet; the RDMA data packet is sent to the receiving end for the receiving end to obtain the key value information according to the RDMA message header, and obtain it from the preset hash table according to the key value information The destination address of the RDMA message, and write the RDMA message into the memory space corresponding to the destination address.
  • the sending end Since the key value information of the sending end and the destination address of the receiving end are stored in the receiving end in the form of a hash table, the sending end does not need to negotiate with the receiving end before each message transmission, nor does it need to manage the relevant information of the receiving end.
  • the end does not need to manage the allocation of fixed receiving memory space for each sending end, but only needs to manage and maintain the hash table, which can improve the flexibility of memory space management at the receiving end and sending end.
  • the embodiment of the present application relates to a message transmission method, which is applied at the sending end, as shown in Figure 6, including:
  • Step 501 acquire the message type of the remote direct data access RDMA message to be sent, and construct the key value information according to the message type.
  • the RDMA packets to be sent are classified according to the preset packet classification method, and the message type of the RDMA packet is obtained, so as to obtain the corresponding key value information according to the message type, and the sending end presets A mapping table of the correspondence between message types and key-value information.
  • Step 502 judging whether the message type is a newly added message type.
  • step 503 when the message type of the RDMA packet is a newly added message type, step 503 is performed; otherwise, step 505 is performed.
  • Step 503 Construct a negotiation message according to the key value information, and send it to the receiving end, so that the receiving end can allocate a destination address for the message type according to the key value information in the negotiation message.
  • the message type when the message type is a newly added message type, it means that the receiving end has not allocated a destination address for the RDMA message of this message type. Therefore, it is necessary to first construct a negotiation message for the key value information, and set The negotiation message is sent to the receiving end. After receiving the negotiation message, the receiving end allocates the destination address according to the key value information in the negotiation message, and stores the corresponding relationship between the key value information and the destination address in the hash table.
  • Step 504 Construct an RDMA message header according to the key-value information, and store it in a preset message header.
  • the message type is a newly added message type
  • the RDMA message header is selected and stored in the preset message header.
  • Step 505 Obtain the RDMA message header from the preset message headers according to the key value information.
  • this step is substantially the same as step 402 in the embodiment of the present application, and details are not repeated here.
  • Step 506 encapsulating the RDMA message header and the RDMA message to generate an RDMA data packet.
  • this step is substantially the same as step 403 in the embodiment of the present application, and details are not repeated here.
  • Step 507 send the RDMA data packet to the receiving end, so that the receiving end obtains the key value information according to the RDMA message header, obtains the destination address of the RDMA message from the preset hash table according to the key value information, and writes the RDMA message into In the memory space corresponding to the destination address.
  • this step is substantially the same as step 404 in the embodiment of the present application, and details are not repeated here.
  • the sending end when the sending end detects that the RDMA message to be transmitted is a new message type, it can negotiate with the receiving end in advance, so that the receiving end can The RDMA message of the new message type is assigned a good destination address to prevent the receiving end from having no place to store the RDMA message at the receiving end, resulting in RDMA message transmission failure.
  • step division of the above various methods is only for the sake of clarity of description. During implementation, it can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. ; Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
  • FIG. 7 is a schematic diagram of the message transmission device described in this embodiment, including: a receiving module 601, an analysis module 602, an acquisition module 603 and a writing module 604.
  • the receiving module 601 is configured to receive remote direct data access RDMA data packets.
  • the parsing module 602 is configured to parse the RDMA data packet, and obtain the RDMA message header and the RDMA message.
  • An obtaining module 603, configured to obtain key-value information according to the RDMA packet header.
  • the writing module 604 is configured to obtain the destination address of the RDMA message from the preset hash table according to the key value information, and write the RDMA message into the memory space corresponding to the destination address.
  • FIG. 8 is a schematic diagram of the message transmission device described in this embodiment, including: a construction module 701, an acquisition module 702, an encapsulation module 703 and a transmission module 704 .
  • the construction module 701 is configured to construct key-value information according to the remote direct data access RDMA message to be sent.
  • the obtaining module 702 is configured to obtain the RDMA message header from preset message headers according to the key value information.
  • the encapsulation module 703 is configured to encapsulate the RDMA message header and the RDMA message to generate an RDMA data packet.
  • a transmission module 704 configured to send the RDMA data packet to a receiving end, so that the receiving end obtains the key value information according to the RDMA packet header, and obtains the key value information from a preset hash table according to the key value information The destination address of the RDMA packet, and writing the RDMA packet into the memory space corresponding to the destination address.
  • this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in cooperation with the above method embodiment.
  • the relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition.
  • the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
  • modules involved in this embodiment are logical modules.
  • a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units.
  • units that are not closely related to solving the technical problem proposed in the present application are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
  • FIG. 9 Another embodiment of the present application relates to an electronic device, as shown in FIG. 9 , including: at least one processor 801; and a memory 802 communicatively connected to the at least one processor 801; wherein, the memory 802 stores Instructions that can be executed by the at least one processor 801, where the instructions are executed by the at least one processor 801, so that the at least one processor 801 can execute the packet transmission methods in the foregoing embodiments.
  • the memory and the processor are connected by a bus
  • 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 together.
  • the bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein.
  • the bus interface provides an interface between the bus and the transceivers.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing 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 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 can be used to store data that the processor uses when performing operations.
  • Another 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 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 media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例涉及通信技术领域,特别涉及一种报文传输方法、装置、电子设备和存储介质。报文传输方法包括:接收远程直接数据存取RDMA数据包;对所述RDMA数据包进行解析,获取RDMA报文头和RDMA报文;根据所述RDMA报文头获取键值信息;根据所述键值信息从预设的散列表中获取所述RDMA报文的目的地址,并将所述RDMA报文写入所述目的地址对应的内存空间中。

Description

报文传输方法、装置、电子设备和存储介质
交叉引用
本申请基于申请号为“202111467655.6”、申请日为2021年12月03日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。
技术领域
本申请实施例涉及通信技术领域,特别涉及一种报文传输方法、装置、电子设备和存储介质。
背景技术
远程直接内存访问技术(Remote Direct Memory Access,简称RDMA)是为了降低中央处理器(central processing unit,简称CPU)参与数据传输过程的消耗而实现的技术,提升业务处理的性能并降低延时。在RDMA技术中,发送端发送报文时需要封装成特定的RDMA格式,其中发送端在发送前需要通过各类握手协议交互来获知接收端的接收地址,再将地址信息封装到RDMA报文中进行传输。接收端根据该地址写入对应的内存区域。
然而,上述RDMA技术在接收端必须为每个接收端分配固定的内存大小供接收,一旦网络拓扑复杂,对于作为大量点对点连接的接收端来说,需要为与接收端连接的各发送端分配一个接收内存空间,会导致接收端的内存管理要求会变得十分复杂,因此传统技术并不适用于大量连接。
发明内容
本申请实施例提供了一种报文传输方法,应用在发送端,包括:接收远程直接数据存取RDMA数据包;对所述RDMA数据包进行解析,获取RDMA报文头和RDMA报文;根据所述RDMA报文头获取键值信息;根据所述键值信息从预设的散列表中获取所述RDMA报文的目的地址,并将所述RDMA报文写入所述目的地址对应的内存空间中。
本申请实施例还提供了一种报文传输方法,应用在接收端,包括:根据待发送的远程直接数据存取RDMA报文构造键值信息;根据所述键值信息从预设报文头中获取RDMA报文头;对所述RDMA报文头和所述RDMA报文进行封装,生成RDMA数据包;将所述RDMA数据包发送至接收端,以供所述接收端根据所述RDMA报文头获取所述键值信息,根据所述 键值信息从预设散列表中获取所述RDMA报文的目的地址,将所述RDMA报文写入所述目的地址对应的内存空间中。
本申请实施例还提供一种报文传输装置,应用在接收端,包括:接收模块,用于接收远程直接数据存取RDMA数据包;解析模块,用于对所述RDMA数据包进行解析,获取RDMA报文头和RDMA报文;获取模块,用于根据所述RDMA报文头获取键值信息;写入模块,用于根据所述键值信息从预设的散列表中获取所述RDMA报文的目的地址,并将所述RDMA报文写入所述目的地址对应的内存空间中。
本申请实施例还提供了一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的报文传输方法。
本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述的报文传输方法。
本申请提出的报文传输方法,在接收端的报文传输过程中,接收远程直接数据存取RDMA数据包;对RDMA数据包进行解析,获取RDMA报文头和RDMA报文;根据RDMA报文头获取键值信息;根据键值信息从预设的散列表中获取RDMA报文的目的地址,并将RDMA报文写入目的地址对应的内存空间中。由于发送端的键值信息和接收端的目的地址以散列表的形式存储在接收端中,接收端不用对为各发送端分配固定的接收内存空间进行管理,只需要对散列表进行管理和维护,可以提高接收端进行内存空间管理的灵活性。解决了由于接收端需要对为各发送端分配固定的接收内存空间进行管理所导致的内存空间管理复杂的技术问题。
附图说明
图1是本申请实施例提供的报文传输方法的流程图;
图2是本申请实施例提供的报文传输方法的流程图;
图3是本申请实施例提供的报文传输方法的流程图;
图4是本申请实施例提供的报文传输方法的流程图;
图5是本申请实施例提供的接收端和发送端的结构示意图;
图6是本申请实施例提供的报文传输方法的流程图;
图7是本申请实施例提供的报文传输装置的结构示意图;
图8是本申请实施例提供的报文传输装置的结构示意图;
图9是本申请实施例提供的电子设备的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施例进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。
本申请实施例的主要目的在于提出一种报文传输方法、装置、电子设备和存储介质。旨在提高接收端进行内存空间管理的灵活性。
本申请的实施例涉及一种报文传输方法,应用在接收端,如图1所示,包括:
步骤101,接收远程直接数据存取RDMA数据包。
在一示例实施中,接收端所接收的RDMA数据包是经过封装的以太网包,发送端在获取到需要进行报文传输的RDMA报文后,生成该RDMA报文的RDMA报文头,将RDMA报文头和RDMA报文封装成RDMA数据包,发送给接收端。其中,本申请实施例并不对RDMA报文头和RDMA报文封装成RDMA数据包的封装方式进行限定,任意一种封装方式均可以,但发送端在确定好封装方式之后,需要将确定好的封装方式对应的解封装方法发送至接收端,以使接收端能够从RDMA数据包中还原出RDMA报文头和RDMA报文。
步骤102,对RDMA数据包进行解析,获取RDMA报文头和RDMA报文。
在一示例实施中,接收端在接收到RDMA数据包之后,首先采用预设的解封装方式对RDMA数据包进行解封装操作,从RDMA数据包中解析出RDMA报文头和RDMA报文,其中,预设的解封装方式是与发送端所使用的封装方式对应的解封装方式。
步骤103,根据RDMA报文头获取键值信息。
在一示例实施中,RDMA报文头实际上使用键值信息生成的,可以直接从RDMA报文头中的指定位置出获取到键值信息。
步骤104,根据键值信息从预设的散列表中获取RDMA报文的目的地址,并将RDMA报文写入目的地址对应的内存空间中。
在一示例实施中,接收端预先存储有键值信息和目的地址对应关系的散列表,在确定好键值信息之后,就可以根据键值信息从散列表中查找与该键值信息对应的目的地址,在RDMA报文的目的地址确定之后,接收端会将RDMA报文写入与该目的地址对应的内存空间中,当RDMA报文全部写入完成时,该RDMA报文的报文传输工作也就完成。
本申请实施例,在接收端的报文传输过程中,接收远程直接数据存取RDMA数据包;对 RDMA数据包进行解析,获取RDMA报文头和RDMA报文;根据RDMA报文头获取键值信息;根据键值信息从预设的散列表中获取RDMA报文的目的地址,并将RDMA报文写入目的地址对应的内存空间中。由于发送端的键值信息和接收端的目的地址以散列表的形式存储在接收端中,接收端不用对为各发送端分配固定的接收内存空间进行管理,只需要对散列表进行管理和维护,可以提高接收端进行内存空间管理的灵活性。解决了由于接收端需要对为各发送端分配固定的接收内存空间进行管理所导致的内存空间管理复杂的技术问题。
本申请的实施例涉及一种报文传输方法,应用在接收端,如图2所示,包括:
步骤201,接收远程直接数据存取RDMA数据包。
在一示例实施中,本步骤与本申请实施例的步骤101大致相同,此处不一一赘述。
步骤202,对RDMA数据包进行解析,获取RDMA报文头和RDMA报文。
在一示例实施中,本步骤与本申请实施例的步骤102大致相同,此处不一一赘述。
步骤203,根据RDMA报文头获取键值信息。
在一示例实施中,本步骤与本申请实施例的步骤103大致相同,此处不一一赘述。
步骤204,对键值信息进行哈希运算,获取条目索引。
在一示例实施中,键值信息实际上是一段长度不固定的字符段,可以对键值信息进行哈希运算,来得到一个固定长度的字符段,将该固定长度的字符段作为散列值,而散列值实际上就是散列表中各散列调度的条目索引。
步骤205,根据条目索引查找预设的散列表,获取与条目索引对应的散列表条目中的目的地址,并将RDMA报文写入目的地址对应的内存空间中。
在一示例实施中,在获取到条目索引之后,在散列表中查找与该条目索引对应的散列表条目,在查到找散列表条目之后,从该散列表条目中获取到目的地址,散列表条目中的目的地址就是所接收到的RDMA报文的目的地址,在RDMA报文的目的地址确定之后,接收端会将RDMA报文写入与该目的地址对应的内存空间中,当RDMA报文全部写入完成时,该RDMA报文的报文传输工作也就完成。
在一示例实施中,由于散列表条目是由键值信息和目的地址构成的,在散列表条目确定好之后,可以先将散列表条目中的键值信息和接收端所接收的键值信息进行对比,检测这两个键值信息是否一致,只有在两个键值信息一致时,才将RDMA报文写入到目的地址中。
本申请的实施例,在其他实施例的基础之上还可以通过查表的方式获取到RDMA报文的传输地址,省略了发送端在RDMA报文在传输前需要通过各类握手协议交互来获取接收端的接收地址这一步骤,提高了进行报文传输的速度和效率。
本申请的实施例涉及一种报文传输方法,应用在接收端,如图3所示,包括:
步骤301,接收发送端的协商报文,其中,协商报文中包含各消息类型对应的各键值信息。
在一示例实施中,在接收端和发送端第一次建立链接时,接收端和发送端首先需要进行协商,发送端确定RDMA报文的消息类型和键值信息的对应关系,接收端确定RDMA报文的键值信息和目的地址的对应关系;发送端在为每一种消息类型的RDMA报文构造好键值信息之后,将各键值信息封装为协商报文发送给接收端。
步骤302,解析协商报文获取各键值信息,并对各键值信息进行哈希运算获取各散列值。
在一示例实施中,接收端在接收到发送端发送的协商报文之后,会从协商报文中解析出各键值信息,如键值信息1、键值信息2和键值信息3;在对各键值信息进行哈希运算得到各散列值,如散列值1、散列值2和散列值3。
在一示例实施中,在接收端只需要获取到键值信息即可,并不关注该键值信息与哪种消息类型对应。
在一示例实施中,接收端除了获取到键值信息,还需要获取该键值信息与哪种消息类型对应,以便根据消息类型为各键值信息分配相对应的目的地址,是得本申请在分配目的地址时,可以根据各消息类型所需要的内存空间来分配。
步骤303,根据接收端的内存空间为各键值信息分配各目的地址。
在一示例实施中,在接收端获取到键值信息后,可以根据接收端当前的内存空间来给各键值信息分配相对于的内存空间,在内存空间分配好之后,可以将获取到所分配的内存空间的目的地址,如目的地址1、目的地址2和目的地址3。
步骤304,将各散列值作为各键值信息在散列表中的各条目索引,将各键值信息和各目的地址作为各散列表条目存储在散列表中。
在一示例实施中,在键值信息、散列值和目的地址都确定好之后,将散列值作为散列值中散列条目的条目索引、将键值信息和目的地址作为散列值中散列条目的条目内容,以此来形成散列表。
在一示例实施中,在接收发送端的协商报文时,还可以接收该发送端的标识,为与接收端连接的各发送端分别建立一个散列子表,在根据键值信息查找散列表时,可以先根据RDMA数据包中的发送端标识从散列表中确定散列子表之后再查找该散列子表获取目的地址。
在一示例实施中,散列表的样式如表1所示:
表1接收端的散列表
Figure PCTCN2022077783-appb-000001
Figure PCTCN2022077783-appb-000002
在一示例实施中,在需要对散列表进行修改或需要重新分配目的地址时,可以先确定好需要修改的第一键值信息,根据第一键值信息获取第一散列值,在散列表中查找与第一散列值对应的第一散列条目,直接修改该第一散列条目中的键值信息或目的地址即可;也可以删除与第一散列值对应的第一散列条目,并重新为第一键值信息构建新的散列条目。
在一示例实施中,接收端可以对散列表中的各散列条目的使用频率进行检测,当使用频率低于预设阈值时,删除与该使用频率对应的散列条目。
本申请的实施例,在其他实施例的基础之上还可以接收端在接收RDMA报文之前,先于发送端进行协商,确定键值信息和目的地址的对应关系,并存储在散列表中,在接收端增加与其进行连接的发送端的个数和消息类型时只会增加少量散列表大小,对于接收数据区的管理变得更加灵活,且在键值信息和目的地址的对应关系发生变更时,只需要修改散列表,不需要与所有发送端进行重新协商,避免了进行重新协商占用大量带宽。
本申请的实施例涉及一种报文传输方法,应用在发送端,如图4所示,包括:
步骤401,根据待发送的远程直接数据存取RDMA报文构造键值信息。
在一示例实施中,发送端在确定好要传输的RDMA报文之后,首先会根据要传输的RDMA报文构造一个键值信息,所构造的键值信息可以是一段长度不固定的字符断。
在一示例实施中,发送端和接收端的结构示意图如图5所示,发送端和接收端为两个可以互相进行远程直接内存访问的系统或芯片。发送端由CPU、RDMA_TX和ETH组成,接收端由CPU、RDMA_RX和ETH组成。其中,CPU负责发送端和接收端的连接建立、内存空间的分配、RDMA报文消息类型的指定以及散列表的维护等工作;RDMA_TX的作用是根据CPU指定的消息类型封装RDMA数据包并发送出去;RDMA_RX负责接收RDMA数据包,并从RDMA数据包中提取键值信息进行哈希运算查找散列表,得到RDMA报文的目的地址,然后根据目的地址将报文写入对应的内存空间中;ETH是以太网接口,实现发送端的以太网L1和接收端的以太网L1的处理功能。
步骤402,根据键值信息从预设报文头中获取RDMA报文头。
在一示例实施中,发送端预设有键值信息和RDMA报文头的映射表,发送端在获取到要传输的RDMA报文的键值信息之后,根据键值信息查找映射表,从中获取到与键值信息对应的RDMA报文头。
步骤403,对RDMA报文头和RDMA报文进行封装,生成RDMA数据包。
在一示例实施中,在获取到RDMA报文头之后,对RDMA报文头和RDMA报文进行封装,将RDMA报文头和RDMA报文封装为RDMA数据包,本申请并不对封装方式进行具体的限定,任意一种对数据报文进行封装的方法都可以采用。
在一示例实施中,当发送端要传输的RDMA报文包含多种消息类型时,可以将RDMA报文根据消息类型进行划分,一种消息类型封装为一个RDMA数据包,也可以将多种键值信息对应的RDMA报文头合并为一种RDMA报文头,合并后的RDMA报文头包含有多个键值信息,之后将合并后的RDMA报文头和RDMA报文进行封装。
步骤404,将RDMA数据包发送至接收端,以供接收端根据所述RDMA报文头获取键值信息,根据键值信息从预设散列表中获取RDMA报文的目的地址,将RDMA报文写入目的地址对应的内存空间中。
在一示例实施中,获取到RDMA数据包之后,根据发送端和接收端的传输协议,将RDMA数据包传输到接收端,接收端在接收到RDMA数据包之后,从中解析出RDMA报文头和RDMA报文,再从RDMA报文头中获取到键值信息,从预设的散列表中获取到与键值信息对应的目的地址,之后将RDMA报文写入与目的地址对应的内存空间中,完成RDMA报文的传输。
本申请的实施例,在接收端的报文传输过程中,根据待发送的远程直接数据存取RDMA报文构造键值信息;根据键值信息从预设报文头中获取RDMA报文头;对RDMA报文头和RDMA报文进行封装,生成RDMA数据包;将RDMA数据包发送至接收端,以供接收端根据RDMA报文头获取键值信息,根据键值信息从预设散列表中获取RDMA报文的目的地址,将RDMA报文写入目的地址对应的内存空间中。由于发送端的键值信息和接收端的目的地址以散列表的形式存储在接收端中,发送端不需要在每次进行报文传输前与接收端进行协商,也不需要管理接收端的相关信息,接收端不用对为各发送端分配固定的接收内存空间进行管理,只需要对散列表进行管理和维护,可以提高接收端和发送端进行内存空间管理的灵活性。
本申请的实施例涉及一种报文传输方法,应用在发送端,如图6所示,包括:
步骤501,获取待发送的远程直接数据存取RDMA报文的消息类型,并根据消息类型构造所述键值信息。
在一示例实施中,首先根据预设的报文分类方式对待发送的RDMA报文进行分类,获取到RDMA报文的消息类型,从而根据消息类型获取到对应的键值信息,发送端预设有消息类型和键值信息对应关系的映射表。
步骤502,判断消息类型是否为新增消息类型。
在一示例实施中,当RDMA报文的消息类型是新增消息类型时,执行步骤503,否则执行步骤505。
步骤503,根据键值信息构造协商报文,并发送给接收端,以供接收端根据协商报文中的键值信息为消息类型分配目的地址。
在一示例实施中,当消息类型是新增消息类型时,说明接收端也并未为该消息类型的RDMA报文分配目的地址,因此,需要先为该键值信息构造协商报文,将该协商报文发送到接收端,接收端在接收到协商报文之后,根据协商报文中的键值信息分配目的地址,并将键值信息和目的地址的对应关系存储在散列表中。
步骤504,根据键值信息构造RDMA报文头,并存储在预设报文头中。
在一示例实施中,若消息类型是新增消息类型,在发送端也并未有与新增消息类型对应的RDMA报文头,因此,需要先根据该新增消息类型对应的键值信息构造好RDMA报文头,并存储在预设的报文头中。
步骤505,根据键值信息从预设报文头中获取RDMA报文头。
在一示例实施中,本步骤与本申请实施例的步骤402大致相同,此处不一一赘述。
步骤506,对RDMA报文头和RDMA报文进行封装,生成RDMA数据包。
在一示例实施中,本步骤与本申请实施例的步骤403大致相同,此处不一一赘述。
步骤507,将RDMA数据包发送至接收端,以供接收端根据RDMA报文头获取键值信息,根据键值信息从预设散列表中获取RDMA报文的目的地址,将RDMA报文写入目的地址对应的内存空间中。
在一示例实施中,本步骤与本申请实施例的步骤404大致相同,此处不一一赘述。
本申请的实施例,在其他实施例的基础之上还可以在发送端检测到所需要传输的RDMA报文是一种新的消息类型时,提前与接收端进行协商,使得接收端可以为该新消息类型的RDMA报文分配好目的地址,避免接收端在接收端RDMA报文时无处存放,导致RDMA报文传输失败。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本申请实施例涉及一种报文传输装置,应用在接收端,图7是本实施例所述的报文传输装置的示意图,包括:接收模块601、解析模块602、获取模块603和写入模块604。
其中,接收模块601,用于接收远程直接数据存取RDMA数据包。
解析模块602,用于对RDMA数据包进行解析,获取RDMA报文头和RDMA报文。
获取模块603,用于根据RDMA报文头获取键值信息。
写入模块604,用于根据键值信息从预设的散列表中获取RDMA报文的目的地址,并将RDMA报文写入目的地址对应的内存空间中。
本申请实施例涉及一种报文传输装置,应用在发送端,图8是本实施例所述的报文传输装置的示意图,包括:构造模块701、获取模块702、封装模块703和传输模块704。
其中,构造模块701,用于根据待发送的远程直接数据存取RDMA报文构造键值信息。
获取模块702,用于根据所述键值信息从预设报文头中获取RDMA报文头。
封装模块703,用于对所述RDMA报文头和所述RDMA报文进行封装,生成RDMA数据包。
传输模块704,用于将所述RDMA数据包发送至接收端,以供所述接收端根据所述RDMA报文头获取所述键值信息,根据所述键值信息从预设散列表中获取所述RDMA报文的目的地址,将所述RDMA报文写入所述目的地址对应的内存空间中。
不难发现,本实施例为与上述方法实施例对应的系统实施例,本实施例可以与上述方法实施例互相配合实施。上述实施例中提到的相关技术细节和技术效果在本实施例中依然有效,为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在上述实施例中。
值得一提的是,本实施例中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本申请的创新部分,本实施例中并没有将与解决本申请所提出的技术问题关系不太密切的单元引入,但这并不表明本实施例中不存在其它的单元。
本申请另一个实施例涉及一种电子设备,如图9所示,包括:至少一个处理器801;以及,与所述至少一个处理器801通信连接的存储器802;其中,所述存储器802存储有可被所述至少一个处理器801执行的指令,所述指令被所述至少一个处理器801执行,以使所述至少一个处理器801能够执行上述各实施例中的报文传输方法。
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收 数据并将数据传送给处理器。
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。
本申请另一个实施例涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。

Claims (10)

  1. 一种报文传输方法,应用在接收端,包括:
    接收远程直接数据存取RDMA数据包;
    对所述RDMA数据包进行解析,获取RDMA报文头和RDMA报文;
    根据所述RDMA报文头获取键值信息;
    根据所述键值信息从预设的散列表中获取所述RDMA报文的目的地址,并将所述RDMA报文写入所述目的地址对应的内存空间中。
  2. 根据权利要求1所述的报文传输方法,其中,所述方法还包括:
    接收发送端的协商报文,其中,所述协商报文中包含各消息类型对应的各键值信息;
    解析所述协商报文获取所述各键值信息,并对各所述键值信息进行哈希运算获取各散列值;
    根据所述接收端的内存空间为各所述键值信息分配各所述目的地址;
    将各所述散列值作为各所述键值信息在所述散列表中的各条目索引,将各所述键值信息和各所述目的地址作为各散列表条目存储在所述散列表中。
  3. 根据权利要求2所述的报文传输方法,其中,所述方法还包括:
    当各述键值信息中存在需要重新分配所述目的地址的第一键值信息时,获取所述第一键值信息对应的第一散列值;
    修改所述散列表中与所述第一散列值对应的散列表条目;或者,
    删除所述散列表中与所述第一散列值对应的散列表条目,为所述第一散列值创建新散列表条目,存储在所述散列表中。
  4. 根据权利要求1至3中任一项所述的报文传输方法,其中,所述根据所述键值信息从预设的散列表中获取所述RDMA报文的目的地址,包括:
    对所述键值信息进行哈希运算,获取条目索引;
    根据所述条目索引查找所述散列表,获取与所述条目索引对应的散列表条目中的所述目的地址。
  5. 一种报文传输方法,应用在发送端,包括:
    根据待发送的远程直接数据存取RDMA报文构造键值信息;
    根据所述键值信息从预设报文头中获取RDMA报文头;
    对所述RDMA报文头和所述RDMA报文进行封装,生成RDMA数据包;
    将所述RDMA数据包发送至接收端,以供所述接收端根据所述RDMA报文头获取所述 键值信息,根据所述键值信息从预设散列表中获取所述RDMA报文的目的地址,将所述RDMA报文写入所述目的地址对应的内存空间中。
  6. 根据权利要求5所述的报文传输方法,其中,所述根据待发送的远程直接数据存取RDMA报文构造键值信息,包括:
    获取所述RDMA报文的消息类型,并根据所述消息类型构造所述键值信息。
  7. 根据权利要求5或权利要求6所述的报文传输方法,其中,所述方法还包括:
    当检测到所述消息类型为新增消息类型时,根据所述键值信息构造所述RDMA报文头,并存储在所述预设报文头中;
    根据所述键值信息构造协商报文,并发送给所述接收端,以供所述接收端根据所述协商报文中的键值信息为所述消息类型分配目的地址。
  8. 一种报文传输装置,应用在接收端,包括:
    接收模块,用于接收远程直接数据存取RDMA数据包;
    解析模块,用于对所述RDMA数据包进行解析,获取RDMA报文头和RDMA报文;
    获取模块,用于根据所述RDMA报文头获取键值信息;
    写入模块,用于根据所述键值信息从预设的散列表中获取所述RDMA报文的目的地址,并将所述RDMA报文写入所述目的地址对应的内存空间中。
  9. 一种电子设备,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至4中任一项或权利要求5至7中任一项所述的报文传输方法。
  10. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至4中任一项或权利要求5至7中任一项所述的报文传输方法。
PCT/CN2022/077783 2021-12-03 2022-02-24 报文传输方法、装置、电子设备和存储介质 WO2023097903A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111467655.6 2021-12-03
CN202111467655.6A CN116320079A (zh) 2021-12-03 2021-12-03 报文传输方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2023097903A1 true WO2023097903A1 (zh) 2023-06-08

Family

ID=86611469

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077783 WO2023097903A1 (zh) 2021-12-03 2022-02-24 报文传输方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN116320079A (zh)
WO (1) WO2023097903A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209640A (zh) * 2016-06-24 2016-12-07 醴陵恒茂电子科技有限公司 Down MEP报文处理方法与系统
CN106992915A (zh) * 2016-01-21 2017-07-28 中兴通讯股份有限公司 一种报文解封装处理、数据写入方法及装置
CN109426631A (zh) * 2017-08-30 2019-03-05 深圳市中兴微电子技术有限公司 一种基于rdma的通信方法、装置及存储介质
US20190079896A1 (en) * 2017-09-14 2019-03-14 Vmware, Inc. Virtualizing connection management for virtual remote direct memory access (rdma) devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106992915A (zh) * 2016-01-21 2017-07-28 中兴通讯股份有限公司 一种报文解封装处理、数据写入方法及装置
CN106209640A (zh) * 2016-06-24 2016-12-07 醴陵恒茂电子科技有限公司 Down MEP报文处理方法与系统
CN109426631A (zh) * 2017-08-30 2019-03-05 深圳市中兴微电子技术有限公司 一种基于rdma的通信方法、装置及存储介质
US20190079896A1 (en) * 2017-09-14 2019-03-14 Vmware, Inc. Virtualizing connection management for virtual remote direct memory access (rdma) devices

Also Published As

Publication number Publication date
CN116320079A (zh) 2023-06-23

Similar Documents

Publication Publication Date Title
CN111352889B (zh) 一种基于mctp协议的设备管理方法、设备、装置和介质
US20120303846A1 (en) Method for implementing audio transmission and mobile terminal
US20060083234A1 (en) Method and apparatus for transmitting and receiving data via wireless universal serial bus (WUSB)
CN108768667B (zh) 一种用于多核处理器片内核间网络通信的方法
KR20130107618A (ko) Usb 디바이스 장치의 데이터를 클라이언트 단말을 통해 서버로 전송하는 데이터 처리 방법 및 클라이언트 단말
CN114710467B (zh) Ip地址存储方法、装置和硬件网关
CN109088957B (zh) Nat规则管理的方法、装置和设备
CN112968919A (zh) 一种数据处理方法、装置、设备和存储介质
CN113014510A (zh) 惯导系统分布式测试中数据缓存方法及装置
US8886913B2 (en) Apparatus and method for identifier management
US20240073746A1 (en) Communication method and communication device
CN116204487A (zh) 远程数据访问方法及装置
WO2023097903A1 (zh) 报文传输方法、装置、电子设备和存储介质
CN109358820B (zh) 数据访问方法、装置、电子设备及计算机可读存储介质
WO2023016407A1 (zh) 数据传输方法、系统、装置及设备
US20220052902A1 (en) Method for managing remote device through management device
WO2022227484A1 (zh) 数据通信方法、装置、计算机设备和存储介质
CN112187669B (zh) 一种数据交互方法、装置、设备及可读存储介质
CN107317773B (zh) 一种片上网络通信接口及通信方法
CN110069422B (zh) 基于mips多核处理器的内存缓冲区回收方法
US20240069754A1 (en) Computing system and associated method
CN112350957B (zh) 一种网络报文发送的方法、装置和网络处理器
EP4362402A1 (en) Communication method and apparatus for external devices, electronic device, and storage medium
CN114079675B (zh) 报文处理方法、装置、终端设备及移动宽带上网设备
WO2024146250A1 (zh) 低时延业务通道实现方法及装置

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: 22899726

Country of ref document: EP

Kind code of ref document: A1