Title: Communication Networks
1Communication Networks
2Quality of Service What is it?
Multimedia applications network audio and video
3Traffic Shaping The Leaky Bucket Algorithm
(a) A leaky bucket with water. (b) a leaky
bucket with packets.
4Leaky Bucket example
- A source generates data in terms of bursts 3 MB
bursts lasting 2 msec once every 100 msec. - The network offers a bandwidth of 60 MB/sec.
- The leaky bucket has a capacity of 4 MB. How does
the output look like? - Input 0-2 msec 1500 MB/sec 100-102 msec 1500
MB/sec 200-202 msec 1500 MB/sec - Output 0-50 msec 60 MB/sec 100-150 msec 60
MB/sec .
5Leaky Bucket CNTD.
- What should be the capacity of the leaky bucket
to avoid loss? - During the burst, data inflow is at the rate of
1.5 MB/msec and the outflow is at the rate of
0.06 MB/msec. - So accumulation is at the rate of 1.44 MB/msec.
So at the end of 2 msec, there will be an
accumulation of 2.88 MB. This is the minimum
leaky bucket capacity to avoid buffer overflow
and hence data loss.
6The Token Bucket Algorithm
5-34
(a) Before. (b) After.
Token bucket allows some burstiness (up to the
number of token the bucket can hold)
7Token Bucket simple example
- 2 tokens of size 100 bytes added each second to
the token bucket of capacity 500 bytes - Avg. rate 200 bytes/sec, burst size 500 bytes
- Packets bigger than 500 bytes will never be sent
- Peak rate is unbounded i.e., 500 bytes of burst
can be transmitted arbitrarily fast
8Token Bucket example
- Bucket capacity 1 MB
- Token arrival rate 2 MB/sec
- Network capacity 10 MB/sec
- Application produces 0.5 MB burst every 250 msec
For 3 seconds - The bucket is full of tokens
9Token Bucket example CNTD.
- Initially, output can be at the rate of 10 MB/s.
But how long can the bucket sustain this? - First, 1MB can be sent
- From then on, for X seconds, the token input rate
is 2MB/s, the traffic rate is 10MB/s - 1 2X 10X ? 8X 1 ? X 1/8 sec 125 ms
- The bucket can transmit 1.25 MB in this time gt
0.5MB the application produces - Output 0-50 ms 10 MB/s
- 50-250 ms None
10Token Bucket example CNTD.
- At the end of this period, the amount of tokens
in the bucket is - 1MB250ms2MB/s-0.5MB1MB
- So the bucket is full again!
- Repeat for 3 seconds
11Minimum Bucket size and Token Rate
- Discarding Bucket (Policing)
- Bucket Size 0.5MB
- Token Rate 0.5MB/250ms 2MB/s
- Queueing Bucket (Shaping)
- How will the traffic look with Bucket Size
200K? - 0.22X10X ? X0.2/80.025s25ms
- 0-25ms 10 MB/s 0.25MB. 0.25MB left
- 0.25MB/(2MB/s) 125ms
- 25-150ms 2MB/s
- 150-250ms None
- Tokens after 100ms2MB/s0.2MB
12(s,?) Model
- Over an interval of length t the number of
packets/bits that are admitted is less than or
equal to (s?t). - Composing flows (s1,?1) (s2,?2)
- Resulting flow (s1 s2,?1?2)
- What does a router need to support streams
(s1,?1) (sk,?k) - Buffer size B gt S si
- Rate R gt S ?i
- Admission Control (at the router)
- Can support (sk,?k) if
- Enough buffers and bandwidth
- R gt S ?i and B gt S si
13(s,?) Model example
- The line from the previous question has router
with 4MB of buffers. How many flows of the above
kind can it accept? - s 0.5MB, ? 0.5MB/250ms 2MB/s
- For n flows, we require 0.5n MB buffers, 2n MB/s
rate ? n 5. - Each line will be served with a 0.5MB2MB/s token
bucket
14Random Early Detection (RED)
- Basic premise
- router should signal congestion when the queue
first starts building up (by dropping a packet) - but router should give flows time to reduce their
sending rates before dropping more packets - Note when RED is coupled with ECN, the router
can simply mark a packet instead of dropping it - Therefore, packet drops should be
- early dont wait for queue to overflow
- random dont drop all packets in burst, but
space them
QoS
15RED
- FIFO scheduling
- Buffer management
- Probabilistically discard packets
- Probability is computed as a function of average
queue length (why average?)
Discard Probability
1
0
Average Queue Length
queue_len
min_th
max_th
16RED (contd)
Discard
Discard Probability (P)
1
0
queue_len
Average Queue Length
min_th
max_th
Enqueue
Discard/Enqueue probabilistically
17RED (contd)
- Setting the discard probability P
Discard Probability
max_P
1
P
0
Average Queue Length
queue_len
min_th
max_th
avg_len
18Average vs Instantaneous Queue