Abstract:
A method for congestion control includes receiving at a destination computer a packet transmitted on a given flow, in accordance with a predefined transport protocol, through a network by a transmitting network interface controller (NIC) of a source computer, and marked by an element in the network with a forward congestion notification. Upon receiving the marked packet in a receiving NIC of the destination computer, a congestion notification packet (CNP) indicating a flow to be throttled is immediately queued for transmission from the receiving NIC through the network to the source computer. Upon receiving the CNP in the transmitting NIC, transmission of further packets on at least the flow indicated by the CNP from the transmitting NIC to the network is immediately throttled, and an indication of the given flow is passed from the transmitting NIC to a protocol processing software stack running on the source computer.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims the benefit of U.S. Provisional Patent Application 62/234,046, filed Sep. 29, 2015, which is incorporated herein by reference. 
     
    
     FIELD OF THE INVENTION 
       [0002]    The present invention relates generally to computer communication networks, and specifically to apparatus and methods for controlling packet flows in such networks. 
       BACKGROUND 
       [0003]    Current high-performance applications inject increasingly unpredictable bursty traffic into data center networks, causing network congestion and degrading their own and other applications&#39; performance. Congestion control protocols have been developed to alleviate these problems. These protocols inform traffic sources about the congestion in the network. Using this information, the traffic sources reduce the injection rate of their traffic. When congestion is not indicated, the traffic sources continually attempt to increase their traffic injection rates. The performance of the congestion control mechanism depends on several factors, such as notification delay, accuracy of notification, and the trigger of congestion. 
         [0004]    Congestion control protocols for large-scale data centers are based mainly on forward explicit congestion notification (FECN), meaning that the congestion notification is propagated first from the detection point to the destination and is then reflected back from the destination to the traffic source. Typically, congested switches send notifications to the destinations of packets that they forward by setting a specific FECN bit in the packet headers. Direct BECN-based feedback (backward explicit congestion notification), meaning that the congestion notification is returned directly from the congested switch to the traffic source, is currently used generally only in smaller, Layer-2 networks. 
         [0005]    When the network interface controller (NIC) at the destination of a given flow receives a packet with the FECN bit set, the NIC is expected to notify the source of the packet about the congestion 2 . The NIC typically sends this notification by returning a packet to the source of the flow with a BECN bit set. In InfiniBand® networks, for example, the NIC may either send an acknowledgement packet (ACK) with the BECN bit set, when communicating with the packet source over a reliable connection, or it may send a dedicated congestion notification packet (CNP). 
         [0006]    Internet Protocol (IP) networks, on the other hand, commonly use the Transmission Control Protocol (TCP) as their transport-layer protocol. The congestion control features of TCP are set forth by Allman et al., in “TCP Congestion Control,” Request for Comments (RFC)  5681  of the Internet Engineering Task Force (IETF), published in  2009 , which is incorporated herein by reference. This document specifies four TCP congestion control algorithms: slow start, congestion avoidance, fast retransmit and fast recovery. The slow start and congestion avoidance algorithms are used by TCP senders to control the amount of outstanding data being injected into the network. To implement these algorithms, two variables are added to the TCP per-connection state: The congestion window (cwnd) is a sender-side limit on the amount of data the sender can transmit into the network before receiving an acknowledgment (ACK), while the receiver&#39;s advertised window (rwnd) is a receiver-side limit on the amount of outstanding data. The minimum of cwnd and rwnd governs data transmission. Upon encountering an indication of congestion, the receiver instructs the sender to reduce the window size, and the sender reduces the transmission rate accordingly. 
       SUMMARY 
       [0007]    Embodiments of the present invention that are described hereinbelow provide improved methods for network congestion control, as well as apparatus that implements such methods. 
         [0008]    There is therefore provided, in accordance with an embodiment of the invention, a method for congestion control, which includes receiving at a destination computer a packet transmitted on a given flow, in accordance with a predefined transport protocol, through a network by a transmitting network interface controller (NIC) of a source computer, and marked by an element in the network with a forward congestion notification. Upon receiving the marked packet in a receiving NIC of the destination computer, a congestion notification packet (CNP) indicating a flow to be throttled is immediately queued for transmission from the receiving NIC through the network to the source computer. Upon receiving the CNP in the transmitting NIC, transmission of further packets on at least the flow indicated by the CNP from the transmitting NIC to the network is immediately throttled, and an indication of the given flow is passed from the transmitting NIC to a protocol processing software stack running on the source computer. 
         [0009]    In the disclosed embodiments, the CNP is transmitted and the transmission is throttled by the receiving and transmitting NICs without waiting for processing of the marked packet or the CNP by software processes running on CPUs of the destination and source computers. Additionally or alternatively, the method includes reducing, by the protocol processing software stack in response to the indication, a transmission rate of the packets in the given flow. In one embodiment, throttling the transmission includes initially reducing a rate of the transmission by the transmitting NIC and subsequently gradually increasing the rate of the transmission by the transmitting NIC while the protocol processing software stack continues to maintain the reduced transmission rate of the packets in the given flow. 
         [0010]    In some embodiments, the CNP contains an indication of a severity of congestion in the network, and the transmitting NIC adjusts the throttling of the transmission responsively to the indication. 
         [0011]    In one embodiment, the predefined transport protocol includes a Transmission Control Protocol (TCP), and the given flow includes a TCP connection. 
         [0012]    Typically, the transmitting NIC, in response to the CNP, throttles the packets that are queued with the flow indicated by the CNP, without modifying a transmission rate of the packets in other queues. 
         [0013]    There is also provided, in accordance with an embodiment of the invention, a method for congestion control, which includes receiving on a given Transmission Control Protocol (TCP) connection at a destination computer a TCP packet transmitted through a network by a transmitting network interface controller (NIC) of a source computer, and marked by an element in the network with a forward congestion notification. Upon receiving the marked TCP packet in a receiving NIC of the destination computer, a congestion notification packet (CNP) is immediately queued for transmission from the receiving NIC through the network to the source computer. Upon receiving the CNP in the transmitting NIC, transmission of further TCP packets from the transmitting NIC to the network is immediately throttled in the NIC. 
         [0014]    Typically, the CNP is transmitted and the transmission is throttled by the receiving and transmitting NICs without waiting for processing of the marked TCP packet or the CNP by software processes running on CPUs of the destination and source computers. 
         [0015]    Additionally or alternatively, the method includes reducing, by a TCP software stack running on the source computer, a transmission rate of the packets on the given TCP connection. In some embodiments, the method includes, in response to receiving the CNP, passing an indication of the given TCP connection from the transmitting NIC to the TCP software stack running on the source computer, wherein the TCP software stack reduces the transmission rate of the packets on the given TCP connection in response to the indication. In one such embodiment, passing the indication includes conveying a message from the NIC to the TCP software stack that emulates a TCP congestion control messaging. 
         [0016]    Additionally or alternatively, the TCP software stack reduces the transmission rate of the packets on the given TCP connection in response to TCP congestion control messaging received from the destination computer. 
         [0017]    Further additionally or alternatively, throttling the transmission includes initially reducing a rate of the transmission by the transmitting NIC and subsequently gradually increasing the rate of the transmission by the transmitting NIC, while the TCP software stack running on the source computer continues to maintain the reduced transmission rate of the packets in the given connection. 
         [0018]    There is additionally provided, in accordance with an embodiment of the invention, a computer network system, including multiple host computers interconnected by a packet network and configured to serve as source computers and destination computers for transmission and reception of packet flows through the network. Each host computer includes a central processing unit (CPU) and a network interface controller (NIC), which connects the host computer to the network. Upon receiving in a receiving NIC of a destination computer a packet that was transmitted through the network by a transmitting NIC of a source computer on a given flow in accordance with a predefined transport protocol and that was marked by an element in the network with a forward congestion notification, the receiving NIC immediately queues a congestion notification packet (CNP) indicating a flow to be throttled, for transmission through the network to the source computer. Upon receiving the CNP in the transmitting NIC, the transmitting NIC immediately throttles transmission of further packets on at least the flow indicated by the CNP from the transmitting NIC to the network, and passes an indication of the given flow from the transmitting NIC to a protocol processing software stack running on the source computer. 
         [0019]    There is further provided, in accordance with an embodiment of the invention, a computer network system, including multiple host computers interconnected by a packet network and configured to serve as source computers and destination computers for transmission and reception of packet flows through the network. Each host computer includes a central processing unit (CPU) and a network interface controller (NIC), which connects the host computer to the network. Upon receiving in a receiving NIC of a destination computer a Transmission Control Protocol (TCP) packet that was transmitted through the network by a transmitting NIC of a source computer on a given TCP connection and that was marked by an element in the network with a forward congestion notification, the receiving NIC immediately transmits a congestion notification packet (CNP) through the network to the source computer. Upon receiving the CNP in the transmitting NIC, the transmitting NIC immediately throttles transmission of further TCP packets from the transmitting NIC to the network. 
         [0020]    The present invention will be more fully understood from the following detailed description of the embodiments thereof, taken together with the drawing in which: 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0021]      FIG. 1  is a block diagram that schematically illustrates a computer network system, in accordance with an embodiment of the invention. 
       
    
    
     DETAILED DESCRIPTION OF EMBODIMENTS 
       [0022]    In IP networks, TCP processing is typically handled by the host processor (CPU) using a TCP software stack. The NICs that receive and transmit the TCP packets do not usually distinguish between different TCP transport service instances—referred to as sockets or connections—and thus cannot distinguish between congesting and non-congesting flows. Therefore, TCP congestion control is also generally implemented in software. 
         [0023]    Congestion can develop very rapidly in data center environments, due, for example, to the well-known “incast” problem. Fast response of the congestion control mechanism is important in resolving such situations and maintaining high system performance. When FECN is used, the speed of response is limited, in the best case, by the round-trip transmission time between the source and destination NICs. In networks using TCP transport, however, the response to congestion is further limited by the processing required by the TCP software stacks at both the destination and the source of the congesting flow. Embodiments of the present invention that are described herein provide devices and techniques that can mitigate this problem. 
         [0024]    Specifically, the embodiments of the present invention that are disclosed herein provide methods for hardware-based congestion control in TCP environments, as well as NICs and software that support such methods. In the disclosed embodiments, a NIC receiving a TCP packet containing a congestion indication immediately transmits a congestion notification packet (CNP) to the source of the TCP packet, without waiting for destination-side CPU software to handle the TCP packet. The NIC at the packet source, upon receiving the CNP, immediately reduces its transmission rate, thus relieving the congestion. Concurrently, when the source-side TCP software stack becomes aware of the congestion, the TCP stack responds by reducing the transmission rate, of the specific connection that is responsible for the congestion. The NIC gradually increases its transmission rate thereafter, while the transmission rate of the congesting connection generally recovers more slowly. 
         [0025]    By implementing front-line congestion control in the NIC, the present methods achieve faster response than techniques that are known in the art. At the same time, the present methods are able to rapidly reduce the injection rate of connections that contribute to congestion with only minimal impact on the performance of non-congesting connections. In some embodiments, the NIC coordinates its role in congestion control with that of the TCP software stack. In other embodiments, however, the NIC carries out its role without any explicit interaction with the TCP stack. 
         [0026]    Although the embodiments described herein apply specifically, for the sake of clarity and concreteness, to control of congestion in packet flows having the form of TCP connections, the principles of the present invention may similarly be applied to flows transmitted in accordance with other transport protocols. Such flows may be identified, for example, on the basis of a flow label in the IP header or by a suitable tuple in the packet header, including the source and destination addresses and ports and the protocol identifier, for instance. On this basis, the principles of the present invention may also be applied to connectionless protocols, such as UDP. 
         [0027]      FIG. 1  is a block diagram that schematically illustrates a computer network system  20 , in accordance with an embodiment of the invention. Multiple host computers  22 ,  24 ,  26 , . . . , are interconnected by a high-speed network  28 , such as a fabric of switches  30 . Each host computer  22 ,  24 ,  26 , . . . , comprises a CPU  32  and a NIC  34 , which connects the computer to network  28 . The computers exchange data by transmitting and receiving TCP packets, under the control of TCP stacks  36  that run in software on the respective CPUs  32 . 
         [0028]    Typically, all of computers  22 ,  24 ,  26 , . . . , both transmit and receive packets over TCP connections via network  28 . In the description that follows, however, for the sake of simplicity, computer  22  will be referred to as the source computer, while computer  24  is referred to as the destination computer. TCP stack  36  on computer  22  maintains multiple sockets  38 ,  40 ,  42 ,  44 , . . . , for connections with other computers  24 ,  26 , . . . , in system  20 , including, for example, socket  42  connecting to a corresponding socket maintained by TCP stack  36  on destination computer  24 . TCP stack  36  on computer  22  queues TCP frames  46  in sockets  38 ,  40 ,  42 ,  44 , and submits corresponding packets to NIC  34  for transmission at rates that depend on the current window size and acknowledgments received on each corresponding connection. 
         [0029]    NIC  34  queues TCP packets  50  for transmission in one or more send queues  48 , and transmits the packets in turn to network  28  when they reach the head of the queue. (Although for the sake of simplicity, only one send queue  48  is shown in  FIG. 1 , NIC  34  may serve multiple queues of this sort concurrently.) Send queue  48  in NIC  34 , in other words, serves multiple different connections to different destinations, i.e., multiple different flows (in contrast to the InfiniBand model, in which the NIC typically maintains a separate QP for each flow, as explained above). Because TCP stack  36  runs in software, NIC  34  is generally unaware of the different flows that it is serving and simply transmits packets  50  in each of the send queues in queue order. 
         [0030]    In the pictured example, NIC  34  in source computer  22  transmits a TCP packet  52 , drawn from queue  42 , via network  28  to destination computer  24 . Along the way, packet  52  encounters congestion in one of switches  30 , which sets the ECN bit in the packet. Switch  30  typically sets the ECN bit in the IP header of the packet, and is thus agnostic to the transport protocol. In some cases, such as in network virtualization schemes, the TCP packet may be encapsulated in a packet having an outer transport header in accordance with another transport protocol, such as UDP. In this case, when the TCP packet is decapsulated, the decapsulating network element will apply the ECN marking to the inner TCP packet so that the congestion notification is carried through to the destination. 
         [0031]    Upon receiving packet  52  and detecting the ECN bit, NIC  34  in destination computer  24  immediately queues a CNP  54  for transmission via network back to source computer  22 . Typically, CNP  54  indicates the flow that should be throttled at the source computer, for example by identifying the connection (in this case, socket  42 ) that transmitted the congesting packet. Additionally or alternatively, CNP  54  may contain other congestion-related information, such as an indication of the severity of congestion, based, for example, on the fraction of packets received at destination computer  24  with the ECN bit set. This additional information may enable NIC  34  in source computer  22  to more finely control its response to the congestion notification. 
         [0032]    NIC  34  in destination computer  24  queues CNP  54  for transmission immediately upon receiving packet  52 , without waiting for processing by TCP stack  36  or other software running on CPU  32 . Assuming network  28  supports multiple priority levels, NIC  34  will typically transmit CNP  54  at the highest priority, higher than the priority normally allocated to TCP packets, in order to minimize the transit time through network  28 . NIC  34  in source computer  22  likewise acts immediately upon receiving CNP  54 , throttling back the transmission rate of packets  50  from queue  48  to network  28  so that the congestion encountered by packet  50  will be promptly relieved. This throttling may affect the packets that share the same queue with the packets belonging to the flow indicated by the CNP (in queue  48 ), but does not modify the transmission rate of the packets in other NIC queues. 
         [0033]    Throttling queue  48 , however, can cause head-of-line blocking of frames  46  waiting for transmission in sockets  38 ,  40  and  44 , which did not contribute to the current congestion situation. To alleviate this sort of blocking, NIC  34  in source computer  22  also notifies TCP stack  36  that CNP  54  has been received, implicating socket  42  as a cause of the congestion in question. In response to this notification, TCP stack  36  temporarily cuts back the transmission from socket  42  in accordance with the TCP congestion control protocol. This interaction between NIC  34  and TCP stack  36  may involve certain modifications to operate with conventional TCP software that is known in the art; but it may alternatively be possible to elicit the desired TCP behavior by conveying messages from NIC  34  that emulate congesting messaging provided by the TCP standard. Alternatively, the present method may be implemented without any explicit interaction between the NIC and TCP stack following reception of CNP  54 , and rather may rely simply on TCP signaling from destination computer  24  in order to reduce the rate of transmission from socket  42 . 
         [0034]    In any of these cases, because transmission from congesting socket  42  is cut back by TCP stack  36 , NIC  34  can quickly ramp up the transmission rate from queue  48  after the initial reduction, without concern of exacerbating the congestion once again, since the contribution of the congesting socket  42  will have been reduced in accordance with TCP congestion management. Thus, after brief initial blocking upon receipt of CNP  54 , sockets  38 ,  40  and  42  will be able to resume transmission at the full speed permitted by the software-based TCP congestion control. 
         [0035]    It will be appreciated that the embodiments described above are cited by way of example, and that the present invention is not limited to what has been particularly shown and described hereinabove. Rather, the scope of the present invention includes both combinations and subcombinations of the various features described hereinabove, as well as variations and modifications thereof which would occur to persons skilled in the art upon reading the foregoing description and which are not disclosed in the prior art.