DiffServ architecture has been widely adopted for the provision of QoS over the Internet. This makes the full understanding of its operation imperative. We believe that only mathematical analysis may have the power of such goal. As the heart of a DiffServ router is the token bucket algorithm, a generic one, with two-colours marking, is to be considered here. A mathematical framework will be first developed for its analysis.