[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN117579555A - Data transmission method, computing device and system - Google Patents

Data transmission method, computing device and system Download PDF

Info

Publication number
CN117579555A
CN117579555A CN202311330765.7A CN202311330765A CN117579555A CN 117579555 A CN117579555 A CN 117579555A CN 202311330765 A CN202311330765 A CN 202311330765A CN 117579555 A CN117579555 A CN 117579555A
Authority
CN
China
Prior art keywords
computing device
length
message
data
unit
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202311330765.7A
Other languages
Chinese (zh)
Inventor
吕志鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
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 XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202311330765.7A priority Critical patent/CN117579555A/en
Publication of CN117579555A publication Critical patent/CN117579555A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/43Assembling or disassembling of packets, e.g. segmentation and reassembly [SAR]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a data transmission method, computing equipment and a system, and belongs to the field of computing equipment. In the embodiment of the application, a second computing device sends a first authorization length to a first computing device, wherein the first authorization length indicates the length of a data message which the second computing device allows the first computing device to send to the second computing device; the first computing device receives a first authorization length from the second computing device; the first computing device generates a first data message based on the first authorization length, wherein the length of the first data message is matched with the first authorization length; the first computing device sends the first data message to the second computing device. The second computing device receives a first data message from the first computing device. The receiving end sends the authorized length to control the length of the data sent by the sending end, so that the risk of network congestion caused by the fact that the data quantity sent by the sending end exceeds the processing capacity of the receiving end is reduced.

Description

Data transmission method, computing device and system
Technical Field
The present disclosure relates to the field of computing devices, and in particular, to a data transmission method, a computing device, and a system.
Background
Different computing devices often need to transmit traffic data over a network. For example, traffic data is often transmitted between different servers deployed in a data center. In the process of transmitting data between computing devices, there is a risk of network congestion, which can lead to reduced network performance, increased transmission delay, and increased packet loss rate. In view of this, it is desirable to provide a solution to help implement a congestion free network.
Disclosure of Invention
The embodiment of the application provides a data transmission method, computing equipment and a system, which can reduce the risk of network congestion. The technical proposal is as follows.
In a first aspect, a data transmission method is provided, the method including: the first computing device receives an authorization length from the second computing device, the authorization length indicating a length of a data message that the second computing device allows the first computing device to send to the second computing device; the first computing device generates a first data message based on the authorization length, wherein the length of the first data message is matched with the authorization length; the first computing device sends a first data message to the second computing device.
The first computing device is, for example, a transmitting device (or source for data transmission), and the second computing device is, for example, a receiving device (or destination for data transmission). The grant length is also called grant size (grant size), transmittable length, or transmittable size. The authorization length is used for indicating the length of the data message which the receiving end authorizes and allows the sending end to send.
In the method provided in the first aspect, the first computing device sends the data message with the length matched with the authorized length to the second computing device based on the authorized length from the second computing device, so that data is sent to the second computing device under the control of the receiving end (the second computing device), which is equivalent to solving congestion from the source of the data (the first computing device serving as the sending end), and therefore the risk of network congestion caused by the fact that the data volume sent by the first computing device exceeds the processing capacity of the second computing device can be reduced.
In addition, the length of the data transmitted by the first computing device and the time for transmitting the data are matched with the processing capacity and the buffer space of the second computing device as much as possible, so that the probability of buffer overflow of the second computing device caused by excessive data quantity transmitted by the first computing device is reduced.
In some embodiments, the authorization length indicates a number of unit messages that the second computing device allows the first computing device to send to the second computing device, the unit messages being data messages of standard length; correspondingly, the length of the first data message is matched with the authorized length, and the method comprises the following steps: the first data message comprises at least one unit message, and the number of the unit messages in the first data message is smaller than or equal to the number of the authorized length indications.
For example, the authorization length is y, the authorization length indicating that the second computing device authorizes the first computing device to transmit y unit messages, the first computing device transmitting y unit messages to the second computing device based on the authorization length. Of course, the number of unit messages in the data message sent by the first computing device may also be smaller than the authorization length. Based on the mode, the second computing device can control the number of unit messages sent by the first computing device by sending the authorization length, so that the number of the unit messages sent by the first computing device does not exceed the number of the unit messages which can be processed by the second computing device, and the risk that the second computing device is congested due to the fact that the number of the messages sent by the first computing device is too large is reduced.
In some embodiments, the authorization length indicates a total length of at least one unit message that the second computing device allows the first computing device to send to the second computing device, the unit message being a data message of standard length; correspondingly, the length of the first data message is matched with the authorized length, and the method comprises the following steps: the first data message comprises at least one unit message, and the total length of the at least one unit message in the first data message is smaller than or equal to the authorized length.
Based on the mode, the second computing device can control the total length of the unit messages sent by the first computing device by sending the authorized length, so that the number of the unit messages sent by the first computing device does not exceed the total length of the unit messages which can be processed by the second computing device, and the risk that the second computing device is congested due to the fact that the number of the messages sent by the first computing device is too large is reduced.
In some implementations, the first computing device generates a first data message based on the authorization length, including: when the length of the original data message is larger than that of the unit message, the first computing device cuts the original data message based on the length of the unit message to obtain a first data message; or when the length of the original data message is smaller than that of the unit message, the first computing device merges the original data message based on the length of the unit message to obtain the first data message.
Because the first computing device segments or merges the data messages based on the lengths of the unit messages, the length of each data message sent by the first computing device is identical, and each data message sent by the first computing device has the same length as the unit message. When the forwarding device forwards the data messages by adopting the load balancing algorithm, the data streams can be uniformly distributed to different forwarding paths, so that the quantity of the data messages transmitted by each forwarding path is basically the same, and the quantity of the data transmitted by each forwarding path is balanced because the length of each data message is the same, thereby realizing the load balancing of each forwarding path in the network as much as possible.
In some implementations, a first computing device receives an authorization length from a second computing device, comprising: the first computing device receives a control message from the second computing device, the control message including an authorization length.
The transmission authorization length of the protocol message of the specific type of the control message is adopted, so that the message of the transmission authorization length is distinguished from the message of the transmission service data, and the flexibility is higher.
In some implementations, the first data message includes a to-be-transmitted length that indicates a length of the data message that the first computing device needs to further transmit to the second computing device in addition to the first data message.
Because the first computing device sends the length to be sent to the second computing device, the second computing device can know the data transmission requirement of the first computing device based on the length to be sent, and the second computing device can take the received length to be sent as a trigger condition for sending the authorized length to the first computing device, so that the risk of redundant communication flow caused by sending the authorized length to the first computing device under the condition that the first computing device does not have the data transmission requirement is reduced, and communication overhead is reduced.
In some implementations, the length to be sent indicates a number of unit messages that the first computing device needs to send further to the second computing device in addition to the first data message; alternatively, the length to be sent indicates a total length of at least one unit message that the first computing device needs to further send to the second computing device in addition to the first data message.
In this way, the number of the messages with the length to be sent passing through the unit is supported, and the number of the messages with the length to be sent passing through the unit is also supported, so that the flexibility is improved. And because the unit message is adopted as a unit of the length to be sent, the data volume transmitted by each forwarding path is balanced, and therefore, the load balance of each forwarding path in the network is realized as much as possible.
In some embodiments, the first data message includes a tunnel header including a length to be sent.
In this way, the length to be sent is carried by using the independent tunnel header, so that the message header of the existing network layer protocol and the message header of the transport layer protocol are not required to be changed to carry the length to be sent, the universality of the scheme is improved, and the complexity of implementing the message parsing by the receiving end to obtain the length to be sent is also reduced.
In some implementations, the tunnel header further includes a protocol type. The protocol type is used for identifying a protocol corresponding to service data encapsulated in the inner layer of the tunnel header in the first data message. For example, the protocol type is transmission control protocol (transmission control protocol, TCP), user datagram protocol (user datagram protocol, UDP), remote direct memory access over ethernet (RDMA over converged ethernet, roCE), or the like.
The protocol type is carried by the tunnel header of the data message, so that the second computing device can accurately identify the protocol used by the inner layer service data, and the expansibility is improved by adopting a corresponding processing mode aiming at each protocol.
In some embodiments, the tunnel header further includes a sequence number. The sequence number is used to identify the order of arrangement of at least one unit message in the first data message.
In consideration of the fact that in the process of forwarding messages, forwarding devices deployed between the computing devices may forward different unit messages in the same data message to different forwarding paths, the unit messages on the different forwarding paths may arrive at the second computing device in sequence at different times, so that the sequence of the plurality of unit messages received by the second computing device is inconsistent with the sequence of the plurality of unit messages sent by the first computing device, and the risk of data processing errors of the second computing device is caused. The plurality of unit messages are sequenced according to the sequence numbers, so that the sequence of the sequenced plurality of unit messages is consistent with the sequence of the plurality of unit messages sent by the first computing equipment, and the risk of data processing errors caused by disorder is reduced.
In some embodiments, the tunnel header further comprises an application identification for identifying the application from which the traffic data is coming.
Because the tunnel header carries the application identifier, in the scenario that a plurality of applications in the sending end transmit data to one receiving end in parallel, the receiving end can distinguish different applications based on the application identifier in the tunnel header, and different applications in two devices can be supported to transmit data through different tunnels.
In some embodiments, the tunnel header further comprises a first flag for identifying whether the first data message has been fragmented.
Because the tunnel header carries the mark for identifying whether the data message is segmented, the receiving end can definitely execute the step of merging or segmenting the message based on the value of the mark, and the realization complexity of the receiving end for recovering the original data message is reduced.
In some embodiments, the tunnel header further comprises a second flag for identifying a last unit message of the at least one unit message included in the first data message.
Because the tunnel header carries the mark that indicates whether the last unit message is the last unit message, the receiving end can distinguish whether the sending end has transmitted the last unit message authorized to be allowed to be sent in the current sending stage to the home end or needs to continue transmitting the unit message based on the value of the mark. In addition, the receiving end can timely start analyzing and processing the received unit message by determining the arrival of the last unit message, so that the probability of the receiving end waiting for additional message transmission is reduced, and the transmission efficiency and response speed are improved.
In some embodiments, the tunnel header further comprises a third flag for identifying the type of the first data packet as a data packet.
Because the tunnel header carries the mark of whether the mark is the data message or not, the receiving end is convenient to distinguish whether the message is the data message or the control message, and the realization complexity of the receiving end is reduced.
In a second aspect, a data transmission method is provided, the method including: the second computing device sends a first authorization length to the first computing device, the first authorization length indicating a length of a data message that the second computing device allows the first computing device to send to the second computing device; the second computing device receives a first data message from the first computing device, the length of the first data message matching the first authorization length.
In the method provided in the first aspect, the second computing device sends the authorization length to the first computing device, so that the length of sending data by the first computing device can be controlled, which is equivalent to solving congestion from a source (the first computing device serving as a sending end) of the data, and reducing the risk that the length of a data message sent by the first computing device exceeds the processing capacity and the buffer space of the second computing device, so that the second computing device is congested.
In some implementations, the second computing device sends the first authorization length to the first computing device, including: the second computing device sends a control message to the first computing device, the control message including a first authorization length.
The transmission authorization length of the protocol message of the specific type of the control message is adopted, so that the message of the transmission authorization length is distinguished from the message of the transmission service data, and the flexibility is higher.
In some embodiments, the first data message includes a length to be sent, the length to be sent indicating a length of the data message that the first computing device needs to send further to the second computing device in addition to the first data message, and after the second computing device receives the first data message from the first computing device, the method further includes: the second computing device compares the length to be transmitted with the first authorized length; in response to the length to be transmitted being greater than the first grant length, the second computing device transmits the second grant length to the first computing device.
When the length to be sent is greater than the first authorization length, the second computing device is indicated to authorize the first computing device to send the data message through the sent authorization length (the first authorization length), and then the first computing device still needs to continue to send data, so that the second computing device continues to authorize the permission sending end to send data through sending the new authorization length to the first computing device again, the data transmission behavior of the first computing device can be continuously controlled, and the requirement of the first computing device for transmitting the data to the second computing device is met as far as possible.
In some implementations, in response to the length to be transmitted being greater than the first grant length, the second computing device transmits the second grant length to the first computing device, including: in response to the length to be transmitted being greater than the second authorization length, the second computing device adding an identification of the first computing device to a list of sending hosts, the list of sending hosts being used to store an identification of the computing device that needs to transmit data to the second computing device; the second computing device sends a first authorization length to the first computing device in response to the identification of the first computing device being top-ranked in the sending host list.
As the first device in the host list is used as the sending object of the control message, the control of each sending end to orderly send data is facilitated.
In some implementations, the first data message includes at least one unit message, and after the second computing device receives the first data message from the first computing device, the method further includes: the second computing equipment combines the at least one unit message to obtain an original data message; or the second computing device segments at least one unit message to obtain the original data message.
In a third aspect, a computing device is provided, the computing device being a first computing device, the computing device comprising: a processor coupled to the memory, the memory having stored therein at least one computer program instruction that is loaded and executed by the processor to cause the computing device to implement the method provided in the first aspect or any of the alternatives of the first aspect.
In a fourth aspect, there is provided a computing device, the computing device being a second computing device, the computing device comprising: a processor coupled to the memory, the memory having stored therein at least one computer program instruction that is loaded and executed by the processor to cause the computing device to implement the method provided by the second aspect or any of the alternatives of the second aspect described above.
In a fifth aspect, a network system is provided, the network system comprising a first computing device and a second computing device;
the second computing device sends a first authorization length to the first computing device, the first authorization length indicating a length of a data message that the second computing device allows the first computing device to send to the second computing device;
the first computing device receives a first authorization length from the second computing device; the first computing device generates a first data message based on a first authorization length, the length of the first data message being matched with the first authorization length;
The first computing device sends a first data message to the second computing device.
The second computing device receives a first data message from the first computing device.
In some implementations, the second computing device sends a control message to the first computing device, the control message including the first authorization length. The first computing device receives the control message. The first computing device obtains a first authorization length carried in the control message.
In some embodiments, when the length of the original data message is greater than the length of the unit message, the first computing device segments the original data message based on the length of the unit message to obtain the first data message; the second computing device merges the at least one unit message to obtain an original data message.
In some embodiments, when the length of the original data message is smaller than the length of the unit message, the first computing device merges the original data message based on the length of the unit message to obtain the first data message. The second computing device segments at least one unit message to obtain an original data message.
In some embodiments, the authorization length indicates a number of unit messages that the second computing device allows the first computing device to send to the second computing device, the unit messages being data messages of standard length; correspondingly, the length of the first data message is matched with the authorized length, and the method comprises the following steps: the first data message comprises at least one unit message, and the number of the unit messages in the first data message is smaller than or equal to the number of the authorized length indications.
In some embodiments, the authorization length indicates a total length of at least one unit message that the second computing device allows the first computing device to send to the second computing device, the unit message being a data message of standard length; correspondingly, the length of the first data message is matched with the authorized length, and the method comprises the following steps: the first data message comprises at least one unit message, and the total length of the at least one unit message in the first data message is smaller than or equal to the authorized length.
In some embodiments, the first data message includes a length to be sent, the length to be sent indicating a length of the data message that the first computing device needs to send further to the second computing device in addition to the first data message, and after the second computing device receives the first data message from the first computing device, the method further includes: the second computing device compares the length to be transmitted with the first authorized length; in response to the length to be transmitted being greater than the first grant length, the second computing device transmits the second grant length to the first computing device.
In some implementations, in response to the length to be transmitted being greater than the first grant length, the second computing device transmits the second grant length to the first computing device, including: in response to the length to be transmitted being greater than the second authorization length, the second computing device adding an identification of the first computing device to a list of sending hosts, the list of sending hosts being used to store an identification of the computing device that needs to transmit data to the second computing device; the second computing device sends a first authorization length to the first computing device in response to the identification of the first computing device being top-ranked in the sending host list.
In some embodiments, the network system employs a leaf spine architecture, the network system further comprising a first leaf switch coupled to the first computing device, a second leaf switch coupled to the second computing device, and a spine switch coupled to the first leaf switch and the second leaf switch, respectively.
In a sixth aspect, a control message is provided, the control message including an authorization length indicating a length of a data message that a receiving end device is allowed to send to the receiving end device by the sending end device.
In some embodiments, the control message includes a tunnel header that includes an authorization length.
In some embodiments, the tunnel header includes an IP header, a UDP header, and a control message header. The IP header, the UDP header and the control message header are sequentially arranged in the control message according to the sequence from the outer layer to the inner layer.
In some embodiments, the tunnel header further includes a device identification of the sender.
In some embodiments, the tunnel header further includes an acknowledgement number. The value of the confirmation number corresponds to the serial number in the data message.
In some embodiments, the tunnel header further includes a sequence number. The sequence number is, for example, the sequence number of the tunnel establishment request message.
In a seventh aspect, a data packet is provided, where the data packet includes a length to be sent, where the length to be sent indicates a length of the data packet that needs to be sent by a sending end device to a receiving end device.
In some embodiments, the data message includes a tunnel header that includes a length to be sent.
In some embodiments, the tunnel header includes an IP header, a UDP header, and a data message header. The IP header, the UDP header and the data message header are sequentially arranged in the data message according to the sequence from the outer layer to the inner layer.
In some embodiments, the tunnel header further includes a protocol type, where the protocol type is used to identify a protocol corresponding to service data encapsulated in an inner layer of the tunnel header in the data packet.
In some embodiments, the tunnel header further includes a sequence number for identifying a sequence of at least one unit message in the data message.
In some embodiments, the tunnel header further includes an application identification for identifying the application from which the traffic data is coming.
In some embodiments, the tunnel header further includes a first flag for identifying whether the data packet has been fragmented.
In some embodiments, the tunnel header further includes a second flag for identifying a last unit message of the at least one unit message included in the data message.
In some embodiments, the tunnel header further includes a third flag for identifying that the type of message is a data message.
In some embodiments, the tunnel header further includes a device identification of the sender.
In an eighth aspect, there is provided a computer readable storage medium having stored therein at least one instruction which when executed on a computer causes the computer to perform the method provided in the first aspect or any of the alternatives of the first aspect.
In a ninth aspect, there is provided a computer readable storage medium having stored therein at least one instruction that when executed on a computer causes the computer to perform the method provided in the second aspect or any of the alternatives of the second aspect.
In a tenth aspect, there is provided a computer program product comprising one or more computer program instructions which, when loaded and run by a computer, cause the computer to carry out the method provided in the first aspect or any of the alternatives of the first aspect.
In an eleventh aspect, there is provided a computer program product comprising one or more computer program instructions which, when loaded and run by a computer, cause the computer to perform the method provided in the second aspect or any of the alternatives of the second aspect described above.
In a twelfth aspect, a chip is provided, comprising a memory for storing computer instructions and a processor for calling and executing the computer instructions from the memory to perform the method of the first aspect and any possible implementation of the first aspect.
In a thirteenth aspect, there is provided a chip comprising a memory for storing computer instructions and a processor for calling and executing the computer instructions from the memory to perform the method provided in the second aspect or any of the alternatives of the second aspect described above.
Further combinations of the present application may be made to provide further implementations based on the implementations provided in the above aspects.
Drawings
Fig. 1 is a schematic architecture diagram of a network system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a data transmission method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a computing device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a format of a control message according to an embodiment of the present application;
fig. 5 is a schematic diagram of a format of a data packet according to an embodiment of the present application;
Fig. 6 is a schematic diagram of a scenario for transmitting data between computing devices according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Some term concepts related to the embodiments of the present application are explained below.
(1) Data messages and control messages
The data messages and control messages are two types of messages. The data message is mainly used for carrying service data. For example, the payload (payload) field of a data message carries traffic data. The control message is used for establishing a tunnel or controlling the data transmission behavior of the sending end. The control message may be a response message, e.g. the control message is a response message for a data message or another control message. The control message used as the response message is referred to as a control response message in this embodiment. Some embodiments of the present application relate to data messages transmitted in multiple transmission phases, and the data messages transmitted in different transmission phases are described differently by "first data message", "second data message", or the data messages transmitted in different transmission phases are described differently by "data message 1", "data message 2". Tunnels may also be referred to as data connections, the tunnels corresponding to virtual communication paths in the network. The tunnel is used to transport messages between two devices in the network. For example, a tunnel includes two endpoints, one of the endpoints of the tunnel being a computing device that is the sender and the other endpoint of the tunnel being a computing device that is the receiver.
(2) Unit message (unit packet)
The unit message refers to a data message with a standard length. The length of a message is also referred to as the size (size) of the message. The length of a message may be measured in bits, bytes, or other units of measure. For example, a unit message has a length of 256 bytes; alternatively, a unit message is 512 bytes in length. In one possible implementation, the length of the unit message is preconfigured on the sender. For example, the length of the unit message is set according to the service scenario or the requirements of the communication protocol. In another possible implementation, the length of the unit message is determined by negotiation between the transmitting end and the receiving end.
(3) Transmission phase
The sending stage refers to a period from the sending end receiving a control message until the sending end sending the data message according to the authorized length in the control message. The transmission phase is also called transmission period. In some implementations of the present application, the data transmission flow may be divided into multiple transmit phases. A transmission phase may include a period of time from when a control message is transmitted by a receiving end until the receiving end receives a data message transmitted by the transmitting end based on the control message. For example, the first sending stage is a period from the control message sent by the receiving end for the first time after the tunnel connection is established until the receiving end receives the data message sent by the sending end based on the control message, for example, in the following steps S211 to S216 in the embodiment of fig. 2. The second sending stage is a period from the receiving end establishing the tunnel connection and sending the control message for the second time until the receiving end receives the data message sent by the sending end based on the control message received for the second time, for example, in the following steps S221 to S226 in the embodiment of fig. 2. The nth transmission stage (last transmission stage) is a period from when the receiving end establishes the tunnel connection and then transmits the control message for the nth time until the receiving end receives the data message transmitted by the transmitting end based on the control message received for the nth time, for example, steps S2n1 to S2n6 in the embodiment of fig. 2.
(4) Length of authorization
The grant length is also called grant size (grant size), transmittable length, or transmittable size. The authorization length is used for indicating the length of the data message which the receiving end authorizes and allows the sending end to send. The authorization length may be a length of the receiving end capable of receiving the processed data packet. In one possible implementation, the grant length is represented by the number of unit messages. For example, the grant length is a multiple of the length of the unit message. For example, the grant length is y, which indicates that the receiving end grants permission for the transmitting end to transmit y unit messages, and y is a positive integer. Taking the length of a unit message as m bytes as an example, when the authorization length is y, it means that the receiving end authorizes the transmitting end to transmit the unit message with the total length of y×m bytes, and m is a positive integer. In another possible implementation, the grant length is represented by the total length of at least one unit message. For example, the grant length is y, which indicates that the receiving end grants the transmitting end to transmit at least one unit message with the total length of y, taking the length of one unit message as m bytes as an example, when the grant length is y, which indicates that the receiving end grants the transmitting end to transmit (y/m) unit messages, y is a positive integer.
For the determination manner of the authorization length, in a possible implementation manner, the receiving end obtains the authorization length by adopting a static configuration manner. In another possible implementation, the authorization length is automatically adjusted by the receiving end according to the state of the device. For example, the receiving end first sets an initial grant length. If the receiving end detects that the device is in a congestion state, the initial authorization length is reduced according to the set amplitude. For example, if the receiving end determines that the device is in a congestion state based on that the buffer (buffer) length of the interface or the queue on the device exceeds a threshold, the initial grant length is reduced according to the set amplitude. For another example, if the bandwidth utilization rate of the interface or the queue on the receiving end exceeds the threshold value, the receiving end determines that the receiving end is in a congestion state, and then reduces the initial authorization length according to the set amplitude. Otherwise, if the receiving end detects that the bandwidth utilization rate of the interface or the queue on the device is smaller than the threshold value, the device is determined to be in a non-congestion state, and the initial authorization length is increased according to the set amplitude value. For another example, if the receiving end detects that the network quality index is not good, such as the parameters of time delay, packet loss rate and the like are larger than the threshold value, the initial authorization length is reduced according to the set amplitude. In this way, the support device adaptively adjusts the authorization length according to the state of the device and the network quality, so that the service damage is reduced by reducing the authorization length when the network quality is poor or the state of the device is poor, and the data transmission times and the communication overhead are reduced by adjusting the authorization length when the network quality is good or the state of the device is good. In yet another possible implementation, the receiving end adjusts the grant length based on the length to be sent of the sending end. For example, if the length to be transmitted of the transmitting end is greater than the threshold value and the receiving end is in a non-congestion state, the receiving end increases the initial grant length according to the set amplitude.
Some embodiments of the present application relate to grant lengths transmitted in multiple transmit phases, with a distinction of "first grant length", "grant length 2" describing the grant length transmitted in different transmit phases, or "grant length 1", "grant length 2" describing the grant length transmitted in different transmit phases.
(5) Length to be transmitted
The to-be-transmitted length is also called a request size (request size), a to-be-transmitted size, or a request length. The length to be sent is used for indicating the length of the data message which needs to be sent to the receiving end by the sending end. In one possible implementation, the length to be sent is represented by the number of unit messages. For example, the length to be sent is x, which means that the sending end needs to send x unit messages to the receiving end, and x is a positive integer. Taking an example that the length of a unit message is m bytes, when the length to be sent is x, it indicates that the sending end needs to send the unit message with the total length of x×m bytes to the receiving end, where m is a positive integer. In another possible implementation, the length to be sent is represented by the total length of at least one unit message. For example, the length to be sent is x, which indicates that the sending end needs to send at least one unit message with the total length of x to the receiving end, taking the length of one unit message as an example, where m bytes is taken as the length of one unit message, when the length to be sent is x, which indicates that the sending end needs to send (x/m) unit messages to the receiving end, x is a positive integer.
Some embodiments of the present application relate to a length to be transmitted in a plurality of transmission phases, and describes the length to be transmitted in different transmission phases by differentiating "a first length to be transmitted", "a second length to be transmitted", or describes the length to be transmitted in different transmission phases by differentiating "a length to be transmitted 1", "a length to be transmitted 2".
(6) Sending host list
The sender list is a list that is maintained by the receiver after the sender establishes a data connection (e.g., tunnel) with the receiver. The sending host list includes an identification of each of one or more hosts to send data to the receiving end. The sending host list may be used to indicate the sending object of the next control response message. In one possible implementation, the sending host list is a linked list. The list of sending hosts may be a circular queue.
(7) Lossless network
Lossless networks refer to networks in which no packet loss occurs during the data transmission phase. In addition, lossless networks also have low latency and high throughput characteristics.
The application scenario of the embodiment of the present application is illustrated below.
The embodiments of the present application may be applied to scenarios in which data is transferred between computing devices, such as scenarios in which data is transferred between different servers in a data center. At present, in the process of transmitting data from a computing device serving as a transmitting end to a computing device serving as a receiving end, limitation is lacking on data transmission behaviors of the transmitting end (such as the time when the transmitting end transmits data and the length of the transmitted data), the transmitting end does not consider the capability of the receiving end to process the data when transmitting the data, so that the situation that the amount of the data transmitted by the transmitting end exceeds the capability of the receiving end to process the data often occurs, for example, the data transmitted by the transmitting end is overlong or the transmitted data is too frequent, the computing power of the receiving end is insufficient to process all the data transmitted by the transmitting end, and a large amount of data which cannot be processed by the receiving end is stored in a buffer memory of a forwarding device connected with the receiving end, so that network congestion is caused.
In particular, in a scenario where a plurality of transmitting terminals transmit data to the same receiving terminal, the amount of data transmitted by the plurality of transmitting terminals is huge, resulting in more serious congestion problems. For example, when multiple servers in a data center perform tasks in a distributed manner, a scenario in which multiple servers transmit data to one server, such as in a scenario in which an artificial intelligence (artificial intelligence, AI) application is deployed in the data center, in order to train a large model in coordination with the computing power of multiple servers, data on which synchronization training is based is often required between multiple servers, and multiple servers may send a large amount of data to the same server when synchronizing data, which results in a greater risk of network congestion.
In view of this, the embodiment of the present application provides a method for controlling, by a receiving end, a transmitting end to transmit data, where the transmitting end transmits data only when the receiving end authorizes the transmitting end to transmit data; under the condition that the receiving end does not authorize the sending end to send data, the sending end caches the data to be sent until the authorization of the receiving end is obtained. Based on the mode, the receiving end can control the sending end to send data by combining the self-receiving processing data capacity, and the risk of congestion caused by the fact that the data quantity sent by the sending end exceeds the processing capacity of the receiving end is reduced. And, because the data to be transmitted is cached in the transmitting end, the congestion is solved from the source (transmitting end) of the data, and the network time delay caused by a large amount of data cached in the forwarding equipment connected with the receiving end due to the limited data amount which can be processed by the receiving end is reduced.
Further, the receiving end may control the length of the data transmitted by the transmitting end. For example, the receiving end sends an authorization length to the sending end, the authorization length indicates a length of a data message that the receiving end authorizes to allow the sending end to send, and the sending end sends the data message to the receiving end based on the authorization length, wherein the length of the data message is matched with the authorization length.
For example, in the case that the authorization length and the length of the data packet are represented by the number of unit packets, the number of unit packets in the data packet sent by the sending end is the same as the authorization length. For example, the authorization length is y, and the authorization length indicates that the receiving end authorizes the transmitting end to transmit y unit messages, and the transmitting end transmits y unit messages to the receiving end based on the authorization length. Of course, the number of unit messages in the data message sent by the sending end may also be smaller than the authorized length. Based on the mode, the receiving end can control the number of the unit messages sent by the sending end, so that the number of the unit messages sent by the sending end cannot exceed the number of the unit messages which can be processed by the receiving end, and the risk of congestion of the receiving end caused by excessive number of the messages sent by the sending end is reduced.
For another example, in the case that the authorization length and the length of the data packet are represented by the total length of at least one unit packet, the total length of all unit packets in the data packet sent by the sending end is the same as the authorization length. For example, the grant length is y, and the grant length indicates that the receiving end grants the transmitting end to allow the transmitting end to transmit the unit message with the total length of y, and the transmitting end transmits at least one unit message to the receiving end based on the grant length, where the total length of the at least one unit message is y. Of course, the total length of the unit message sent by the sending end may also be smaller than the authorized length. Based on the mode, the receiving end can control the total length of the unit messages sent by the sending end, so that the number of the unit messages sent by the sending end cannot exceed the total length of the unit messages which can be processed by the receiving end, and the risk of congestion of the receiving end caused by excessive number of the messages sent by the sending end is reduced.
For another example, in the case that the authorization length is directly represented by the length of one data packet, the length of the data packet sent by the sending end is smaller than or equal to the authorization length.
In one possible implementation, the receiving end announces the authorization length to the sending end through a control message. For example, the sending end sends a message a to the receiving end, and when the receiving end receives the message a from the sending end, the receiving end generates a control message corresponding to the message a and sends the control message to the sending end, where the control message includes an authorization length. The transmitting end transmits a message B to the receiving end based on the authorization length in the control message. The control message achieves the function of informing the authorized length on one hand, and also achieves the function of confirming that the message A sent by the sending end in advance is received or feeding back the message A, which is equivalent to simultaneously confirming the prior message and informing the authorized length in one communication, thereby being beneficial to reducing the frequency and the cost of communication.
In an exemplary scenario, a transmitting end transmits a data message a to a receiving end, and when the receiving end receives the data message a from the transmitting end, the receiving end generates a control message corresponding to the data message a and transmits the control message to the transmitting end, wherein the control message includes an authorization length. The transmitting end transmits a data message B to the receiving end based on the authorization length in the control message. The control message achieves the function of informing the authorized length on one hand, and also achieves the function of confirming that the data message A sent by the sending end in advance is received, which is equivalent to simultaneously confirming that the data message sent by the last sending stage is received and informing the authorized length of the next sending stage in one communication, thereby reducing the times and the communication expenditure of communication and improving the communication efficiency.
In another exemplary scenario, a sending end sends a tunnel establishment request message to a receiving end, when the receiving end receives the tunnel establishment request message from the sending end, the receiving end generates a control message corresponding to the tunnel establishment request message and sends the control message to the sending end, wherein the control message comprises an authorization length. The transmitting end transmits the data message to the receiving end based on the authorization length in the control message. The control message achieves the function of informing the authorized length on one hand, and also achieves the function of confirming that the tunnel establishment request message sent by the sending end in advance is received, which is equivalent to simultaneously confirming the establishment of the tunnel and informing the authorized length of the data transmission stage in one communication, and the tunnel establishment stage and the data transmission stage are mutually related, so that the data transmission can be carried out after the tunnel establishment is successful without triggering the data transmission through an additional message.
In one possible implementation manner, the sending end sends a length to be sent to the receiving end, where the length to be sent is used to indicate a length of a data packet that the sending end needs to send to the receiving end, the receiving end can learn a data transmission requirement of the sending end based on the length to be sent, and the receiving end can use the received length to be sent as a trigger condition for sending an authorized length to the sending end. For example, the receiving end receives a message, and sends an authorized length to the sending end of the message in response to the message including the length to be sent, thereby triggering the sending end to transmit data to the receiving end. In this way, the risk of redundant communication flow caused by sending the authorization length to the sending end under the condition that the sending end does not have the data transmission requirement is reduced, the communication overhead is reduced, and in addition, the sending end can clearly indicate the length of the data message sent to the receiving end by sending the length to be sent.
In addition, in some implementations of the present application, unit messages are adopted as a basic unit for transmitting data messages by a transmitting end, and each data message transmitted by the transmitting end is a unit message, in other words, the length of each data message transmitted by the transmitting end is a standard length. For example, after the sending end generates the original data message, if the length of the original data message is greater than the length of the unit message, the sending end segments the original data message according to the length of the unit message to obtain at least one unit message; if the length of the original data message is smaller than that of the unit message, the sending end combines the plurality of original data messages to obtain at least one unit message. When the forwarding device forwards the data messages by adopting the load balancing algorithm, the data streams can be uniformly distributed to different forwarding paths, so that the number of the data messages transmitted by each forwarding path is basically the same, and the data quantity transmitted by each forwarding path is balanced because the lengths of the data messages are the same, thereby realizing the load balancing of each forwarding path in the network as much as possible.
Of course, the length of the individual data message sent by the sending end may be slightly smaller than the length of the unit message. For example, in all segmented messages obtained by segmenting an original data message by the transmitting end, the length of the last segmented message is slightly smaller than that of a unit message, or the length of the original data message is smaller than that of the unit message, but the number of the messages is small, the influence on the load balancing effect is small, and the influence can be almost ignored. For example, the length of the original data message is one kilobyte, the length of the unit message is 256 bytes, the transmitting end can divide the original data message into four messages, the lengths of the first three divided messages are all 256 bytes, and the length of the last message can be slightly smaller than 256 bytes.
In one possible implementation, by defining a tunneling protocol, the tunnel header carries information required by the receiving end to control the sending end to send data. For example, the tunnel header in the control message sent from the receiving end to the sending end includes the grant length. The tunnel header in the data message sent from the sending end to the receiving end comprises the length to be sent.
The tunnel header in the data message sent from the sending end to the receiving end may also include a protocol type. The protocol type is used for identifying the protocol corresponding to the service data encapsulated in the inner layer of the tunnel header in the data message. For example, the protocol type is transmission control protocol (transmission control protocol, TCP), user datagram protocol (user datagram protocol, UDP), remote direct memory access over ethernet (RDMA over converged ethernet, roCE), or the like.
The tunnel header in the data packet sent from the sender to the receiver may further include a sequence number (sequence number). The sequence number is used to identify the order of arrangement of at least one unit message in the data message. The sequence number in the tunnel header is similar to the sequence number in the TCP protocol. The sequence number is used to indicate the sequence of each unit message in the data message. After receiving a plurality of unit messages, the receiving end can acquire the sequence number carried by the tunnel header of each unit message, sort the unit messages according to the sequence number, and combine the sorted unit messages to acquire the original data message.
The tunnel header in the data packet sent from the sender to the receiver may further include an identifier (sender ID) of the sender. For example, the identification of the sender is used to identify the sender. For example, the identifier of the transmitting end includes an application identifier, where the application identifier is used to identify an application from which service data carried in a payload field of the data packet comes. Because the tunnel header carries the application identifier, in the scenario that a plurality of applications in the sending end transmit data to one receiving end in parallel, the receiving end can distinguish different applications based on the application identifier in the tunnel header, and different applications in two devices can be supported to transmit data through different tunnels.
The tunnel header in the data packet sent from the sending end to the receiving end may further include a first flag. The first flag is used for identifying whether the data message is a segmented message. For example, when the value of the first flag is the first value, the identification data message is a segmented message, and when the value of the first flag is the second value, the identification data message is a message which is not segmented. After the receiving end receives a message, if the value of the first flag is the first value, the receiving end can combine based on the message to recover the original data message. If the value of the first flag is the second value, the receiving end does not need to execute the step of merging for the message.
The tunnel header in the data packet sent from the sending end to the receiving end may further include a second flag. The second flag is used for identifying the last unit message in at least one unit message included in the data message transmitted in one sending stage. For example, when the value of the second flag is the first value, the identification message is the last unit message in the at least one unit message transmitted in one transmission stage, and when the value of the second flag is the second value, the identification message is not the last unit message in the at least one unit message transmitted in one transmission stage. After the receiving end receives a message, if the value of the second flag is the first value, the receiving end can determine that the sending end has transmitted the last unit message authorized to allow sending in the current sending stage to the local end, and the current sending stage is ended. If the value of the second flag is the second value, the receiving end can determine that the sending end still needs to continue transmitting the unit message.
The tunnel header in the data packet sent from the sending end to the receiving end may further include a third flag. The third flag is used for identifying the type of the first data message as a data message. After the receiving end receives a message, if the receiving end identifies a third mark in the tunnel header in the message, the receiving end can determine that the received message is a data message, and then the receiving end can further analyze the payload field of the inner layer package of the tunnel header, acquire service data carried by the payload field and perform service processing.
In one possible implementation, the processing and sending tasks are performed using the computing power of the intelligent network card in the computing device. For example, one or more of splitting the original data message, merging the original data message, encapsulating the tunnel header, decapsulating the tunnel header, merging the unit message into the original data message, and generating the control message is executed by the intelligent network card, so that the calculation force of the host is saved, the burden of the host is reduced, and the transmission process of the message is accelerated.
The system architecture of the embodiments of the present application is illustrated below.
Referring to fig. 1, fig. 1 is a schematic architecture diagram of a network system 10 according to an embodiment of the present application. The network system 10 has disposed therein a computing device 11a, a computing device 11b, a computing device 11c, a computing device 11d, a forwarding device 21, a forwarding device 22, and a forwarding device 23.
Computing device 11a, computing device 11b, computing device 11c, and computing device 11d may each be a server or a terminal. Each of computing devices 11a, 11b, 11c, and 11d may include a host computer in which an application is running and a smart card. Computing device 11a, computing device 11b, computing device 11c, and computing device 11d are communicatively coupled via forwarding device 21, forwarding device 22, and forwarding device 23.
Forwarding device 21, forwarding device 22, and forwarding device 23 are connected through network 31 and network 32. Each of forwarding devices 21, 22, and 23 is connected to one or more computing devices. The forwarding device 21, the forwarding device 22, and the forwarding device 23 may each be a network device such as a switch, a router, or a firewall. Alternatively, the network system 10 employs a leaf-spine (leaf-spine) architecture connection. Forwarding device 21, forwarding device 22, and forwarding device 23 are leaf switches, with spine (spine) switches deployed in both network 31 and network 32. Forwarding device 21, forwarding device 22, and forwarding device 23 deploy a load balancing algorithm. The load balancing algorithm is used for uniformly distributing the flow to each forwarding path, so that the quantity of the messages transmitted on each forwarding path is basically the same, and the load balancing of each forwarding path is realized.
The network system 10 shown in fig. 1 may be a data center network, and the computing devices 11a, 11b, 11c, and 11d may each be servers deployed in a data center.
Referring to fig. 2, fig. 2 is a flow chart of a data transmission method according to an embodiment of the present application. The method of fig. 2 may be performed interactively by computing device 11a with computing device 11d in network system 10 of fig. 1. For example, the role of the sender in the method of FIG. 2 is played by computing device 11a, and the role of the receiver is played by computing device 11 d.
In one possible implementation, after the application in the computing device 11a generates the service data, the intelligent network card configured by the computing device 11a and the intelligent network card configured by the computing device 11d perform the method shown in fig. 2 through interaction, so that the service data of the application of the computing device 11a is transmitted to the application of the computing device 11 d. In another possible implementation manner, the central processing unit (Central Processing Unit, CPU) configured by the computing device 11a and the CPU configured by the computing device 11d perform the method shown in fig. 2 interactively to transmit service data, and the hardware responsible for performing data transmission inside the computing device is not limited in this embodiment.
The method shown in fig. 2 comprises a tunnel establishment phase and a data transmission phase. The tunnel establishment phase includes steps S201 to S203. The data transmission phase comprises steps S211 to S216, optionally further comprises steps S221 to S226, optionally further comprises steps S2n1 to S2n6.
The data transmission stage in the embodiment of fig. 2 includes one or more stages, and steps S211 to S216 show the data transmission stage of the first transmission stage, steps S221 to S226 show the data transmission stage of the second transmission stage, and steps S2n1 to S2n6 show the data transmission stage of the nth transmission stage. For example, in the case where the amount of data to be transmitted is small, the data transmission stage may be composed of one transmission stage, and steps S221 to S226 and steps S2n1 to S2n6 are optional steps, and steps S221 to S226 and steps S2n1 to S2n6 may be omitted from execution; or, the data transmission stage is composed of two transmission stages, and steps S2n1 to S2n6 are optional steps, and steps S2n1 to S2n6 may be omitted from being performed; alternatively, in the case where the amount of data to be transmitted is large, the data transmission stage may include more than three transmission stages, and although not shown in the embodiment of fig. 2, the embodiment of fig. 2 further includes more data transmission stages, and any one of the data transmission stages may refer to the descriptions of steps S211 to S216.
The method of fig. 2 may be applied to a scenario in which multiple applications in the same computing device transmit traffic data to multiple applications in another computing device. For example, the method shown in fig. 2 is applied to a scenario in which a first application in the computing device 11a and a second application in the computing device 11a transmit service data to a first application in the computing device 11d and a second application in the computing device 11 d. In one possible implementation manner, after the first application in the computing device 11a generates the first service data and the second application generates the second service data, the intelligent network card configured by the computing device 11a and the intelligent network card configured by the computing device 11d execute steps S201 to S203 for the first application and the second application, so as to establish a first tunnel corresponding to the first application and a second tunnel corresponding to the second application, and the steps S211 to S216 enable the first service data of the first application of the computing device 11a to be transmitted to the first application of the computing device 11d through the first tunnel, and the second service data of the second application of the computing device 11a to be transmitted to the second application of the computing device 11d through the second tunnel.
The method illustrated in fig. 2 may be used in a scenario where multiple computing devices transmit data to one computing device. For the convenience of the reader, the method of FIG. 2 is illustrated by way of example in which computing device 11a interacts with computing device 11 d. The flow of interactions of computing devices 11d with computing devices 11d other than computing device 11a may refer to the flow of interactions of computing device 11a with computing device 11 d.
In step S201, the computing device 11a generates a tunnel establishment request message.
In step S202, the computing device 11a transmits a tunnel establishment request message to the computing device 11d.
The type of the tunnel establishment request message is a control message. The tunnel establishment request message may be a first control message transmitted when the transmitting end interacts with the receiving end. The tunnel establishment request message is used for requesting establishment of a tunnel for transmitting data, one end point of the tunnel is the computing device 11a, and the other end point of the tunnel is the computing device 11d. The tunnel may pass through one or more forwarding devices, such as forwarding device 21 and forwarding device 23 in fig. 1.
The tunnel is used to transport data messages between computing device 11a and computing device 11d. Alternatively, different applications in the computing device 11a and the computing device 11d correspond to different tunnels, and the computing device 11a and the computing device 11d respectively establish a tunnel for each application to which data is to be transmitted, so that data of different applications is transmitted through different tunnels. For example, computing device 11a includes a first application and a second application, computing device 11d includes a first application and a second application, a first tunnel is established for the first application of computing device 11a and the first application of computing device 11d, and a second tunnel is established for the second application of computing device 11a and the second application of computing device 11d.
The tunnel establishment request message may include a length 1 to be sent. The to-be-transmitted length 1 is used to indicate the length of the data message that the computing device 11a needs to transmit to the computing device 11 d. The computing device 11a may determine the length to be transmitted 1 based on the data amount of the traffic data. Optionally, the computing device 11a determines the length to be transmitted 1 based on the data amount of the traffic data and the length of the tunnel header.
In one possible implementation, the length to be sent 1 is represented by the number of unit messages. For example, the length to be sent 1 is k, which indicates that the computing device 11a needs to send k unit messages, and k is a positive integer. In one possible implementation, the application or the operating system of the computing device 11a issues service data to the intelligent network card of the computing device 11a, and the intelligent network card of the computing device 11a determines the length 1 to be sent based on the data amount of the service data.
The tunnel establishment request message may include information of the computing device 11a to synchronize the information of the computing device 11a to the computing device 11d, facilitating the computing device 11d to establish a tunnel with the computing device 11a based on the information of the computing device 11 a. The tunnel establishment request message may include a tunnel header. The tunnel header includes information of computing device 11 a.
The information of the computing device 11a is, for example, an identification of the computing device 11a. The identity of computing device 11a is used to identify computing device 11a. The identification of the computing device 11a may also include an identification of the application on the computing device 11a that generated the original data message. The information of computing device 11a may also include the length of unit messages configured on computing device 11a. The computing device 11a sends the configured length of the unit message to the computing device 11d, so that the computing device 11a and the computing device 11d determine the length of the unit message that should be transmitted in the data transmission stage in a negotiation manner.
In step S203, the computing device 11d receives the tunnel establishment request message from the computing device 11a.
In one possible implementation, computing device 11d initializes a receive queue to receive data packets from computing device 11a via the receive queue.
Optionally, the computing device 11d also sends a response message to the computing device 11a, and the computing device 11d is instructed to acknowledge receipt of the channel establishment request message by the response message.
The process flow of the tunnel establishment phase is described above through steps S201 to S203, and the data transmission flow of the first transmission phase is exemplified below through steps S211 to S216.
In step S211, the computing device 11d generates a control message 1.
In step S212, the computing device 11d sends the control message 1 to the computing device 11 a.
The control message 1 is used to instruct the computing device 11a to transmit data. Wherein computing device 11d determines authorization length 1. The computing device 11d generates a control message 1 based on the grant length 1, the control message 1 including the grant length 1. Optionally, in the case of the message format provided in fig. 4, the computing device 11d writes the grant length 1 to a grant length (grant size) field in the control message header, and further encapsulates the UDP header and the IP header into an outer layer of the control message header, thereby generating the control message 1.
The grant length 1 is used to indicate the length of data messages that the computing device 11d grants permission for the computing device 11a to transmit in the first transmission phase. The computing device 11d transmits the control message 1 including the grant length 1 to the computing device 11a, so that the grant length 1 is transmitted to the computing device 11a, so that the computing device 11a knows the length of the data message capable of being transmitted to the computing device 11d in the first transmission stage and the data message capable of being transmitted in the first transmission stage based on the grant length 1, and thus controls the data transmission behavior of the computing device 11a in the first transmission stage.
Optionally, when the control message 1 is a control message transmitted in the first sending stage, the control message 1 is a response message for the tunnel establishment request message. Control message 1 indicates receipt of the tunnel establishment request message so that computing device 11a knows that the tunnel establishment request message has arrived successfully at computing device 11d. The control message 1 may instruct the computing device 11d to confirm establishment of the tunnel between the computing device 11d and the computing device 11 a. For example, the control packet 1 includes an acknowledgement number (ACK number) corresponding to the sequence number in the tunnel establishment request packet, and the reception of the tunnel establishment request packet is indicated by the ACK number.
Optionally, when the control message 1 is a control message transmitted in a transmission phase other than the first transmission phase, the control message 1 indicates that a data message transmitted in a previous transmission phase is received.
Illustratively, the to-be-transmitted length 1 is greater than the grant length 1. Illustratively, the grant length 1 is represented by the number of unit messages. The to-be-sent length 1 is k, which indicates that the computing device 11a needs to send k unit messages, the authorized length 1 is y1, which indicates that the computing device 11d allows the computing device 11a to send y1 unit messages, and y1 is a positive integer less than or equal to k.
In one possible implementation, computing device 11d determines whether to add the identity of computing device 11a to the sending host list based on length to send 1. For example, when in the first transmission stage, the computing device 11d acquires the length to be transmitted 1 carried by the tunnel establishment request message, and the computing device 11d determines whether to add the identifier of the computing device 11a to the transmission host list based on the length to be transmitted 1. When the transmission phase is other than the first transmission phase, the computing device 11d acquires the length to be transmitted in the data message of the previous transmission phase, and the computing device 11d determines whether to add the identification of the computing device 11a to the transmission host list or delete the identification of the computing device 11a from the transmission host list based on the length to be transmitted in the data message of the previous transmission phase.
In one possible implementation of determining whether to add the identity of the computing device 11a to the sending host list based on the length to send 1, when in the first sending phase, the computing device 11d determines whether to add the identity of the computing device 11a to the sending host list based on the length to send 1 and the grant length 1 in the control message 1. When other transmission phases than the first transmission phase are performed, the computing device 11d determines whether to add the identity of the computing device 11a to the transmission host list based on the length to be transmitted 1 and the authorized length in the control message of the last transmission phase.
For example, in the first transmission stage, it is determined whether to add the identity of the computing device 11a to the transmission host list, the computing device 11d compares the length to be transmitted 1 with the authorized length 1. If the length to be sent 1 is greater than the authorized length 1, it indicates that the computing device 11d needs to continue sending data after authorizing the computing device 11a to send the data message corresponding to the authorized length 1 through the control message 1 this time, so that the computing device 11d adds the identifier of the computing device 11a to the last position of the sending host list. As another example, the computing device 11d calculates a difference between the length to be transmitted 1 and the grant length 1. The computing device 11d determines whether the difference between the length to be transmitted 1 and the grant length 1 is greater than 0. If the difference between the length to be sent 1 and the grant length 1 is greater than 0, the computing device 11d determines that the computing device 11a still needs to continue sending data, and the computing device 11d adds the identity of the computing device 11a to the last position of the sending host list.
In one possible implementation, the computing device 11d determines the length of the unit message. The computing device 11d generates a control message 1 based on the length of the unit message. The control message 1 also includes the length of the unit message configured on the computing device 11 d. The length of the unit message is carried in the control message (control message 1) transmitted in the first transmission stage, so that the function of negotiating the length of the unit message between the receiving end and the transmitting end is realized, the computing device 11a serving as the transmitting end can learn the length of the unit message based on the received control message 1 when data is transmitted subsequently, the realization complexity brought by configuring the length of the unit message at the transmitting end is reduced, and the flexibility is improved.
In step S213, the computing device 11a receives the control message 1 from the computing device 11 d.
In one possible implementation, the computing device 11d determines the length of the unit message. The computing device 11d generates a control message 1 based on the length of the unit message. The control message 1 also includes the length of the unit message configured on the computing device 11 d. The computing device 11a acquires the length of the unit message carried in the control message 1. If the length of the unit message carried in the control message 1 is consistent with the length of the unit message configured on the computing device 11a, the computing device 11a may use the length of the unit message configured on the computing device 11a as the length of the unit message that is subsequently transmitted to the computing device 11 d. If the length of the unit message carried in the control message 1 is inconsistent with the length of the unit message configured on the computing device 11a, the computing device 11a adopts the length of the unit message carried in the control message 1 as the length of the unit message subsequently transmitted to the computing device 11 d. In other words, the data transmission is based on the length of the unit message configured on the computing device 11 d.
In step S214, the computing device 11a generates the data packet 1 based on the authorization length 1.
In step S215, the computing device 11a sends the data packet 1 to the computing device 11 d.
The length of the data message 1 satisfies the grant length 1. The following is an illustration in conjunction with both cases.
The first case, the grant length 1 indicates the number of unit messages that the computing device 11d allows the computing device 11a to transmit in the first transmission stage of the data transmission flow; accordingly, the data message 1 sent by the computing device 11a based on the authorization length 1 includes one or more unit messages, and the number of unit messages in the data message 1 is the same as the authorization length 1. For example, the grant length 1 is y1, the data packet 1 includes y1 unit packets, and y1 is a positive integer. The data message 1 may be composed of unit messages entirely, or the length of individual messages in the data message 1 is smaller than the length of the unit messages.
In one possible implementation, each time computing device 11a sends a unit message to computing device 11d, computing device 11a decrements grant length 1 by one and waits for transmission length 1 by one. The computing device 11a determines whether the value of the authorized length 1 is zero and whether the value of the length 1 to be transmitted is zero. When the grant length 1 is not zero and the value of the length 1 to be sent is not zero, the computing device 11a continues to send a unit message to the computing device 11 d. When the grant length 1 is 0 and the value of the length 1 to be sent is not zero, the computing device 11a pauses sending the unit message to the computing device 11d, and stores the remaining unit messages which are not sent in the buffer space of the computing device 11a, waiting for the control message from the computing device 11d for the data message 1.
Case two, grant length 1 indicates the total length of unit messages that computing device 11d allows computing device 11a to transmit in the first transmission phase; accordingly, the data packet 1 sent by the computing device 11a based on the grant length 1 includes one or more unit packets, for example, the grant length 1 is y1, the data packet 1 includes k unit packets, the length of each unit packet in the k unit packets is m bytes, k×m=y1, k is a positive integer, and y1 is a positive integer.
In one possible implementation, the data packet 1 is obtained by splitting or merging the original data packets based on the length of the unit packet. Illustratively, computing device 11a compares the lengths of the original data messages and the unit messages. When the length of the original data packet is greater than the length of the unit packet, the computing device 11a segments the original data packet based on the length of the unit packet, so as to obtain the data packet 1. When the length of the original data message is smaller than the length of the unit message, the computing device 11a merges the plurality of original data messages so as to obtain the data message 1. In one possible implementation, computing device 11a merges multiple original data messages from the same application and with the same flow identification to obtain data message 1. The flow identification is used to identify the data flow. The flow identification is, for example, a five tuple, a three tuple, a seven tuple, a flow label, or other information capable of identifying the flow. The five-tuple includes a source IP address, a source port number, a destination IP address, a destination port number, and a transport layer protocol number. The seven-tuple includes an interface index, a source IP address, a destination IP address, a source port number, a destination port number, a transport layer protocol, and a service type. The triplet includes a source IP address, a destination IP address, and a transport layer protocol.
In one possible implementation, when the computing device 11a segments or merges the original data packet, the computing device specifically segments or merges the service data in the original data packet. For example, the original data packet includes a header and a payload field, and the computing device 11a segments or merges the payload field in the original data packet based on the length of the unit packet, and retains the header in the original data packet to obtain the data packet 1, where the data packet 1 includes the header in the original data packet and part of the service data in the original data packet. For example, the computing device 11a segments the original data message into k unit messages, each of the k unit messages including a header in the original data message and 1/k service data in the original data message.
In one possible implementation, the data packet 1 includes a tunnel header. The tunnel header is generated by computing device 11a and encapsulated into data packet 1. The tunnel header may be encapsulated in the outer layer of the segmented message or the merged message. The tunnel header is used for the forwarding device to forward data message 1 to computing device 11d. For example, the tunnel header includes an internet protocol header (internet protocol header, IP header), UDP header, and data packet header (data packet header). The IP header includes a source internet protocol (internet protocol, IP) address (IP address of the computing device 11 a) and a destination address (IP address of the computing device 11 d). The IP header is used for the forwarding device to forward the data packet 1 to the computing device 11d based on the IP address of the computing device 11d. The IP header may be an Internet protocol version 4 (internet protocol version, IPv 4) header or an Internet protocol version 6 (internet protocol version, IPv 6) header. The port number in the UDP header is used for the forwarding device to determine the forwarding path of the data packet 1 by using a load balancing algorithm. The port number in the tunnel header in each unit message in data message 1 may be different, so that the forwarding device forwards different unit headers through different paths based on the port number, so that the data streams transmitted on different paths are balanced. The data header is used for reception processing by the computing device 11d. For example, the data packet header includes an identification (sender ID) of the computing device 11a. Since the tunnel header includes the identifier of the computing device 11a, the computing device 11d may determine, according to the identifier of the computing device 11a, that the sender corresponding to the data packet 1 is the computing device 11a. In the case where multiple senders transmit data messages to the computing device 11d, the computing device 11d may distinguish between data messages from different senders based on their identities. The tunnel header may also include a sequence number. The sequence number in the tunnel header in each unit message in data message 1 may be different. The sequence number is used to indicate the sequence of each unit message in the data message 1, so that the computing device 11d merges each data message after segmentation based on the sequence number field of each data message after segmentation.
In one possible implementation, each unit message in data message 1 includes a tunnel header. Computing device 11a may generate a corresponding tunnel header for each unit message and encapsulate the corresponding tunnel header in each unit message.
The act of splitting the original data message and the act of tunneling header encapsulation may be performed in combination. Illustratively, the computing device 11a segments the original data packet based on the length of the unit packet and the length of the tunnel header to obtain a plurality of segmented packets, where the length of each segmented packet is the difference between the length of the unit packet and the length of the tunnel header; the computing device 11a adds a tunnel header to each of the plurality of segmented messages, respectively, to obtain a plurality of unit messages, where each of the plurality of unit messages includes the segmented message and the tunnel header. Each unit message of the plurality of unit messages may constitute a data message 1.
In one possible implementation, the computing device 11a parses the control message 1 to obtain the length of the unit message carried in the control message 1. The computing device 11a generates a data message 1 based on the length of the unit message and the grant length 1.
In one possible implementation, the length m of the unit message and the length k of the tunnel header are configured on the computing device 11 a. The computing device 11a segments the original data message according to the configured length m of the unit message and the length k of the tunnel header, so that the length of each segmented message in the multiple segmented messages is (m-k), and therefore the length of the message obtained by adding the tunnel header to the segmented message is the length m of the unit message. Illustratively, the tunnel header includes an IP header, a UDP header, and data packet header, and the length k of the tunnel header is, for example, the sum of the length of the IP header, the length of the UDP header, and the length of data packet header.
The act of merging the original data packets and the act of tunneling header encapsulation may be performed in combination. Illustratively, when the length of the original data packet is smaller than the length of the unit packet, the computing device 11a merges the plurality of original data packets based on the length of the unit packet and the length of the tunnel header, to obtain a merged packet, where the length of the merged packet is the difference between the length of the unit packet and the length of the tunnel header. The computing device 11a adds a tunnel header to the combined message to obtain a unit message. The unit message comprises a combined message and a tunnel header.
In one possible implementation, an application running in computing device 11a generates the original data message. Alternatively, the operating system of computing device 11a generates the original data message.
In one possible implementation, the data message 1 includes a length to be sent 2. The length to be transmitted 2 is used to indicate the length of the data packet that the computing device 11a needs to further transmit to the computing device 11d in addition to the data packet 1. Illustratively, data message 1 includes a tunnel header, the data message header in the tunnel header including the length to be sent 2. The computing device 11a sends the length to be sent to the computing device 11d, so that the computing device 11d is informed of how long data needs to be transmitted to the computing device 11d, and the computing device 11d can conveniently judge whether to continue to authorize the permission sending end to send data based on the length to be sent.
In one possible implementation, the length to be transmitted 2 is updated by the computing device 11a by the length to be transmitted 1. For example, the length to be transmitted 2 is obtained by updating the length to be transmitted 1 by the computing device 11a based on the length of the service data that is retrieved after the tunnel establishment request message is transmitted and the length of the data message 1. For example, the length to be sent 1 carried in the tunnel establishment request packet is k1, where the length to be sent 1 indicates that the computing device 11a needs to send k1 unit packets, the length of the data packet 1 is equal to the total length of y1 unit packets, the computing device 11a regains service data that needs to be transmitted to the computing device 11d after sending the tunnel establishment request packet, the length of the regained service data is equal to the total length of p1 unit packets, the length to be sent 2 may be (k 1-y1+p1), where k1 is a positive integer, y1 is a positive integer, and p1 is a positive integer greater than or equal to 0. The computing device 11a updates the length to be sent, and sends the updated length to be sent to the computing device 11d in a data message, so that the computing device 11d can be accurately informed of the data quantity required to be sent, and the computing device 11d can continuously control the data transmission behavior of the computing device 11 a.
In one possible implementation, after sending the tunnel establishment request message to the computing device 11d, the computing device 11a application issues service data to the intelligent network card of the computing device 11 a. The intelligent network card of the computing device 11a updates the length to be sent 1 based on the length of the service data issued by the application, and obtains the length to be sent 2. The step of updating the length to be sent is executed by the intelligent network card, so that the calculation force of a host is saved.
Optionally, each unit message in the data message 1 includes a length to be sent 2. Or, the first unit message in the data message 1 includes the length 2 to be sent, and the other unit messages except the first unit message in the data message 1 omit the length 2 to be sent. Or, the last unit message in the data message 1 includes the length 2 to be sent, and the other unit messages except the last unit message in the data message 1 omit the length 2 to be sent.
In step S216, the computing device 11d receives the data packet 1 from the computing device 11 a.
In one possible implementation, the data packet 1 includes at least one unit packet, each unit packet includes a segmented packet, and the computing device 11d merges the segmented packets in the at least one unit packet to obtain an original data packet.
In one possible implementation, the data packet 1 includes at least one unit packet, where the at least one unit packet includes a combined packet. The computing device 11d segments the combined message in the at least one unit message to obtain an original data message.
In one possible implementation, the data packet 1 includes a tunnel header. The computing device 11d decapsulates the tunnel header from the data message 1 such that the data message 1 is restored from the encapsulation format specified by the tunnel protocol to the encapsulation format of the original data message.
The action of merging the segmented messages and the action of decapsulating the tunnel header can be performed in combination. For example, the data packet 1 includes at least one unit packet, where each unit packet in the at least one unit packet includes a tunnel header, and the computing device 11d decapsulates the tunnel header from each unit packet in the data packet 1 to obtain a plurality of segmented packets. The computing device 11d merges the plurality of segmented messages to obtain the original data message.
The action of splitting the combined message and the action of decapsulating the tunnel header can be performed in combination. For example, the data packet 1 includes at least one unit packet, where each unit packet in the at least one unit packet includes a tunnel header, and the computing device 11d decapsulates the tunnel header from each unit packet in the data packet 1 to obtain a combined packet. The computing device 11d segments the combined message to obtain the original data message.
In one possible implementation, the computing device 11d also performs an act of ordering the messages before performing an act of merging the split messages or an act of splitting the merged messages. For example, the computing device 11d obtains the sequence number carried by the tunnel header in each unit message in the plurality of unit messages, sorts each unit message according to the sequence from small to large, and merges the segmented messages in the sorted plurality of unit messages to obtain the original data message.
Considering that in the process of forwarding the message, the forwarding device may forward different unit messages in the data message 1 onto different forwarding paths, where the unit messages on the different forwarding paths may arrive at the computing device 11d sequentially at different times, so that the sequence of the plurality of unit messages received by the computing device 11d is inconsistent with the sequence of the plurality of unit messages sent by the computing device 11a, which causes a risk of data processing errors of the computing device 11 d. And the sequence of the unit messages after sequencing is consistent with the sequence of the unit messages sent by the computing equipment 11a by sequencing the unit messages according to the sequence numbers, so that the risk of data processing errors caused by disorder is reduced.
The data transmission flow of the second transmission stage is exemplified by steps S221 to S226. The data transmission procedure of the second transmission stage is mainly described as different from the data transmission procedure of the first transmission stage, and please refer to steps S211 to S216 for the same and similar parts between the data transmission procedure of the second transmission stage and the data transmission procedure of the first transmission stage. For example, the implementation details of step S221 may refer to step S211, the implementation details of step S222 may refer to step S212, the implementation details of step S223 may refer to step S213, and the implementation details of step S226 may refer to step S216.
In step S221, the computing device 11d generates a control message 2.
In step S222, the computing device 11d sends the control message 2 to the computing device 11 a.
In one possible implementation, the computing device 11d determines the transmission object of the control message based on the transmission host list. For example, the computing device 11d determines the device identifier that is first in the host list, and uses the device indicated by the device identifier as the transmission object of the control message. Step S222 is described taking the first device in the sending host list as the computing device 11a as an example, and for example, the computing device 11d sends the control message 2 to the computing device 11a in response to determining that the first device in the sending host list is the computing device 11 a. For another example, in the case where the first device identifier in the sending host list is the computing device 11b, the computing device 11d sends the control message 2 to the computing device 11b in response to determining that the first device identifier in the sending host list is the computing device 11b, and the sending object of the control message 2 is not limited in this embodiment.
The control message 2 includes an grant length 2. The grant length 2 is used to indicate the length of a data message that the computing device 11d is authorized to allow the computing device 11a to transmit to the computing device 11d in the second transmission phase. The computing device 11d transmits the control message 1 including the grant length 2 to the computing device 11a, so that the grant length 2 is transferred to the computing device 11a, so that the computing device 11a can learn, based on the grant length 2, the length of the data message capable of being transmitted to the computing device 11d in the second transmission stage and the length of the data message capable of being transmitted in the second transmission stage, so as to control the data transmission behavior of the computing device 11a in the second transmission stage.
Optionally, the control message 2 is used as a control message transmitted in the 2 nd sending stage, and the control message 2 is a response message for the data message 1. Control message 2 instructs computing device 11d to acknowledge receipt of data message 1 so that computing device 11a knows that data message 1 has arrived successfully at computing device 11d. For example, the control packet 2 includes an acknowledgement number (ACK number) corresponding to the sequence number in the data packet 1, and the ACK number indicates that the data packet 1 is received.
In one possible implementation, computing device 11d sends control message 2 to computing device 11a based on the send host list. For example, computing device 11d polls each host in the list of sending hosts. When computing device 11a is polled in the send host list, computing device 11d sends control message 2 to computing device 11a and continues to poll the next device in the send host list outside of computing device 11 a.
In one possible implementation, computing device 11d determines whether to rejoin the identity of computing device 11a to the sending host list based on length to send 2. Processing logic that determines whether to add the identity of computing device 11a to the send host list again based on the length to send 2 please refer to step S211. In addition, if the length to be transmitted 2 is less than or equal to the grant length 2, which indicates that after the computing device 11a transmits the data packet corresponding to the grant length 2, all the data that the computing device 11a needs to transmit has been transmitted to the computing device 11d, in other words, the second transmission phase is the last transmission phase, so that the computing device 11d deletes the identity of the computing device 11a from the transmission host list.
In step S223, the computing device 11a receives the control message 2 from the computing device 11 d.
In step S224, the computing device 11a generates the data packet 2 based on the authorization length 2 carried by the control packet 2.
In step S225, the computing device 11a sends the data packet 2 to the computing device 11 d.
The data message 2 satisfies the grant length 2. The following is an illustration in conjunction with both cases.
The first case, the grant length 2 indicates the number of unit messages that the computing device 11d allows the computing device 11a to transmit in the second transmission stage of the data transmission flow; accordingly, the data message 2 sent by the computing device 11a based on the authorization length 2 includes one or more unit messages, and the number of unit messages in the data message 2 is the same as the authorization length 2. For example, the grant length 2 is y2, the data packet 2 includes y2 unit packets, and y2 is a positive integer. The data message 2 may be composed of unit messages entirely, or the length of individual messages in the data message 2 is smaller than the length of the unit messages.
In one possible implementation, each time computing device 11a sends a unit message to computing device 11d, computing device 11a decrements grant length 2. When the grant length 2 is not 0, computing device 11a continues to send a unit message to computing device 11 d. When the grant length 2 is 0, the computing device 11a pauses sending unit messages to the computing device 11d, and stores the remaining unit messages which are not sent in the buffer space of the computing device 11a, and waits for a control message for the data message 2 from the computing device 11 d.
Case two, grant length 2 indicates the total length of unit messages that computing device 11d allows computing device 11a to transmit in the second transmission phase; accordingly, the data message 2 sent by the computing device 11a based on the authorization length 2 includes one or more unit messages, and the total length of the unit messages in the data message 2 is the same as the authorization length 2. For example, the grant length 2 is y2, the data packet 2 includes k unit packets, the length of each unit packet in the k unit packets is m bytes, k=y2, k is a positive integer, and y2 is a positive integer.
The data message 2 may be obtained by splitting or merging the original data message based on the length of the unit message, and details of splitting or merging the original data message may refer to a description corresponding to the data message 1.
The data message 2 includes a length to be transmitted 3. The to-be-transmitted length 3 is used to indicate the length of the data packet that the computing device 11a needs to further transmit to the computing device 11d in addition to the data packet 2. Illustratively, the data message 2 includes a tunnel header, and the data message header in the tunnel header includes a length to be transmitted 3.
In one possible implementation, the length to be sent 3 is updated by the computing device 11a by the length to be sent 2. For example, the length to be transmitted 3 is obtained by updating the length to be transmitted 2 by the computing device 11a based on the length of the service data retrieved after transmitting the data packet 1 and the length of the data packet 2. For example, the length to be sent 2 carried in the data packet 1 is k2, where the length to be sent 2 indicates that the computing device 11a needs to send k2 unit packets in addition to the data packet 1, the length of the data packet 2 is equal to the total length of y2 unit packets, the computing device 11a regains service data that needs to be transmitted to the computing device 11d after sending the data packet 1, the length of the regained service data is equal to the total length of p2 unit packets, the length to be sent 2 may be (k 2-y2+p2), where k2 is a positive integer, y2 is a positive integer, and p2 is a positive integer greater than or equal to 0. The computing device 11a updates the length to be sent, and sends the updated length to be sent to the computing device 11d in a data message, so that the computing device 11d can be accurately informed of the data quantity required to be sent, and the computing device 11d can continuously control the data transmission behavior of the computing device 11 a.
In one possible implementation, after the computing device 11a sends the data packet 1, the application of the computing device 11a may issue the service data to the intelligent network card of the computing device 11 a. The intelligent network card of the computing device 11a may determine the length of the service data issued by the application after sending the data packet 1. The intelligent network card of the computing device 11a updates the length to be sent 2 based on the length of the service data issued by the application, and obtains the length to be sent 3.
In one possible implementation, after sending the data packet 1, if the computing device 11a obtains service data that needs to be further transmitted to the computing device 11d, the computing device 11a caches the service data in the memory, and waits for a control packet from the computing device 11 d. When receiving the control message 2 from the computing device 11d, the computing device 11a encapsulates the buffered service data into the data message 2, and sends the previously buffered service data through the data message 2, thereby reducing the risk of congestion caused by insufficient capability of the computing device 11d for receiving and processing the service data, and facilitating orderly communication between the computing device 11a and the computing device 11 d. The computing device 11a may cache the service data to be sent in the memory of the host, or may cache the service data to be sent in the memory of the intelligent network card configured in the computing device 11 a.
In step S226, the computing device 11d receives the data packet 2 from the computing device 11 a.
The processing manner of the data packet 2 by the computing device 11d is similar to that of the data packet 1, and reference may be made to the description of the processing manner of the data packet 1 in step S212.
The data transmission phases of the two transmission phases are shown above by steps S211 to S216 and steps S221 to S226. By analogy, the data transmission phase of any one of the transmission phases may include: the computing device 11d sends a control message containing the authorization length, and then the computing device 11a sends a data message to the computing device 11d based on the authorization length, where the data message includes a length to be sent corresponding to a next sending stage, until all the service data to be sent by the computing device 11a has been transmitted to the computing device 11d.
The data transfer phase of the last transmission phase is described below. The last transmission phase is described using "transmission phase n", the control message transmitted by the last transmission phase computing device 11d is described using "control message n", the data message transmitted by the last transmission phase computing device 11a is described using "data message n", n is a positive integer greater than or equal to 1.
In step S2n1, the computing device 11d generates a control message n.
In step S2n2, the computing device 11d sends a control message n to the computing device 11 a.
In one possible implementation, the computing device 11d determines the transmission object of the control message based on the transmission host list. For example, the computing device 11d determines the device identifier that is first in the host list, and uses the device indicated by the device identifier as the transmission object of the control message. Step S2n2 illustrates taking the first device in the sending host list as the computing device 11a as an example, where, for example, the computing device 11d sends the control message n to the computing device 11a in response to determining that the first device in the sending host list is the computing device 11 a. For another example, in the case where the first device identifier in the sending host list is the computing device 11b, the computing device 11d sends the control message n to the computing device 11b in response to determining that the first device identifier in the sending host list is the computing device 11b, and the sending object of the control message n is not limited in this embodiment.
In one possible implementation, computing device 11d determines the authorization length n. The computing device 11d generates a control message n based on the grant length n, the control message n including the grant length n.
The grant length n is used to indicate the length of the data message that the computing device 11d grants permission for the computing device 11a to transmit in the last transmission phase (transmission phase n). The transmission phase n refers to a period from when the computing device 11a receives the control message n until when the computing device 11a ends transmitting the data message n according to the grant length n in the control message n. The control message n may be a response message to the data message (n-1). The control message n may instruct the computing device 11d to acknowledge receipt of the data message (n-1) so that the computing device 11a knows that the data message (n-1) has arrived successfully at the computing device 11d. The control message n may be used to control the data transmission behaviour of the computing device 11a in the nth transmission phase. For example, the control message n may be used to control the timing at which the computing device 11a transmits the data message in the nth transmission stage and the length of the data message transmitted by the computing device 11a in the nth transmission stage.
In step S2n3, the computing device 11a receives the control message n from the computing device 11d.
In step S2n4, the computing device 11a generates a data packet n based on the authorization length n carried by the control packet n.
In step S2n5, the computing device 11a sends a data packet n to the computing device 11d.
The length of the data message n is matched with the authorized length n. In one possible implementation, the authorization length n indicates the number of unit messages that the computing device 11d allows the computing device 11a to send, and the data message n includes one or more unit messages, where the number of unit messages in the data message n is the same as the authorization length n.
In one possible implementation, after the computing device 11a obtains the grant length n, each time the computing device 11a sends a unit message to the computing device 11d, the computing device 11a subtracts 1 from the grant length n and subtracts one from the length n to be sent. When the grant length n is not zero and the value of the length n to be sent is not zero, the computing device 11a continues to send a unit message to the computing device 11 d. When the grant length n is 0 and the value of the length n to be sent is also zero, the computing device 11a ends sending the message to the computing device 11d, the computing device 11a may end the data transmission procedure, and the computing device 11a may release the tunnel with the computing device 11 d.
In step S2n6, the computing device 11d receives the data message n from the computing device 11 a.
In one possible implementation, the computing device 11d parses the data packet n to obtain the length n to be sent carried in the data packet n. The computing device 11d determines that the authorization length n carried in the control message n is greater than the length n to be transmitted, and the computing device 11d determines that the nth stage is the last transmission stage, so the computing device 11d deletes the identity of the computing device 11a from the list of transmitting hosts. The computing device 11d waits for the last unit message in the data message n to be transmitted to the computing device 11d, at which time the computing device 11a has no data to be transmitted, and the computing device 11d does not need to add the computing device 11a to the transmitting host list.
According to the method provided by the embodiment, the computing device 11d can flexibly control the time for transmitting data by the transmitting end and the length of the data transmitted by the transmitting end through the transmitting control message, so that the probability that the computing device 11d is congested due to the fact that the data cannot be received due to the fact that the length of the data transmitted by the transmitting end is too long and the frequency of the data transmitted by the transmitting end is too frequent is reduced, the time for transmitting the data by the transmitting end is matched with the processing capacity and the buffer space of the computing device 11d as much as possible, and the probability that the situation that the buffer of the computing device 11d overflows due to the fact that the data is excessively transmitted by the transmitting end is reduced.
The method of FIG. 2 is further described below in connection with the main components of a computing device. Referring to fig. 3, fig. 3 is a schematic structural diagram of a computing device 11 according to an embodiment of the present application. The computing devices 11a, 11b, 11c, and 11d in the network system 10 shown in fig. 1 may have the structure shown in fig. 3. Computing device 11a and computing device 11d may perform the method of fig. 2 using the structure of fig. 3.
The computing device 11 shown in fig. 3 includes a host 111 and a smart network card 112. The host 111 and the intelligent network card 112 may be connected by a bus. For example, the host 111 and the intelligent network card 112 are optionally connected via a peripheral component interconnect express data transfer bus (peripheral component interconnect express, PCIe). For example, host 111 includes PCIe interface 1113, intelligent network card 112 includes PCIe interface 160, and PCIe interface 1113 of host 111 is connected to PCIe interface 160 of intelligent network card 112.
Host 111 includes application 1111 and memory 1112. The application 1111 is used to generate the original data message. The memory 1112 is used for buffering the original data message.
The intelligent network card 112 includes at least one of a data transmitting device 120 or a data receiving device 130.
The data transmitting apparatus 120 is configured to perform steps performed by the transmitting end in the data transmission method (e.g., steps performed by the computing device 11a in the method shown in fig. 2). The data transmitting apparatus 120 includes a transmission control module 124 and a message parsing module 125. The data receiving apparatus 130 is configured to perform steps performed by the receiving end in the data transmission method (e.g., steps performed by the computing device 11d in the method shown in fig. 2). The data receiving apparatus 130 includes a control message generating module 136 and a message parsing module 135.
In the case where the intelligent network card 112 is used to perform a data transmission procedure performed by a transmitting end (e.g., the step performed by the computing device 11a in the method shown in fig. 2) and also used to perform a data transmission procedure performed by a receiving end (e.g., the step performed by the computing device 11d in the method shown in fig. 2), the intelligent network card 112 may be provided with the data transmitting apparatus 120 and the data receiving apparatus 130. In the case where the intelligent network card 112 is used to perform the data transmission procedure performed by the transmitting end, the intelligent network card 112 does not need to perform the data transmission procedure performed by the receiving end, the data transmitting device 120 may be provided in the intelligent network card 112 and the data receiving device 130 may be omitted. In the case where the intelligent network card 112 is used to perform the data transmission procedure performed by the receiving end, the intelligent network card 112 does not need to perform the data transmission procedure performed by the transmitting end, the data receiving apparatus 130 may be provided in the intelligent network card 112 and the data transmitting apparatus 120 may be omitted.
The message parsing module 125 is configured to parse a control message from the receiving end, and obtain an authorization length of a message carried in the control message, so as to perform subsequent processing on the message based on the authorization length. Optionally, the message parsing module 125 is further configured to parse a type of a message or an attribute of the message carried in the control message, so as to perform subsequent processing on the message based on the type of the message or the attribute of the message.
The transmission control module 124 is configured to control a transmission process of the data packet based on the authorization length. For example, the transmission control module 124 continuously transmits the unit message according to the grant length until the total length of the unit message transmitted in one transmission stage reaches the grant length, so as to implement using the grant length to block the transmission message, where the block transmission message refers to transmitting the data message under the control of the receiving end, instead of optionally transmitting the data message.
Optionally, the data sending device 120 further includes a sending message buffering module 122. The transmitted message buffer module 122 is configured to buffer a message to be transmitted. In one possible implementation manner, the computing device serving as the sending end does not receive the control message from the computing device serving as the receiving end, or when the authorization length in the control message of the receiving end is greater than the length to be sent, the sending message buffering module 122 buffers the unit message to be sent until the authorization of the receiving end is obtained, and therefore, the risk of congestion caused by buffering a large number of packets which cannot be processed by the receiving end is reduced because the unit message to be sent is buffered at the sending end. In one possible implementation, the intelligent network card 112 determines the length to be sent based on the length of the unsent message buffered in the send message buffer module 122, and the intelligent network card 112 carries the length to be sent in the data message, so as to notify the receiving end of the length of the data that needs to be sent.
The sending message buffer module 122 may use the memory space in the intelligent network card to buffer the unit message to be sent, or may use the memory space in the host to buffer the unit message to be sent. In one possible implementation, if the capacity of the buffer space in the intelligent network card is insufficient, for example, the capacity of the buffer space in the intelligent network card is smaller than the length of the unit message to be sent, the send message buffer module 122 sends a memory allocation request to the host, where the memory allocation request is used to apply for the memory space of the host. The host receives the memory space application, allocates a section of memory space in the memory of the host to the intelligent network card for use, and sends the address of the allocated memory space to the sending message buffer module 122. The sending message buffer module 122 receives the address of the memory space sent by the host, and writes the unit message to be sent into the memory space of the host based on the address, so as to buffer the unit message to be sent by using the memory space of the host.
In one possible implementation, the send message buffer module 122 maintains two types of send queues, a send wait queue and a send store queue, respectively. The transmission waiting queue is used for storing unit messages to be transmitted. The transmit wait queue is implemented using the on-chip memory space of the intelligent network card itself. The sending storage queue is used for storing the original data message transmitted by the host side to the intelligent network card. The sending storage queue can be realized by using the memory space of the host, and can also be realized by using the on-chip storage space of the intelligent network card. The sending message buffer module 122 may detect the state of the sending waiting queue, when the sending waiting queue is empty, the sending message buffer module 122 takes out the original data message from the sending storage queue, the sending message buffer module 122 obtains a unit message obtained by splitting or merging the original data message, and the sending message buffer module 122 adds the unit message to the sending waiting queue.
In one possible implementation, the sending control module 124 is further configured to update the historical length to be sent based on the length of the sent unit message and the length of the unit message cached in the sending message caching module 122, to obtain an updated length to be sent. The transmission control module 124 synchronizes the updated length to be transmitted to the receiving end, so as to notify the receiving end how many unit messages need to be transmitted, so that the receiving end continuously controls the message transmission behavior of the transmitting end.
In one possible implementation of synchronizing the updated length to be sent, when the sending control module 124 sends the unit message, the sending control module 124 carries the updated length to be sent in the tunnel header of the unit message. The sending control module controls the data message in the sending message buffer module 122 to enter a sending state in real time by utilizing the to-be-sent length of each global tunnel, thereby realizing sending control. The global individual tunnels are, for example, tunnels for each application in computing device 11 a.
Optionally, the data sending device 120 further includes a unit message sending processing module 121. The unit message sending processing module 121 is configured to process the original data message before sending the unit message. In one possible implementation manner, in the case that the length of the original data packet is greater than the length of the unit packet, the unit packet sending processing module 121 segments the original data packet according to the length of the unit packet, so as to obtain a plurality of segmented packets, where the lengths of each segmented packet in the plurality of segmented packets are the same. In the case that the length of the original data message is smaller than that of the unit message, the unit message sending processing module 121 merges the plurality of original data messages to obtain a merged message. In one possible implementation, the application of the sending end host sends the original data message to the intelligent network card 112. Or the operating system of the sending end host sends the original data message to the intelligent network card 112. For example, an application or an operating system of the sending host writes the original data packet buffered in the host into the memory space of the intelligent network card 112.
In one possible implementation manner, the intelligent network card 112 is configured with a unit message length, and the unit message sending processing module 121 segments or merges the original data messages according to the configured unit message length, so that the length of each data message sent by the intelligent network card 112 is the unit message length, thereby facilitating load balancing.
In one possible implementation manner, the unit message sending processing module 121 merges the plurality of original data messages according to the configured length m of the unit message and the length k of the tunnel header, so that the length of the merged message is (m-k), and therefore the length of the message obtained by adding the tunnel header to the merged message is the length m of the unit message.
Optionally, the data transmitting apparatus 120 further includes a tunnel head encapsulation module 123. The tunnel header encapsulation module 123 is configured to encapsulate the data packet based on a tunneling protocol. For example, the tunnel header encapsulation module 123 is configured to generate a tunnel header, and add the tunnel header to the segmented message to obtain a unit message to be sent. Or, the tunnel header encapsulation module 123 is configured to generate a tunnel header, and add the tunnel header to the combined message to obtain a unit message to be sent. The tunnel header encapsulation module 123 makes the unit message sent by the intelligent network card 112 have the encapsulation format of the tunnel message by executing the step of adding the tunnel header, so that the forwarding device can conveniently forward the unit message to the receiving end through the tunnel header.
Optionally, the transmit message buffering module 122 and the transmit control module 124 cooperate together to synchronize the information of the unit messages to be transmitted. For example, the transmit message buffer module 122 determines the number of unit messages in the transmit wait queue, the transmit message buffer module 122 transmits the number of unit messages to the transmit control module 124, the transmit control module 124 determines the length to be transmitted based on the number of unit messages, and the transmit control module 124 writes the length to be transmitted into the tunnel header of the data message.
The control message generation module 136 is configured to determine an authorization length, and generate a control message based on the authorization length. The message parsing module 135 is configured to parse the received data message to obtain a length to be sent in the data message, so as to determine whether to add the sending end to the sending host list based on the length to be sent.
Optionally, the data receiving apparatus 130 further includes a tunnel header decapsulation module 133. The tunneling header decapsulation module 133 is configured to decapsulate the data packet based on the tunneling protocol, so that the data packet is restored from the encapsulation format specified by the tunneling protocol to the encapsulation format of the original data packet. For example, the tunnel header decapsulation module 133 receives the unit message, and the tunnel header decapsulation module 133 strips the tunnel header carried by the unit message to obtain a segmented message or a combined message. The tunnel header decapsulation module 133 sends the segmented message or the combined message to the unit message reception processing module 131. The tunnel header unpacking module can analyze the control message header or the data message header of the inner layer in the tunnel header, and preprocess the control message based on the content of the control message header or preprocess the data message based on the content of the data message header. Meanwhile, the tunnel header decapsulation module 133 performs update maintenance for the length to be transmitted of the transmitting end and the information of the transmitting end.
Optionally, the data receiving apparatus 130 further includes a message sequence adjustment module 132. The message sequence adjusting module 132 is further configured to sort the sequence of the unit messages according to the sequence numbers carried in the tunnel header of the unit messages, so as to readjust the sequence. Considering that after the data message is split, the split message may be out of order in the forwarding process between the sending end and the computing device 11d, so that the sequence of the unit message received by the computing device 11d is inconsistent with the sequence of the unit message sent by the sending end, the influence caused by the out of order in the message transmission is reduced by readjusting the sequence, and the accuracy of the data processing of the receiving end is facilitated. The message sequence adjustment module 132 may be implemented using the on-chip memory space of the network card itself.
Optionally, the data receiving apparatus 130 further includes a unit message receiving processing module 131. The unit message receiving and processing module 131 is configured to combine or segment the received unit messages, so that the unit messages are restored to the original data messages. The unit message receiving and processing module 131 cooperates with the message sequence adjusting module 132 to realize the processing of the final receiving end. The processing procedure of the unit message receiving processing module 131 is opposite to the processing procedure of the unit message transmitting processing module 121, and is exemplified below in conjunction with both cases.
In the case that the length of the original data packet is greater than that of the unit packet, the unit packet receiving and processing module 131 receives a plurality of segmented packets from the tunnel header decapsulating module 133, and the unit packet receiving and processing module 131 merges the plurality of segmented packets to obtain the original data packet. In one possible implementation manner, the unit message receiving processing module 131 sorts the multiple segmented messages based on the sequence numbers carried in the tunnel headers corresponding to the multiple segmented messages, and merges the sorted segmented messages. In the case that the length of the original data packet is smaller than that of the unit packet, the unit packet receiving and processing module 131 receives the combined packet from the tunnel header decapsulating module 133, and segments the combined packet to obtain the original data packet.
The embedded processor 140 is used to provide computing power for the intelligent network card. The embedded processor 140 is, for example, a multi-core processor. The embedded processor 140 is used to execute processing and control programs within the intelligent network card.
The on-chip memory 150 is memory internal to the intelligent network card. The on-chip memory 150 is configured to store the corresponding queues, buffers, data entries and store some global information.
In one possible implementation, each module in the data transmitting device 120 and each module in the data receiving device 130 are implemented in software. For example, the embedded processor 140 implements the method in the embodiment of FIG. 2 by reading computer readable instructions stored in the on-chip memory 150, and the on-chip memory 150 stores computer readable instructions implementing the embodiment of FIG. 2. In one example, the computer readable instructions include a plurality of software modules, such as a unit message sending processing module 121, a sending message buffering module 122, a tunnel header encapsulation module 123, a sending control module 124, a message parsing module 125, a unit message receiving processing module 131, a message order adjustment module 132, a tunnel header decapsulation module 133, a message parsing module 135, and a control message generation module 136. The embedded processor 140 may perform corresponding operations as instructed by the respective software modules after executing the respective software modules. The operations performed by one software module actually refer to operations performed by the embedded processor 140 according to instructions of the software module. Alternatively, the embedded processor 140 implements the method in the embodiment of FIG. 2 via internally stored computer readable instructions.
In another possible implementation, each module in the data transmitting device 120 and each module in the data receiving device 130 are implemented in hardware. For example, one or more of the unit message sending processing module 121, the sending message buffer module 122, the tunnel header encapsulation module 123, the sending control module 124, the message parsing module 125, the unit message receiving processing module 131, the message sequence adjustment module 132, the tunnel header decapsulation module 133, the message parsing module 135, and the control message generation module 136 may be implemented by a portion of the processing resources in the embedded processor 140 (e.g., one core or two cores in a multi-core processor), or may be implemented by a field programmable gate array (field-programmable gate array, FPGA), or a coprocessor, or other programmable device.
The message formats provided in the embodiments of the present application are illustrated below.
The present embodiment defines a lightweight tunneling protocol, which further provides two types of messages, namely a control message and a data message, based on a UDP message. The control message comprises a message sent by the sending end to the receiving end in the tunnel establishment stage and a control message returned by the receiving end to the sending end in the data transmission stage. The message in the tunnel protocol is encapsulated with a tunnel header, and the tunnel header comprises an IP header, a UDP header and a self-defined control message header (control packet header) or a data message header.
Referring to fig. 4, fig. 4 is a schematic diagram of a format of a control message according to an embodiment of the present application. The control message shown in fig. 4 may be a control response message sent by the receiving end, or a tunnel establishment request message sent by the sending end. As shown in fig. 4, the control message includes a tunnel header and a payload field. The tunnel header in the control message is encapsulated at the outer layer of the payload field. The tunnel header in the control message comprises an IP header, a UDP header and a control message header.
The IP header is encapsulated in the UDP header and controls the outer layer of the message header. The IP header includes a source address field and a destination address field. The source address field includes the IP address of the sender and the destination address field includes the IP address of the destination. For example, in performing the method of fig. 2, the source address field in the IP header in the tunnel establishment request message includes the IP address of computing device 11a, and the destination address field includes the IP address of computing device 11 d. The source address field in the IP header in the data packet calculates the IP address of device 11a, and the destination address field includes the IP address of computing device 11 d.
The UDP header is encapsulated at the outer layer of the control message header. The UDP header includes a source port number and a destination port number.
The control header includes a sender identification (sender ID) field, a sequence number (sequence number) field or an acknowledgement number (ACK number) field, a length to send (request size) field or an grant size (grant size) field, and a reserved bits (reserved bits) field. The sender ID field is used to indicate the sender. The sender ID field includes an identification of the sender. In one possible implementation, the tunnel establishment request message transmitted in step S201 includes a sequence number field. The sequence number field includes a sequence number of the tunnel establishment request message. The control message includes an acknowledgement number (acknowledgment number, ACK number) field. The ACK number in the control message corresponds to the sequence number in the data message. For example, in performing step S216 of the method shown in fig. 2, when the computing device 11d receives the data packet from the computing device 11a, the computing device 11d detects the sequence number in the last unit packet in the data packet, the computing device 11d determines that the sequence number next to the sequence number in the last unit packet is the sequence number expected to be received next, and the computing device 11d sets the value of the ACK number field to the sequence number next to the sequence number in the last unit packet.
The request size field includes the length to be transmitted. The size in the request size field refers to the number of unit messages. The request size field includes the number of unit messages that the sender needs to send. The grant size field includes an grant length. The size in the grant size refers to the number of unit messages. The grant size field includes the number of unit messages that the computing device 11d grants permission for the sender to send.
Optionally, the control header further includes a flag (flags) field. The flags (flags) field includes one or more flag bits. The flag bit is used for identifying at least one of the type of the message or the attribute of the message. The type of the message comprises a data message or a control message. The attribute of the message includes whether the message is segmented, and whether the current unit message is the last unit message in the plurality of unit messages transmitted in one transmission stage. For example, the flags field includes at least one of a first flag, a second flag, or a third flag. The reserved bits field may include additional information such as timeout times or response times.
Optionally, the content of the payload field in the control message is null, so that the overall length of the control message and the length of the tunnel header in the control message are basically the same, thereby reducing the length of the control message as much as possible and saving the overhead of transmitting the control message.
Referring to fig. 5, fig. 5 is a schematic diagram of a format of a data packet according to an embodiment of the present application. The data messages shown in fig. 5 may be unit messages. For example, the total length of the data packet shown in fig. 5 is a set standard length. For example, the sum of the length of the tunnel header and the length of the payload in fig. 5 is a set standard length.
The data message includes a tunnel header and a payload (payload) field. The tunnel header in the data message is encapsulated in the outer layer of the payload field. The tunnel header in the data message includes an IP header, a UDP header, and a data message header (data packet header).
The content of the IP header is the same as the content of the IP header in the original data message. For example, the IP header includes a source IP address and a destination IP address. The source IP address in the IP header is the same as the source IP address in the IP header in the original data message. The destination IP address in the IP header is the same as the destination IP address in the IP header in the original data message. In one possible implementation manner, the content of the IP header in the tunnel header in each unit message obtained by splitting the same original data message is the same. In one possible implementation manner, after the intelligent network card in the transmitting end receives the original data message of the host, the intelligent network card copies the IP header in the original data message to be used as the IP header in the tunnel header. The IP header encapsulates the UDP header and the outer layer of data packet header.
The UDP header includes a port number. The forwarding device may select a forwarding path of the unit message using an ECMP algorithm based on the port number in the UDP header. For example, the forwarding device may calculate a hash value of the port number, and determine a forwarding path of the data packet based on the hash value of the port number. In one possible implementation manner, the port number of the UDP header in the tunnel header in each unit packet obtained by splitting the same original data packet is different, so that the forwarding device determines different hash values based on the port number of the UDP header, and forwards different unit packets to different paths based on the different hash values. The method includes that after an original data message is divided into a plurality of unit messages by an intelligent network card in a sending end, the intelligent network card respectively generates a corresponding port number for each unit message. The UDP header encapsulates the outer layer of data packet header.
data packet header contains a sender ID field and next request size field.
The sender ID field is used to indicate the sender. The sender ID field includes a sender identification. For example, sender ID is an identification of an application in the sender host. Since the sender ID is carried in the control message, the computing device 11d is convenient to distinguish different sending ends.
Optionally, data packet header also contains a flags field.
Optionally, data packet header also contains a sequence number (sequence number) field. The sequence number field carries a sequence number. The sequence number field is used to indicate the sequence of each data message after the splitting of an original data message. Optionally, data packet header also contains a type field. the type field is used for indicating the protocol type of the original data message carried in the payload field. For example, the type field includes a protocol number of TCP, a protocol number of UDP, or a protocol number of RoCE.
The next request size field includes the length to be sent and size refers to the number of unit messages. next refers to the next transmission stage, for example, the next request size field in the data packet of the first transmission stage includes the number of unit packets to be transmitted in the second transmission stage, and the next request size field in the data packet of the second transmission stage includes the number of unit packets to be transmitted in the third transmission stage.
The payload field in the data packet includes a header of the original data packet and a portion of service data in the original data packet. The computing device 11d may combine based on the service data in the payload field in the different data messages, thereby recovering the complete original data message.
Ordered communication between a transmitting end and a receiving end is supported by the message format shown in fig. 4 and the message format shown in fig. 5. The ordered communication refers to the action of controlling the transmitting end to transmit data by the receiving end, and the transmitting end uses the control message received by the receiving end as a precondition for transmitting data to the receiving end. For example, when the sending end receives a control message of the receiving end, the sending end sends a data message corresponding to the authorization length to the receiving end according to the authorization length in the control message, and when the sending end finishes sending the data message corresponding to the authorization length, the sending end needs to wait for receiving the control message returned by the receiving end for the data message, so that the data message can be sent again.
The following summarizes and describes the control logic of the receiving end in the method for controlling the sending end to send data by the receiving end.
In one possible implementation manner, the receiving end realizes the control of the sending end to send data through the control response message and the sending host list. The sending host list is used for indicating the receiving end to send control messages to the corresponding hosts, and the control response messages comprise the number of unit messages indicating that the receiving end is authorized to allow the sending end to send. The sending host list cooperates with the control message, and the receiving end can determine the host for sending data next based on the sending host list. For example, in response to the identifier of host a being polled in the sending host list, the receiving end sends a control response message to host a, thereby triggering host a to send a data message to the receiving end. The receiving end can authorize the host A to send a plurality of unit messages by sending control response messages. By the method, each host machine orderly and evenly transmits data, so that processing can be completed at a receiving end, and congestion risk is reduced.
The following summarizes processing logic of the transmitting end in the method that the receiving end controls the transmitting end to transmit data.
The sender may implement processing logic based on the grant length and the buffered message. For example, the transmission control module 124 in the transmitting end controls the number of unit messages transmitted for the next transmission window by maintaining the grant length received from the receiving end. The transmission message buffer module 122 in the transmission control module 124 in the transmitting end buffers all the messages that need to be transmitted to the outside in the host, so as to be transmitted according to the control requirement of the receiving end in the following.
The processing logic for implementing load balancing is summarized below.
Referring to fig. 1, in the process of sending data to the computing device 11d, the computing device 11a obtains unit messages with equal lengths from the original datagram Wen Qiefen through the intelligent network card 112. If the length of the original data message is greater than the length of the unit message, the computing device 11a segments the original data message into a plurality of unit messages. If the length of the original data message is smaller than the length of the unit message, the computing device 11a merges the plurality of original data messages into one unit message. As such, the size of each message sent by computing device 11a is balanced. For example, as shown in fig. 1, the computing device 11a segments the original data packet a to obtain the unit packet a1 and the unit packet a2, and the computing device 11a sends the unit packet a1 and the unit packet a2 to the forwarding device 21. The computing device 11b segments the original data message b to obtain the unit message b1 and the unit message b2. The computing device 11b sends the unit message b1 and the unit message b2 to the forwarding device 21. The length of each unit message in the unit message a1, the unit message a2, the unit message b1 and the unit message b2 is the same. In fig. 1, the forwarding path of the unit message a1 includes a computing device 11a→a forwarding device 21→a network 31→a forwarding device 23→a computing device 11d, the forwarding path of the unit message a2 includes a computing device 11a→a forwarding device 21→a network 32→a forwarding device 23→a computing device 11d, the forwarding path of the unit message b1 includes a computing device 11b→a forwarding device 21→a network 31→a forwarding device 23→a computing device 11d, and the forwarding path of the unit message b2 includes a computing device 11b→a forwarding device 21→a network 32→a forwarding device 23→a computing device 11d. In fig. 1, in order to distinguish the position of a unit message in the transmission process of the unit message in the network, a solid rectangle is used to represent the unit message currently in transmission in the network, and a dotted rectangle is used to represent the position to which the unit message is expected to be transmitted subsequently. For example, a unit message a1 shown by a solid rectangle indicates that the unit message a1 is currently being transmitted in the link between the computing device 11a and the forwarding device 21, and a unit message a1 shown by a broken rectangle indicates that the unit message a1 is subsequently transmitted to the link between the forwarding device 21 and the network 31, the link between the network 31 and the forwarding device 23, and the link between the forwarding device 23 and the computing device 11d, thereby being transmitted to the destination (computing device 11 d). The meaning of the unit message a2, the unit message b1, and the unit message b2 shown by the dotted rectangle is similar to the meaning of the unit message a1 shown by the dotted rectangle.
Because the forwarding devices 21, 22 and 23 deploy the load balancing algorithm, when the forwarding devices 21, 22 and 23 forward the unit messages by adopting the load balancing algorithm, the number of the unit messages transmitted by each forwarding path is basically the same, and the length of each data message is the same, so that the data quantity transmitted by each forwarding path is balanced.
The load balancing algorithm is, for example, an equivalent path selection (equal cost multipath, ECMP) algorithm. For example, the forwarding device obtains a port number of a UDP header in the packet, determines a hash value of the port number, and determines a forwarding path of the packet based on the hash value of the port number. Or the forwarding device adopts a polling mode, and the forwarding device circularly selects a forwarding path for the message from a plurality of connected candidate forwarding paths. For example, as shown in fig. 1, there is one candidate forwarding path between the forwarding device 21 and the network 31, and another candidate forwarding path between the forwarding device 21 and the network 32, where the forwarding device 21 forwards the unit message a1 and the unit message b1 to the network 31 by using the ECMP algorithm, and the forwarding device 21 forwards the unit message a2 and the unit message b2 to the network 32. The number of the messages transmitted on each of the two forwarding paths upstream of the forwarding device 21 is 2, and the length of each message transmitted on each forwarding path is the same, so that the loads of the two forwarding paths are equal.
The data transmission flow is illustrated below in connection with a specific application scenario. The application scenario described below is that a plurality of transmitting terminals transmit data to the same receiving terminal. For example, in a data center network, there often occurs a situation where the data amount of different data flows transmitted in the network is not balanced, resulting in congestion. For example, the data volume of a single data flow in a network is large, so that the data flow occupies transmission resources of paths in the network, and cannot fully utilize the transmission resources of multiple paths in the network, thereby causing network congestion. For another example, the multiple computing devices synchronize data in a short time (for example, synchronization model parameters among different hosts in the process of jointly training the AI model by multiple hosts), and when the data stream is transmitted to the downstream switch, the downstream switch caches excessive data, so that congestion occurs, and the transmission delay of the network is higher. Under the above circumstances, by adopting the method provided by the embodiment, the receiving end sends the authorized length to each sending end to control the data amount sent by each sending end, so that the part, exceeding the authorized length, of the data message to be sent by each sending end is respectively cached in the cache of the corresponding sending end, thereby reducing the risk that the message is greatly accumulated on the forwarding equipment butted by the receiving end, solving the congestion and being beneficial to realizing the intelligent lossless network.
Referring to FIG. 6, a schematic diagram of a scenario in which computing devices 11a and 11b shown in FIG. 6 send data to computing device 11d is shown. In the scenario shown in fig. 6, the data transmission method may include the following steps one to seven.
The following steps one to seven describe the data transmission flow of a sending stage after the tunnel establishment is completed. For example, the computing device 11a and the computing device 11d have established a tunnel in advance before performing the data transfer flow described in the following steps one to seven. The computing device 11b and the computing device 11d have previously established a tunnel before performing the data transfer flow described in the following steps one to seven. The tunnel establishment process is described with reference to steps S201 to S203 in the embodiment of fig. 2.
Optionally, the smart network card provided in the present embodiment is already deployed in all three computing devices, i.e., the computing device 11a, the computing device 11b, and the computing device 11 d. The three computing devices 11a, 11b, and 11d have completed the initialization configuration by software, respectively. For example, the lengths of the unit messages are respectively configured on the computing device 11a, the computing device 11b, and the computing device 11d, and the lengths of the unit messages configured on each computing device are the same.
Illustratively, the traffic of the data stream sent by computing device 11a is different from the traffic of the data stream sent by computing device 11 b. And, computing device 11a and computing device 11b are ready to begin transmitting data to computing device 11d at the same time. The bandwidth resources of the computing device 11d are smaller than the sum of the bandwidth resources of the two transmitting ends of the computing device 11a and the computing device 11b, thereby simulating a case where a plurality of transmitting ends transmit data to one receiving end synchronously in a short time.
In step one, the host in computing device 11a is ready to send data to computing device 11d, and in addition, the host in computing device 11b is ready to send data to computing device 11 d. The host in computing device 11a generates an original data message a1. The intelligent network card in the computing device 11a processes the original data message a1 into a unit message. For example, as shown in fig. 6, the intelligent network card in the computing device 11a segments the original data packet a to obtain two segmented packets. The intelligent network card in the computing device 11a adds tunneling heads to the two segmented messages respectively to obtain a unit message a1 and a unit message a2. The intelligent network card in the computing device 11a adds the unit message a1 and the unit message a2 to a transmission queue (e.g., a transmission waiting queue).
Similarly, the intelligent network card in the computing device 11b segments the original data packet b to obtain two segmented packets. The intelligent network card in the computing device 11b adds tunneling headers to the two segmented messages respectively to obtain a unit message b1 and a unit message b2. The intelligent network card in the computing device 11b adds the unit message b1 and the unit message b2 to a transmit queue (e.g., transmit wait queue).
Since the computing device 11a and the computing device 11b do not establish a communication tunnel with the computing device 11d at this time, the computing device 11a sends a tunnel establishment request message (first control message) to the computing device 11d before sending the unit message, so as to request the computing device 11d to authorize the computing device 11a to send the data message, where the tunnel establishment request message sent by the computing device 11a includes the length to be sent by the computing device 11 a; similarly, the computing device 11b sends a tunnel establishment request message (first control message) to the computing device 11d before sending the unit message, so as to request the computing device 11d to authorize the computing device 11b to send the data message, where the tunnel establishment request message sent by the computing device 11b includes the length to be sent by the computing device 11 b.
The tunnel establishment request message meets the encapsulation format of the tunnel protocol. For example, the tunnel establishment request message has a message format shown in fig. 4, and the tunnel header in the tunnel establishment request message includes the length to be sent.
Step two, after the computing device 11d receives the first control message a1 from the computing device 11a and the first control message b1 from the computing device 11b, the computing device 11d adds both the identifier of the computing device 11a and the identifier of the computing device 11b to the sending host list. Further, the computing device 11d records the length to be transmitted of the computing device 11a and the length to be transmitted of the computing device 11 b.
Furthermore, the computing device 11d transmits a control message to the computing device 11a based on the identification of the computing device 11a polled at the transmitting host list, the control message including an authorization length, for example, the total number of unit messages. In response to determining that the length to be transmitted of computing device 11a is greater than the authorized length, computing device 11d rejoins computing device 11a to the end of the list of transmitting hosts.
Step three, the computing device 11a receives the control message sent by the computing device 11 d. If the control message is a control message received by computing device 11d for the first time by computing device 11a, computing device 11a will establish a tunnel with computing device 11 d. Computing device 11a sends a total number of unit messages equal to the authorization length to computing device 11 d. Wherein each unit message satisfies the encapsulation format of the tunneling protocol. For example, each unit message has the message format shown in fig. 5, and in one possible implementation, the computing device 11a updates the length to be sent in the tunnel establishment request message sent in the step one based on the length of the buffered message, and writes the updated length to be sent to the tunnel header in the unit message.
Step four, the forwarding device 21 receives the unit messages with the total number equal to the authorized length from the computing device 11a, and the forwarding device 21 forwards each unit message to the network 31 and the network 32 respectively by adopting a load balancing algorithm. The network 31 and the network 32 forward each unit message to the forwarding device 23, respectively, and the forwarding device 23 forwards each unit message to the computing device 11d, respectively.
Because the original data message is processed into the unit message, after the forwarding device forwards the unit message to the corresponding forwarding path by adopting a load balancing algorithm (such as hash or polling), each forwarding path can almost transmit data in an balanced manner, so that the probability of congestion of the forwarding path caused by unbalanced transmission is reduced.
Step five, the computing device 11d receives the unit messages with the total number equal to the authorized length. The computing device 11d obtains the length to be sent carried in the unit message, the computing device 11d determines whether the length to be sent is greater than the authorized length, and if the length to be sent is greater than the authorized length, the computing device 11d adds the computing device 11a to the sending host list.
Step six, the computing device 11d sends a control message to the computing device 11b based on the sending host list.
Step seven, which is the same as the processing logic of the computing device 11a, after the computing device 11b receives the control message from the computing device 11d, if the control message is the first received control message from the computing device 11d, the computing device 11b completes the tunnel establishment phase and starts the transmission process of the execution unit message.
Through repeated execution of the steps two to seven, the computing device 11d is used as a control party to control the data transmission behavior of the sending end all the time, so that the forwarding device 23 in butt joint with the computing device 11d cannot accumulate a large amount of caches due to the fact that a large amount of messages are sent concurrently, for example, most of the messages are cached by the sending end, and the risk of overall congestion risk of the network is reduced.
According to the method provided by the embodiment, the original data message is segmented or combined into the unit message by using the intelligent network card configured by the host, and the unit message is transmitted in the data center network, so that the end-side computing force is fully utilized, the congestion probability and the packet loss probability of the data center network are reduced, the purpose of load balancing is achieved, and the transmission performance is improved.
In addition, the network can be compatible with the current switch network, and the purchase and configuration of a special switch and the reconstruction of a data center network are not required, so that the network cost is greatly reduced.
In addition, because the mode of transmitting data messages between the switches is still a standard mode, the method can be compatible with a mature general problem positioning tool, and has good locatability and maintainability.
In some embodiments, there is also provided a computer-readable storage medium having stored therein at least one instruction that, when executed on a computer, cause the computer to perform the method performed by the computing device 11a in the embodiment of fig. 2.
In some embodiments, there is also provided a computer-readable storage medium having stored therein at least one instruction that, when executed on a computer, cause the computer to perform the method performed by the computing device 11d in the embodiment of fig. 2.
In some embodiments, there is also provided a computer program product comprising one or more computer program instructions which, when loaded and run by a computer, cause the computer to perform the method performed by the computing device 11a in the embodiment of fig. 2.
In some embodiments, there is also provided a computer program product comprising one or more computer program instructions which, when loaded and run by a computer, cause the computer to perform the method performed by the computing device 11d in the embodiment of fig. 2.
In some embodiments, a chip is also provided, comprising a memory for storing computer instructions and a processor for calling and executing the computer instructions from the memory to perform the method performed by the computing device 11a in the embodiment of fig. 2.
In some embodiments, a chip is also provided, comprising a memory for storing computer instructions and a processor for calling and executing the computer instructions from the memory to perform the method performed by the computing device 11d in the embodiment of fig. 2.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are referred to each other, and each embodiment is mainly described as a difference from other embodiments.
A refers to B, referring to a simple variation where A is the same as B or A is B.
The terms "first" and "second" and the like in the description and in the claims of embodiments of the present application are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order of the objects, and should not be interpreted to indicate or imply relative importance. For example, a first computing device and a second computing device are used to distinguish between the different computing devices, rather than to describe a particular order of computing devices, nor should the first computing device be understood to be more important than the second computing device.
In the examples herein, unless otherwise indicated, the meaning of "at least one" means one or more and the meaning of "a plurality" means two or more. For example, a plurality of computing devices refers to two or more computing devices.
The above-described embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces, in whole or in part, the procedures or functions described in accordance with embodiments of the present application. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (18)

1. A method of data transmission, the method comprising:
a first computing device receives an authorization length from a second computing device, the authorization length indicating a length of a data message that the second computing device is permitted to send to the second computing device;
the first computing device generates a first data message based on the authorization length, wherein the length of the first data message is matched with the authorization length;
the first computing device sends the first data message to the second computing device.
2. The method of claim 1, wherein the grant length indicates a number of unit messages that the second computing device allows the first computing device to send to the second computing device, the unit messages being data messages having a standard length;
Correspondingly, the length of the first data message is matched with the authorization length, which comprises the following steps:
the first data message comprises at least one unit message, and the number of the unit messages in the first data message is smaller than or equal to the number of the authorized length indications.
3. The method of claim 1, wherein the grant length indicates a total length of at least one unit message that the second computing device allows the first computing device to send to the second computing device, the unit message being a data message having a standard length;
correspondingly, the length of the first data message is matched with the authorization length, which comprises the following steps:
the first data message comprises at least one unit message, and the total length of the unit messages in the first data message is smaller than or equal to the authorized length.
4. A method according to claim 2 or 3, wherein the first computing device generating a first data message based on the grant length comprises:
when the length of the original data message is greater than that of the unit message, the first computing device segments the original data message based on the length of the unit message to obtain the first data message; or,
And when the length of the original data message is smaller than that of the unit message, the first computing equipment merges the original data message based on the length of the unit message so as to obtain the first data message.
5. The method of any of claims 1-4, wherein the first computing device receiving the authorization length from the second computing device comprises:
the first computing device receives a control message from a second computing device, the control message including the authorization length.
6. The method of any of claims 1-5, wherein the first data message comprises a to-be-transmitted length indicating a length of data messages that the first computing device needs to further transmit to a second computing device in addition to the first data message.
7. The method of claim 6, wherein the length to be sent indicates a number of unit messages that the first computing device needs to send further to a second computing device in addition to the first data message; or, the length to be sent indicates the total length of at least one unit message that the first computing device needs to further send to the second computing device in addition to the first data message.
8. The method according to claim 6 or 7, wherein the first data message comprises a tunnel header, the tunnel header comprising the length to be sent.
9. The method of claim 8, wherein the tunnel header further comprises a protocol type, a sequence number, an application identifier, a first flag, a second flag and a third flag, the protocol type is used for identifying a protocol corresponding to service data encapsulated in an inner layer of the tunnel header in the first data packet, the sequence number is used for identifying an arrangement sequence of at least one unit packet in the first data packet, the application identifier is used for identifying an application from which the service data comes, the first flag is used for identifying whether the first data packet is segmented, the second flag is used for identifying a last unit packet in at least one unit packet included in the first data packet, and the third flag is used for identifying a type of the first data packet as the data packet.
10. A method of data transmission, the method comprising:
the second computing device sends a first authorization length to the first computing device, the first authorization length indicating a length of a data message that the second computing device allows the first computing device to send to the second computing device;
The second computing device receives a first data message from the first computing device, the length of the first data message matching the first authorization length.
11. The method of claim 10, wherein the second computing device transmitting the first authorization length to the first computing device comprises:
the second computing device sends a control message to the first computing device, the control message including the first grant length.
12. The method of claim 10 or 11, wherein the first data message includes a length to be sent indicating a length of the data message that the first computing device needs to further send to a second computing device in addition to the first data message, the second computing device receiving the first data message from the first computing device, the method further comprising:
the second computing device compares the length to be transmitted with the first grant length;
in response to the length to be sent being greater than the first grant length, the second computing device sends a second grant length to the first computing device.
13. The method of claim 12, wherein the second computing device sending a second grant length to the first computing device in response to the length to be sent being greater than the first grant length comprises:
in response to the length to be sent being greater than the second authorization length, the second computing device adding an identification of the first computing device to a sending host list, the sending host list being used to store an identification of computing devices that need to transmit data to the second computing device;
the second computing device sends a first authorization length to the first computing device in response to the identification of the first computing device being top-ranked in the sending host list.
14. The method of any of claims 10 to 13, wherein the first data message comprises at least one unit message, and wherein after the second computing device receives the first data message from the first computing device, the method further comprises:
the second computing equipment combines the at least one unit message to obtain an original data message; or,
and the second computing equipment cuts the at least one unit message to obtain an original data message.
15. A computing device, wherein the computing device is a first computing device, the computing device comprising: a processor coupled to a memory having stored therein at least one computer program instruction that is loaded and executed by the processor to cause the computing device to implement the method of any of claims 1-9.
16. A computing device, wherein the computing device is a second computing device, the computing device comprising: a processor coupled with a memory having stored therein at least one computer program instruction that is loaded and executed by the processor to cause the computing device to implement the method of any of claims 10-14.
17. A network system comprising the computing device of claim 15 and the computing device of claim 16.
18. The network system of claim 17, wherein the network system employs a leaf spine architecture, the network system further comprising a first leaf switch coupled to the computing device of claim 15, a second leaf switch coupled to the computing device of claim 16, and a spine switch coupled to the first leaf switch and the second leaf switch, respectively.
CN202311330765.7A 2023-10-13 2023-10-13 Data transmission method, computing device and system Pending CN117579555A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311330765.7A CN117579555A (en) 2023-10-13 2023-10-13 Data transmission method, computing device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311330765.7A CN117579555A (en) 2023-10-13 2023-10-13 Data transmission method, computing device and system

Publications (1)

Publication Number Publication Date
CN117579555A true CN117579555A (en) 2024-02-20

Family

ID=89892473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311330765.7A Pending CN117579555A (en) 2023-10-13 2023-10-13 Data transmission method, computing device and system

Country Status (1)

Country Link
CN (1) CN117579555A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118642883A (en) * 2024-08-12 2024-09-13 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on network card and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118642883A (en) * 2024-08-12 2024-09-13 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on network card and readable storage medium

Similar Documents

Publication Publication Date Title
US11418629B2 (en) Methods and systems for accessing remote digital data over a wide area network (WAN)
US7447233B2 (en) Packet aggregation protocol for advanced switching
CN113711547A (en) System and method for facilitating efficient packet forwarding in a Network Interface Controller (NIC)
US9049218B2 (en) Stateless fibre channel sequence acceleration for fibre channel traffic over Ethernet
US6510135B1 (en) Flow-level demultiplexing within routers
US7562158B2 (en) Message context based TCP transmission
US8139482B1 (en) Method to implement an L4-L7 switch using split connections and an offloading NIC
US7308001B2 (en) Fibre channel frame batching for IP transmission
WO2016187813A1 (en) Data transmission method and device for photoelectric hybrid network
EP3298738A1 (en) In-line network accelerator
EP3298739B1 (en) Lightweight transport protocol
CN112491717B (en) Service routing method and device
WO2011120467A2 (en) Message order-preserving processing method, order-preserving coprocessor and network equipment
CN109120540B (en) Method for transmitting message, proxy server and computer readable storage medium
US8862768B2 (en) Method and system for packetizing data for servicing traffic end-to-end
WO2018036173A1 (en) Network load balancing method, device and system
CN117176486A (en) network information transmission system
US9130957B2 (en) Data communication apparatus and method
CN117579555A (en) Data transmission method, computing device and system
CN115002023A (en) Link aggregation method, link aggregation device, electronic equipment and storage medium
US20210092058A1 (en) Transmission of high-throughput streams through a network using packet fragmentation and port aggregation
WO2024001820A1 (en) Data transmission method, and gateway device
CN116916382A (en) Method and system for realizing connectionless SCTP protocol stack
CN117041166A (en) Congestion control method and device, switch and computer readable storage medium
CN116962545A (en) SRV6 network-based data slice transmission system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination