In this exercise we will simulate an M/M/k queue as a model of a packet router and how packets are dropped due to lack of buffer space.
The number of clients waiting in the queue of an M/M/1 system is unbounded, and indeed when the load is high the queue can become very big. But in real systems there may be a limit on the number of clients waiting in the queue. The corresponding model where only b clients are allowed at a time is called M/M/1/b/.
Another variant on the M/M/1 queue is when we have more than one server. In this case, a waiting client may be served by any free server. This is like a post office, where the first person in line goes to the first window that becomes available. In queueing notation a queue with k servers is called M/M/k.
And of course we can combine the two: a queue with k servers and place for no more than b clients is M/M/k/b. We want to compare the behavior of all three variants with the original M/M/1 queue. Can you anticipate which will exhibit improved performance, and which will be worse?
Extend your simulator of an M/M/1 queue with support for a bounded queue. The bound b is on the total number of clients in the system; thus b=3 means that no more than 3 clients are allowed, where one is receiving service and another two are in the queue. If an arrival occurs when the system is full, the arriving client is lost. This is what happens sometimes in the phone system, when you try to place a long distance call and all lines are busy.
Run your simulation with b=3, using an average service rate of one client per time unit, and different arrival rates to generate different load values as we did in previous exercises.
Now extend your simulator to support multiple servers. Run simulations for M/M/k with k=2, and no bound on the queue size. This time use an average service rate of one client per two time units, so that the combined power of the two servers is the same as the single server we used before. Use the same load levels as before.
Draw a graph and compare the response time results of these three simulations with each other and with the M/M/1 results you have from before. Specifically, include 4 lines on the same plot:
Grade the four systems based on your results: which provides the best service level, and which the worst? Is this what you expected? Can you explain the differences?
Consider whether there is anything else that is important (beyond the response times) in comparing these systems.
Use Moodle to submit a report on your work, in pdf format, with the following data.