>> % This is a diary of a session showing the use of the Markov Chain >> % techniques to model a switch using the N Geo/D/1/B queue model >> % Specifying the parameters of the switch >> % for example Buffer size = K = 7, Number of Ports = NP - 2 and >> % probability of a cell arrival in a slot at the input = p = .4 >> p = .4; >> K = 7; >> NP = 2; >> % Calling the routing to set up the state transition matrix >> NGeoD1K >> % Lets look at the arrival process probabilities >> NA NA = 0.6400 0.3200 0.0400 >> % Lets look at the state transition matrix >> P P = Columns 1 through 7 0.6400 0.3200 0.0400 0 0 0 0 0.6400 0.3200 0.0400 0 0 0 0 0 0.6400 0.3200 0.0400 0 0 0 0 0 0.6400 0.3200 0.0400 0 0 0 0 0 0.6400 0.3200 0.0400 0 0 0 0 0 0.6400 0.3200 0.0400 0 0 0 0 0 0.6400 0.3200 0 0 0 0 0 0 0.6400 Column 8 0 0 0 0 0 0 0.0400 0.3600 >> % The P matrix can be used with the standard Markov Chain techniques >> % to study the queue - for example finding L the mean number in the system >> N = 8; >> mcss sspi = 0.6000 0.3375 0.0586 0.0037 0.0002 0.0000 0.0000 0.0000 >> itemp = 0:1:7 itemp = 0 1 2 3 4 5 6 7 >> L = itemp*sspi L = 0.4667 >> % Lets repeat this computation and plot L vs. p for a range of p >> PV = 0:0.05:1 PV = Columns 1 through 7 0 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 Columns 8 through 14 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 Columns 15 through 21 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 >> % computing L for each value of p >> for p = 0:0.05:1 NGeoD1K mcss L = [L itemp*sspi]; end sspi = 1 0 0 0 0 0 0 0 sspi = 0.9500 0.0493 0.0007 0.0000 0.0000 0.0000 0.0000 0.0000 sspi = 0.9000 0.0972 0.0028 0.0000 0.0000 0.0000 0.0000 0.0000 sspi = 0.8500 0.1434 0.0065 0.0000 0.0000 0.0000 0.0000 0.0000 sspi = 0.8000 0.1877 0.0122 0.0002 0.0000 0.0000 0.0000 0.0000 sspi = 0.7500 0.2296 0.0200 0.0004 0.0000 0.0000 0.0000 0.0000 sspi = 0.7000 0.2689 0.0302 0.0009 0.0000 0.0000 0.0000 0.0000 sspi = 0.6500 0.3050 0.0430 0.0019 0.0001 0.0000 0.0000 0.0000 sspi = 0.6000 0.3375 0.0586 0.0037 0.0002 0.0000 0.0000 0.0000 sspi = 0.5500 0.3657 0.0772 0.0065 0.0005 0.0000 0.0000 0.0000 sspi = 0.5000 0.3889 0.0988 0.0110 0.0012 0.0001 0.0000 0.0000 sspi = 0.4500 0.4061 0.1232 0.0177 0.0025 0.0004 0.0001 0.0000 sspi = 0.4000 0.4163 0.1499 0.0275 0.0051 0.0009 0.0002 0.0000 sspi = 0.3500 0.4182 0.1781 0.0413 0.0096 0.0022 0.0005 0.0001 sspi = 0.3001 0.4101 0.2059 0.0597 0.0173 0.0050 0.0015 0.0004 sspi = 0.2502 0.3903 0.2306 0.0830 0.0299 0.0108 0.0039 0.0014 sspi = 0.2007 0.3568 0.2478 0.1101 0.0489 0.0218 0.0097 0.0043 sspi = 0.1522 0.3082 0.2515 0.1374 0.0751 0.0410 0.0224 0.0122 sspi = 0.1064 0.2454 0.2355 0.1576 0.1055 0.0706 0.0473 0.0317 sspi = 0.0663 0.1743 0.1970 0.1613 0.1320 0.1081 0.0885 0.0724 sspi = 0.0357 0.1071 0.1429 0.1429 0.1429 0.1429 0.1429 0.1429 >> L L = 0 0.0507 0.1028 0.1566 0.2125 0.2708 0.3321 0.3971 0.4667 0.5420 0.6250 0.7180 0.8249 0.9515 1.1071 1.3068 1.5753 1.9488 2.4699 3.1585 3.9643 >> plot(PV, L) >> xlabel('Probability of a cell arrival in a slot') >> ylabel('Mean number of cells in the System') >> exit 31348 flops.