Patent ID: 7782776

Claim:
A network device comprising: a port configured to send packets and receive packets, wherein the port is connected to a network entity; a buffer configured to store packets; a flow control module configured to control transmission of the stored packets within the network device and to determine whether congestion exists within the network device; and a service differentiation module coupled with the buffer and the flow control module, said service differentiation module being configured to regulate storage of the packets in the buffer and to regulate transmission of the packets from the network device to the network entity, wherein said service differentiation module comprises: a plurality of two-stage schedulers, each corresponding to different classes of service and each configured to regulate and shape a traffic flow, each of the plurality of two-stage schedulers comprising circuitry configured to transmit packets in a flow shaped by at least one token bucket model, and each of the plurality of two-stage schedulers is configured to: if a transfer rate of the packets is within an average rate of packet transmission for a class of service, employ a first token bucket model to regulate the transmission of the packets, otherwise, if the transfer rate of the packets exceeds the average rate of packet transmission for a class of service, employ both said first token bucket model and a second token bucket model are to regulate the transmission of the packets; and wherein said service differentiation module is further configured to: determine excess bandwidth available within the network device and to allocate said excess bandwidth amongst said classes of service within said traffic flow, via a shared two-stage shaper comprising circuitry configured to transmit packets in a flow shaped by at least two shared token buckets models.