When a packet is transmitted, the value of the packet length is subtracted from the deficit counter
There are 3 flows with different packet sizes in the corresponding queues:
Deficit counter +-----+ +------------+ +---------------------------+ flow 1 | 0 | | 200 bytes | | 400 bytes | +-----+ +------------+ +---------------------------+ +-----+ +-----+ +------------+ +-------------------+ flow 2 | 0 | | 100 | | 200 | | 300 bytes | +-----+ +-----+ +------------+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 0 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Deficit counter +-----+ +------------+ +---------------------------+ flow 1 | 500 | | 200 bytes | | 400 bytes | +-----+ +------------+ +---------------------------+ +-----+ +-----+ +------------+ +-------------------+ flow 2 | 0 | | 100 | | 200 | | 300 bytes | +-----+ +-----+ +------------+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 0 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Flow 1 has enough credit to transmit the first packet of 200 bytes:
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-----+ +------------+ +-------------------+ flow 2 | 0 | | 100 | | 200 | | 300 bytes | +-----+ +-----+ +------------+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 0 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Now Flow 1 does not have enough credits and the turn goes to Flow 2.
Flow 1 will carry its residual transmission credit over to the next service round
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-----+ +------------+ +-------------------+ flow 2 | 500 | | 100 | | 200 | | 300 bytes | +-----+ +-----+ +------------+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 0 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Flow 2 has enough credit to transmit its first packet:
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +------------+ +-------------------+ flow 2 | 400 | | 200 | | 300 bytes | +-----+ +------------+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 0 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Flow 2 has enough credit to transmit its second packet:
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-------------------+ flow 2 | 200 | | 300 bytes | +-----+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 0 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Now Flow 2 does not have enough credits and the turn goes to Flow 3.
Flow 2 will carry its residual transmission credit over to the next service round
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-------------------+ flow 2 | 200 | | 300 bytes | +-----+ +-------------------+ +-----+ +------------+ +------------+ +------------+ flow 3 | 500 | | 200 bytes | | 200 | | 200 | +-----+ +------------+ +------------- +------------+ Quantum = 500 |
Flow 3 has enough credit to transmit its first packet:
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-------------------+ flow 2 | 200 | | 300 bytes | +-----+ +-------------------+ +-----+ +------------+ +------------+ flow 3 | 300 | | 200 | | 200 | +-----+ +------------- +------------+ Quantum = 500 |
Flow 3 has enough credit to transmit its second packet:
Deficit counter +-----+ +---------------------------+ flow 1 | 300 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-------------------+ flow 2 | 200 | | 300 bytes | +-----+ +-------------------+ +-----+ +------------+ flow 3 | 100 | | 200 | +-----+ +------------+ Quantum = 500 |
Now Flow 3 does not have enough credits and the turn goes BACK to Flow 1.
Flow 1 will get another quantum added to its residual transmission credit
Deficit counter +-----+ +---------------------------+ flow 1 | 800 | | 400 bytes | +-----+ +---------------------------+ +-----+ +-------------------+ flow 2 | 200 | | 300 bytes | +-----+ +-------------------+ +-----+ +------------+ flow 3 | 100 | | 200 | +-----+ +------------+ Quantum = 500 |
The left over transmission rate will be divided among the unsaturated flows
Flow Deficit Quantum counter +-----+ +-----+ +------------+ +---------------------------+ flow 1 | 800 | | 0 | | 200 bytes | | 400 bytes | +-----+ +-----+ +------------+ +---------------------------+ +-----+ +-----+ +-----+ +------------+ +-------------------+ flow 2 | 400 | | 0 | | 100 | | 200 | | 300 bytes | +-----+ +-----+ +-----+ +------------+ +-------------------+ +-----+ +-----+ +------------+ +------------+ +------------+ flow 3 | 600 | | 0 | | 200 bytes | | 200 | | 200 | +-----+ +-----+ +------------+ +------------- +------------+ |