Beruflich Dokumente
Kultur Dokumente
28 29
Footer Page 1 of 9.
S.Muralidharan 1
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 2 S.Muralidharan
(a) A leaky bucket with water. (b) a leaky bucket with packets.
30 31
32 33
Footer Page 2 of 9.
S.Muralidharan 2
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 3 S.Muralidharan
In contrast to the LB, the Token Bucket Algorithm, The token bucket is a control mechanism that
allows the output rate to vary, depending on the size dictates when traffic can be transmitted, based on
of the burst. the presence of tokens in the bucket.
In the TB algorithm, the bucket holds tokens. To The token bucket contains tokens, each of which
transmit a packet, the host must capture and destroy can represent a unit of bytes. The network
one token. administrator specifies how many tokens are
needed to transmit
Tokens are generated by a clock at the rate of one
token every t sec. When tokens are present, a flow is allowed to
transmit. If there are no tokens in the bucket, a flow
Idle hosts can capture and save up tokens (up to the
cannot transmit its packets. Therefore, a flow can
max. size of the bucket) in order to send larger bursts transmit traffic up to its peak burst rate if there are
later. adequate tokens in the bucket and if the burst
threshold is configured appropriately.
34 35
36 37
Footer Page 3 of 9.
S.Muralidharan 3
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 4 S.Muralidharan
5-34
38
(a) Before. (b) After. 39
40 41
Footer Page 4 of 9.
S.Muralidharan 4
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 5 S.Muralidharan
Leaky and Token bucket Algorithm Animation LB discards packets; TB does not. TB discards
tokens.
With TB, a packet can only be transmitted if there are
enough tokens to cover its length in bytes.
LB sends packets at an average rate. TB allows for
large bursts to be sent faster by speeding up the
output.
TB allows saving up tokens (permissions) to send
large bursts. LB does not allow saving.
42 43
Scheduling Classifying
Schedulers arrange and/or rearrange packets for Classifiers sort or separate traffic into queues.
output. Classifying is the mechanism by which packets are
separated for different treatment, possibly different
Scheduling is the mechanism by which packets are output queues.
arranged (or rearranged) between input and output During the process of accepting, routing and
of a particular queue. transmitting a packet, a networking device can
The overwhelmingly most common scheduler is the classify the packet a number of different ways.
FIFO (first-in first-out) scheduler. Classification can include marking the packet,
which usually happens on the boundary of a network
From a larger perspective, any set of traffic control under a single administrative control or classification
mechanisms on an output queue can be regarded can occur on each hop individually.
as a scheduler, because packets are arranged for
output.
44 45
Footer Page 5 of 9.
S.Muralidharan 5
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 6 S.Muralidharan
Policing Policing
Policers measure and limit traffic in a particular queue. A policer is a yes/no question about the rate at
Policing is simply a mechanism by which traffic can be which traffic is entering a queue.
limited. If the packet is about to enter a queue below a given rate,
take one action (allow the enqueuing).
Policing is most frequently used on the network border to
If the packet is about to enter a queue above a given rate,
ensure that a peer is not consuming more than its
take another action.
allocated bandwidth.
Although the policer uses a token bucket
A policer will accept traffic to a certain rate, and then
mechanism internally, it does not have the capability
perform an action on traffic exceeding this rate. A rather to delay a packet as a shaping mechanism does.
harsh solution is to drop the traffic, although the traffic
could be reclassified instead of being dropped.
46 47
Dropping Marking
Dropping discards an entire packet, flow or Marking is a mechanism by which the packet is
classification. altered.
Dropping a packet is a mechanism by which a Traffic control marking mechanisms install a DSCP
packet is discarded. on the packet itself, which is then used and
respected by other routers inside an administrative
domain
48 49
Footer Page 6 of 9.
S.Muralidharan 6
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 7 S.Muralidharan
Queues
Queues form the backdrop for all of traffic control A queue becomes much more interesting when
and are the integral concept behind scheduling coupled with other mechanisms which can
In networking, a queue is the place where packets delay packets,
(our units) wait to be transmitted by the hardware rearrange,
(the service). drop and prioritize packets in multiple queues.
In the simplest model, packets are transmitted in a A queue can also use subqueues, which allow for
first-come first-serve basis (FIFO) complexity of behavior in a scheduling operation.
Without any other mechanisms, a queue doesn't
offer any promise for traffic control.
There are only two interesting actions in a queue.
Anything entering a queue is enqueued into the queue.
To remove an item from a queue is to dequeue that item.
50 51
52 53
Footer Page 7 of 9.
S.Muralidharan 7
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 8 S.Muralidharan
Priority FIFO
54 55
56 57
Footer Page 8 of 9.
S.Muralidharan 8
CS 65 Computer Networks Department of EEE
CS65 - Computer Networks 9 S.Muralidharan
58 59
Theory declares that a RED algorithm is useful on a Classful queuing is very useful if you have different
backbone or core network, but not as useful near the kinds of traffic which should have differing treatment.
end-user. A Classful queue can also divide bandwidth
The idea behind RED is to provide, as soon as is Three classful queues: CBQ Class Based Queuing,
possible, a feedback to responsive flows (like TCP) HTB Hierarchical Token Bucket, PRIO
before the queue overflows in an effort to indicate that
congestion is imminent, instead of waiting until the
congestion has become excessive.
Also, packet drops are distributed more fairly across all
flows.
GRED applies RED to several queues
60 61
Footer Page 9 of 9.
S.Muralidharan 9