Computer Networks · TEE · papers

Q1(c) · Priority scheduling

2022-11-16 · AI-only Sem V

Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.

Q1(c). Packets arrive as shown: packet 1 before t=0; packets 2,3,4 during (0,1), in that order; packet 5 during (2,3); packets 6,7 during (3,4), in that order. One packet takes one slot and starts only at the next slot boundary after arrival. Packets 2,3,5,7 have priority over 1,4,6; use FIFO within each priority class. Give and justify departures at t=1,2,3,4,5,6,7 as seven ordered digits. [5 marks]

Answer

Given

Arrival groups in the question; one-unit service; slot-boundary starts; FIFO inside each queue.

To find

Departure order at t=1 through7.

Formula and why

At each slot start, consider only packets that have already arrived.

Strict priority chooses the high queue whenever it is nonempty. A running packet is not preempted.

Solution

Step 1. Apply the queue rule at each boundary

Service intervalDeparture packetReason
[0,1)1Only1 is available.
[1,2)2High-priority2 is oldest.
[2,3)3High-priority3 precedes low-priority4.
[3,4)5High-priority5 has arrived.
[4,5)7High-priority7 precedes low-priority4 and6.
[5,6)4No high-priority packet remains; send oldest low4.
[6,7)6Send remaining low6.

Step 2. Write the required ordered digits

1 2 3 5 7 4 6