We were tasked to implement a FIFO scheduler simulator with these specifications:
- A generator for generating packets to be processed
- A scheduler that fetches packets from a queue and processes them
- A FIFO queue that stores the packets from the generator
I implemented this using Python. Python has a Queue object that is thread safe so using this would be very useful to this simulator.
For all the cases, I generated 100 packets from the generator.
Case 1:
- Input rate = 1 packet / s
- Output rate = 1 packet / s
- Buffer size = 1 unit
- Results:
- Drop rate = 0 %
- Waiting time = 0.008092 s
Case 2:
- Input rate = 5 packets / s
- Output rate = 1 packet / s
- Buffer size = 1 unit
- Results:
- Drop rate = 78%
- Waiting time = 0.001251 s
Case 3:
- Input rate = 5 packet / s
- Output rate = 1 packet / s
- Buffer size = 5 units
- Results:
- Drop rate = 74 %
- Waiting time = 0.008092 s
Case 4:
- Input rate = 5 packets / s
- Output rate = 5 packets / s
- Buffer size = 25 units
- Results:
- Drop rate = 0 %
- Waiting time = 0.008092 s
Case 5:
- Input rate = 5 packets / s
- Output rate = 25 packets / s
- Buffer size = 5 units
- Results:
- Drop rate = 0 %
- Waiting time =16.023787 s
Case 6:
- Input rate = 10 packets / s
- Output rate = 5 packets / s
- Buffer size = 20 unit
- Results:
- Drop rate = 29 %
- Waiting time = 0.004243
From this results, I can say that the different parameters affect how the scheduler behaves.
- If Input rate = Output rate and buffer size is constant, there is insignificant drop rate and idle time.
- If Input rate > Output rate and buffer size is constant, there is a significant drop rate but insignificant idle time.
- If Input rate < Output rate and buffer size is constant, there is insignificant drop rate but significant idle time.
- If Buffer size is increased, the scheduler will have a lesser drop rate.