Starting from:
$35

$29

Project #1: Switching Element Problem Solution

In this project you will write a program to produce a discrete event simulation of a switching element with 10 inputs and 3 outputs as shown in Fig. 1. Time is slotted on all inputs and outputs. Each input packet follows a Bernoulli process. In a given slot the independent probability that a packet arrives in a slot is p and the probability that a slot is empty is (1– p). One packet fills one slot.

For a switching element if three or less packets arrives to some inputs, they are forwarded to the switching element outputs without a loss. If more than three packets arrive to the inputs of the switching element, only three packets are randomly chosen to

be forwarded to the switching element outputs and the remaining ones are discarded.




p p p p

p Switching

p Element

p

p p p







Fig. 1. Switching Element




In your discrete event simulation the program will mimic the operation of the switch and collect statistics. That is, in each time slot the program randomly generates packets for all inputs of the switching element and counts how many packets can be passed to the output of the switching element (causing throughput) and, alternatively counts how many packets are dropped (when the switching element has more than three input packets at a given time slot) .

Your task is to collect throughput




statistics for different values of p (p = 0.05,



0.10 up to 1.0 in steps of 0.05), by running the procedure described above for each value of p and for many slots (at least a thousand slots per value of p). The more simulated slots, the more accurate the results will be. Based on this statistics, plot two graphs: 1) the
average number of busy outputs versus p, and 2) the average number of dropped packets versus p. If you also plot the model equation curves, you will receive extra credit.

For instance:




3 10  10 

#busy slots

  Pr(exactly i outputs)  i    p1 (1 − p)9 1    p2 (1 − p)8  2 



i 1

 1   2 
       

10 10 10

1 −   p0 (1 − p)10 −   p1 (1 − p)9 −   p2 (1 − p)8   3 

  0   1   2  

3 − 3(1 − p)10 − 20 p1 (1 − p)9 − 45 p2 (1 − p)8










Submission:




This is a one person project – you may discuss it with your classmates – but code should not be identical between two or more students. Each individual must submit an independently prepared report including:

1. Stapled cover sheet (NO binders or folders): Identifying information: name, student number, course, and project identification.

2. Source Code (with name of the language/package used) and brief description of the program. The program can be done in C, Java or Matlab (other languages allowed).

3. A flow chart of about 6-12 boxes showing the major parts and flow of the program – may be hand drawn.

4. Two visualization graphs showing the average number of busy outputs and dropped packets versus p.

5. Conclusion: a paragraph summarizing your evaluation of the performance of the switching element.

More products