Patent attributes
A method and an apparatus for data traffic restriction are applied to a network device where a link aggregation group interface includes member ports. Firstly, configuring, for each link aggregation group interface, a credit bucket for storing tokens overflowing from a token bucket corresponding to each member port, and the tokens overflowing from the different token buckets are distinctively labeled; receiving a packet to be sent, if a number of tokens in the token bucket is not sufficient for sending the packet to be sent, borrowing, from the credit bucket, tokens overflowing from a non-current token bucket, if the tokens of the current token bucket and the borrowed tokens are sufficient for sending the packet to be sent, sending the packet to be sent, and meanwhile, reducing the number of tokens in the current token bucket and tokens in the credit bucket. A dynamic restriction of data traffic is achieved.