QoS for multiplexing network receive queues
By using a hierarchical policyr and a two-level meter in the producer-consumer software model, fairness to multiplexed network reception queues is achieved, fairness problems caused by shared queues are solved, memory usage is reduced and avoidance Queue starvation.
Patent Information
- Application Number
- CN202410198988.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-02-23
- Filing Date
- 2024-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
In the producer-consumer software model, shared queues lead to fairness issues, with heavier producers excluding lighter producers, resulting in increased memory usage and queue starvation.
The hierarchical policyr and two-level meter mechanism are used to ensure the fastest entry of each network flow into the multiplexing network reception queue by marking and re-marking packets to achieve queue fairness. The hierarchical policyr marks groups according to the available credit and re-marks and discards unnecessary groupings through the secondary meter to ensure fair competition.
It effectively solves the problem of queue fairness, ensures fast access to the queue for each network flow, reduces memory usage, and avoids queue starvation.
Smart Images

Figure CN118540289A
Abstract
Description
Technical Field
[0001] The present invention relates to computer systems and, in particular but not exclusively, to providing queue fairness. Background Art
[0002] In the producer-consumer software model, there are two entities, the producer and the consumer. The producer produces objects, such as items in a queue, and the consumer consumes objects, such as items from a queue. Providing a separate queue for each producer-consumer pair provides a fair solution. However, the memory footprint of the queue grows linearly with the number of consumers.
[0003] A solution to the above problem is to provide a queue shared by multiple producers and consumers, thereby reducing memory usage. However, shared queues lead to fairness issues, where consumers compete to use the queue because heavy producers exclude light producers from adding to the queue based on the large number of objects provided by one or more producers. Summary of the invention
[0004] According to an embodiment of the present disclosure, a network device is provided, comprising: a network interface for receiving packets through a packet data network; and a hierarchical policyr for providing queue fairness for multiple network flows competing for access to a multiplexed network receive queue; and comprising a primary meter for marking the received packets, a secondary meter for receiving at least some of the marked packets and re-marking at least some of the marked packets, and queuing logic for adding packets marked with a first label type to the multiplexed network receive queue and discarding packets marked with a third label type.
[0005] According to another embodiment of the present disclosure, a network device is provided, comprising: a network interface for receiving packets through a packet data network; and a packet processing circuit for managing a multiplexed network receiving queue, and comprising a hierarchical policy device for providing queue fairness for a plurality of network flows competing for entry into the multiplexed network receiving queue, the hierarchical policy device comprising: a plurality of primary meters for marking received packets with corresponding labels selected from three label types, a first primary meter among the primary meters for selectively marking packets of a first network flow of the three label types, and a second primary meter among the primary meters for selectively marking packets of a second network flow of the three label types; a secondary meter for receiving at least some of the marked packets output by the primary meter and re-marking the at least some of the marked packets; and a queuing logic for selectively adding packets marked with a first label type or a second label type among the three label types to the multiplexed network receiving queue, and discarding packets marked with a third label type among the three label types.
[0006] Further in accordance with an embodiment of the present disclosure, a hierarchical policer is used to provide queue fairness for network flows such that each network flow contending for access to a multiplexed network receive queue is provided at least minimal access to the multiplexed network receive queue.
[0007] Still further in accordance with an embodiment of the present disclosure, the primary meter marks three label types on received packets based on available primary meter credits for the first label type and the second label type, and the secondary meter re-marks some of the marked packets based on current labels of the marked packets and available secondary meter credits for the first label type and the second label type.
[0008] Furthermore, according to an embodiment of the present disclosure, the packet processing circuit is configured to consume the available primary meter credits and the available secondary meter credits on the bandwidth of the packet.
[0009] Furthermore, according to an embodiment of the present disclosure, the packet processing circuit is configured to periodically replenish available primary meter credits and available secondary meter credits.
[0010] Further according to an embodiment of the present disclosure, the packet processing circuit is used to consume the available primary meter credits and the available secondary meter credits into a plurality of packets.
[0011] Still further in accordance with an embodiment of the present disclosure, the packet processing circuit is configured to add back consumed credits of the primary meter credits and the secondary meter credits in response to corresponding ones of the packets being consumed by the multiplex network receive queue.
[0012] In addition, according to an embodiment of the present disclosure, the packet processing circuit is used to configure the number of available primary meter credits and the available secondary meter credits so that the packet marked by the primary meter using the first label type retains the first label type after re-marking by the secondary meter.
[0013] In addition, according to an embodiment of the present disclosure, a hierarchical policyr is used to provide queue fairness for the network flows, so that each of the network flows competing for entry into the multiplexed network receive queue is provided with at least the fastest entry into the multiplexed network receive queue based on packets marked by the primary meter with the first label type retaining the first label type after being re-marked by the secondary meter.
[0014] Further in accordance with an embodiment of the present disclosure, the packet processing circuit is used to configure the available primary meter credits and the available secondary meter credits so that some of the packets marked by the primary meter using the second label type are re-marked by the secondary meter using the third label type.
[0015] According to another embodiment of the present disclosure, a network method is also provided, including: receiving packets through a packet data network, managing a multiplexed network receiving queue, using a hierarchical policyr to provide queue fairness for multiple network flows competing for entry into the multiplexed network receiving queue, marking the received packets with corresponding labels selected from three label types through multiple first-level meters including a first first-level meter and a second first-level meter, selectively marking the three label types for packets of a first network flow by the first first-level meter, selectively marking the three label types for packets of a second network flow by the second first-level meter, receiving at least some of the marked packets output by the first-level meter, re-marking the at least some of the marked packets, and selectively adding the packets marked with the first label type or the second label type of the three label types to the multiplexed network receiving queue, and discarding the packets marked with the third label type of the three label types.
[0016] Still further in accordance with an embodiment of the present disclosure, there is provided: providing queue fairness for network flows such that each network flow competing for entry to a multiplexed network receive queue is provided at least with the fastest entry to the multiplexed network receive queue.
[0017] In addition, according to an embodiment of the present disclosure, the marking includes: marking the three label types on the received packets based on available primary meter credits of the first label type and the second label type, and the re-marking includes: re-marking some of the marked packets based on current markings of the marked packets and available secondary meter credits of the first label type and the second label type.
[0018] Furthermore, according to an embodiment of the present disclosure, the method includes: consuming available primary meter credits and available secondary meter credits with a bandwidth of the packet.
[0019] Further in accordance with an embodiment of the present disclosure, the method includes: periodically replenishing the available primary meter credit and the available secondary meter credit.
[0020] Still further, according to an embodiment of the present disclosure, the method includes: consuming the available primary meter credits and the available secondary meter credits by the number of packets.
[0021] Furthermore, according to an embodiment of the present disclosure, the method includes: adding back consumed credits of the primary meter credits and the secondary meter credits in response to corresponding packets of the packets consumed by the multiplex network reception queue.
[0022] Furthermore, according to an embodiment of the present disclosure, the method includes configuring the number of available primary meter credits and available secondary meter credits so that packets marked with a first label type by the primary meter retain the first label type after being re-marked by the secondary meter.
[0023] Further in accordance with an embodiment of the present disclosure, there is provided: providing queue fairness for network flows such that each network flow competing for entry to a multiplexed network receive queue is provided with at least the fastest entry to the multiplexed network receive queue based on packets marked with a first label type by a primary meter retaining the first label type after being re-marked by a secondary meter.
[0024] Still further, according to an embodiment of the present disclosure, the configuration includes: configuring the available primary meter credits and the available secondary meter credits so that some of the packets marked by the primary meter using the second label type are re-marked by the secondary meter using the third label type. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The present invention will be understood through the following detailed description in conjunction with the accompanying drawings, in which:
[0026] Figure 1is a block diagram of a computer system constructed and operated in accordance with an embodiment of the present invention;
[0027] Figure 2 is included in Figure 1 A flowchart of the steps in a method of operating a primary meter in a system;
[0028] Figure 3 is included in Figure 1 A flowchart of the steps of a method of operating a secondary meter in a system;
[0029] Figure 4 is included in Figure 1 A flowchart of the steps in a method for setting a credit rating in a system;
[0030] Figure 5 is included in Figure 1 A flowchart of the steps of a method for replenishing credit in a system;
[0031] Figure 6 is included in Figure 1 A flowchart of the steps in an alternative method of supplementing credit in a system;
[0032] Figure 7-9 is a diagram showing example tags Figure 1 A block diagram view of a hierarchical policy controller in a system of
[0033] Figure 10-11 is a diagram showing example tags Figure 1 Block diagram view of an alternative hierarchical policy maker in a system. DETAILED DESCRIPTION
[0034] Overview
[0035] As mentioned previously, implementing a shared queue in a producer-consumer software model can lead to fairness issues for consumers. For example, when multiple virtual machines (VMs) share the same network queue, there is a possibility that one of the VM connections can starve other VMs. In this example, the network connection or VM is considered a producer, and the network queue is considered a consumer. One solution is to determine when a producer is allowed to insert an object into a queue. In software, for example, this can be provided using an "if" statement. However, in the case of receiving a packet, the hardware places the packet in a receive queue. In hardware, it is difficult to provide queue fairness, and a decision on whether to limit the producer needs to be made before the packet is consumed by the consumer (for example, before the packet is placed on the receive queue). In many cases, queue fairness is not provided using a congestion control algorithm because there may be no congestion on the network. For example, a queue can retain 1GB / s, and the link feeding the queue can have a bandwidth greater than 100GB / s. Therefore, in this case, it may not be necessary to control the network connection, but it may be necessary to control the entry to the queue.
[0036] Additionally, when applying fairness, the different loads on the queue should be taken into account. For example, if three producers are added to the queue, then the capacity of the queue should be divided between the three producers. However, if only a single producer is added to the queue, then most of the capacity of the queue should be allocated to that single producer.
[0037] Embodiments of the present invention use a hierarchical policyr to provide queue fairness for network flows competing for entry to a multiplexed network receive queue. The hierarchical policyr includes two levels of meters. The first level includes a meter for each network flow, and each meter marks incoming packets according to available credits, so that some packets are marked type-1 (e.g., green) according to available type-1 credits, some packets are marked type-2 (e.g., yellow) according to available type-2 credits (when type-1 credits are not available), and some packets are marked type-3 (e.g., red) when type-1 credits and type-2 credits are not available. Type-3 (e.g., red) packets are discarded, and type-1 (e.g., green) and type-2 (e.g., yellow) packets are provided as input to the secondary meter of the hierarchical policyr.
[0038] The secondary meter re-labels packets according to the following logic. If a packet has been labeled as type-1 (e.g., green), the packet is re-labeled as type-1 (e.g., green) by the secondary meter based on the available type-1 credits. In the context of this document, the term "re-labeling" may include actually re-labeling a packet with a new label or verifying a previous labeling of a packet. Secondary meter credits are typically configured so that type-1 (e.g., green) packets that arrive at the secondary meter remain type-1 (e.g., green) packets. However, in some embodiments, according to the logic of the secondary meter, if for some reason no type-1 credits are available in the secondary meter, the type-1 (e.g., green) packet may be re-labeled by the secondary meter as a type-2 (e.g., yellow) packet, or even as a type-3 packet if no type-2 credits are available.
[0039] If a packet arriving at the secondary meter is already marked as type-2 (e.g., yellow), the packet is re-marked as type-2 (e.g., yellow) by the secondary meter based on the available type-2 credits. If no type-2 credits are available in the secondary meter, the type-2 (e.g., yellow) packet may be re-marked as type-3 by the secondary meter. Packets marked as type-1 (e.g., green) or type-2 (e.g., yellow) by the secondary meter are added to the queue, while packets marked as type-3 are dropped.
[0040] The initial level of type-1 credits allocated to the secondary meter is configured as the sum of the type-1 credits allocated to the primary meter, so that all packets marked as type-1 (e.g., green) remain type-1 (e.g., green) after the secondary meter, thereby guaranteeing the fastest entry to the queue for each network flow. In other words, typically, all packets marked as type-1 (e.g., green) by the primary meter will eventually be added to the queue, while some packets marked as type-2 (e.g., yellow) will be added to the queue, while some packets will be dropped.
[0041] The use of two levels of meters and three types of packet marking allows queue fairness to be provided when all network flows are active. It also allows unused queue capacity to be reassigned to one or more active network flows when one or more other network flows are less active or not active at all. For example, if all network flows are active, more type-2 marked packets will be remarked as type-3 by the secondary meter and discarded. However, if one or more network flows are less active or not active, the less type-2 marked packets of the more active flows will be remarked by the secondary meter, thereby adding more type-2 packets to the queue.
[0042] In some embodiments, the classification policer may be configured as a bandwidth classification policer, where the credits are bandwidth credits. For example, for one of the meters, the type-1 credits may be initially set equal to X GB (gigabytes) and the type-2 credits may be initially set equal to Y GB. Credits may be consumed relative to the size of the packet. For example, if a packet has a size of A, and the packet is labeled according to a type-1 tag, the type-1 credits are reduced by A. Credits are replenished periodically, for example by adding X GB / sec back to the type-1 credits and Y GB / sec back to the type-2 credits.
[0043] In some embodiments, the hierarchical policer may be configured as a token hierarchical policer, where credits are equal to the number of packets or the number of positions in a queue. For example, for one of the meters, type-1 credits may be initially set equal to X packets and type-2 credits may be initially set equal to Y packets. Credits may be consumed relative to the number of packets. For example, if a packet is marked according to a type-1 tag, the type-1 credit is reduced by 1. As described in the disclosed embodiments, credits are replenished based on packets consumed by a queue.
[0044] System Description
[0045] See now Figure 1 , Figure 1 1 is a block diagram of a computer system 10 constructed and operated according to an embodiment of the present invention. System 10 includes a host device 12 and a network interface controller 14. In some embodiments, network interface controller 14 can be replaced by any suitable network device. Host device 12 includes a processor 16 and a host memory 18. Processor 16 can be configured to run virtual machines (VMs), including VM 20 and VM 22. Host memory 18 can store a multiplexed network receive queue 24, described in more detail below.
[0046] The network interface controller 14 includes a network interface 26 and a packet processing circuit 28. The network interface 26 and the packet processing circuit 28 may be implemented using one or more application specific integrated circuits (ASICs). The network interface 26 is configured to receive packets 30 from remote nodes such as a remote node 34 and a remote node 36 via a packet data network 32. The packets 30 received from the remote node 34 represent one network flow, and the packets 30 received from the remote node 36 represent another network flow. A "network flow" is typically identified by the values of a set of specified header fields, such as an IP and TCP / UDP 5-tuple of source and destination addresses, source and destination ports, and a protocol, or any suitable flow information such as layer 2, 3, 4, or tunnel data, which is consistent across all packets in the flow.
[0047] The packet processing circuit 28 is configured to process packets 30 received from remote nodes and manage the multiplexed network receive queue 24. The packet processing circuit 28 may include a physical (PHY) layer unit, a MAC unit, and a classification policer 38 for providing queue fairness for network flows competing for entry to the multiplexed network receive queue 24.
[0048] The hierarchical policer 38 is configured to provide queue fairness for network flows such that each network flow competing for entry to the multiplexed network receive queue 24 is provided with at least the fastest entry to the multiplexed network receive queue 24. The hierarchical policer 38 includes a plurality of primary meters 40 for marking received packets 30 with corresponding labels selected from three label types (type-1, type-2, type-3). Marking the packets 30 may be accomplished by adding or updating a flag or other data item in a header of the packet 30. Each of the primary meters 40 marks packets of one network flow, and each packet is marked with one of the label types. Figure 1 An example of two primary meters 40, primary meter 42, and primary meter 44 are shown. Hierarchical policer 38 may include any suitable number of primary meters 40.
[0049] Primary meter 42 is configured to selectively mark packets 30 of one network flow (from remote node 34) according to three label types. Primary meter 44 is configured to selectively mark packets 30 of another network flow (from remote node 36) according to three label types. Each of packets 30 is marked with one of the label types.
[0050] The hierarchical policer 38 includes a secondary meter 46 configured to receive at least some of the packets output and marked by the primary meter 40. It should be noted that packets marked as type-3 by the primary meter 40 may be dropped before reaching the secondary meter 46. The secondary meter 46 is configured to re-mark the packets 30 it receives. As used in the specification and claims, in all grammatical forms, the term "re-marking" may include re-marking a packet with a different label type (i.e., changing the label of the packet), or re-marking a packet with the same label type (i.e., overwriting an existing label with the same label, or verifying an existing label of a packet by leaving the existing label in place without overwriting the existing label).
[0051] The classification policer 38 includes queuing logic 48 for selectively adding packets 30 marked with a type-1 label or a label type-2 to the multiplex network receive queue 24 and discarding packets marked with a type-3 label.
[0052] In practice, some or all of the functions of the packet processing circuit 28 may be combined in a single physical component, or alternatively, implemented using multiple physical components. These physical components may include hard-wired or programmable devices, or a combination of the two. In some embodiments, at least some of the functions of the packet processing circuit 28 may be performed by a programmable processor under the control of suitable software. For example, the software may be downloaded to the device in electronic form over a network. Alternatively, or in addition, the software may be stored in a tangible, non-transient computer-readable storage medium, such as an optical, magnetic, or electronic memory.
[0053] Reference now Figure 2 , Figure 2 is a flow chart 200, which includes Figure 1 Steps in the method of operating the primary meter 40 in the system 10. Also refer to Figure 1 Typically, primary meter 40 is configured to tag received packets 30 according to three label types (Type-1, Type-2, and Type-3) based on available primary meter credits for the first label type and the second label type. Each primary meter 40 has its own allocation of primary meter credits for both Type-1 and Type-2 credits.
[0054] The operation of the primary meter 40 is now described in more detail below. One of the packets 30 is received and directed by the network interface 26 to one of the primary meters 40 according to the network flow in which the received packet 30 is included.
[0055] The primary meter 40 is configured to receive a packet 30 (block 202). At decision block 204, the primary meter 40 determines whether there are sufficient available type-1 credits to assign a given amount of available type-1 credits to the received packet 30. For example, if the credits are bandwidth-based, the primary meter 40 compares the size of the packet 30 to the value of available type-1 credits. If the value of available type-1 credits is greater than the size of the packet 30, then there are sufficient available type-1 credits to assign a given amount of available type-1 credits to the received packet 30. If the credits are tokens corresponding to packets or positions in the multiplex network receive queue 24, then if the value of available type-1 credits is greater than 0, then there are sufficient available type-1 credits to assign 1 credit to the received packet 30.
[0056] If there are sufficient available type-1 credits to assign the given amount of available type-1 credits to the received packet 30, the primary meter 40 is configured to mark the packet 30 with a type-1 tag (block 206), reduce the number of available type-1 credits accordingly by the given amount of available type-1 credits assigned to the received packet 30 (block 208), and forward the marked packet 30 to the secondary meter 46 (block 210), as described with reference to FIG. Figure 3 Described in more detail.
[0057] If there are not enough available type-1 credits to assign the given amount of available type-1 credits to the received packet 30, then at decision block 212, the primary meter 40 determines whether there are enough available type-2 credits to assign the given amount of available type-2 credits to the received packet 30. If there are enough available type-2 credits to assign the given amount of available type-2 credits to the received packet 30, the primary meter 40 is configured to mark the packet 30 with a type-2 tag (block 214), accordingly reduce the number of available type-2 credits assigned to the received packet 30 by the given amount of available type-2 credits (block 216), and forward the marked packet 30 to the secondary meter 46 (block 210), as described with reference to FIG. Figure 3 Described in more detail.
[0058] If there are not enough available type-2 credits to assign a given amount of available type-2 credits to the received packet 30, the primary meter 40 is configured to mark the packet with a type-3 tag (block 218) and drop the packet 30 (block 220). In some embodiments, the packet 30 marked as type-3 may be dropped by the queuing logic 48 at that point in the packet flow (i.e., after the primary meter 40 but before the secondary meter 46), or the packet may be dropped by the queuing logic 48 after flowing through the secondary meter 46, which simply ignores the packet marked as type-3.
[0059] Reference now Figure 3 , Figure 3 is a flow chart 300, which includes Figure 1 Steps in a method of operating the secondary meter 46 in the system 10.
[0060] Typically, secondary meter 46 is configured to re-mark labeled packets 30 (received from primary meter 40) based on the current markings of labeled packets 30 and the available secondary meter credits for label type-1 and label type-2. Secondary meter 46 has its own primary meter credits allocated for type-1 and type-2 credits, independent of the credits allocated to primary meter 40. All packets 30 processed by primary meter 40 (perhaps excluding packets marked with type-3 labels) are typically provided as input to secondary meter 46.
[0061] The operation of the secondary meter 46 is now described in more detail below with respect to one of the packets 30 processed by one of the primary meters 40 and provided to the secondary meter 46 .
[0062] The secondary meter 46 is configured to receive a marked packet 30 (block 302). At decision block 304, the secondary meter 46 is configured to determine whether the marked packet 30 is marked with a type-1 label. If the marked packet 30 is marked with a type-1 label, then at decision block 306, the secondary meter 46 determines whether there are sufficient available type-1 credits to assign a given amount of available type-1 credits to the marked packet 30. For example, if the credits are bandwidth-based, the secondary meter 46 compares the size of the packet 30 to the value of the available type-1 credits. If the value of the available type-1 credits is greater than the size of the packet 30, then there are sufficient available type-1 credits to assign a given amount of available type-1 credits to the packet 30. If the credits are tokens corresponding to packets or positions in the multiplex network receive queue 24, then if the value of the available type-1 credits is greater than 0, then there are sufficient available type-1 credits to assign 1 credit to the packet 30.
[0063] If there are sufficient available type-1 credits to assign the given amount of available type-1 credits to the packet 30, the secondary meter 46 is configured to re-mark the packet 30 with a type-1 label (block 308) and correspondingly reduce the number of available type-1 credits by the given amount of available type-1 credits assigned to the packet 30 (block 310), and the queuing logic 48 is configured to add the re-marked packet 30 to the multiplex network receive queue 24 (block 312).
[0064] If there are not enough available Type-1 credits to assign a given amount of available Type-1 credits to packet 30 (which would not happen if Type-1 credits were assigned correctly, as will be seen in Figure 4314), then at decision block 314, the secondary meter 46 determines whether there are sufficient available type-2 credits to assign the given amount of available type-2 credits to the marked packet 30. If there are sufficient available type-2 credits to assign the given amount of available type-2 credits to the marked packet 30, the secondary meter 46 is configured to re-mark the packet 30 with a type-2 label (block 316), correspondingly reduce the number of available type-2 credits by the given amount of available type-2 credits assigned to the packet 30 (block 318), and the queuing logic 48 is configured to add the re-marked packet 30 to the multiplex network receive queue 24 (block 312).
[0065] If there are not enough available type-2 credits to assign a given amount of available type-2 credits to the received packet 30, the secondary meter 46 is configured to re-mark the packet with a type-3 label (block 322) and discard the packet 30 (block 324). In some embodiments, the re-marked type-3 packet 30 may be discarded by the queuing logic 48.
[0066] If at decision block 304, the secondary meter 46 determines that the marked packet 30 is not marked with a type-1 label, then at decision block 326, the secondary meter 46 determines whether the marked packet 30 is marked with a type-2 label. If the marked packet 30 is marked with a type-2 label, then at decision block 314, the secondary meter 46 determines whether there are sufficient available type-2 credits to assign the given amount of available type-2 credits to the marked packet 30. If there are sufficient available type-2 credits to assign the given amount of available type-2 credits to the marked packet 30, the secondary meter 46 is configured to re-mark the packet 30 with a type-2 label (block 316), correspondingly reduce the number of available type-2 credits by the given amount of available type-2 credits assigned to the packet 30 (block 318), and the queuing logic 48 is configured to add the re-marked packet 30 to the multiplex network receive queue 24 (block 312). If there are not enough available type-2 credits to assign a given amount of available type-2 credits to the received packet 30, the secondary meter 46 is configured to mark the packet with a type-3 tag (block 322) and drop the packet 30 (block 324). In some embodiments, packets 30 marked as type-3 may be dropped by the queuing logic 48.
[0067] If at decision block 326, secondary meter 46 determines that marked packet 30 is not marked with a type-2 label, secondary meter 46 is configured to re-mark the packet with a type-3 label (block 322) or ignore the packet and drop packet 30 (block 324). In some embodiments, packets 30 marked as type-3 may be dropped by queuing logic 48.
[0068] Reference now Figure 4 , which is included in Figure 1 Flowchart 400 of steps in a method of setting credit levels in system 10. As previously described, each primary meter 40 is assigned a plurality of type-1 credits and a plurality of type-2 credits. Similarly, secondary meters 46 are assigned a plurality of type-1 credits and a plurality of type-2 credits. In some embodiments, as described in reference Figure 5 As described in more detail, credit is replenished periodically. In other embodiments, such as reference Figure 6 As described in more detail, as packets are consumed by multiplex network receive queue 24, for example, by VM 20 or VM 22, credits are replenished.
[0069] For example, a multiplexed network receive queue 24 has a capacity of Z, where Z may be the bandwidth limit or number of packets or positions of the multiplexed network receive queue 24. If there are N primary meters 40, each primary meter 40 may be assigned X type-1 credits and Y type-2 credits, where X plus Y equals Z. Credits for the secondary meter 46 may be assigned as follows. Type-1 credits may be set equal to N times X, and type-2 credits may be set equal to Z minus (N times X). In this manner, each network flow from a remote node will be guaranteed the fastest entry to the multiplexed network receive queue 24 defined by the credit limit of X. Packets marked as type-1 by the primary meter 40 will generally retain the type-1 label after being processed (i.e., re-marked) by the secondary meter 46, while some packets marked as type-2 are re-marked as type-3 and discarded by the secondary meter 46.
[0070] Thus, in some embodiments, the packet processing circuitry 28 is configured to configure (i.e., initially set, and subsequently maintain by replenishment) the number of available type-1 primary meter credits (for each primary meter 40) to provide the fastest access to the multiplexed network receive queue 24 for each network flow within the constraints of the multiplexed network receive queue 24 (block 402). The packet processing circuitry 28 is also configured to: (1) configure (i.e., initially set, and subsequently maintain by replenishment) the number of available type-1 credits for the secondary meters 46 to be equal to the sum of the type-1 primary meter credits; and (2) configure (i.e., initially set, and subsequently maintain by replenishment) the number of available type-2 credits for the secondary meters 46 to be less than the type-2 credits assigned to each of the primary meters 40 (block 404).
[0071] Thus, in some embodiments, the packet processing circuitry 28 is configured to configure (i.e., initially set, and subsequently maintain by replenishment) a plurality of available primary meter credits and available secondary meter credits such that packets 30 marked with a type-1 tag by the primary meter 40 retain the type-1 tag after re-marking by the secondary meter 46. As a result of the above, the packet processing circuitry 28 is configured to configure (i.e., initially set, and subsequently maintain by replenishment) the available primary meter credits and available secondary meter credits such that some packets marked with a type-2 tag by the primary meter 40 are re-marked with a type-3 tag by the secondary meter 46.
[0072] In this manner, the hierarchical policer 38 is configured to provide queue fairness for network flows such that packets marked with a type-1 label by the primary meter 40 retain the type-1 label after being re-marked by the secondary meter 46 to provide at least the fastest access to the multiplexed network receive queue 24 for each network flow competing for access to the multiplexed network receive queue 24.
[0073] See now Figure 5 , which is included in Figure 1 500 of steps in a method of replenishing credits in a system 10 of FIG. 500. In some embodiments, the hierarchical policer 38 is configured as a bandwidth policer, wherein packets 30 are marked with different label types according to bandwidth restrictions. The packet processing circuitry 28 is configured to consume available primary meter credits and available secondary meter credits according to the bandwidth of the packet. For example, if a packet has a size A and is marked as type-1 by one of the primary meters 40, the available type-1 credits for the primary meter 40 are reduced by A.
[0074] The packet processing circuitry 28 is configured to set the type-1 and type-2 tag credit limits for each of the primary meter 40 and the secondary meter 46. Once the hierarchical policer 38 is operating, the packet processing circuitry 28 is configured to periodically replenish the available primary meter credits (type-1 and type-2) and the available secondary meter credits (type-1 and type-2). The packet processing circuitry 28 is configured to wait for a time period equal to the replenishment period (e.g., 1 second) (block 502), and replenish the credits (type-1 and type-2) of each of the primary meter 40 and the secondary meter 46 (block 504).
[0075] For example, based on an estimate that packets 30 in the multiplex network receive queue 24 are being processed at a rate of Z GB / s, one of the primary meters 40 may mark packets as type-1 at a rate of X GB / s and as type-2 at a rate of Y GB / s (where Z=X+Y). In this case, (for example) X type-1 credits and Y type-2 credits may be assigned to the primary meter 40 per second, so that the above-described marking rate between type-1 and type-2 may be achieved by the primary meter 40. The same applies to the other primary meter 40. In a similar manner, but with different restrictions, credits may be assigned to the secondary meter 46. For example, N times X type-1 credits may be assigned per second, and Z minus (N times X) type-2 credits may be assigned per second.
[0076] See now Figure 6 , which is included in Figure 1 600 of steps in an alternative method of replenishing credits in the system 10 of FIG. 60. In some embodiments, the packet processing circuitry 28 is configured to consume available primary meter credits and available secondary meter credits based on the number of packets or positions in the multiplex network receive queue 24. For example, if a packet is received by one of the primary meters 40 and marked as type-1, then the available type-1 credit for that primary meter 40 is reduced by 1. If a packet is received by one of the primary meters 40 and marked as type-2, then the available type-2 credit for that primary meter 40 is reduced by 1. If a packet is received and re-marked by the secondary meter 46 with a label type-1 or type-2, then the available type-1 or type-2 credit is reduced by 1, respectively.
[0077] Credits are typically not replenished periodically. Credits are typically replenished when a packet 30 is consumed by the multiplexed network receive queue 24, for example, by one of the VMs (block 602). If a packet is consumed, the processor 16 instructs the packet processing circuitry 28 to add credits back to the secondary meter 46 and primary meter 40 from which the packet originated. Based on data in the header of the packet, the primary meter 40 from which the packet originated can be determined based on the network flow to which the packet belongs. The packet processing circuitry 28 attempts to add credit values back to the type-1 credits of the secondary meter 46. If the type-1 credits of the secondary meter 46 are full (i.e., at their initial values), the packet processing circuitry 28 adds credits back to the type-2 credits of the secondary meter 46. Similarly, the packet processing circuitry 28 attempts to add credits back to the type-1 credits of the primary meter 40 from which the packet originated. If the type-1 credits of the primary meter 40 from which the packet originated are full (i.e., at their initial values), the packet processing circuitry 28 adds credits back to the type-2 credits of the primary meter 40 from which the packet originated.
[0078] Thus, the packet processing circuitry 28 is configured to add back the consumed primary meter credits and secondary meter credits in response to respective packets 30 being consumed from the multiplexed network receive queue 24, for example, by respective ones of the VMs (block 604).
[0079] Reference now Figure 7-9 , which shows an example mark Figure 1 10 is a block diagram of the hierarchical policy 38 in the system 10.
[0080] Figure 7-9 The same credit levels and replenishment rates are shown being used, but with different bandwidth network flows entering the primary meter 40. Figures 7 to 9 In the example of , the multiplex network receive queue 24 has a bandwidth limit of 1 GB / s. Therefore, the credit limits of the primary meter 40 and the secondary meter 46 are set as follows. Each of the primary meters 40 has a type-1 tag credit limit of 0.1 GB / s, so for type-1 tags, 0.1 GB of credit per second is assigned to each primary meter 40. Each of the primary meters 40 has a type-2 tag credit limit of 0.9 GB / s, so for type-2 tags, 0.9 GB of credit per second is assigned to each primary meter 40.
[0081] Secondary meter 46 has a Type-1 tag credit limit of 0.2 GB / s, so for Type-1 tags, 0.2 GB of credit per second is assigned to secondary meter 46. Secondary meter 46 has a Type-2 tag credit limit of 0.8 GB / s, so for Type-2 tags, 0.8 GB of credit per second is assigned to secondary meter 46.
[0082] Figure 7 It is shown that the bandwidth of network flow 50 entering primary meter 42 is 1.2 GB / s and the bandwidth of network flow 52 entering primary meter 44 is 1.4 GB / s. Figure 7 It is shown that in the network flow 50 entering the primary meter 42, 0.1 GB per second of packets are marked as type-1 (line 54), 0.9 GB per second are marked as type-2 (line 56), and the remaining 0.2 GB per second are marked as type-3 (line 58). The packets marked as type-1 and type-2 by the primary meter 42 are forwarded to the secondary meter 46, while the packets marked as type-3 are discarded.
[0083] Similarly, Figure 7 It is shown that in the network flow 52 entering the primary meter 44, 0.1 GB per second of packets are marked as type-1 (line 60), 0.9 GB per second are marked as type-2 (line 62), and the remaining 0.4 GB per second are marked as type-3 (line 64). The packets marked as type-1 and type-2 by the primary meter 44 are forwarded to the secondary meter 46, while the packets marked as type-3 are discarded.
[0084] Figure 7 It is shown that among the packets entering the secondary meter 46, the 0.2 GB / s packets marked as type-1 are re-marked (i.e., retained) as type-1 (line 66) (0.1 GB / s of the packets from the primary meter 42 and 0.1 GB / s of the packets from the primary meter 44). Among the 1.8 GB / s packets marked as type-2 entering the secondary meter 46, the 0.8 GB / s packets are re-marked (i.e., retained) as type-2 (line 68), while the 1 GB / s packets are re-marked as type-3 (line 70). The type-1 and type-2 packets leaving the secondary meter 46 are added to the multiplex network receive queue 24 by the queuing logic 48, while the type-3 packets are discarded.
[0085] Figure 8 It is shown that the bandwidth of network flow 50 entering primary meter 42 is 1.2 GB / s and the bandwidth of network flow 52 entering primary meter 44 is 0.2 GB / s. Figure 8 It is shown that in the network flow 50 entering the primary meter 42, 0.1 GB per second of packets are marked as type-1 (line 54), 0.9 GB per second are marked as type-2 (line 56), and the remaining 0.2 GB per second are marked as type-3 (line 58). The packets marked as type-1 and type-2 by the primary meter 42 are forwarded to the secondary meter 46, while the packets marked as type-3 are discarded.
[0086] Similarly, Figure 8 It is shown that in the network flow 52 entering the primary meter 44, 0.1 GB per second packets are marked as type-1 (line 60) and 0.1 GB per second are marked as type-2 (line 62). The packets marked as type-1 and type-2 by the primary meter 44 are forwarded to the secondary meter 46.
[0087] Figure 8 It is shown that among the packets entering the secondary meter 46, the 0.2 GB / s packets marked as type-1 are re-marked (i.e., retained) as type-1 (line 66) (the 0.1 GB / s packets from the primary meter 42 and the 0.1 GB / s packets from the primary meter 44). Among the 1 GB / s packets marked as type-2 entering the secondary meter 46, the 0.8 GB / s packets are re-marked (i.e., retained) as type-2 (line 68), while the 0.2 GB / s packets are re-marked as type-3 (line 70). The type-1 and type-2 packets leaving the secondary meter 46 are added to the multiplex network receive queue 24 by the queuing logic 48, while the type-3 packets are discarded.
[0088] Fig. 9 It is shown that the bandwidth of network flow 50 entering primary meter 42 is 1.2 GB / s and the bandwidth of network flow 52 entering primary meter 44 is 0 GB / s (ie, no packets). Fig. 9 It is shown that in the network flow 50 entering the primary meter level 42, 0.1 GB per second of packets are marked as type-1 (line 54), 0.9 GB per second are marked as type-2 (line 56), and the remaining 0.2 GB per second are marked as type-3 (line 58). Packets marked as type-1 and type-2 by the primary meter 42 are forwarded to the secondary meter 46, while packets marked as type-3 are discarded.
[0089] Fig. 9 It is shown that of the packets entering the secondary meter 46, 0.1 GB per second of packets marked as type-1 are re-marked (i.e., retained) as type-1 (line 66). Of the 0.9 GB per second of packets marked as type-2 entering the secondary meter 46, 0.8 GB per second of these packets are re-marked (i.e., retained) as type-2 (line 68), while 0.1 GB per second of these packets are re-marked as type-3 (line 70). The type-1 and type-2 packets leaving the secondary meter 46 are added to the multiplex network receive queue 24 by the queuing logic 48, while the type 3 packets are discarded.
[0090] See now Figure 10-11 , which shows an example mark Figure 110, where credits are consumed per packet or per position in a multiplex network receive queue 24.
[0091] Figure 10-11 The same credit levels are shown, but with different network flow loads entering the primary meter 40. Figure 10 to Figure 11 In the example of , the multiplex network receive queue 24 has a capacity of 100 packets. Therefore, the credit limits of the primary meter 40 and the secondary meter 46 are set accordingly as follows. Each of the primary meters 40 has 10 type-1 tag credits and 90 type-2 tag credits. The secondary meter 46 has 20 type-1 tag credits and 80 type-2 tag credits.
[0092] Fig.10 Network flow 50 is shown entering primary meter 42 and network flow 52 is shown entering primary meter 44 . Fig.10 It is shown that in the network flow 50 entering the primary meter 42, 10 packets are marked as type-1 (line 54), 90 packets are marked as type-2 (line 56), and the remaining packets are marked as type-3 (line 58) by the primary meter 42. The packets marked as type-1 and type-2 by the primary meter 42 are forwarded to the secondary meter 46, while the packets marked as type-3 are dropped.
[0093] Similarly, Fig.10 It is shown that in the network flow 52 entering the primary meter 44, 10 packets are marked as type-1 (line 60), 90 packets are marked as type-2 (line 62), and the remaining packets are marked as type-3 (line 64) by the primary meter 44. The packets marked as type-1 and type-2 by the primary meter 44 are forwarded to the secondary meter 46, while the packets marked as type-3 are discarded.
[0094] Fig.10 It is shown that of the packets entering the secondary meter 46, 20 packets marked as type-1 are re-marked (i.e., retained) as type-1 (line 66) by the secondary meter 46 (10 packets from the primary meter 42 and 10 packets from the primary meter 44). Of the 180 packets marked as type-2 entering the secondary meter 46, 80 packets are re-marked (i.e., retained) as type-2 (line 68) by the secondary meter 46, while the remaining 100 packets are re-marked as type-3 (line 70) by the secondary meter 46. The type-1 and type-2 packets leaving the secondary meter 46 are added to the multiplex network receive queue 24 by the queuing logic 48, while the type-3 packets are discarded.
[0095] Fig.11It is shown that network flow 50 is entering primary meter 42 , but no network flow is entering primary meter 44 . Fig.10 It is shown that in the network flow 50 entering the primary meter 42, 10 packets are marked as type-1 (line 54), 90 packets are marked as type-2 (line 56), and the remaining packets are marked as type-3 (line 58) by the primary meter 42. The packets marked as type-1 and type-2 by the primary meter 42 are forwarded to the secondary meter 46, while the packets marked as type-3 are dropped.
[0096] Fig.11 It is shown that of the packets entering the secondary meter 46, 10 packets per second marked as type-1 are re-marked (i.e., retained) as type-1 (line 66). Of the 90 packets entering the secondary meter 46 marked as type-2, 80 packets are re-marked (i.e., retained) as type-2 (line 68) by the secondary meter 46, while the remaining 10 packets are re-marked as type-3 (line 70) by the secondary meter 46. The type-1 and type-2 packets leaving the secondary meter 46 are added to the multiplex network receive queue 24 by the queuing logic 48, while the type 3 packets are discarded.
[0097] For the sake of clarity, various features of the invention described in the context of separate embodiments may also be provided in combination in a single embodiment. Conversely, for the sake of brevity, various features of the invention described in the context of a single embodiment may also be provided separately or in any suitable sub-combination.
[0098] The above embodiments are cited by way of example, and the present invention is not limited by what has been specifically shown and described above. On the contrary, the scope of the present invention includes the combination and sub-combination of the various features described above, as well as changes and modifications thereof that occur to those skilled in the art upon reading the above description and are not disclosed in the prior art.
Claims
1. A network device, comprising: a network interface for receiving packets via a packet data network; as well as A hierarchical policy device, the hierarchical policy device is used to provide queue fairness for multiple network flows competing for entry to a multiplexed network receive queue, and the hierarchical policy device includes: a primary meter, the primary meter being used to mark received packets; a secondary meter for receiving at least some of the marked packets and re-marking the at least some of the marked packets; and Queuing logic that adds packets tagged with the first label type to the multiplex network receive queue and discards packets tagged with a third label type.
2. A network device, comprising: a network interface for receiving packets via a packet data network; as well as A packet processing circuit for managing a multiplexed network receive queue and comprising a hierarchical policy maker for providing queue fairness for a plurality of network flows competing for access to the multiplexed network receive queue, the hierarchical policy maker comprising: a plurality of primary meters, the plurality of primary meters being used to mark received packets with corresponding labels selected from three label types, a first primary meter of the primary meters being used to selectively mark packets of a first network flow according to the three label types, and a second primary meter of the primary meters being used to selectively mark packets of a second network flow according to the three label types; a secondary meter configured to receive at least some of the marked packets output by the primary meter and re-mark the at least some of the marked packets; and The queuing logic is configured to selectively: add packets marked with a first label type or a second label type of the three label types to the multiplexing network receive queue; and discard packets marked with a third label type of the three label types.
3. The apparatus of claim 1 , wherein the hierarchical policyr is used to provide the queue fairness for the network flows such that each of the network flows competing for entry to the multiplexed network receive queue is provided with at least the fastest entry to the multiplexed network receive queue.
4. The apparatus of claim 1, wherein: the primary meter to mark the received packets according to the three tag types based on available primary meter credits for the first tag type and the second tag type; as well as The secondary meter is used to re-mark some of the marked packets based on current markings of the marked packets and available secondary meter credits for the first label type and the second label type.
5. The apparatus of claim 4, wherein the packet processing circuit is to consume the available primary meter credits and the available secondary meter credits based on a bandwidth of the packet.
6. The apparatus of claim 5, wherein the packet processing circuit is configured to periodically replenish the available primary meter credits and the available secondary meter credits.
7. The apparatus of claim 4, wherein the packet processing circuit is configured to consume the available primary meter credits and the available secondary meter credits based on a number of the packets.
8. The apparatus of claim 7, wherein the packet processing circuit is to add back consumed ones of the primary meter credits and the secondary meter credits in response to corresponding ones of the packets being consumed by the multiplexed network receive queue.
9. The apparatus of claim 4, wherein the packet processing circuitry is to configure the number of available primary meter credits and the available secondary meter credits such that the packet marked with the first label type by the primary meter retains the first label type after being re-marked by the secondary meter.
10. The apparatus of claim 9, wherein the hierarchical policer is to provide the queue fairness for the network flows such that each of the network flows competing for entry to the multiplexed network receive queue is provided at least the fastest entry to the multiplexed network receive queue based on packets marked with the first label type by the primary meter retaining the first label type after being re-marked by the secondary meter.
11. The apparatus of claim 9, wherein the packet processing circuit is to configure the available primary meter credits and the available secondary meter credits so that some of the packets marked by the primary meter with the second label type are re-marked by the secondary meter with the third label type.
12. A network method comprising: receiving packets via a packet data network; Manage multiplexed network receive queues; Using a hierarchical policer, providing queue fairness for a plurality of network flows competing for access to said multiplexed network receive queue; marking, by a plurality of primary meters including a first primary meter and a second primary meter, the received packets with corresponding labels selected from labels of three label types; selectively marking, by the first level meter, packets of the first network flow according to the three label types; The second level meter selectively marks packets of the second network flow according to the three label types; receiving at least some of the marked packets output by the primary meter; remarking the at least some of the marked packets; as well as Packets marked with a first label type or a second label type among the three label types are selectively added to the multiplexing network receiving queue, and packets marked with a third label type among the three label types are discarded.
13. The method of claim 12, wherein said providing comprises: The queue fairness is provided for the network flows such that each of the network flows competing for entry to the multiplexed network receive queue is provided at least the fastest entry to the multiplexed network receive queue.
14. The method of claim 12, wherein: The marking includes: marking the received packets according to the three tag types based on available primary meter credits for the first tag type and the second tag type; and The re-marking includes re-marking some of the marked packets based on current markings of the marked packets and available secondary meter credits for the first label type and the second label type.
15. The method of claim 14, further comprising: The available primary meter credits and the available secondary meter credits are consumed according to a bandwidth of the packet.
16. The method of claim 15, further comprising: The available primary meter credit and the available secondary meter credit are periodically replenished.
17. The method of claim 14, further comprising: The available primary meter credits and the available secondary meter credits are consumed according to the number of the packets.
18. The method of claim 17, further comprising: In response to consumption of corresponding ones of the packets by the multiplex network receive queue, consumed ones of the primary meter credits and the secondary meter credits are added back.
19. The method of claim 14, further comprising: The number of available primary meter credits and available secondary meter credits is configured such that the packets marked with the first label type by the primary meter retain the first label type after being re-marked by the secondary meter.
20. The method of claim 19, wherein said providing comprises: The queue fairness is provided for the network flows such that each of the network flows competing for entry to the multiplexed network receive queue is provided at least the fastest entry to the multiplexed network receive queue based on packets marked with the first label type by the primary meter retaining the first label type after being re-marked by the secondary meter.
21. The method of claim 19, wherein the configuring comprises: The available primary meter credits and the available secondary meter credits are configured such that some of the packets marked by the primary meter with the second label type are re-marked by the secondary meter with the third label type.
