Patent ID: 8861514

Claim:
A network switch, comprising: a first queue configured to receive a first packet; a second queue configured to receive a second packet; and a queue control module configured to determine a desired output time slot of the first packet based on i) an arrival time of the first packet, and ii) an output rate associated with the first packet, determine an amount of time required to output the first packet, determine a length of the second packet, determine a scheduled output time slot of the second packet based on i) a byte count of the second packet, and ii) an output rate associated with the second packet, determine a difference between a current time and the scheduled output time slot of the second packet, determine whether the amount of time required to output the first packet is less than or equal to the difference between the current time and the scheduled output time slot of the second packet, and selectively output the first packet before the second packet if the amount of time required to output the first packet is less than or equal to the difference between the current time and the scheduled output time slot of the second packet, wherein the queue control module is configured to i) increase a first token count associated with the first packet by a token count of the first packet when the queue control module outputs the first packet, and ii) increase a second token count associated with the second packet by a token count of the second packet when the queue control module outputs the second packet, wherein the queue control module is configured to i) output the first packet when the first token count is less than or equal to a first token limit associated with the first packet, and ii) output the second packet when the second token count is less than or equal to a second token limit associated with the second packet, and wherein the queue control module is configured to: determine the first token limit based on i) a first output time period of the first packet and ii) the token count per time period associated with the first packet; and determine the second token limit based on i) a second output time period of the second packet and ii) the token count per time period associated with the second packet.