Patent ID: 8213445

Claim:
A communication device comprising: first and second holding circuitries, equipped corresponding to a first and second quality classes respectively, operable to hold packets each of which has a variable length and a quality class; first and second counters, equipped corresponding to a first and second quality classes respectively, operable to count an amount of data of packets, belonging to the first and second quality classes respectively, output from an output circuitry; first and second comparison circuitries, equipped corresponding to the first and the second quality classes respectively, operable to compare a count value of the respective counters with a first and second threshold values respectively; the output circuitry operable to output packets held in one of the first and second holding circuitries based on results of the comparisons made by the first and second comparison circuitries; and a subtraction decision circuitry which, when the results of the comparisons indicate that the count values are in excess of the respective threshold values, subtracts value corresponding to the first threshold value from the count value of the first counter and subtracts value corresponding to the second threshold value from the count value of the second counter; wherein a ratio of the first and second threshold values is set to correspond to a weighting ratio corresponding to the output frequencies of packets of the first and the second quality classes; the communication device further comprising: an observation circuitry operable to observe packet lengths of packets output by the output portion; and a threshold setting circuitry operable to set threshold values based on the packet lengths observed by the observation portion.