# Patent

## Title
Methods and devices for backward congestion notification

## Abstract

The present invention provides improved methods and devices for managing network congestion. Preferred implementations of the invention allow congestion to be pushed from congestion points in the core of a network to reaction points, which may be edge devices, host devices or components thereof. Preferably, rate limiters shape individual flows of the reaction points that are causing congestion. Parameters of these rate limiters are preferably tuned based on feedback from congestion points, e.g., in the form of backward congestion notification (“BCN”) messages. In some implementations, such BCN messages include congestion change information and at least one instantaneous measure of congestion. The instantaneous measure(s) of congestion may be relative to a threshold of a particular queue and/or relative to a threshold of a buffer that includes a plurality of queues.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application is a divisional of U.S. application Ser. No. 11/248,933, entitled “Methods and Devices for Backward Congestion Notification,” filed on Oct. 11, 2005, by Davide Bergamasco et al, which is incorporated herein by reference in its entirety for all purposes. The present application claims priority to and benefit of this application.
This application is related to U.S. patent application Ser. No. 11/155,388, entitled “ACTIVE QUEUE MANAGEMENT METHODS AND DEVICES” and filed on Jun. 16, 2005 (the “AQM Application”), which is hereby incorporated by reference for all purposes.


BACKGROUND OF THE INVENTION
Congestion avoidance techniques are essential to the operation of networks and network devices. One such technique known in the art as “Random Early Discard” or “RED” is described in a publication by S. Floyd and V. Jacobson entitled “Random Early Detection Gateways for Congestion Avoidance,” (Transactions on Networking, August 1993), which is hereby incorporated by reference for all purposes.
The basic principle behind RED is to control the average length of a network device's (e.g., a router's) output queue in order to avoid long-term congestion. To achieve this goal, RED must work tightly coupled with transport protocols, such as TCP, which are equipped with their own congestion avoidance mechanisms and are thus capable to react to congestion indications generated by RED routers.
FIG. 1A includes graph 100 that illustrates how RED works. For each incoming packet, the average queue length is calculated. (Please note that the terms “packet” and “frame” may be used interchangeably herein.) If the average queue length is below a predefined minimum threshold 102, the packet is accepted and stored in the output queue for transmission. If the average queue size is above the minimum threshold 102 but below a predefined maximum threshold 104, a packet marking probability is computed and the packet gets marked according to this probability. The marking probability is proportional to the average queue size. Therefore, when the queue is larger, there is a higher probability for an incoming packet to be marked. Finally, if the average queue size is above the maximum threshold 104, all incoming packets are marked until the average queue size falls again below the maximum threshold 104.
It is responsibility of the transport protocol to take the appropriate countermeasures when it detects packets marked by RED. One explicit method of marking packets in this context is described in RFC 3168, “The Addition of Explicit Congestion Notification (ECN) to IP” (K. Ramakrishnan et al., September 2001), which is hereby incorporated by reference. When TCP is being used in the absence of an explicit method of marking packets, packets can only be “marked” by discarding them, with TCP interpreting the loss of packets as a congestion indication. When packet drops are detected, TCP sources immediately reduce their transmission rate, causing a reduction of the traffic volume at the congested router(s). Discarding packets is also a useful means to control average queue size when non-reactive transport protocols such as UDP are exploited.
As noted in the Background section of the AQM Application, the RED algorithm presents scalability issues and other challenges. Moreover, as the speed of network traffic increases, controlling network congestion in an acceptable manner becomes increasingly challenging. This is true in part because it is not economically feasible to increase buffer sizes in proportion to the higher network speeds. High speed, coupled with proportionally smaller buffer sizes and low latency, causes buffers to fill up very quickly when congestion arises.
Some exemplary high-speed, low latency networks having relatively small buffers, which will be referred to herein as Data Center Ethernet (“DCE”) or the like, are described in U.S. patent application Ser. No. 11/084,587, entitled “Ethernet Extension for the Data Center” and filed on Mar. 18, 2005, to U.S. patent application Ser. No. 11/078,992, entitled “Fibre Channel Over Ethernet” and filed on Mar. 10, 2005 and to U.S. patent application Ser. No. 11/094,877, entitled “Network Device Architecture for Consolidating Input/Output and Reducing Latency” and filed on Mar. 30, 2005, (the “DCE Applications”), all of which are incorporated by reference for all purposes.
DCE networks are a challenging environment for congestion management because of their high speed (minimum 10 Gbps) and low latency (few microseconds of round trip). Also, in certain cases, such networks make use of 802.3X link-level flow control to guarantee zero packet loss to applications. If link-level flow-control is being used, congestion spreads almost instantly.
Prior art congestion control techniques such as RED and ECN have been shown to work poorly with small buffers because of the extremely compressed dynamics exhibited by such buffers. In fact, under congestion conditions a buffer in a DCE network fills up instantly when such techniques are employed, causing RED or ECN to work in the region of maximum drop/mark probability. This, in turn, causes the traffic flows to slow down more than necessary, which causes a loss of throughput.
More advanced congestion control mechanisms tailored for networks characterized by operational parameters similar to DCE have been considered. One such mechanism is Fibre Channel Congestion Control (“FCC”), a congestion management mechanism for Fibre Channel networks that is described in co-pending U.S. patent application Ser. No. 10/777,886, entitled “End-to-End Congestion Control in a Fibre Channel Network” and filed on Feb. 11, 2004, which is a continuation-in-part of co-pending U.S. patent application Ser. No. 10/026,583, entitled “Methods and Apparatus for Network Congestion Control” and filed on Dec. 18, 2001, both of which are incorporated herein by reference for all purposes.
While quite effective at controlling congestion when it arises, FCC uses a conservative, time-driven rate recovery process to accelerate traffic flows when congestion is improving. Therefore, FCC may take a longer-than-optimal time to recover the original rate of traffic flows in congested high-speed, low-latency networks such as DCE networks.
Many of the congestion management challenges of DCE networks are shared by other networks, including but not limited to Fibre Channel networks and high-speed Ethernet. It would be very desirable to implement methods and devices that address at least some of the shortcomings of the prior art.
SUMMARY OF THE INVENTION
The present invention provides improved methods and devices for managing network traffic. Preferred implementations of the invention allow congestion to be pushed from congestion points in the core of a network to reaction points, which may be edge devices, host devices or components thereof. Preferably, rate limiters shape individual flows of the reaction points that are causing congestion. Parameters of these rate limiters are preferably tuned based on feedback from congestion points, e.g., in the form of backward congestion notification (“BCN”) messages. In some implementations, such BCN messages include congestion change information and at least one instantaneous measure of congestion. The instantaneous measure(s) of congestion may be relative to a threshold of a particular queue and/or relative to a threshold of a buffer that includes a plurality of queues.
Some implementations of the invention provide a congestion management method that includes the following steps: detecting network congestion at a first congestion point of a network; identifying a first congested entity of the network; calculating feedback information regarding a congestion level of the congested entity; and sending a first feedback message to a first reaction point of the network. The reaction point is associated with one or more traffic flows causing the congestion, at least in part. The feedback message includes the feedback information and identity data for the congested entity.
The feedback information may comprise an instantaneous measure of congestion and congestion change information. The instantaneous measure of congestion and the congestion change information may be determined with reference to a predetermined threshold of a queue. The predetermined threshold may decrease as a number of active virtual output queues (“VOQs”) in a buffer of a congestion point increases and the first predetermined threshold may increase as the number of active VOQs in the buffer decreases.
The first feedback message may be an indication to slow down a traffic flow, an indication to speed up a traffic flow or an indication to stop a traffic flow. The first feedback message preferably identifies a particular flow. The congested entity may be a queue.
The detecting step may involve sampling a frame and determining whether a sampled frame includes data that is responsive to a feedback message. When it is determined that the sampled frame includes responsive data, the method may also include these steps: determining that the responsive data identify the first congested entity; determining that the occupancy of a queue to which the sampled frame will be added is currently above a first predetermined threshold; and sending a second feedback message to a source address of the sampled frame. The second feedback message comprises an indication to slow down a traffic flow.
When it is determined that the sampled frame includes responsive data, the method may also include these steps: determining that the responsive data identify the first congested entity; determining that the occupancy of a queue to which the sampled frame will be added is currently above a second predetermined threshold; and sending a second feedback message to a source address of the sampled frame. The second feedback message comprises an indication to stop a traffic flow.
When it is determined that the sampled frame includes responsive data, the method may also include these steps: determining that the responsive data identify the first congested entity; determining that the occupancy of a buffer of the congestion point is above a buffer congestion threshold; and sending a second feedback message to a source address of the sampled frame. The second feedback message comprises an indication that the occupancy of the buffer is above the buffer congestion threshold.
When it is determined that the sampled frame does not include responsive data, the method may further comprise the steps of determining that the occupancy of a queue to which the sampled frame will be added is currently below a first predetermined threshold and determining not to send a second feedback message to a source address of the sampled frame.
Alternative methods of the invention control rates of traffic injected into a network. One such method includes these steps: receiving a first feedback message from a congestion point of a network, the first feedback message comprising an instantaneous measure of congestion for the congestion point, congestion change information for the congestion point and identity data for the congestion point; calculating a feedback signal based, at least in part, on information in the first feedback message; and adjusting a flow rate of traffic addressed to the congestion point according to the feedback signal.
The first feedback message may identify a particular flow. The congested entity may comprise a queue. The calculating step may involve calculating the feedback signal based on the instantaneous measure of congestion and the congestion change information for the congestion point.
The first feedback message may also comprise an indication that the occupancy of a buffer of the congestion point is above a buffer congestion threshold. If so, the calculating step may involve calculating the maximum negative value of the feedback signal.
The method may include the step of adding a tag to each frame sent to the congestion point. The tag includes data responsive to the first feedback message.
All of the foregoing methods, along with other methods of the present invention, may be implemented by software, firmware and/or hardware. For example, at least some methods of the present invention may be implemented by computer programs embodied in machine-readable media. Some aspects of the invention can be implemented by network devices or portions thereof, such as an ingress port of an edge network device or an egress port of a host device's network interface card.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1A is a graph illustrating the RED algorithm.
FIG. 1B is a network diagram illustrating network congestion.
FIGS. 2A and 2B illustrate different types of BCN messages between a congestion point and a reaction point.
FIG. 3 illustrates an exemplary BCN frame format.
FIG. 4 illustrates an exemplary Rate Limited Tag (“RLT”) frame format.
FIG. 5 illustrates an exemplary BCN frame format with MAC-in-MAC encapsulation.
FIG. 6 illustrates exemplary processes of congestion detection and message generation at a congestion point.
FIG. 7 illustrates an exemplary data path structure of a reaction point.
FIG. 8 illustrates an example of timeout and restart at a reaction point.
FIG. 9 depicts an alternative implementation for congestion points having input buffers that are shared by a number of output queues.
FIG. 10 is a network device that may be configured to implement some aspects of the invention.



DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
In this application, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be obvious, however, to one skilled in the art, that the present invention may be practiced without some or all of these specific details. In other instances, well known process steps have not been described in detail in order not to obscure the present invention.
The present invention provides congestion management methods and devices that are particularly suitable for network devices, such as switches and routers. Some aspects of the present invention are particularly suitable for implementing a Data Center Ethernet (“DCE”) solution, which simplifies the connectivity of data centers and provides a high bandwidth, low latency network for carrying Ethernet and storage traffic. Some exemplary DCE methods and devices are described in the DCE Applications, which have been incorporated by reference herein. However, the present invention has wide applicability outside of the DCE context and is suitable for Fibre Channel networks, IP networks, etc, potentially any kind of packet switched network.
FIG. 1B shows a DCE network 105 that includes core switch 140, edge switches 110, 120 and 130 and corresponding end nodes 115, 125 and 135. End nodes 115 and 135 are simultaneously sending traffic at a line rate (10 Gbps) to end node 125. Because the aggregate traffic rate from links 150 and 160 exceeds the capacity of link 170, link 170 is subject to congestion and the queue(s) associated with it start filling up. Those of skill in the art will appreciate that links 150, 160 and 170 are merely illustrative and that in some networks there may be many more links, core devices, etc., disposed between the edge switches and the core switch shown in FIG. 1B.
In this example, core switch 140 is a “congestion point” that detects the congestion condition. According to preferred implementations of the invention, as soon as a congestion point detects congestion, it starts sending explicit feedback messages to the reaction points associated with the traffic flows causing such congestion. Such feedback messages will sometimes be referenced herein as backwards congestion notification (“BCN”) messages, BCN frames, or the like. In some such implementations, the feedback message is an Ethernet frame, which may have a format similar to that of the frame depicted in FIG. 3.
In this example, core switch 140 causes “slow-down” BCN messages 180 and 190 to be sent towards end nodes 115 and 135. These messages will also be referred to herein as a “negative BCN feedback messages” or the like. Such messages (and other BCN messages that are described below) are processed at “reaction points,” where congestion mitigation measures are put into place. The reaction points could be edge switches 110 and 130, or, in some implementations, end nodes 115 and 135.
The processing of a negative BCN feedback message will result in the instantiation of a filter/rate limiter (or a further slow down of the one(s) already instantiated, if any) at the reaction point. The purpose of the rate limiter is to slow down a congesting traffic flow to mitigate congestion at the core switch. If congestion should improve (or dissipate completely), “speed-up” messages (also referred to herein as “positive BCN feedback messages” or the like) will cause the rate limiters to increase their rate to avoid wasting bandwidth at the congestion point.
FIGS. 2A and 2B illustrate exemplary exchanges of messages between a congestion point and a reaction point. In this example, the congestion point is core switch 140 and the reaction point is edge switch 110. In FIG. 2A, edge switch 110 is sending untagged data frames 210 to core switch 140, indicating that edge switch 110 has not yet received (or has not recently received) a BCN feedback message.
However, core switch 140 has detected congestion. First, core switch 140 has sent negative BCN feedback message 220 to a reaction point (edge switch 110), indicating that edge switch 110 should slow down its rate of transmission. Preferably, negative BCN feedback message 220 includes sufficient detail to allow edge switch 110 to identify a particular traffic flow (i.e., a layer 2 flow, a layer 3 flow, or a layer 4 flow) that needs to be slowed. A BCN frame is generated by a congestion point by sampling incoming traffic, e.g., as described below. In this example, core switch 140 has subsequently sent a “stop” BCN message 230 to edge switch 110. As described in more detail below, a “stop” BCN message 230 will cause a reaction point to stop transmitting data (preferably on a specified data flow) for a period of time.
One exemplary BCN frame is depicted in FIG. 3. BCN frame 305 has a Destination Address (“DA”) 310 that is equal to the Source Address of the sampled frame. BCN frame 305 also has a Source Address (“SA”) 315 equal to an address (here a MAC address) associated with the congestion point. This allows BCN Frame 220 to be routed back to the source of the traffic causing congestion (in this example, to edge switch 110) with a valid source address.
In this example, field 320 is an IEEE 802.1Q tag that carries the VLAN of the sampled frame and the Priority field indicating the highest priority. Field 320 will indicate a null VLAN in two instances: (1) if the sampled frame did not carry an 802.1Q tag or (2) if the VLAN field of such tag indicated a null value. Field 325 identifies the frame as being a BCN feedback message, in this example by indicating a predetermined EtherType This EtherType could be any of the currently unassigned EtherTypes, e.g., as per http://www.iana.org/assignments/ethernet-numbers. These EtherTypes are assignable by the IEEE Standards Department, 445 Hoes Lane, P.O. Box 1331, Piscataway, N.J. 08855-1331.
Version field 330 indicates the version of the BCN protocol. In this example, three bits following version field 330 change the semantics of the BCN message when they are set. The meaning of these bits will be described below. Q bit 331 indicates that Qdelta is saturated. In the example described below, Qdelta is saturated when its value is either equal to −2Qeq or −2Qeq. M bit 332 indicates a condition of mild congestion, whereas S bit 333 indicates a condition of severe congestion. Reserved bits in field 335 are not used in this example. Instead, they are set to zero on transmission and ignored on reception. Future versions of the BCN protocol may redefine all or some of the reserved bits.
Field 340 indicates a congestion point identifier (“CPID”). A primary purpose of the CPID is to identify a congested entity in the network. In this example, the congested entity is a queue of core switch 140. This information is sent to a reaction point in order to create an association between the congested entity and the reaction point.
The contents of timestamp field 350 and unit field 352 are copied from the homonymous fields of a Rate Limited Tag (“RLT”) of the sampled frame. RLTs will be described below with reference to FIGS. 2B and 4. If the sampled frame does not carry such a tag, timestamp field 350 and unit field 352 are set to zero.
Qoff field 355 and Qdelta field 360 contain quantitative feedback information conveyed by the congestion point to the reaction point. The use of such fields will be described below with reference to FIG. 6.
Field 365 of BCN frame 305 consists of the first N bytes of the sampled frame. N is a configurable parameter, and it has a minimum value is such that the resulting BCN frame is always guaranteed to be as large as, or larger than, a minimum-sized frame of the type used to implement the invention (e.g., a minimum-sized Ethernet frame of 64 bytes). For example, in the case of BCN frame 305 of FIG. 3, the minimum value of N has to be 26 in order to ensure the length of BCN frame 305 to be 64 bytes or larger. The information in field 365 conveys to the reaction point enough information to exert highly focused congestion mitigation actions. For example, a reaction point may use source and/or destination IP addresses and TCP ports from field 365 to identify specific traffic flows and alter the corresponding transmission rates. Field 370 is the Frame Check Sequence or CRC of the BCN frame 305.
FIG. 5 illustrates an example of an extended BCN frame 505 that may be used in networks employing MAC-in-MAC encapsulation. Such methods may be implemented, for example, according to a conventional MAC-in-MAC scheme as described in IEEE standard draft 802.1 ah or according to novel methods described in U.S. patent application Ser. No. 11/152,991, entitled “FORWARDING TABLE REDUCTION AND MULTIPATH NETWORK FORWARDING” and filed on Jun. 14, 2005, both of which are hereby incorporated by reference.
BCN frame 505 includes outer destination address field 510, which indicates the outer source address of the sampled frame. Field 515 indicates the outer source address of the congestion point, which is a hierarchical MAC address in this example. Field 520 indicates the outer S-Tag (the outer IEEE 802.1Q tag) of the sampled frame. Field 525 indicates that frame 505 is a MAC-in-MAC frame.
Field 530 indicates the inner destination address, which is the inner source address of the sampled frame. Fields 535 through 580 correspond generally with fields 315 through 370 of BCN frame 305. The VLAN field of the inner and outer S-Tags 540 and 520 (a.k.a. B-Tag in 802.1ah) should be the same as the VLAN field of the 802.1Q field of the sampled frame. The priority field of the outer S-Tag 520 should be set to the highest level of priority, while the same field of the inner S-Tag 540 is the priority field of the sampled packet.
FIG. 2B illustrates exemplary exchanges of messages that may occur when a reaction point has already received one or more BCN frames from a congestion point. Here, edge switch 110 has previously received BCN frames from core switch 140. Additional BCN frames are en route, including positive BCN feedback message 250 and another negative BCN feedback message 220.
When edge switch 110 receives a BCN frame from congestion point 140 and such message is intended to cause a congestion mitigation action to be undertaken on a particular data flow (e.g., the installation of a rate limiter or the slowing down of an existing one), edge switch 110 stores a CPID in a local register associated with such data flow. All the frames 240 belonging to that flow that are subsequently injected by edge switch 110 in the network will carry a Rate Limited Tag (“RLT”) containing the CPID.
One exemplary rate-limited frame 400 is illustrated in FIG. 4. Fields 402 and 405 indicate the destination address and source address, respectively, of rate-limited frame 400. Field 407 indicates the S-Tag value of rate-limited frame 400.
Fields 410 through 427, shown in bold in FIG. 4, comprise an RLT in this example. Field 410 indicates that the tag is an RLT. In this example, the RLT tag is identified by a predetermined value in EtherType field 410. Version field 412 and Reserved field 414 have the same meaning as the 330 and 335, respectively, of BCN frame 305.
CPID field 415 indicates the congestion point to which the RLT pertains. This information may be used to complete the association between a reaction point and the corresponding congestion point. One important purpose of this association is to prevent a reaction point from receiving positive feedback from multiple congestion points for the same flow. Preferably, a congestion point will generate BCN feedback messages only on flows whose frames that carry an RLT tag with a CPID matching its own ID. As noted above, when a reaction point receives a BCN frame from a congestion point and such message causes a congestion mitigation action to be undertaken on a particular data flow, the reaction point associates the CPID with the data flow, e.g. by saving the CPID in a local register associated with such data flow. Field 420 is reserved.
Timestamp field 425 may be used to estimate the round trip time between the reaction point and the congestion point with which it is associated. Each time a reaction point inserts an RLT tag in a frame it is going to transmit, the current value of a local free running timer is copied into timestamp field 425. Unit field 427 indicates the time units used by the free running timer. The resolution of this free running timer may be, for example, a value in the range 1 μs to 100 μs. As noted above, when a frame having an RLT tag is sampled by a congestion point, the contents of timestamp field 425 and unit field 427 are copied and inserted in timestamp field 350 and unit field 352 of a BCN frame generated by the congestion point.
Exemplary methods for congestion detection and for generating BCN frames at a congestion point will now be described with reference to FIG. 6. Queue 605 is a queue of a congestion point. An equilibrium threshold Qeq 610 defines a desired operating point of a queue under congestion conditions. In other words, Qeq 610 establishes a target level around which the length of queue 605 should oscillate when congestion arises. A severe congestion threshold Qsc 615 defines the level at which the queue is subject to extreme congestion conditions.
Incoming frames are sampled with a certain probability P 620. P 620 is a configurable parameter, the selection of which is a tradeoff between the usefulness of more frequent congestion detection and the overhead required for more frequent sampling and computation. In some preferred implementations, P 620 is in the range of 0.001 to 0.1; in some such implementations, P 620 is 0.01. The values of Qeq 610, Qsc 615 and P 620 should be established before the other steps shown in FIG. 6 are performed.
In step 625, a congestion point determines whether or not to sample a frame. If no frame is sampled, no BCN frame will be generated at that moment. When a frame is sampled, the process continues to step 635, wherein the sampled frame is evaluated.
In this example, when the length of queue 605 is below Qeq, the treatment of sampled frames will differ according to whether the sampled frame carries an RLT tag having a CPID that identifies the congestion point. If the sampled frame does not carry such an RLT tag and the length of the queue below Qeq, no BCN Frame is generated (message generation scheme 640) and sent (step 642). However, if the sampled frame does carry such an RLT tag and the length of the queue below Qeq, a BCN Frame is generated (message generation scheme 660) and sent (step 642).
In other words, in this implementation, if the sampled frame carries an RLT tag the congestion point generates a BCN frame irrespective of the current queue length if and only if its congestion point identifier matches the CPID field in the RLT tag. When such a match occurs, the timestamp field of the RLT tag is copied into the corresponding field of the BCN Frame.
In this implementation, when the queue length is above Qeq, the Congestion Point will generate either a regular BCN feedback message or a “stop” BCN feedback message irrespective of the CPID field in the RLT tag. In this example, if the length of queue 605 is ≧Qeq and is ≦Qsc, a negative BCN feedback message is generated whether or not the packet carries an RLT tag, and whether or not the CPID of the RLT tag (if any) matches the congestion point ID. A “stop” BCN feedback message is generated when the length of the queue is >Qsc.
In this example, a BCN feedback message includes two fields, Qoff and Qdelta. Qoff is an instantaneous measure of congestion, which in this example is the offset of the current queue length with respect to the equilibrium threshold Qeq. Here, Qoff is saturated at +Qeq and −Qeq. Here, a BCN feedback message also includes congestion change information. Here, the congestion change information is Qdelta, which is the change in length of the queue since the last sampled frame. In this example, Qdelta is saturated at +2Qeq and −2Qeq. When Qdelta saturates, the Q bit in the BCN Frame is set. A “stop” BCN feedback message is indicated by zero values for Qoff and Qdelta. In fact, since a BCN message is not generated when a frame is sampled and Qoff and Qdelta are both zero, this combination may be used to identify a “stop” BCN message.
Qdelta may be calculated according to at least two methods. In the first method, Qdelta is the difference between the current queue length and the queue length at the previous time of sampling. In a second method, Qdelta is the difference between the number of packets (or other data units) added to the queue and the number of packets (or other data units) removed from the queue since the last time of sampling. The first method is more accurate but requires that an indication of the previous queue length be stored in memory. The second method requires a smaller amount of state to be kept, but may be prone to error accumulation.
FIG. 7 illustrates the structure of the data paths of a reaction point according to some implementations of the invention. This process may be implemented, for example, in an ingress port of an edge switch or in an egress port of the network interface card (“NIC”) of a host device. Data path 705 represents a condition of the reaction point before any BCN frames have been received indicating congestion that pertains to this reaction point, e.g., as in the state of edge device 110 in FIG. 2A. In data path 705, un-tagged data frames, like those of data frames 210 of FIG. 2A, are transmitted by the reaction point.
After BCN frames have been received indicating congestion that pertains to this reaction point (e.g., as in the state of edge device 110 in FIG. 2B), a set of filters 720, F1 through Fn, divert the traffic that matches a particular filtering criterion (e.g., L2 SA-DA, L3 SA-DA, etc.) from data path 705 to a set of queues. Traffic is drained from such queues by a set of corresponding rate limiters 740, R1 through Rn, whose rate is controlled by the BCN Frames coming from congestion points. Besides controlling the rate of traffic, in this implementation the rate limiters also cause an RLT tag to be added to all the frames they transmit in order to elicit feedback from the congestion points. To ensure that the feedback is generated only by the congestion point that originally caused the instantiation of the filter, the RLT tag contains the identity of such congestion point (“CPID”). Congestion points should include their identity in every BCN Frame they generate, so that each of filters 720 may be associated with individual congestion points.
According to some implementations of the invention, the rate control algorithm used by rate limiters 740 works according to a Feedback Signal Fb that is calculated, e.g., according to Equation (1):

Fb=(Qoff−w·Qdelta)  Equation (1)

In Equation (1), w is a parameter used to weight the derivative component Qdelta (which is also referred to herein as the congestion change component or the like) more or less with respect to the offset component Qoff (which is also referred to herein as the instantaneous measure of congestion or the like). The values of Qoff and Qdelta are determined from BCN frames received by a reaction point. Based on the sign of the Feedback Signal Fb, in some implementations of the invention the rate R is increased or decreased as follows:

If Fb>0 R=R+Gi·Fb·Ru  Equation (2)

If Fb<0 R=R·(1−Gd·|Fb|)  Equation (3)

If Fb=0, R is unchanged. Here, Gi and Gd are the Increase Gain and Decrease Gain respectively, and Ru is the Rate Unit (i.e., the granularity of the rate adjustment) employed by the rate limiters. In one example, Gi=1, Ru=8 Mbps and Gd= 1/64. However, these values are merely exemplary and the variables of Equations (2) and (3) may be optimized according to the implementation. The calculations are preferably done in the reaction point. In alternative implementations, the calculations are done elsewhere, e.g., in the detection point. However, if the calculations are performed in a location other than the reaction point, the most effective use of timestamps will be inhibited.
It will be observed that in implementations that use equations in the general form of Equations (2) and (3) to control changes in R, the rates are decreased more aggressively when Fb<0 (a multiplicative decrease) than the rates are increased when Fb>0 (an additive increase). This is desirable in order to avoid filling the buffers of a congestion point too quickly due to a slow response to detected congestion or due to a too-rapid increase in flow when congestion is abating.
A limited number of filters/rate limiters may be available. There may be cases when all the filters have been used and a BCN message is received which should cause the instantiation of a new filter/rate limiter pair. In such cases, a number of actions may be taken, e.g.: (1) aggregate all the filters/rate limiters in a single filter/rate limiter that controls the entire traffic originated by and end system; (2) aggregate filters/rate limiters in an “intelligent” way, e.g., use the same filter/rate limiter for all the traffic flows sharing the same destination address, etc; or (3) aggregate filters/rate limiters in a “less intelligent” way, e.g., use the same filter/rate limiter for all the traffic flows sharing the same bucket based on an hash function of the frame header.
When a reaction point receives a BCN Frame, the difference between the current time and the time indicated in the timestamp field of the BCN Frame is calculated. This difference is the last measure of the round trip time between the reaction point and the congestion point. This measure may be averaged out, for example using an Exponential Weighted Moving Average similar to the one used by WRED, and used to dynamically adjust the value of some of the reaction parameters. For example, a reaction point may have a number of tables containing different values of the w, Gi, and Gd parameters precalculated based on different round-trip times. The current value of the averaged round-trip time may be used to select the table of parameters that best suite the current loop delay.
Once a rate limiter has been instantiated, it may be reclaimed once two conditions are satisfied: (1) the queue of the rate limiter is empty, and (2) its rate is at or above the line-rate. These two conditions are necessary to avoid out of order packet delivery.
Each rate limiter is associated with a timer that is reset every time a BCN Frame is received. If this timer expires, it means that the corresponding rate limiter has not received BCN Frames for the entire duration of the timeout period. This may happen, for example, because the traffic stream that that rate limiter was controlling has suddenly ended. Alternatively, this may occur because routing issues in the network are preventing BCN Frames from reaching the reaction point. To reclaim a rate limiter that may potentially be stale, various implementations of the invention employ a variety of solutions. In some implementations, the rate limiter is immediately freed up at the timeout expiration. In other implementations, the rate of the rate limiter starts automatically increasing when the timer expires. This increase may continue, for example, until the conditions for the filter reclaiming are met or BCN frames are eventually received. In other implementations, management software is notified (e.g., via an interrupt) of the anomaly and the management software is allowed to deal with the issue.
Rate limiters use a certain amount of buffer space to store frames held in their queues. Therefore, an active queue management mechanism may advantageously be used to prevent such buffers from overflowing. Traditional AQM techniques such as RED do not work well in such conditions because of the limited buffer and flow dynamics. An alternative AQM algorithm of the present invention may be implemented as follows. First, a threshold Qaqm is associated with the rate limiter queues. If the length of a rate limiter queue is below the Qaqm threshold, no action is taken. If the length of the rate limiter is above the Qaqm threshold, a packet is dropped/marked with a certain fixed probability (e.g., a probability in the range of 0.1 to 0.001).
If reactive and non-reactive flows (such as TCP and UDP flows) are sharing the same rate limiter queue, two separate packet counters are introduced. One packet counter is used for counting reactive packets in and the other for non-reactive packets stored in the queue. The AQM algorithm described in the previous paragraph could be implemented in the same way, except that for non-reactive flows the drop probability is 1.
An active filter 720 may change its association with a congestion point over time. The association can be changed when a negative BCN Frame is received from a congestion point different from the one currently associated with the filter. For example, if a traffic flow is subject to congestion at congestion point CP1 (and therefore is filtered and rate-controlled according to feedback from CP1) starts experiencing congestion at congestion point CP2, CP2 will generate negative a BCN frame for that flow, causing its filter to change association from CP1 to CP2. After some time, the negative feedback generated by one of the two congestion points will prevail and the filter will settle its association with that congestion point.
When a congestion point is subject to severe congestion, it may send a “stop” BCN feedback message. Such a message is also referred to herein as a “BCN0” message or the like because in some implementations a “stop” BCN feedback message is a BCN message with Qoff=0 and Qdelta=0.
Referring now to graph 805 of FIG. 8, transmission rates are indicated with respect to vertical axis 810 and time is indicated with respect to horizontal axis 815. When a rate limiter receives a “stop” BCN feedback message (at time 825), in some implementations of the invention it sets its current rate 820 to 0 and starts a timer, e.g., a random timer whose range is determined by time Tmax (e.g., 10 us). When the timer started by the BCN0 message expires, the rate limiter is set to operate at a minimum rate 835, which is a minimum rate Rmin in this example (e.g., 1/10 of line rate). This should restart the traffic flow towards the congestion point and trigger—hopefully positive—feedback. In this example, the slow restart leads to positive feedback from the congestion point at time 840 and a subsequent increase in R to rate 845.
After the timer expiration, Tmax is doubled and Rmin is halved, so that the next BCN0 will cause the random timer to have a longer duration and the rate limiter to restart from a slower rate, effectively realizing an exponential back-off. The initial values of Tmax and Rmin are restored upon the reception of the first positive feedback. During the timeout period, i.e., while the random timer is running, all BCN messages, including BCN0, must be ignored.
The same timer may be used if, for any reason, the rate of a rate limiter becomes smaller that Rmin. When this happens, the random timer is started. When it expires, the rate of the rate limiter is set to Rmin.
Special handling of the BCN message is required when any of the Q bits is set in the BCN Frame. When this bit is set, the Qdelta parameter is saturated at 2Qeq or −2Qeq. When this happens, a stronger rate adjustment must be performed because the system is working outside of the linear region. The saturation feedback signal is calculated as follow:




  
    Fb
    sat
  
  =
  
    
      -
      2
    
    ·
    
      (
      
        
          Qdelta
          2
        
        +
        
          w
          ·
          Qdelta
        
      
      )
    
  




The rate adjustment is then performed as usual, i.e.:

    
    
        If Fbsat>0 R=R+Gi·Fbsat·Ru
        If Fbsat<0 R=R·(1−Gd·|Fbsat|)
    
    


The saturation feedback generates a rate adjustment twice as big as the maximum rate adjustment.
It will often be the case that a queue considered herein is part of a VOQ system wherein an unpredictable number of queues may be sharing a common buffer at any given time. In such circumstances, it may be beneficial to tune or modify the previously-described methods of the present invention according to the state of the VOQ system and the associated buffer. The larger the number of VOQs sharing the same physical or logical buffer, the lower the equilibrium threshold Qeq should be kept. Accordingly, some implementations of the invention provide a dynamic equilibrium threshold Qeq that responds to such conditions by decreasing Qeq as the number of active VOQs increases and increasing Qeq as the number of active VOQs decreases.
Moreover, the more that a common buffer is congested, the stronger the reaction implemented by the reaction points should be. In some implementations of the invention, the overall occupancy of a buffer will override the previously-described methods for implementing BCN messages according to indications from individual queues. One such implementation will now be described with reference to FIG. 9.
FIG. 9 depicts core switch 900 having an input buffer 905 for port 902. Core switch 900 is a congestion detection point. Here, input buffer 905 is shared by a number of output queues 910. When the overall occupancy of buffer 905 reaches a predetermined level, “slow down” or “stop” BCN indications will result, even when no individual queue is experiencing congestion.
In this example, when the occupancy of buffer 905 increases beyond mild congestion threshold (“Bmc”), the M bit will be set in the BCN frame (e.g., in reserved area 335 of frame 305 (see FIG. 3)). The reaction point (e.g., an edge switch) will detect that the M bit has been set and will double the effect of any negative feedback. Positive feedback sent from a congestion point according to the condition of an individual queue with the M bit set will be ignored.
When the severe congestion threshold (“Bsc”) is crossed, the S bit will be set in the BCN frame. If the reaction point detects that the S bit has been set, the reaction point will translate any corresponding BCN indication to be a “stop” BCN indication and will respond accordingly.
FIG. 10 illustrates an example of a network device that may be configured to implement some methods of the present invention. Network device 1060 includes a master central processing unit (CPU) 1062, interfaces 1068, and a bus 1067 (e.g., a PCI bus). Generally, interfaces 1068 include ports 1069 appropriate for communication with the appropriate media. In some embodiments, one or more of interfaces 1068 includes at least one independent processor 1074 and, in some instances, volatile RAM. Independent processors 1074 may be, for example ASICs or any other appropriate processors. According to some such embodiments, these independent processors 1074 perform at least some of the functions of the logic described herein. In some embodiments, one or more of interfaces 1068 control such communications-intensive tasks as media control and management. By providing separate processors for the communications-intensive tasks, interfaces 1068 allow the master microprocessor 1062 efficiently to perform other functions such as routing computations, network diagnostics, security functions, etc.
The interfaces 1068 are typically provided as interface cards (sometimes referred to as “line cards”). Generally, interfaces 1068 control the sending and receiving of data packets over the network and sometimes support other peripherals used with the network device 1060. Among the interfaces that may be provided are Fibre Channel (“FC”) interfaces, Ethernet interfaces, frame relay interfaces, cable interfaces, DSL interfaces, token ring interfaces, and the like. In addition, various very high-speed interfaces may be provided, such as fast Ethernet interfaces, Gigabit Ethernet interfaces, ATM interfaces, HSSI interfaces, POS interfaces, FDDI interfaces, ASI interfaces, DHEI interfaces and the like.
When acting under the control of appropriate software or firmware, in some implementations of the invention CPU 1062 may be responsible for implementing specific functions associated with the functions of a desired network device. According to some embodiments, CPU 1062 accomplishes all these functions under the control of software including an operating system (e.g. Linux, VxWorks, etc.), and any appropriate applications software.
CPU 1062 may include one or more processors 1063 such as a processor from the Motorola family of microprocessors or the MIPS family of microprocessors. In an alternative embodiment, processor 1063 is specially designed hardware for controlling the operations of network device 1060. In a specific embodiment, a memory 1061 (such as non-volatile RAM and/or ROM) also forms part of CPU 1062. However, there are many different ways in which memory could be coupled to the system. Memory block 1061 may be used for a variety of purposes such as, for example, caching and/or storing data, programming instructions, etc.
Regardless of network device's configuration, it may employ one or more memories or memory modules (such as, for example, memory block 1065) configured to store data, program instructions for the general-purpose network operations and/or other information relating to the functionality of the techniques described herein. The program instructions may control the operation of an operating system and/or one or more applications, for example.
Because such information and program instructions may be employed to implement the systems/methods described herein, the present invention relates to machine-readable media that include program instructions, state information, etc. for performing various operations described herein. Examples of machine-readable media include, but are not limited to, magnetic media such as hard disks, floppy disks, and magnetic tape; optical media such as CD-ROM disks; magneto-optical media; and hardware devices that are specially configured to store and perform program instructions, such as read-only memory devices (ROM) and random access memory (RAM). The invention may also be embodied in a carrier wave traveling over an appropriate medium such as airwaves, optical lines, electric lines, etc. Examples of program instructions include both machine code, such as produced by a compiler, and files containing higher level code that may be executed by the computer using an interpreter.
Although the system shown in FIG. 10 illustrates one specific network device of the present invention, it is by no means the only network device architecture on which the present invention can be implemented. For example, an architecture having a single processor that handles communications as well as routing computations, etc. is often used. Further, other types of interfaces and media could also be used with the network device. The communication path between interfaces/line cards may be bus based (as shown in FIG. 10) or switch fabric based (such as a cross-bar).
Other Embodiments
Although illustrative embodiments and applications of this invention are shown and described herein, many variations and modifications are possible which remain within the concept, scope, and spirit of the invention, and these variations would become clear to those of ordinary skill in the art after perusal of this application.
Accordingly, the present embodiments are to be considered as illustrative and not restrictive, and the invention is not to be limited to the details given herein, but may be modified within the scope and equivalents of the appended claims.

## Claims

1. A method of controlling a rate of traffic injected into a network, the method comprising:
receiving a first feedback message from a congestion point of a network, the first feedback message comprising an Ethernet frame having embedded therein:
an instantaneous congestion value in a first field of the Ethernet frame;
a congestion change value in a second field of the Ethernet frame, the second field being separate from the first field; and
a congestion point identifier associated with the congestion point;

calculating a rate control value based, at least in part, on the instantaneous congestion value and the congestion change value; and
adjusting a flow rate of traffic addressed to the congestion point according to the rate control value.

2. The method of claim 1, wherein the Ethernet frame includes an EtherType field value that identifies the Ethernet frame as a backwards congestion notification message.

3. The method of claim 1, wherein the Ethernet frame includes first and second congestion condition bits, wherein the first congestion condition bit indicates whether mild congestion is present, and the second congestion condition bit indicates whether severe congestion is present.

4. The method of claim 1, wherein the first feedback message further comprises an indication that an occupancy of a buffer of the congestion point is above a buffer congestion threshold, wherein calculating the rate control value comprises calculating a maximum negative value of the rate control value.

5. The method of claim 1, further comprising adding a tag to frames sent to the congestion point, the tag including data responsive to the first feedback message.

6. An apparatus for controlling a rate of traffic injected into a network, comprising:
a processor; and
a memory, at least one of the processor or the memory being configured for:
receiving a first feedback message from a congestion point of a network, the first feedback message comprising an Ethernet frame having embedded therein:
an instantaneous congestion value in a first field of the Ethernet frame;
a congestion change value in a second field of the Ethernet frame, the second field being separate from the first field, the congestion change value indicating a change in an amount of congestion at the congestion point; and
a congestion point identifier associated with the congestion point;

calculating a rate control value based, at least in part, on the instantaneous congestion value and the congestion change value; and
adjusting a flow rate of traffic addressed to the congestion point according to the rate control value.

7. The apparatus of claim 6, wherein the first feedback message identifies a network flow.

8. The apparatus of claim 6, wherein the first feedback message further comprises an indication that an occupancy of a buffer of the congestion point is above a buffer congestion threshold, wherein said calculating step the rate control value comprises calculating a maximum negative value of the rate control value.

9. The apparatus of claim 6, at least one of the processor or the memory being further configured for adding a tag to frames sent to the congestion point, the tag including data responsive to the first feedback message.

10. A device for controlling a rate of traffic injected into a network, the device comprising:
means for receiving a first feedback message from a congestion point of a network, the first feedback message comprising an Ethernet frame having embedded therein:
an instantaneous congestion value in a first field of the Ethernet frame;
a congestion change value in a second field of the Ethernet frame, the second field being separate from the first field; and
a congestion point identifier associated with the congestion point;

means for calculating a rate control value based, at least in part, on the instantaneous congestion value and the congestion change value;
means for adjusting a flow rate of traffic addressed to the congestion point according to the rate control value; and
means for adding data responsive to the first feedback message to frames sent to the congestion point.

11. The device of claim 10, wherein the device comprises an ingress port of an edge switch.

12. The device of claim 10, wherein the device comprises an egress port of a host device.

13. A congestion management method, comprising:
detecting network congestion at a first congestion point of a network
identifying a first congested entity of the network;
determining a current queue level of the congested entity;
sending a first feedback message to a first reaction point of the network, the first reaction point being associated with one or more traffic flows at least partly causing the congestion, the first feedback message comprising an Ethernet frame having embedded therein:
an instantaneous congestion value in a first field of the Ethernet frame;
a congestion change value in a second field of the Ethernet frame, the second field being separate from the first field; and
a congestion point identifier associated with the congested; and

determining whether the congestion change value exceeds a predetermined threshold;
wherein the predetermined threshold decreases as a number of active virtual output queues (“VOQs”) in a buffer of the first congestion point increases and wherein the predetermined threshold increases as the number of active VOQs in the buffer decreases.

14. The method of claim 1, wherein the congestion change value is associated with a change in length of a queue.

15. The method of claim 1, wherein the congestion change value indicates a change in a level of congestion since a previous time.

16. The method of claim 1, further comprising adding data responsive to the first feedback message to frames sent to the congestion point.