# Q1(c) · Round-robin scheduling

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/papers/paper-2023-jan-ai-reexam/q1c

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/papers/paper-2023-jan-ai-reexam--q1c/

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

### Q1(c). Set 1 contains packets 1,4,6; set 2 contains 2,3,5,7. Packet 1 arrives before t=0; 2,3,4 arrive during (0,1); 5 during (2,3); 6,7 during (3,4). Each packet takes one slot, starting at a slot boundary after arrival. Round-robin begins with set 1 and uses FIFO within a set. Give departures at t=1 through 7 and justify. [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.

Round robin alternates nonempty queues, skipping an empty queue.

### Solution

### Step 1. Apply the queue rule at each boundary

| Service interval | Departure packet | Reason |
| --- | --- | --- |
| [0,1) | 1 | Only packet1 has arrived. |
| [1,2) | 2 | Use set2: oldest is2. |
| [2,3) | 4 | Use set1: oldest is4. |
| [3,4) | 3 | Use set2: oldest is3. |
| [4,5) | 6 | Use set1:6 has arrived. |
| [5,6) | 5 | Use set2:oldest is5. |
| [6,7) | 7 | Set1 empty; set2 supplies7. |

### Step 2. Write the required ordered digits

**1 2 4 3 6 5 7**
