Exercise 9: Solution

advertisement
Exercise 9: Solution
1
Problem 1: Scheduling
Consider Figure 1 and then answer the following questions.
2
4
7
3
5
1
12
9
6
11
8
10
Arrivals
Time
Packet
in service
1
t=0
t=2
t=4
t=6
t=8
t=10
t=12
t=14
Departures
1
Figure 1: Problem 1: Scheduling
Note that from Figure 1, we know that the packet transmission
time is 1 time slot which is the same for all packets. In addition,
we assume that once a packet arrives to the queue, it can be served
immediately if the employed scheduling mechanism allows.
1.1
Assume First-In-First-Out (FIFO) service, indicate the time at which packets
2 through 12 each leave the queue. For each packet, what is the delay between
its arrival and the beginning of the slot in which it is transmitted? What is the
average of this delay over all 12 packets?
Answer:
The departure time of packets 2 through 12 are shown in Figure 2.
1
Time
Packet in
service
2
1
3
4
t=2
t=0
6
5
t=4
7
8
t=6
9
10
11
12
t=10
t=8
t=12
t=14
Departures
1
2
3
4
5
6
7
8
9
10
11
12
Figure 2: Packet departure time under FIFO scheduling
For each packet, the delay between its arrival and the beginning of the time
in which it is transmitted:
Packet 1 : delay = 0;
Packet 2 : delay = 1;
Packet 3 : delay = 1;
Packet 4 : delay = 2;
Packet 5 : delay = 2;
Packet
Packet
Packet
Packet
6 : delay
7 : delay
8 : delay
9 : delay
= 2;
= 3;
= 2;
= 3;
Packet 10 : delay = 2;
Packet 11 : delay = 2;
Packet 12 : delay = 3;
The average delay of this delay over all 12 packets is:
average delay =
23
.
12
1.2
Now assume a priority service, and assume that odd-numbered packets are high
priority, and even-numbered packets are low priority. Indicate the time at which
packets 2 through 12 each leave the queue. For each packet, what is the delay
between its arrival and the beginning of the slot in which it is transmitted?
What is the average of this delay over all 12 packets?
Answer:
The departure time of packets 2 through 12 are shown in Figure 3.
For each packet, the delay between its arrival and the beginning of the time
2
Time
Packet in
service
3
1
2
5
t=2
t=0
7
9
t=4
4
6
t=6
11
12
10
8
t=10
t=8
t=12
t=14
Departures
1
3
2
5
9
7
4
6
11
8
10
12
Figure 3: Packet departure time under Priority scheduling
in which it is transmitted:
Packet 1 : delay = 0;
Packet
Packet
Packet
Packet
2 : delay
3 : delay
4 : delay
5 : delay
= 2;
= 0;
= 5;
= 0;
Packet 6 : delay = 5;
Packet 7 : delay = 1;
Packet 8 : delay = 4;
Packet 9 : delay = 0;
Packet 10 : delay = 3;
Packet 11 : delay = 0;
Packet 12 : delay = 3;
The average delay of this delay over all 12 packets is:
average delay =
23
.
12
1.3
Now assume round robin service. Assume that packets 1, 2, 3, 6, 11, and 12 are
from class 1, and packets 4, 5, 7, 8, 9, and 10 are from class 2. Indicate the time
at which packets 2 through 12 each leave the queue. For each packet, what is
the delay between its arrival and its departure? What is the average delay over
all 12 packets?
Answer:
The departure time of packets 2 through 12 are shown in Figure 4.
For each packet, the delay between its arrival and the beginning of the time
3
Time
Packet in
service
1
4
2
5
t=2
t=0
3
7
t=4
6
t=6
9
11
8
10
12
t=10
t=8
t=12
t=14
Departures
1
4
2
5
3
7
6
8
11
9
12
10
Figure 4: Packet departure time under Round Robin scheduling
in which it is transmitted:
Packet
Packet
Packet
Packet
1 : delay
2 : delay
3 : delay
4 : delay
= 0;
= 2;
= 3;
= 0;
Packet
Packet
Packet
Packet
5 : delay
6 : delay
7 : delay
8 : delay
= 0;
= 4;
= 2;
= 2;
Packet 9 : delay = 4;
Packet 10 : delay = 4;
Packet 11 : delay = 0;
Packet 12 : delay = 2;
The average delay of this delay over all 12 packets is:
average delay =
23
.
12
1.4
Now assume weighted fair queueing (WFQ) service. Assume that odd-numbered
packets are from class 1, and even-numbered packets are from class 2. Class 1
has a WFQ weight of 2, while class 2 has a WFQ weight of 1. Note that it
may not be possible to achieve an idealized WFQ schedule as described in the
text, so indicate why you have chosen the particular packet to go into service
at each time slot. For each packet what is the delay between its arrival and its
departure? What is the average delay over all 12 packets?
Answer: Note that the computation of WFQ is complicated. Here
we use the Weighted Round Robin to emulate or approximate the
WFQ. Each round equals 3 time slots. If both classes have packets
to be served, class 1 is allocated 2 time slots and class 2 is allocated
1 time slot.
4
Time
The departure time of packets 2 through 12 are shown in Figure 5.
Packet in
service
1
3
2
5
t=2
t=0
7
4
t=4
9
t=6
8
11
6
t=8
12
10
t=10
t=12
t=14
Departures
1
3
2
5
7
4
9
6
11
8
10
12
Figure 5: Packet departure time under Weighted Fair Queueing scheduling
For each packet, the delay between its arrival and the beginning of the time
in which it is transmitted:
Packet 1 : delay = 0;
Packet 2 : delay = 2;
Packet 3 : delay = 0;
Packet 4 : delay = 4;
Packet 5 : delay = 0;
Packet
Packet
Packet
Packet
6 : delay
7 : delay
8 : delay
9 : delay
= 5;
= 1;
= 4;
= 1;
Packet 10 : delay = 3;
Packet 11 : delay = 0;
Packet 12 : delay = 3;
The average delay of this delay over all 12 packets is:
average delay =
23
.
12
1.5
What do you notice about the average delay in all four cases (FIFO,priority,
RR, and WFQ)?
Answer:
The average delay in four cases are the same.
2
Leaky bucket
A packet flow is said to conform to a leaky bucket specification (r, b) with burst
size b and average rate r if the number of packets that arrive to the leaky bucket
5
Time
is less than rt+b packets in every interval time of length t for all t. Will a packet
flow that conforms to a leaky bucket specification (r, b) ever have to wait at a
leaky bucket policer with parameters r and b? Justify your answer.
Answer:
Assume that one packet needs one token for being transmitted into the network.
The flow conforming to a leaking bucket will never have to wait. Let’s look
at a time interval of t. If a burst b comes in this interval, there are b tokens in
the leaky bucket and all these packets will be taken. Since the traffic is said to
be less than rt + b, it means that the following traffic will be no greater than
rt. To really visualize this, use the example from lecture with the traffic sent
through a leaky bucket with burst size b. Then put this traffic into a second
bucket with the same parameters.
6
Download