A two stage rate shaping and scheduling system and method is implemented
to control the flow of traffic to at least one output interface. The
system and method involves initially queuing incoming packets into
type-specific queues and applying individual rate shaping rules to each
queue. A first stage arbitration is performed to determine how traffic is
queued from the type-specific queues to interface-specific queues.
Packets that win arbitration and pass the applied rate shaping rules are
queued in interface-specific queues. Rate shaping rules are applied to
the interface-specific queues. The interface-specific queues are further
distinguished by priority and priority-specific and interface-specific
rate shaping rules are applied to each queue. A second stage arbitration
is performed to determine how different priority traffic that is
targeting the same output interface is dequeued in response to
interface-specific requests.