A Python/Jupyter Notebook project that simulates and compares packet scheduling algorithms used in input-queued crossbar switches.
This project evaluates how scheduling policies impact:
- Total service time
- Average packet delay
- Throughput
- Queue backlog
- Head-of-Line (HoL) blocking
Each input port has one queue.
- Simple and easy to implement
- Only the head packet can be transmitted
- Suffers from Head-of-Line blocking
- Highest delay
- Lowest throughput
Each input port maintains separate queues for each output port.
- Eliminates HoL blocking
- Finds maximum matching every slot
- Gives best possible scheduling result
- Highest throughput
- Best service efficiency
A practical iterative matching scheduler used in real switches.
- Request → Grant → Accept phases
- Round-robin fairness using pointers
- Lower complexity than exhaustive optimal matching
- Much better than FIFO
- Near-optimal in practice
Evaluating-Network-switch-Scheduling-algorithm/
│── switch_simulation.ipynb
│── Results/
│ ├── switch_simulation_results.png
│ ├── FIFO_Packet_Timeline.png
│ └── iSLIP_Packet_Timeline.png
│── README.md
Install dependency:
pip install matplotlibjupyter notebookOpen:
switch_simulation.ipynb
Run all cells in order.
- Imports & Setup
- Packet Class
- Switch Classes
- FIFOSwitch
- OptimalVOQSwitch
- iSLIPSwitch
- Packet Loader
- Simulation Runners
- FIFO Runner
- OptimalVOQ Runner
- iSLIP Runner
- Visualization Functions
- Metrics Functions
- Main Execution
Saved inside:
Results/
switch_simulation_results.png→ Comparison graphsFIFO_Packet_Timeline.png→ FIFO packet scheduleiSLIP_Packet_Timeline.png→ iSLIP packet schedule
| Algorithm | Average Delay | Throughput (packets/slot) |
|---|---|---|
| FIFO | 2.22 | 1.636 |
| Optimal VOQ | — | 2.571 |
| iSLIP | 1.06 | 2.250 |
- Highest delay due to HoL blocking
- Lowest throughput
- Inefficient under contention
- Best throughput among all algorithms
- Fully utilizes switch fabric
- Computationally expensive for large systems
- Delay reduced significantly vs FIFO
- Throughput close to optimal
- Practical and scalable solution
- FIFO queues can waste switch capacity
- VOQ removes Head-of-Line blocking
- Maximum matching improves utilization
- iSLIP balances performance and complexity
- Python
- Jupyter Notebook
- Matplotlib
- deque (queue simulation)
Deepanshu Sharma
IIT Guwahati
Educational / Academic Use