Communication method and communication apparatus
By using the Remote Command Table (RCT) for shared resources across target devices, the problem of wasted storage resources in a single QP is solved, achieving both storage resource savings and improved communication efficiency while ensuring message rate.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2026-03-26
AI Technical Summary
In IB and RoCE networks, the read and atomic message rates of a single QP are not high, resulting in a waste of storage resources. How to save storage resources while ensuring message rate has become an urgent problem to be solved.
By setting a remote command table (RCT) for shared resources on the target device, process commands from multiple source devices are stored to achieve resource sharing. Processing strategies are determined based on the storage space usage of the RCT, including setting thresholds and transaction negation acknowledgment mechanisms to optimize command processing.
This approach achieves the goal of saving storage resources while ensuring message rate, avoiding the discarding of duplicate commands and congestion, and improving communication efficiency.
Smart Images

Figure CN2024074978_26032026_PF_FP_ABST
Abstract
Description
Communication method and communication apparatus
[0001] The present application claims priority to the Chinese patent application No. 202311093485.9, filed on August 28, 2023, and entitled "Communication method and communication apparatus", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of computer, in particular to a communication method and a communication apparatus. BACKGROUND
[0003] In an enterprise data center or a super computing center, the network architecture of the computing cluster of a business usually adopts an Infiniband (IB) network or an RDMA over converged Ethernet (RoCE) network. The IB network and the RoCE network allow the use of remote direct memory access (RDMA) technology in a traditional Ethernet, are based on the mature ecology of the traditional Ethernet, have obvious cost advantages, and have a much higher version evolution speed than other types of networks, and will become the mainstream network selection in the future.
[0004] In the IB network and the RoCE network, when a queue pair (QP) is established, the source device and the destination device negotiate the maximum number of outstanding Read operations and Atomic operations that can be sent, and a dedicated queue resource is set for each QP to store Read and Atomic commands. The larger the number of QPs, the more storage resources are required.
[0005] Currently, the outstanding number of Read and Atomic operations negotiated by the source device and the destination device for a single QP is usually not large, for example, the outstanding number is 128. Because the outstanding number of Read and Atomic operations for a single QP is not large, when the round trip time (RTT) is large, the message rate of Read and Atomic operations for a single QP is not high. Therefore, how to save storage resources while ensuring the message rate of Read and Atomic operations for a single QP becomes a problem to be solved.
[0006] SUMMARY
[0007] The present application provides a communication method and apparatus, which uses shared resources to receive remote commands sent by multiple source devices by a target device, thereby saving storage resources.
[0008] In a first aspect, a communication method is provided and applied to a first host. The method can be executed by the first host or by a circuit or chip configured in the first host, which is not limited in the present application. For ease of description, the first host is taken as an example in the following description.
[0009] The communication method comprises: setting a first remote command table (RCT) in the first host, the first RCT being used to store remote commands corresponding to a plurality of processes, the plurality of processes belonging to at least one second host; receiving a packet of a remote command from any second host of the at least one second host, and determining a processing strategy of the remote command according to a storage space usage of the first RCT.
[0010] Based on the above technical solution, the first host is a target device and the second host is a source device. For the first host, the first host is a local end and the second host is a remote end, and the command sent by the second host is called a remote command. Specifically, in the present solution, the first RCT is set in the first host, and the first RCT can be used to store remote commands corresponding to a plurality of processes of at least one second host. When the first host receives a certain remote command from the second host, the processing strategy of the remote command can be determined according to the storage space usage of the first RCT. In the communication method, the first host can set one RCT for the plurality of processes of at least one second host, and the plurality of processes share one RCT, without the need to set an RCT for each process respectively, thereby realizing resource sharing and saving resource overhead. In the present solution, the plurality of processes share one RCT, and the storage space of the RCT can be set to be larger, thereby ensuring the transmission rate of the remote command.
[0011] In combination with the first aspect, in some implementations of the first aspect, a first identifier is included in a packet header of the remote command, the first identifier being used to identify whether the remote command is a first transmission remote command or a retransmission remote command.
[0012] Based on the above technical solution, the first identifier is included in the packet header of the remote command sent by the second host, and the first identifier indicates whether the remote command is a first transmission remote command or a retransmission remote command, so that the first host can process different types of remote commands according to the types of the remote commands.
[0013] In combination with the first aspect, in some implementations of the first aspect, the method further comprises: setting a first threshold in the first RCT; and determining the processing strategy of the remote command according to the storage space usage of the first RCT comprises: determining the processing strategy of the remote command according to the first threshold and the storage space usage of the first RCT.
[0014] In some implementations of the first aspect, the determining the processing strategy of the remote command according to the first threshold and the used storage space of the first RCT comprises: if the used storage space of the first RCT exceeds the first threshold, processing the remote command by using a first processing strategy; and if the used storage space of the first RCT does not exceed the first threshold, processing the remote command by using a second processing strategy.
[0015] According to the above technical solution, the first threshold can be set in the first RCT, and when determining the processing strategy of the remote command, the relationship between the used storage space of the first RCT and the first threshold is considered, and different processing strategies are used according to whether the used storage space of the first RCT exceeds the first threshold, so that different processing strategies of the remote command can be accurately determined based on the used storage space of the first RCT.
[0016] In some implementations of the first aspect, if the used storage space of the first RCT exceeds the first threshold, the first processing strategy is used to process the remote command, which comprises: if the remote command is a newly transmitted remote command, determining to discard the remote command; and if the remote command is a retransmitted remote command, determining to receive the remote command and store the remote command in the first RCT.
[0017] According to the above technical solution, when the used storage space of the first RCT exceeds the first threshold, the first host can preferentially process the retransmitted remote command, so that a certain remote command can be avoided from being repeatedly discarded to a certain extent.
[0018] In some implementations of the first aspect, when it is determined to discard the remote command, the method further comprises: sending a first transaction negative acknowledgement (TANAK), the first TANAK being used to instruct to retransmit the remote command after a first time length.
[0019] In some implementations of the first aspect, the method further comprises: setting a second threshold in the first RCT, the second threshold being greater than the first threshold; and the determining the processing strategy of the remote command according to the used storage space of the first RCT comprises: determining the processing strategy of the remote command according to the second threshold and the used storage space of the first RCT.
[0020] In some implementations of the first aspect, the determining the processing strategy of the remote command according to the second threshold and the used storage space of the first RCT comprises: if the used storage space of the first RCT exceeds the second threshold and the remote command is a first-time remote command, determining to discard the remote command; and the method further comprises: sending a second transaction negative acknowledgement (TANAK), the second TANAK being used to instruct the second host to retransmit the remote command after a second time period, the second time period being longer than the first time period.
[0021] According to the above technical solution, different thresholds can be set in the first RCT, and when a remote command is received, the usage of the first RCT can be determined according to the relationship between the used storage space of the first RCT and the different thresholds. When the used storage space of the first RCT exceeds the second threshold, the first-time remote command is discarded, and compared with the case where the used storage space of the first RCT exceeds the first threshold, the interval time period for instructing the retransmission of the remote command by the first host is longer, so as to avoid the congestion of the first RCT. For example, when the used storage space of the first RCT exceeds the second threshold, the first RCT has stored a large number of remote commands to be processed, and the congestion is more serious, so the second host can be instructed by the second TANAK to increase the retransmission interval and reduce the sending rate of the remote command.
[0022] In some implementations of the first aspect, the determining the processing strategy of the remote command according to the usage of the RCT comprises: if the first RCT is full, determining to discard the remote command; and the method further comprises: sending a third transaction negative acknowledgement (TANAK), the third TANAK being used to instruct the retransmission of the remote command; and if the remote command is a retransmitted remote command, the third TANAK is used to instruct the retransmission of the remote command after a first time period.
[0023] According to the above technical solution, if the first host receives the packet of the remote command and the first RCT is full, the first host will discard the remote command regardless of whether the remote command is a first-time remote command or a retransmitted remote command, and instruct the source device to retransmit. For the first-time remote command, the second host retransmits the remote command after the second time period after receiving the third TANAK, and for the retransmitted remote command, the third TANAK instructs the second host to retransmit the remote command after the first time period after receiving the third TANAK, so that the transmission frequency of the'second-time retransmitted remote command' is higher than that of the 'first-time retransmitted remote command', thereby making the'second-time retransmitted remote command' more likely to be received than the 'first-time retransmitted remote command'.
[0024] With reference to the first aspect, in some implementations of the first aspect, the method further includes: setting a second RCT in the first host, the stored remote command in the first RCT and the stored remote command in the second RCT are processed with different priorities; or, the second RCT and the first RCT correspond to different processes.
[0025] Based on the above technical solutions, the first host can set multiple RCTs, for example, RCTs for different processes, each RCT corresponding to multiple processes, and for example, RCTs for remote commands of different priorities.
[0026] With reference to the first aspect, in some implementations of the first aspect, the method further includes: establishing a transport layer connection group (TPG) between the first host and the at least one second host respectively.
[0027] With reference to the first aspect, in some implementations of the first aspect, the remote command includes a read (Read) request or an atomic (Atomic) request.
[0028] With reference to the first aspect, in some implementations of the first aspect, the receiving the packet of the remote command from any one of the at least one second host includes: receiving the packet of the remote command from any one of the at least one second host through a communication interface Jetty, the Jetty being configured to receive the packet of the remote command from the at least one second host.
[0029] The second aspect provides a communication method applied to a second host. The method can be executed by the second host, or can also be executed by a circuit or a chip configured in the second host, which is not limited in the present application. For ease of description, the following describes an example in which the second host executes.
[0030] The communication method includes: generating a packet of a remote command, the packet of the remote command including a first identifier in a packet header, the first identifier being used to identify the remote command as a first transmission remote command or a retransmission remote command; and sending the packet of the remote command to a first host.
[0031] With reference to the second aspect, in some implementations of the second aspect, the method further includes: receiving a first transaction negative acknowledgement (TANAK) from the first host, the first TANAK being used to indicate retransmission of the remote command after a first time length; or receiving a second transaction negative acknowledgement (TANAK) from the first host, the second TANAK being used to indicate retransmission of the remote command after a second time length, the second time length being greater than the first time length.
[0032] The technical effects of the method shown in the second aspect and possible designs thereof can refer to the technical effects in the first aspect and possible designs thereof.
[0033] In a third aspect, a communication apparatus is provided, which comprises a storage module configured to store a program, and a processing module configured to execute the program stored in the storage module, and when the program stored in the storage module is executed, the processing module is configured to perform the method in any of the aspects.
[0034] In a fourth aspect, a computer readable storage medium is provided, which stores program code for execution by an apparatus, and the program code comprises instructions for performing the method in any of the aspects.
[0035] In a fifth aspect, a computer program product containing instructions which, when the computer program product runs on a computer, enables the computer to perform the method in any of the aspects.
[0036] In a sixth aspect, a chip is provided, which comprises a processing module and a communication interface, the processing module is configured to read instructions stored in a storage through the communication interface, and perform the method in any of the aspects.
[0037] Optionally, as an implementation manner, the chip can further comprise a storage module, the storage module stores instructions, and the processing module is configured to execute the instructions stored in the storage module, and when the instructions are executed, the processing module is configured to perform the method in any of the aspects.
[0038] In a seventh aspect, a chip is provided, which comprises a network management unit configured to perform the method in the first aspect and a bus device configured to perform the method in the second aspect.
[0039] In an eighth aspect, a computer system is provided, which comprises the chip shown in the seventh aspect.
[0040] In a ninth aspect, a terminal device is provided, which comprises the chip shown in the seventh aspect. For example, the terminal device comprises, but is not limited to, a mobile phone, a vehicle, and the like.
[0041] In a tenth aspect, a system for accessing a configuration space is provided, which comprises a first host configured to perform the method in the first aspect and a second host configured to perform the method in the second aspect. BRIEF DESCRIPTION OF DRAWINGS
[0042] FIG. 1 is a structural schematic diagram of a computer device provided by an embodiment of the present application.
[0043] FIG. 2 is a schematic diagram of a data center provided by an embodiment of the present application.
[0044] FIG. 3 is a schematic diagram of a general bus protocol message format according to an embodiment of the present application.
[0045] FIG. 4 is a schematic diagram of a host according to an embodiment of the present application.
[0046] FIG. 5 is a schematic flowchart of a communication method according to an embodiment of the present application.
[0047] FIG. 6 is a schematic diagram of setting a threshold in a first RCT according to an embodiment of the present application.
[0048] FIG. 7 is a schematic diagram of remote command transmission according to an embodiment of the present application.
[0049] FIG. 8 is a schematic diagram of another remote command transmission according to an embodiment of the present application.
[0050] FIG. 9 is a schematic diagram of yet another remote command transmission according to an embodiment of the present application.
[0051] FIG. 10 is a schematic diagram of yet another remote command transmission according to an embodiment of the present application.
[0052] FIG. 11 is a schematic diagram of a communication apparatus 1100 according to an embodiment of the present application.
[0053] FIG. 12 is a schematic diagram of a chip system 1200 according to an embodiment of the present application.
[0054] FIG. 13 is a conceptual partial view of a computer program product according to an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to facilitate understanding of the embodiments of the present application, the following points are explained.
[0056] First, "at least one" in the present application means one or more, and "multiple" means two or more. In addition, in the embodiments of the present application, "first", "second", and various numbers (for example, "#1", "#2", and the like) are only for the convenience of description and do not limit the scope of the embodiments of the present application. The size of the serial number of each process below does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. It should be understood that the objects thus described can be interchanged under appropriate circumstances in order to describe solutions other than the embodiments of the present application. In addition, in the embodiments of the present application, "S510" and the like are only for the convenience of description and do not limit the order of execution steps.
[0057] Second, the words "example" or "exemplary" are used herein to mean serving as an example, instance, or illustration. Any implementation described herein as "example" or "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations. Rather, use of the terms "example" or "exemplary" is intended to present concepts in a concrete manner. As used in this description and the following claims, the terms "include" and / or "comprise," or "including" and / or "comprising" and variations thereof (e.g., "includes" or "comprises") will be understood to specify the presence of the stated features, integers, steps, or components but not the absence thereof.
[0058] Third, the term "save" or "saving" as used in the embodiments of the present application can refer to saving in one or more memories. The one or more memories can be separately arranged or integrated in an encoder or decoder, a processor, or a communication device. The one or more memories can be partially separately arranged and partially integrated in a decoder, a processor, or a communication device. The memory can be any form of storage medium, which is not limited in the present application.
[0059] Fourth, the term "comprise", "comprises", "comprising", "include", "includes", "including" or "comprising" as used in the embodiments of the present application, when used in this specification and / or claims, specifies the presence of stated features, integers, steps, operations, elements, and / or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0060] Fifth, the term "if" can be interpreted to mean "when" or "upon" or "in response to a determination" or "in response to a detection" of, as appropriate. Similarly, the phrase "if determined", or "if [a stated condition or event] is detected" can be interpreted to mean "upon a determination" or "in response to a determination" or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]", as appropriate.
[0061] Sixth, the terminology used in the description of the various described examples herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the description of the various described examples and the appended claims, the articles "a", "an" and "the" are intended to include one or more items, unless the context clearly indicates otherwise.
[0062] Seventh, the term "and / or" as used herein is merely an associative relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which means that there can be three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a "or" relationship.
[0063] The technical solutions in the embodiments of the present application will be described below with reference to the drawings.
[0064] The present application relates to a processor in a computer system accessing a configuration space of an external device. The computer system can be a server or a terminal. The terminal includes, but is not limited to, a desktop computer, a notebook computer, a smart phone, and the like. For ease of understanding, the structure of the computer system will be introduced below.
[0065] Referring to a structural diagram of a computer system shown in FIG. 1, the computer system includes a processor 101, an input output device (I / O device) 102, a memory 103, a cache 104, a memory management unit (MMU) 105, an input output management unit (IOMMU) 106, a storage 107, and a bus 108.
[0066] The processor 101 includes at least one core. The core is also referred to as a computing engine. Each core can independently execute a task. When the processor 101 includes multiple cores, tasks from an application can be divided so that the application can fully utilize the multiple cores to execute more tasks in a specific time. In the present embodiment, the processor 101 can be a main processor, for example, a central processing unit (CPU).
[0067] The input output device 102 refers to a hardware device having an input data and / or output data capability. The input output device 102 can be divided into an input device and an output device. The input device can include a mouse, a keyboard, a joystick, a stylus, a microphone, and the like, and the output device can include a display, a speaker, and the like.
[0068] The memory 103 is also referred to as an internal memory or a main memory, and is used to temporarily store operation data in the processor 101. Further, the memory 103 is also used to temporarily store data exchanged with the storage 107. The memory 103 can be implemented by using a dynamic random access memory (DRAM) or a static random access memory (SRAM), and the like.
[0069] Cache 104 (in this embodiment, a processor cache such as a CPU cache) is a component used to reduce the average time required for processor 101 to access memory 103. Referring to FIG. 1, in a pyramid memory hierarchy, cache 104 is located at the second level from the top, just below the registers of processor 101 (not shown in FIG. 1) and above memory 103 (which is located at the third level from the top). Typically, cache 104 has a much smaller capacity than memory 103 but can access data at a speed close to the frequency of processor 101.
[0070] Memory management unit 105 is a computer hardware used to handle data access requests. Memory management unit 105 is specifically used to map virtual addresses (VAs) in data access requests. In particular, memory management unit 105 can intercept data access requests issued by the kernel of processor 101 and map (or translate) the virtual addresses in the data access requests to physical addresses (PAs) so that memory 103 can be accessed according to the physical addresses.
[0071] Input-output memory management unit 106 is essentially a memory management unit. Similar to how memory management unit 105 maps virtual addresses visible to processor 101 to physical addresses, input-output memory management unit 106 is used to map virtual addresses (also referred to as device addresses or I / O addresses) visible to input-output devices 102 to physical addresses.
[0072] External storage 107, also referred to as external memory or secondary storage, is typically used to persistently store data. For example, external storage 107 can be used to persistently store data of computations performed by processor 101. Even if power supply is abnormal, data already written to external storage 107 can still be saved, avoiding data loss. In practice, external storage 107 includes at least one non-volatile memory 1071. When external storage includes multiple non-volatile memories, the multiple non-volatile memories can be of the same type or of different types. For example, in the example of FIG. 1, external storage 107 can include two types of non-volatile memories, such as storage class memory (SCM) and solid state drive (SSD).
[0073] Bus 108 is used to connect various functional components of a computer system. Bus 108 is a common communication trunk for transmitting information between various functional components of a computer system. Bus 108 can be a bundle of transmission lines formed by wires. According to the connection objects, bus 108 can also be divided into internal bus and external bus.
[0074] The internal bus transmits information by using an internal bus protocol. The internal bus protocol includes a bus protocol for accessing a memory space of the computer system. The external bus transmits information by using an external bus protocol. The external bus protocol includes a bus protocol for accessing an external storage space of the computer system. The memory space refers to an address space of a memory, and the external storage space refers to an address space of an external storage.
[0075] In some embodiments, the internal bus protocol includes, but is not limited to, a peripheral component interconnect (PCI) bus, a peripheral component interconnect express (PCIe) protocol, an IntelTM Quick Path Interconnect (QPI) protocol, and a universal bus protocol. The external bus protocol includes, but is not limited to, a small computer system interface (SCSI) protocol or a serial attached SCSI (SAS) protocol.
[0076] It should be noted that the computer system shown in FIG. 1 is exemplarily illustrated by taking the external storage 107 as a remote external storage. As shown in FIG. 1, the external storage 107 includes a network card 1072. The network card 1072 can be, for example, a smart NIC network interface card (i.e., a network adapter). The external storage 107 accesses a network through the network card 1072, and then connects with other components of the computer system 101 through the network. The network can be a wired communication network, such as an optical fiber communication network, or a wireless communication network, such as a wireless local area network (WLAN) or a fifth generation (5G) mobile communication network.
[0077] In some possible implementations, the external storage 107 of the computer system can also be a local external storage, and other components of the computer system, such as the processor 101, can be connected to the above local external storage through the bus 108. In other possible implementations, the computer system can include both a remote external storage and a local external storage. In addition, the embodiments of the present application can be applied to a centralized storage or a distributed storage scenario, and the embodiments of the present application are not limited in this regard.
[0078] Exemplarily, the manner of accessing the configuration space register of the bus device provided in the embodiments of the present application can also be applied to the server cluster in cross-network communication shown in FIG. 2, such as the data center shown in FIG. 2. As shown in FIG. 2, the internal structure of the switch or server shown in FIG. 2 is as shown in FIG. 1.
[0079] In addition, the internal bus protocol supported by the computer system involved in the present application includes a general bus protocol, and a transport layer connection can be established between computer systems. The general bus protocol can also be referred to as a smart bus protocol or a unified bus protocol, a bus protocol standard, and the name of the general bus protocol is not limited in the present application.
[0080] The general bus protocol breaks through the barriers of various existing protocols, removes unnecessary conversion overhead in the middle, and thus achieves extremely low latency. The general bus protocol defines independent transaction layers (Transaction, TA) and transport layers (Transport, TP). There is a connection between the transport layers, and there is no connection between the transaction layers. For a host, there is no connection between the transaction layers of two hosts, and there is a connection between the transport layers. Then all transactions of any one of the two hosts are transmitted on the transport layer. The general bus protocol includes a transport layer and a transaction layer, the transport layer is responsible for network packet retransmission to ensure reliable transmission, and the transaction layer processes different transactions. The transport layer receives a packet from the network, strips the transport layer packet header, and forwards it to the transaction layer.
[0081] The general bus protocol message format is shown in FIG. 3. Specifically, the field definitions in the general bus protocol message format are shown in Table 1 as follows:
[0082] Table 1
[0083] Specifically, the interaction interface between the transaction layer of the general bus protocol and the application is called Jetty, and the message of the application can be sent to any destination through a Jetty, or received from any source through a Jetty. Only sendable Jetty is defined as (Jetty For Send, JFS); only receivable Jetty is defined as (Jetty For Receive, JFR).
[0084] FIG. 4 is a structural schematic diagram of a host according to an embodiment of the present application. The host (such as host A, host B and host C shown in FIG. 4) can be applied to the application scenario of cross-network communication shown in FIG. 2. Host A and host C can be understood as source devices, and host B can be understood as a target device, and the source device sends a remote command to the target device.
[0085] As shown in FIG. 4, the host B includes a plurality of virtual machines (VMs), one VM includes a plurality of processes and a plurality of remote command tables (RCTs) for receiving remote commands (such as a Read command). One process corresponds to a plurality of communication interfaces (such as a Jetty), a communication interface (such as a JFS) capable of only sending, and a communication interface (such as a JFR) capable of only receiving. The process-related messages can be transmitted through the corresponding communication interface. Among them, the Jetty is bidirectional, which can both receive and send; the JFS is unidirectional, which can only send; and the JFR is unidirectional, which can only receive.
[0086] The Jetty, the JFS, the JFR, and the RCT have respective contexts (CXTs). A plurality of TP connections (such as TP connection #0 to TP connection #7 shown in FIG. 4, a total of 8 TP connections) are established between two hosts, and the 8 TP connections can form a transport group (TPG). All traffic between the two hosts passes through the TPG. The 8 TP connections can be distributed in different physical ports, and the traffic is evenly sent between the 8 TP connections to realize multi-port and multi-path. The TP connection and the TPG belong to the transport layer. The TP connection is responsible for network packet loss retransmission to ensure end-to-end reliability. The TP connection is responsible for end-to-end congestion control.
[0087] The host B in FIG. 4 includes a plurality of VMs and a plurality of processes.
[0088] In the above, the scenarios to which the application can be applied and the internal logic units of the host involved are briefly introduced in combination with FIGS. 1 to 4. In order to facilitate the understanding of the embodiments of the application, some basic concepts involved in the application are briefly described.
[0089] 1. Packet sequence number (PSN): When the sending side transport layer transmits a packet, a PSN is marked on each packet to identify the packet. The PSN is incremented by one for each packet. When the receiving side receives a packet, a TPACK (carrying the PSN of the received packet) is returned to the sending side transport layer to indicate that the packet has been correctly received. If the receiving side receives a packet and finds that a packet with a smaller PSN than the received packet has not been received, it is determined that the packet with a smaller PSN than the received packet is lost in the network, and a TPSACK (carrying the PSN of the received packet and the PSN of the lost packet) is returned. The sending side transport layer receives the TPSACK and retransmits the lost packet.
[0090] 2、Segment sequence number (SSN): The message of transaction layer can be large, for example, 16MB. In the UB protocol, multiple transaction layers share a transport layer. In order to prevent a transaction layer from occupying the transport layer connection for a long time, the transaction layer cuts the message into multiple segments when sending the message to the transport layer, and gives each segment a SSN for identifying the segment. The SSN is incremented by segment, for example, 64KB per segment, and the transaction layer sends only one segment to the transport layer at a time.
[0091] 3、Transaction ACK (TAACK): After receiving a Segment (a Segment is split into multiple packets in the transport layer) and performing correctly (for example, correctly reading and writing memory), the receiving side returns a TAACK to the sending side transaction layer, indicating that the segment has been performed correctly, or the receiving side returns a TAACK to the sending side transaction layer, indicating that the message has been successfully received.
[0092] 4、Transaction No OK ACK (TANAK): After receiving a Segment, the receiving side returns a TANAK to the sending side transaction layer, indicating that the segment has been performed incorrectly (for example, page fault occurs when reading and writing memory), or the receiving side returns a TANAK to the sending side transaction layer, indicating that the message has not been successfully received.
[0093] 5、Remote Direct Memory Access (RDMA): Data is directly transmitted to the storage area of a computer through a network, and data is quickly moved from one system to the storage of a remote system without the intervention of the operating system or kernel of the two computer devices. RDMA eliminates the overhead of external memory copying and context switching, so as to free up memory bandwidth and CPU cycles for improving the performance of application systems.
[0094] 6、Queue Pair (QP): One QP is connected to another QP. For example, the message in the sending queue of one QP is transmitted to the receiving queue of another QP.
[0095] Specifically, RDMA first creates a context and a protection domain (PD) to associate a queue pair (QP) with a memory region (MR) before both sides establish a connection, and then both sides create a QP, each of which contains two first in first out (FIFO) work queues: a send queue (SQ) for sending requests and a receive queue (RQ) for receiving requests, each of which is associated with a completion queue (CQ). In order to allow the RDMA network card to have access to the memory, the memory needs to be registered, and such memory that both sides can access arbitrarily is referred to as memory supporting RDMA access, and the remote address is the starting virtual address of the memory region. After both sides create the MR, an 8-byte type key will be generated respectively, and both sides should exchange their keys and the virtual addresses of the registered memory. Each MR contains its own key (lkey) and the key of the remote memory (rkey), and the rkey must be used to access the remote registered memory. In general, it takes about 10s to create 4096 connections through the native communication library RDMA_CM of RDMA, and it takes 1ms to 5ms to create each connection on average, and the delay of RDMA is about 4us under the condition of a load of 32 bytes, so in order to create a connection, the sending of hundreds of network data packets needs to be delayed.
[0096] 7. outstanding number: outstanding refers to the ability of the host to initiate multiple read-write transactions without receiving a response, assuming that N instructions have been sent, if no write response is returned during this period, the write response must be returned before the next command is sent through the address channel, if a write response is returned, several write responses are returned, and then several instructions can be sent.
[0097] 8. Queue resource: the hosts negotiate the maximum number of outstanding Read and Atomic operations that can be sent, and each QP is set with dedicated queue resource to store Read and Atomic commands, and the queue resource is not shared between QPs. The larger the number of QPs, the more storage resources are required. For example, QP#1 in host A is connected with QP#1 in host B, and QP#2 in host A is connected with QP#2 in host B, host A needs to set queue resources for QP#1 and QP#2 respectively to store the Read and Atomic commands transmitted by the corresponding QPs; similarly, host B needs to set queue resources for QP#1 and QP#2 respectively to store the Read and Atomic commands transmitted by the corresponding QPs.
[0098] 9. Process: is a running activity of a program on a certain data set in a computer, is the basic unit of resource allocation of the system, and is the basis of the structure of the operating system. In the early process-oriented computer structure, the process is the basic execution entity of the program; in the contemporary thread-oriented computer structure, the process is the container of the thread. The program is the description of instructions, data and their organization form, and the process is the entity of the program.
[0099] The above briefly introduces the scenario to which the communication method provided by the application is applicable, and introduces the basic concepts involved in the application. In the basic concepts, QP and queue resource are introduced. The larger the network scale, the more QPs are required, and the more queue storage resources are consumed.
[0100] In order to save storage resources, the outstanding number of Read and Atomic of a single QP negotiated between hosts (such as source devices and target devices) is usually not large, for example, 128. However, if the outstanding number of Read and Atomic of a single QP is not large, when the RTT is large, the message rate of Read and Atomic of a single QP is not high.
[0101] In order to solve the problem of low Read and Atomic message rate existing in the current resource use method, the application provides a communication method and device, which receives Read and Atomic requests sent by multiple source devices by using shared resources by a target device, thereby saving storage resources. The communication method provided by the application will be described in detail below with reference to the accompanying drawings.
[0102] It should be understood that the communication method provided by the embodiments of the application can be applied to a computer system, for example, the cross-network communication system shown in FIG. 2.
[0103] It should also be understood that the embodiments shown below do not particularly limit the specific structure of the subject performing the method provided by the embodiments of the present application, as long as the subject can implement the method provided by the embodiments of the present application by running a program in which the code of the method provided by the embodiments of the present application is recorded. For example, the subject performing the method provided by the embodiments of the present application can be a device, or a functional module in the device that can invoke and execute a program.
[0104] FIG. 5 is a schematic flowchart of a communication method provided by the present application. The method is applied to a scenario in which communication is performed between a first host and at least one second host, such as the scenario shown in FIG. 2.
[0105] In the embodiment shown in FIG. 5, the first host can be a receiving end (or referred to as a target device), and the second host can be a sending end (or referred to as an initiator). For the receiving end, the receiving end is a local device, and the sending end is a remote device. The command received by the receiving end from the sending end is referred to as a remote command.
[0106] By way of example, the first host described above can be a physical machine or a virtual machine. If the first host is a virtual machine, the steps performed by the first host can be performed by the virtual machine. Similarly, the second host can be a physical machine or a virtual machine. If the second host is a virtual machine, the steps performed by the second host can be performed by the virtual machine.
[0107] Specifically, the method shown in FIG. 5 includes the following steps.
[0108] S510, the first host sets a first RCT.
[0109] In this embodiment, the first host can be understood as a target device that receives a remote command sent by at least one second host. For example, the first host can be the host B shown in FIG. 4. The second host can be understood as an initiator, for example, the second host can be the host A and / or the host C shown in FIG. 4.
[0110] As a possible implementation manner, a TP connection is established between the first host and each second host, and a packet of the remote command sent by the second host is received through the TP connection. As shown in FIG. 4, a TP connection is established between the host A and the host B, and a TP connection is established between the host C and the host B.
[0111] As another possible implementation manner, when there is a retransmission mechanism to ensure reliable transmission, a transport layer connection does not need to be established. The link layer connection between the first host and each second host has a retransmission mechanism to ensure reliable transmission, and a packet of the remote command sent by the second host can be received through the link layer connection.
[0112] It should be noted that the specific form of the first host and the second host in this embodiment is not limited, and the device capable of realizing the corresponding function in this embodiment is within the protection scope of the present application.
[0113] Exemplarily, the remote command involved in this embodiment includes but is not limited to Read and / or Atomic request. The format and content of the remote command in the present application are not limited, and reference can be made to the description of the remote command in the prior art.
[0114] Specifically, the first RCT set by the first host is used to store the remote commands corresponding to a plurality of processes, and the plurality of processes belong to at least one second host.
[0115] For example, the first host and the second host #1 and the second host #2 communicate, the process #1 and the process #2 are executed in the second host #1, the process #3 and the process #4 are executed in the second host #2, and the first host can set the first RCT, which is used to store the remote commands corresponding to the process #1, the process #2, the process #3 and the process #4.
[0116] It should be understood that the remote commands of the plurality of processes in this embodiment can be understood as the remote commands received by the first host through the Jetty, wherein the first host can receive the remote commands from one or more second hosts through one Jetty, and it can be understood that the Jetty corresponds to one or more processes.
[0117] By setting the first RCT, the remote commands of the plurality of processes in the at least one second host are stored, and it is avoided to set the corresponding RCT for each process, the RCT shared by the plurality of processes is realized, that is, the storage resource sharing is realized. In addition, in this scheme, the plurality of processes share one RCT, and the storage space of the RCT can be set to be larger, so as to ensure the remote command transmission rate.
[0118] Exemplarily, the first host sets the first RCT, including: the first host sets at least one RCT, and the first RCT is any one of the at least one RCT.
[0119] If the first host sets multiple RCTs, the remote commands stored in the multiple RCTs are processed with different priorities. For example, the first host sets RCT #1, RCT #2 and RCT #3, and the remote commands stored in the three RCTs are processed with priorities in the order of RCT #1 > RCT #2 > RCT #3. When the first host receives a packet of a remote command, the first host can determine the priority of the remote command according to the priority indication information carried in the packet, and forward the received remote command to the RCT with the matching priority according to the priorities of the remote commands stored in the multiple RCTs.
[0120] If the first host sets multiple RCTs, the multiple RCTs can correspond to different processes, and the different processes can belong to different or same second hosts. For example, the first host establishes connections with second host #1, second host #2 and second host #3, and the processes in the second host #1 include process #1, the processes in the second host #2 include process #2, and the processes in the second host #3 include process #3. The first host sets RCT #1 and RCT #2, and RCT #1 is used to store remote commands of process #1, and RCT #2 is used to store remote commands of process #2 and process #3.
[0121] It should be understood that the specific number of RCTs set by the first host in this embodiment is not limited. For example, the first host receives remote commands corresponding to P processes from N second hosts, the first host sets M RCTs, where N is a positive integer, P is an integer greater than or equal to 2, and M is a positive integer less than P.
[0122] Optionally, the RCTs set by the first host in this embodiment can be shared by multiple processes, and the RCTs set by the first host can also be referred to as shared RCTs.
[0123] In this embodiment, since the RCTs are shared by remote commands corresponding to multiple processes in at least one second host, the multiple processes share the RCTs. When the first host is forced to discard the received remote commands when the RCTs are full, there can be a case that the remote commands issued by the processes in a certain second host are discarded all the time.
[0124] For example, assume that a remote command from Jetty X of the second host #1 reaches the first host, the RCT in the first host is full, the remote command is discarded, the first host informs the second host #1 to retransmit; when the RCT is not full, a remote command from Jetty of the second host #2 is received; when a remote command from Jetty X of the second host #1 is received again, the RCT is full again, the remote command from the second host #1 is discarded again. Therefore, there can be a case that the remote command from Jetty X of the second host #1 is discarded all the time (or a case that the remote command is starved).
[0125] In order to reduce the risk that the remote command of a process in a certain second host is discarded all the time, in this embodiment, the first host determines the processing strategy of the remote command based on the storage space usage of the first RCT.
[0126] The method flow shown in FIG. 5 further includes:
[0127] S520, the first host receives a packet of a remote command from a second host.
[0128] The second host can be any one of the at least one second host described above.
[0129] As a possible implementation, the second host can send the packet of the remote command to the first host through a TPG between the second host and the first host.
[0130] In this implementation, after the transport layer of the first host receives the packet of the remote command, if the packet is verified to be correct, a TPACK (transport layer acknowledgement) is returned to the second host, which is used to inform the transport layer of the source device side that ‘the packet has been correctly received’; if it is found that there is a packet loss in the network by checking the PSN in the TPH, a transport selective ACK (TPSACK) is returned, which carries the PSN, and the TPSACK is used to inform the source device side that ‘the packet has been correctly received, but there is a packet loss, and the lost packet corresponding to the PSN needs to be retransmitted’.
[0131] As another possible implementation, the second host can send the packet of the remote command to the first host through a link layer connection. In this implementation, the first host does not need to inform the second host whether the packet is correctly received through the TPACK or the TPSACK.
[0132] It should be understood that the embodiment does not make any limitation on the way of packet transmission between the second host and the first host. In this embodiment, it mainly involves how to determine the processing strategy of the remote command according to the storage space usage of the first RCT in the scenario that the first host correctly receives the packet of the remote command.
[0133] For example, the first host includes at least one virtual machine (VM) in the first host, the destination address of the packet of the remote command sent by the second host can be the address of any one of the at least one VM, after the first host receives the packet of the remote command from the network, the packet of the remote command is checked through the LINK layer, the IP layer and the transport layer (for example, whether there is a packet loss based on PSN, SSN and the like), the destination of the remote command is VM#1 based on the Destination Entity ID (DEID) lookup table. The transport layer strips the TPH and the previous part of the packet of the remote command, and the remaining part is transferred to VM#1.
[0134] S530, the first host determines the processing strategy of the remote command based on the storage space usage of the first RCT.
[0135] In this embodiment, the storage space usage of the RCT can be represented by the storage space margin of the RCT, the storage space usage of the RCT, the storage space occupancy rate of the RCT, the storage space usage rate of the RCT, or the storage space utilization rate of the RCT.
[0136] For example, in this embodiment, a first threshold can be set in the first RCT, which can also be referred to as a first water line.
[0137] Specifically, in the case where the first threshold is set in the first RCT, the first host determines the processing strategy of the remote command based on the storage space usage of the first RCT, including: the first host determines the processing strategy of the remote command according to the first threshold and the storage space usage of the first RCT. For example, if the used storage space of the first RCT exceeds the first threshold, the first processing strategy is used to process the remote command; if the used storage space of the first RCT does not exceed the first threshold, the second processing strategy is used to process the remote command. Wherein, the first processing strategy and the second processing strategy are different, for example, the first processing strategy is to determine to receive or discard the remote command according to the type of the remote command, and the second processing strategy is to receive.
[0138] For example, the first identification can be carried in the packet header of the remote command, the first identification is used to identify the initial transmission remote command or the retransmission remote command, the first identification can be referred to as a retransmission flag bit, and the first host can implement priority receiving of the remote command with retransmission based on the storage space usage of the first RCT.
[0139] As a possible implementation, in the case where the used storage space of the first RCT exceeds the first threshold, the first processing strategy described above is related to the initial transmission remote command or the retransmission remote command received by the first host.
[0140] For example, if the remote command is a newly transmitted remote command, it is determined to discard the remote command; if the remote command is a retransmitted remote command, it is determined to receive the remote command and store the remote command in the first RCT.
[0141] In this implementation, after the first host determines to discard the remote command, the first host sends a first TANAK to the second host, where the first TANAK is used to instruct the second host to retransmit the remote command after a first time length. For example, the first TANAK carries indication information #1, where the indication information #1 is used to instruct the second host to retransmit the remote command after the first time length after receiving the first TANAK. After the first host determines to receive the remote command, when the remote command is executed, the first host sends a response message to the second host.
[0142] Further, the second threshold greater than the first threshold can also be set in the first RCT. As shown in FIG. 6, FIG. 6 is a schematic diagram of setting thresholds in the first RCT according to an embodiment of the present application, for example, the first host sets a drop_new water line and a delay_rty water line in the first RCT. Wherein, the drop_new water line is the first threshold, and the delay_rty water line is the second threshold.
[0143] In the case that the first threshold and the second threshold are set in the first RCT, the first host determines the processing strategy of the remote command according to the storage space usage of the first RCT, including: determining the processing strategy of the remote command according to the second threshold and the storage space usage of the first RCT. For example, if the used storage space of the first RCT exceeds the second threshold, the third processing strategy is used to process the remote command; if the used storage space of the first RCT does not exceed the second threshold, it is determined whether the used storage space of the first RCT exceeds the first threshold, and the first processing strategy and the second processing strategy are referred to according to the determination result.
[0144] As another possible implementation, in the case that the used storage space of the first RCT exceeds the second threshold, the third processing strategy is related to whether the remote command received by the first host is a newly transmitted remote command or a retransmitted remote command.
[0145] For example, if the remote command is a newly transmitted remote command, it is determined to discard the remote command; if the remote command is a retransmitted remote command, it is determined to receive the remote command and store the remote command in the first RCT.
[0146] In this implementation, after the first host determines to discard the remote command, the first host sends a second TANAK to the second host, where the second TANAK is used to indicate that the remote command is to be retransmitted after a second time duration. For example, the second TANAK carries indication information #2, which is used to indicate that the second host is to retransmit the remote command after a second time duration after receiving the second TANAK. After the first host determines to receive the remote command, the first host sends a response message to the second host when the remote command is executed.
[0147] It should be noted that the second time duration is greater than the first time duration described above, for example, the second time duration is twice the first time duration. That is, if the used storage space of the first RCT exceeds the second threshold, the first RCT has stored a large number of remote commands to be processed, and the congestion is relatively heavy, so the first host can instruct the second host to increase the retransmission interval and reduce the transmission rate of the remote command through the second TANAK.
[0148] For example, the first host determines the processing strategy of the remote command according to the usage of the first RCT, and the method further includes: if the first RCT is full, determining to discard the remote command. The first host sends a third TANAK to the second host, where the third TANAK is used to indicate that the remote command is to be retransmitted. For the first retransmission of the remote command, the third TANAK indicates that the second host is to retransmit the remote command after a second time duration after receiving the third TANAK, and for the second retransmission of the remote command, the third TANAK indicates that the second host is to retransmit the remote command after a first time duration after receiving the third TANAK, so that the frequency of the 'third retransmission of the remote command' is higher than that of the 'first retransmission of the remote command', and thus the 'third retransmission of the remote command' has a higher probability of being received than the 'first retransmission of the remote command'.
[0149] S540, the first host sends a TANAK or a response message to the second host.
[0150] As described above in step S530, the first host can feed back a TANAK (such as the first TANAK, the second TANAK, or the third TANAK described above) to the second host. The TANAK passes through the network and reaches the second host, and informs the second host that the remote command is to be retransmitted after a certain time interval (for example, the first time duration or the second time duration).
[0151] The first host can feed back a response message to the second host, and the response message passes through the network and reaches the second host.
[0152] In the embodiment shown in Figure 5, the first host is equipped with a first RCT, which can be used to store remote commands corresponding to multiple processes of at least one second host. When the first host receives a remote command from the second host, it can determine the processing strategy for the remote command based on the storage space usage of the first RCT. In this communication method, the first host can set up one RCT for multiple processes of at least one second host, and these multiple processes share one RCT, eliminating the need to set up an RCT for each process separately, thereby achieving resource sharing and saving resource overhead. Furthermore, in this scheme, multiple processes share one RCT, and the storage space of the RCT can be set to be larger, ensuring the remote command transmission rate.
[0153] Furthermore, by adding a retransmission flag to the message and / or setting a threshold in the RCT, the starvation problem that may be caused by multiple processes sharing the RCT can be reduced.
[0154] To facilitate understanding, the communication methods provided in this application are illustrated with specific examples.
[0155] Example 1: This example illustrates a scenario where the remote command is a read request, and a TPG (Transmission over Group) is established between the target and source devices. Example 1 includes the following steps:
[0156] Step 1: The application process in the source device (i.e., the second host mentioned above) sends a 'Read' transaction to the JFS of the source device.
[0157] Step 2: The source device's JFS sends 'Read' to TPG and encapsulates it into TPH.
[0158] Step 3: The source device's Link layer encapsulates the Link header to obtain a 'Read' message. This 'Read' message selects the TP connection with the lightest load in the TPG and sends it to the target device (i.e., the first host mentioned above) through the network.
[0159] Step 4: When the target device's transport layer receives the packet, if the packet verification passes, it returns a TPACK (Transport Layer Acknowledgment) to the source device. This TPACK is used to notify the source device's transport layer that 'the packet has been received correctly'. If the PSN in the TPH is checked and packet loss is found, a Transport Selective ACK (TPSACK) is returned. This TPSACK carries the PSN of the lost packet and is used to notify the source device that 'the packet has been received correctly, but there is packet loss, and the packet corresponding to the lost PSN needs to be retransmitted'.
[0160] Step five: the transport layer of the target device parses the packet, and learns that the destination of the packet is a VM, for example, by looking up the DEID table to determine the destination of the packet. The transport layer of the target device strips the TPH and the previous part in the packet, and transfers the remaining part to the VM.
[0161] Step six: the VM of the target device receives the 'Read', and determines the processing strategy of the 'Read' according to the storage space usage of the RCT.
[0162] For example, the VM of the target device receives the 'Read', and judges whether the RCT is full,
[0163] If the RCT is full (i.e., there is no available storage space), the target device discards the 'Read', and returns a TANAK to the source device, to inform the source device to retransmit, and if the 'Read' is the first transmission, the indication information carried in the TANAK indicates that the retransmission is after a second time length after the TANAK is received; if the 'Read' is the retransmission, the indication information carried in the TANAK indicates that the retransmission is after a first time length after the TANAK is received.
[0164] If the RCT is not full, but the used depth of the RCT exceeds the delay_rty waterline, if the 'Read' is the first transmission, a TANAK is returned to the source device, to inform the source device to retransmit after a second time length after the TANAK is received; if the 'Read' is the retransmission, the 'Read' is received, and exists in the RCT, and when the 'Read' is executed, a read response (Read Response) is returned.
[0165] If the RCT is not full, but the used depth of the RCT exceeds the drop_new waterline, but does not exceed the delay_rty waterline, if the 'Read' is the first transmission, a TANAK is returned to the source device, to inform the source device to retransmit after a first time length after the TANAK is received; if the 'Read' is the retransmission, the 'Read' is received, and exists in the RCT, and when the 'Read' is executed, a read response (Read Response) is returned.
[0166] In addition, in order to facilitate understanding, the flow of receiving or discarding a remote command when there is a TP connection between the first host and the second host and when there is no TP connection between the first host and the second host is described in combination with FIG. 7 to FIG. 10.
[0167] FIG. 7 is a schematic diagram of remote command transmission provided by an embodiment of the present application.
[0168] As shown in FIG. 7, a TPG is established between the first host and the second host, and the remote command is a read request. The second host sends the read request to the first host through the TPG. After the transport layer of the first host receives the packet carrying the read request, a TPACK is returned to notify the second host that the read request has been correctly received. The first host determines the processing strategy of the read request according to the storage space usage of the RCT. In the scenario shown in FIG. 7, the first host determines to store the read request in the RCT. After the read request is executed, the first host sends a read response to the second host, to inform the source device that the read request has been successfully executed. After the second host receives the read response, a TPACK can be returned to notify the first host that the read response has been correctly received.
[0169] FIG. 8 is a schematic diagram of another remote command transmission provided by an embodiment of the present application.
[0170] As shown in FIG. 8, no TPG is established between the first host and the second host, and the remote command is a read request. The second host sends the read request to the first host. The first host determines the processing strategy of the read request according to the storage space usage of the RCT. In the scenario shown in FIG. 8, the first host determines to discard the read request. The first host sends a TANAK to the second host, to inform the source device to retransmit.
[0171] FIG. 9 is a schematic diagram of another remote command transmission provided by an embodiment of the present application.
[0172] As shown in FIG. 9, a TPG is established between the first host and the second host, and the remote command is a read request. The second host sends the read request to the first host through the TPG. After the transport layer of the first host receives the packet carrying the read request, a TPACK is returned to notify the second host that the read request has been correctly received. The first host determines the processing strategy of the read request according to the storage space usage of the RCT. In the scenario shown in FIG. 9, the first host determines to discard the read request. The first host sends a TANAK to the second host, to inform the source device to retransmit. After the second host receives the TANAK, a TPACK can be returned to notify the first host that the TANAK has been received.
[0173] FIG. 10 is a schematic diagram of another remote command transmission provided by an embodiment of the present application.
[0174] As shown in FIG. 10, no TPG is established between the first host and the second host, and the remote command is a read request. The second host sends the read request to the first host. The first host determines the processing strategy of the read request according to the storage space usage of the RCT. In the scenario shown in FIG. 10, the first host determines to discard the read request. The first host sends a TANAK to the second host, to inform the source device to retransmit.
[0175] It should be understood that the specific examples shown in FIGS. 5-10 in the embodiments of the present application are only to help those skilled in the art better understand the embodiments of the present application, and do not limit the scope of the embodiments of the present application. It should also be understood that the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0176] It should also be understood that in various embodiments of the present application, the terms and / or descriptions of different embodiments are consistent and can be referred to each other if there is no special description and logical conflict, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationship.
[0177] The above mainly introduces the scheme provided by the embodiments of the present application from the method aspect. In order to realize the above functions, it contains the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized in the form of hardware or combination of hardware and computer software. Whether a certain function is driven by hardware or computer software, it depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0178] In the following, the communication device provided by the embodiments of the present application is described in detail in combination with FIGS. 11-13. It should be understood that the description of the device embodiments corresponds to the description of the method embodiments, therefore, the content not described in detail can be referred to the above method embodiments, and part of the content will not be described again for the sake of brevity.
[0179] The embodiments of the present application can divide the function modules of the first host or the second host according to the above method examples, for example, each function module can be divided according to each function, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or software function module. It should be noted that the division of the module in the embodiments of the present application is illustrative, and is only a logical function division, and another division method can be used in actual implementation. The following takes the division of each function module according to each function as an example for description.
[0180] FIG. 11 shows a structure schematic diagram of a communication device 1000 provided by the embodiments of the present application.
[0181] An example, the communication apparatus 1100 can be applied to a first host, and the communication apparatus 1000 can be used to perform the communication method described above, for example, to perform the method shown in FIG. 5. Specifically, the communication apparatus 1100 can include a transceiver unit 1110 and a processing unit 1120.
[0182] The processing unit 1120 is configured to set a first remote command table (RCT) in the first host, the first RCT being used to store remote commands corresponding to a plurality of processes, the plurality of processes belonging to at least one second host. The transceiver unit 1010 is configured to receive a packet of a remote command from any second host of the at least one second host. The processing unit 1120 is configured to determine a processing strategy of the remote command according to a storage space usage of the first RCT.
[0183] As an example, in combination with FIG. 5, the transceiver unit 1010 can be used to perform S520 and S540, and the processing unit 1020 can be used to perform S510 and S530.
[0184] It should be noted that the apparatus described in FIG. 11 can also be used to perform the method steps involved in the aforementioned embodiment variants shown in the accompanying drawings, which will not be described here again.
[0185] Another example, the communication apparatus 1100 can be applied to a second host, and the communication apparatus 1100 can be used to perform the communication method described above, for example, to perform the method shown in FIG. 5.
[0186] The processing unit 1120 is configured to generate a packet of a remote command, the first identifier being included in a header of the packet of the remote command, the first identifier being used to identify whether the remote command is a first transmission remote command or a retransmission remote command. The transceiver unit 1110 is configured to send the packet of the remote command to the first host.
[0187] As an example, in combination with FIG. 5, the transceiver unit 1010 can be used to perform S520 and S540.
[0188] It should be noted that the apparatus described in FIG. 11 can also be used to perform the method steps involved in the aforementioned embodiment variants shown in the accompanying drawings, which will not be described here again.
[0189] Embodiments of the present application also provide a chip system 1200, as shown in FIG. 12, which includes at least one processor and at least one interface circuit. As an example, when the chip system 1200 includes one processor and one interface circuit, the one processor can be the processor 1210 shown in the solid line box in FIG. 12 (or the processor 1210 shown in the dashed line box), and the one interface circuit can be the interface circuit 1220 shown in the solid line box in FIG. 12 (or the interface circuit 1220 shown in the dashed line box).
[0190] When the chip system 1200 includes two processors and two interface circuits, then the two processors include the processor 1210 shown in the solid line box and the processor 1210 shown in the dashed line box in FIG. 12, and the two interface circuits include the interface circuit 1220 shown in the solid line box and the interface circuit 1220 shown in the dashed line box in FIG. 12. No limitation is made herein. The processor 1210 and the interface circuit 1220 can be interconnected through a line. For example, the interface circuit 1220 can be used to receive a signal (e.g., an instruction stored in a memory, etc.). For another example, the interface circuit 1220 can be used to send a signal to another device (e.g., the processor 1210).
[0191] For example, the interface circuit 1220 can read an instruction stored in a memory and send the instruction to the processor 1210. When the instruction is executed by the processor 1210, the communication device can be caused to perform various steps in the above-described embodiments. Of course, the chip system 1200 can also include other discrete devices, and no limitation is made herein to the embodiments of the present application.
[0192] Another embodiment of the present application also provides a computer readable storage medium, which stores instructions, when the instructions are run on a communication device, the communication device performs various steps performed by the communication device in the method flow shown in the above-described method embodiments. In some embodiments, the disclosed method can be implemented as computer program instructions encoded in a computer readable storage medium in a machine readable format or encoded in other non-transitory media or articles of manufacture.
[0193] FIG. 13 schematically shows a conceptual partial view of a computer program product provided by an embodiment of the present application, which includes a computer program for executing a computer process on a computer device.
[0194] In one embodiment, the computer program product is provided using a signal bearing medium 1300. The signal bearing medium 1300 can include one or more program instructions, which when run by one or more processors, can provide the functions or partial functions described above with respect to FIG. 5. Thus, for example, one or more features with respect to S510-S540 in FIG. 5 can be undertaken by one or more instructions associated with the signal bearing medium 1300. Further, the program instructions in FIG. 13 also describe example instructions.
[0195] In some examples, the signal-bearing medium 1300 can comprise a computer- readable medium 1301, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video disc (DVD), a memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electronically erasable programmable read-only memory (EEPROM), a floppy disk, a Zip® disk, a Blu-ray® disc, a flash memory, a magnetic tape, other forms of non-transitory computer-readable media, or any suitable combination thereof.
[0196] In some embodiments, the signal-bearing medium 1300 can comprise a computer- recordable medium 1302, such as, but not limited to, a floppy disk, a Zip® disk, a Blu-ray® disc, a flash memory, a flexible disk, a hard disk, a magnetic tape, a cassette tape, other forms of non-transitory computer-readable media, or any suitable combination thereof.
[0197] In some embodiments, the signal-bearing medium 1300 can comprise a communication medium 1303, such as, but not limited to, a digital and / or an analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communication link, a wireless communication link, etc.). The signal-bearing medium 1300 can be conveyed by a wireless form of the communication medium 1303. The one or more program instructions can be, for example, computer-executable instructions or logic-implementing instructions.
[0198] In some examples, various operations, functions, or actions are provided by the one or more program instructions in response to the program instructions being executed by a computer readable medium 1301, a computer recordable medium 1302, and / or a communication medium 1303.
[0199] It should be understood that the arrangements described herein are for purposes of example only. As such, those skilled in the art will appreciate that other arrangements and other elements (e.g. machines, interfaces, functions, orders, and number and
[0200] In the embodiments described above, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, all or part of the embodiments, or elements thereof, can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are executed by a computer, all or part of the embodiments according to the embodiments of the present application are produced. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus.
[0201] The computer instructions can be stored in or transferred from one computer-readable storage medium to another computer-readable storage medium, such as from one website, computer, server, or data center to another website, computer, server, or data center through wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available media that can be accessed by a computer and includes one or more data storage devices that can be integrated into a server, data center, etc. with the medium. The available media can be magnetic media (e.g., floppy diskette, hard disk, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., solid state disk (SSD)), etc.
[0202] The above description is merely that of the specific embodiments of the present application, but the scope of the protection of the present application is not limited thereto. It should be understood by those skilled in the art that any modification, substitution and change within the technical range disclosed in the present application can be easily conceived. Therefore, the scope of the protection of the present application should be defined by the scope of the claims.
Claims
1. A communication method characterized by comprising: The method is applied to a first host, and comprises: setting a first remote command table (RCT) in the first host, the first RCT being used to store remote commands corresponding to a plurality of processes, the plurality of processes belonging to at least one second host; receiving a packet of a remote command from any second host of the at least one second host, and determining a processing strategy of the remote command according to a storage space usage of the first RCT.
2. The method of claim 1, wherein, The packet header of the remote command packet includes a first identifier, the first identifier being used to identify the remote command as a first transmission remote command or a retransmission remote command.
3. The method of claim 2, wherein, The method further comprises: setting a first threshold in the first RCT; the determining of the processing strategy of the remote command according to the storage space usage of the first RCT comprises: determining the processing strategy of the remote command according to the first threshold and the storage space usage of the first RCT.
4. The method of claim 3, wherein, The determining of the processing strategy of the remote command according to the first threshold and the storage space usage of the first RCT comprises: if the used storage space of the first RCT exceeds the first threshold, adopting a first processing strategy to process the remote command; if the used storage space of the first RCT does not exceed the first threshold, adopting a second processing strategy to process the remote command.
5. The method of claim 4, wherein, The adopting of the first processing strategy to process the remote command if the used storage space of the first RCT exceeds the first threshold comprises: if the remote command is the first transmission remote command, determining to discard the remote command; if the remote command is the retransmission remote command, determining to receive the remote command and store the remote command in the first RCT.
6. The method of claim 5, wherein, In the case of determining to discard the remote command, the method further comprises: sending a first transaction negative acknowledgement (TANAK), the first TANAK being used to instruct to retransmit the remote command after a first time length of receiving the first TANAK.
7. The method according to any one of claims 3 to 6, characterized in that, The method further comprises: setting a second threshold in the first RCT, the second threshold being greater than the first threshold; the determining of the processing strategy of the remote command according to the storage space usage of the first RCT comprises: determining the processing strategy of the remote command according to the second threshold and the storage space usage of the first RCT.
8. The method of claim 7, wherein, The determining of the processing strategy of the remote command according to the second threshold and the storage space usage of the first RCT comprises: if the used storage space of the first RCT exceeds the second threshold and the remote command is the first transmission remote command, determining to discard the remote command. The method further comprises: sending a second transaction negative acknowledgement (TANAK), the second TANAK being used to instruct to retransmit the remote command after a second time length of receiving the second TANAK, the second time length being greater than the first time length.
9. The method according to any one of claims 2 to 8, characterized in that, The determining of the processing strategy of the remote command according to the usage of the first RCT comprises: if the first RCT is full, determining to discard the remote command. The method further comprises: sending a third transaction negative acknowledgement (TANAK), the third TANAK being used to indicate that the remote command is to be retransmitted; if the remote command is a retransmitted remote command, the third TANAK being used to indicate that the remote command is to be retransmitted after a first time duration from receiving the third TANAK.
10. The method according to any one of claims 1 to 9, characterized in that, The method further comprises: setting a second RCT in the first host, the stored remote commands in the first RCT and the stored remote commands in the second RCT being processed with different priorities; or, the second RCT and the first RCT corresponding to different processes.
11. The method according to any one of claims 1 to 10, characterized in that, The method further comprises: establishing a transport protocol group (TPG) between the first host and the at least one second host respectively.
12. The method according to any one of claims 1 to 11, characterized in that, The remote command comprises a read (Read) request or an atomic (Atomic) request.
13. The method according to any one of claims 1 to 12, characterized in that, The receiving of the packet of the remote command from any of the at least one second host comprises: receiving the packet of the remote command from any of the at least one second host through a communication interface Jetty, the Jetty being used to receive the packet of the remote command from the at least one second host.
14. A communication method, comprising: The method applied to a second host comprises: generating a packet of a remote command, the packet of the remote command comprising a first identifier in a packet header, the first identifier being used to indicate that the remote command is a first-transmitted remote command or a retransmitted remote command sending the packet of the remote command to a first host.
15. The method of claim 14, wherein, The method further comprises: receiving a first transaction negative acknowledgement (TANAK) from the first host, the first TANAK being used to indicate that the remote command is to be retransmitted after a first time duration from receiving the first TANAK; or receiving a second transaction negative acknowledgement (TANAK) from the first host, the second TANAK being used to indicate that the remote command is to be retransmitted after a second time duration from receiving the second TANAK, the second time duration being greater than the first time duration.
16. A method of communication, comprising: comprising: a first host setting a first remote command table (RCT) in the first host, the first RCT being used to store remote commands corresponding to a plurality of processes, the plurality of processes belonging to at least one second host; a second host sending a packet of a remote command to the first host, the second host being any of the at least one second host; the first host determining a processing strategy of the remote command according to a storage space usage of the first RCT.
17. A communication system, characterized by comprising a first host and at least one second host, the first host setting a first remote command table (RCT) in the first host, the first RCT being used to store remote commands corresponding to a plurality of processes, the plurality of processes belonging to the at least one second host; the second host sending a packet of a remote command to the first host, the second host being any of the at least one second host; the first host determining a processing strategy of the remote command according to a storage space usage of the first RCT.
18. A communications device, characterized by comprising: a processor configured to read instructions stored in a memory, which when executed by the processor, cause the communication device to implement the method of any one of claims 1 to 13; or, cause the communication device to implement the method of claim 14 or 15.
19. A computer program product, characterised in that, The computer program product comprises computer program code which, when run on a computer, causes the method of any one of claims 1 to 13 to be performed; or, when run on a computer, causes the method of claim 14 or 15 to be performed.
20. A computer-readable storage medium, characterized in that, The computer program comprises instructions which, when executed on a computer system, cause a processing module in the computer system to perform the method of any one of claims 1 to 13; or, when executed on a computer system, cause a processing module in the computer system to perform the method of claim 14 or 15.