Sep-16-2020, 10:45 PM
you are provided with four text files that have the inter-arrival times and service times of
100,000 data packets.
• The first file called “interArrivals.txt” has the time between arrivals for 100,000 data packets
with a mean time of 0.2 seconds between arrivals (generated using the Exponential
distribution). NOTE: we assume that the first packet arrives at time 0 (this is why the
first number in the file is 0).
• The remaining three files (“serviceTimesMu3.txt”, “serviceTimesMu6.txt” and
“serviceTimesMu8.txt”) contain the service times of the same 100,000 packets that
correspond to three different service rates of 3, 6 and 8 packets/sec respectively.
4.1) Using Python, develop a tool to simulate a router with a single server queue with infinite buffer and
a service rate of 8 packets/sec (use “serviceTimesMu8.txt”). Here are some suggestions/tips for your
coding:
• Create 5 different arrays: one for inter-arrival times, one for service times, one for the actual
arrival time on the clock, one for the delay experienced in the queue, and one for departure times.
• You know that a packet will spend some time in the queue if and only if the previous packet is
still being processed. Otherwise, the delay will be 0. See course notes from the example by hand.
• Hint for processing the given files: Since the first packet entering the system is a special case
(has a queuing delay = 0 and total delay = service time), you can hardcode these values in the
arrays that you created before processing the rest of the packets. Each subsequent packet after the
first one will depend on the one before it to determine its queueing delay and departure time. With
this information, you should be able to fill all your arrays.
100,000 data packets.
• The first file called “interArrivals.txt” has the time between arrivals for 100,000 data packets
with a mean time of 0.2 seconds between arrivals (generated using the Exponential
distribution). NOTE: we assume that the first packet arrives at time 0 (this is why the
first number in the file is 0).
• The remaining three files (“serviceTimesMu3.txt”, “serviceTimesMu6.txt” and
“serviceTimesMu8.txt”) contain the service times of the same 100,000 packets that
correspond to three different service rates of 3, 6 and 8 packets/sec respectively.
4.1) Using Python, develop a tool to simulate a router with a single server queue with infinite buffer and
a service rate of 8 packets/sec (use “serviceTimesMu8.txt”). Here are some suggestions/tips for your
coding:
• Create 5 different arrays: one for inter-arrival times, one for service times, one for the actual
arrival time on the clock, one for the delay experienced in the queue, and one for departure times.
• You know that a packet will spend some time in the queue if and only if the previous packet is
still being processed. Otherwise, the delay will be 0. See course notes from the example by hand.
• Hint for processing the given files: Since the first packet entering the system is a special case
(has a queuing delay = 0 and total delay = service time), you can hardcode these values in the
arrays that you created before processing the rest of the packets. Each subsequent packet after the
first one will depend on the one before it to determine its queueing delay and departure time. With
this information, you should be able to fill all your arrays.