Note: Open this readme.md file in GitHub for better readability.
This program simulates the performance of queuing in a packet switch with different scheduling mechanisms. It consists of three phases: traffic generation, packet scheduling, and packet transmission. The input parameters include the number of switch input and output ports, buffer size, packet generation probability, queue scheduling technique, and simulation time. The output includes metrics such as average packet delay, average link utilization, and KOUQ drop probability.
First, compile the program using g++ with the following command:
g++ -o routing routing.cppFor Windows
./routing.exe -N switchportcount-B buffersize-p packetgenprob-queue INQ/KOUQ/iSLIP-K knockout-out-outputfile-T maxtimeslotsFor Linux
./routing -N switchportcount-B buffersize-p packetgenprob-queue INQ/KOUQ/iSLIP-K knockout-out-outputfile-T maxtimeslotsFor Windows
./routing.exe -N 8 -B 4 -p 0.5 -queue INQ -T 10000For Linux
./routing -N 8 -B 4 -p 0.5 -queue INQ -T 10000- Number of switch input and output ports (
N) - Buffer size (
B) - Packet generation probability (
p) - Queue scheduling technique (
INQ,KOUQ,iSLIP) - K value for KOUQ (default is
0.6) - Output file for results
- Maximum number of time slots (default is
10000)
- Traffic Generation: Each port generates packets with probability
p. Packets are randomly assigned a destination port and a start time within the time slot. - Scheduling:
INQ: Non-contentious packets are selected for transmission. Contending packets are randomly selected.KOUQ: K packets per output port are queued based on arrival time. If more than K packets arrive, K are randomly selected for buffering, and the rest are dropped.iSLIP: Implements the iSLIP scheduling algorithm with VOQ.
- Transmission: Packets are transmitted from the head of the queue.
- Average packet delay (
Avg PD) - Standard deviation of packet delay (
Std Dev of PD) - Average link utilization (
Avglink utilization) - KOUQ drop probability
Input
./routing.exe -N 100 -B 10 -p 0.9 -queue KOUQ -K 0.7 -out output.txt -T 10000Output
Number of ports: 100
Packet generation probability: 0.9
Queue type: KOUQ
Average Packet Delay: 3.00045
Average Link Utilization: 0.88659
KOUQ drop probability: 9e-007
The program allows for the evaluation of different queuing strategies in a packet switch, providing insights into packet delay, link utilization, and drop probability under various conditions.