Patent ID: 7792131

Claim:
A method comprising: changing a first meter value at a target rate in a first direction, where the first direction is either positive or negative, while a first packet of a first flow occupies the head of a shared transmit queue enqueing packets from different flows, with the first meter value indicating the amount of time the first packet in the first flow occupies the head of the shared transmit queue and with the packet characterized by a packet length indicating the number of bytes transmitted when the packet in the first flow is dequeued; changing the first meter value in a second direction, where the second direction is opposite the first direction, by a multiple of the packet length of the first packet in the first flow when the first packet in the first flow is dequeued or dropped; changing a second meter value at the target rate in the first direction while a first packet of a second flow occupies the head of the shared transmit queue, with the second meter value indicating the amount of time the first packet in the second flow occupies the head of the shared transmit queue and with the first packet in the second flow characterized by a packet length indicating the number of bytes transmitted when the first packet second flow is dequeued; changing the second meter value in the second direction by a multiple of the packet length of the first packet in the second flow when the first packet in the second flow is dequeued or dropped; comparing the first meter value to a threshold value when a second packet in the first flow occupies the head of the shared transmit queue; dropping the second packet in the first flow if the difference between the first meter value and the threshold value has a first sign, where the first sign is either positive or negative, or scheduling the second packet in the first flow for dequeing if the difference between the first meter value and the threshold value has a second sign; comparing the second meter value to the threshold value when a second packet in the second flow occupies the head of the shared transmit queue; and dropping the second packet in the second flow if the difference between the second meter value and the threshold value has the first sign or scheduling the second packet in the second flow for dequeing if the difference between the second meter value and the threshold value has the second sign, where the second sign is opposite the first sign.