You are on page 1of 9

M/M/1 Queue An M/M/1 queue consists of a first-in-first-out (FIFO) buffer with packets arriving rando !

" according to a #oisson process$and a processor$ ca!!ed a server$ that retrievespackets fro the buffer at a specified servicerate% In this !esson$ "ou wi!! e&p!ore the 'ode(ditor and how it can be used to create an M/M/1 queue% )ou wi!! a!so* + ,se the #robe (ditor to gather different t"pes of statistics% + -earn how to app!" fi!ters to data gathered during si u!ation% + Mathe atica!!" ana!".e the statistica! data fro the si u!ation% M/M/1 /ueue Overview 0o set up a new pro1ect and scenario for this !esson* 1) 2!ose an" e&isting pro1ects% 3) Open a new pro1ect and a new scenario% 'a e the new pro1ect <initials>_mm1net and the scenario 1% 4) In the 5tartup 6i.ard$ c!ick /uit% )ou wi!! set up the scenario after the node ode! has been created% 7) Fro the Fi!e enu$ choose 'ew$ then se!ect 'ode Mode! fro the pu!!-down !ist and c!ick O8%

0he 'ode (ditor opens as a new window% 1) 2!ick on the Create Processor action button% 3) 2!ick in the workspace where "ou want the odu!e to be p!aced% A processor appears in the 'ode (ditor workspace% 4) 9ight-c!ick to end the operation% M/M/1 /ueue 0he 'ode (ditor 0o set the odu!e:s attributes* 1) 9ight-c!ick on the processor odu!e and se!ect Edit Attributes fro the processor:s Ob1ect pop-up enu% 3) 2hange the name attribute to src (for source) b" !eft-c!icking in the ;a!ue co!u n$ t"ping src$ then pressing 9eturn% 4) 2hange the process ode! attribute to simple_source% <enerator attributes appear in the attribute !ist% 7) -eft-c!ick in the ;a!ue co!u n of the Packet Interarrival 0i e attribute to open the Packet Interarrival 0i e 5pecification dia!og bo&%

=) 5e!ect exponential fro the Distribution Name pop-up enu% 0his sets the interarriva! ti es of generated packets to be e&ponentia!!" distributed$ as in a #oisson process% >) 5et the Mean utcome to 1%? and c!ick O8% 0his sets the ean interarriva! ti e of a packet to 1 second% @) 2hange the Packet !i"e attribute so that Aistribution 'a e is exponential and Mean utcome is #$$$% 2!ose the 5pecification dia!og bo& b" c!icking O8% 0his sets the si.e of the generated packets to be e&ponentia!!" distributed with a ean si.e of B??? bits per packet% C) 2!ick O8 to c!ose the Attributes dia!og bo&% 0he ne&t step is to create a queue odu!e that e u!ates both the infinite buffer and the server of the M/M/1 queue%

1) 2!ick on the Create %ueue Module action button$ and p!ace a queue odu!e to the right of the generator odu!e in the workspace% 3) 9ight-c!ick to end the operation% 4) 9ight-c!ick on the queue odu!e and se!ect Edit Attributes to bring up its attributes% 7) 2hange the name attribute to &ueue% =) 2hange the process model attribute to acb_'i'o (the reasoning behind this is discussed on the ne&t page)% >) Make sure the service_rate attribute is set to B>??$ then press 9eturn% @) 2!ick O8 to c!ose the dia!og bo&% For proper e or" anage ent$ packets shou!d be destro"ed when the" are no !onger needed% For this task$ "ou can use a sink odu!e% 1) 2!ick on the Create Processor Module action button and p!ace a processor odu!e to the right of the queue odu!e$ as shown be!ow%

3) 9ight-c!ick on the processor to open its

Attributes dia!og bo&% 4) 2hange the name attribute to sink% /M/1 /ueue 0he 'ode (ditor 'ote here that the defau!t va!ue of the process model attribute is sink% 1) 2!ose the dia!og bo& b" c!icking on the O8 button%

/ueue 0he 'ode (ditor

'ow that a!! the odu!es to e u!ate the M/M/1 queue have been p!aced in the workspace and proper!" configured$ the" ust be connected via packet strea s so that the packets can be transferred fro odu!e to odu!e% 1) 2!ick on the 2reate #acket 5trea action button% odu!e b" c!icking on the src icon$ then

3) 2onnect the src odu!e to the queue c!icking on the queue icon%

4) 2onnect the queue odu!e with the sink odu!e b" c!icking on the queue icon$ then c!icking on the sink icon% 9e e ber to end the 2reate #acket 5trea operation b" right-c!icking%

)ou have finished creating the node odu!e and are read" to create the network ode!% First$ "ou shou!d save "our work*

1) Fro the Fi!e enu$ choose !ave% 'a e the node <initials>_mm1$ then c!ick O8% 2!ose the 'ode (ditor% M/M/1 0he first step to creating the network ode! is to create a new ob1ect pa!ette% In this wa"$ "ou can custo i.e the pa!ette to ho!d on!" the network ob1ects "ou wi!! use to create the network ode!% 0o construct "our own ob1ect pa!ette* 1) 2!ick on the pen b(ect Palette action button% 3) 2!ick on the Con'i)ure Palette button in the ob1ect pa!ette%

DD 0his brings up a nu ber of options that a!!ow "ou to custo i.e "our pa!ette% 4) 2!ick on the Model *ist radio button if it is not a!read" se!ected% 7) 2!ick on the Clear button in the 2onfigure #a!ette dia!og bo&% 0his re oves a!! ode!s fro the pa!ette e&cept for the subnet icon$ which is a!wa"s present% =) 2!ick on the Node Models button to bring up the !ist of avai!ab!e node ode!s% /M/1 /ueue 2reating the 'etwork >) 5cro!! in the tab!e unti! "ou find the <initials>_mm1 node ode!% 2!ick in the 5tatus co!u n ne&t to Einitia!sDF 1 to change it fro not inc!uded to inc!uded%

@) 2!ick O8 to c!ose the tab!e% DD 0he pa!ette now contains the icon for the new!"-inc!uded node ode!% C) 2!ick on the 5ave button in the 2onfigure #a!ette dia!og bo& to save the pa!ette configuration% (nter the na e Einitia!sDF 1Fpa!ette at the pro pt and c!ick O8%

0he pa!ette now contains the node ode! "ou created in the Node Model Editor+ M/M/1 /ueue 2reating the 'etwork B) 2!ick on the O8 button in the 2onfigure #a!ette dia!og bo& to c!ose the dia!og bo&$ ending the pa!ette configuration operation% )ou cannot se!ect an" of the icons in the pa!ette unti! the configuration operation is ended%e 'ow that "ou have configured a custo pa!ette$ "ou can create the network ode!% 1) 2!ick and drag the <initials>_mm1 node ode! fro the ob1ect pa!ette to the

workspace% 9e e ber to right-c!ick to end the operation%

3) 9ight-c!ick on the node ob1ect and se!ect !et Name fro the Ob1ect pop-up enu% 4) (nter m1 as the na e$ then c!ick O8% 'ow that "ou have finished creating the node$ "ou need to set the statistics to co!!ect during si u!ation% In this !esson$ "ou wi!! use the #robe (ditor (a!though "ou cou!d a!so use the 2hoose 9esu!ts option on the ob1ect pop-up enu) to set the statistics% Gut first$ save "our network ode!* 1) Fro the Fi!e enu$ choose !ave% 2!ick O8 to accept the e&isting na e <initials>_mm1net+M/M/1 /ueue 2o!!ecting 9esu!ts with the #robe (ditorM/M/1 /ueue 2o!!ecting 9esu!ts with the #robe (ditor For the M/M/1 queue$ there are severa! statistics to be co!!ected$ inc!uding* + 0he average ti e a packet is de!a"ed in the infinite buffer (queue de!a")% + 0he average nu ber of packets that are in the queue (queue si.e$ in packets)% 0hese two statistics are necessar" to answer the two pri ar" questions we have for this network ode!$ na e!"* + Aoes the average ti e a packet waits in the queue e&ceed an acceptab!e !i itH For this tutoria!$ we wi!! sa" that the acceptab!e !i it is 1= seconds% + Aoes the queue si.e increase onotonica!!"$ or does it reach stead" stateH If the queue si.e does not reach stead" state$ that a" be an indication that the s"ste (especia!!" the server$ in this case) is over!oaded% For this !esson$ "ou wi!! use the #robe (ditor to co!!ect queue de!a" and queue si.e statistics%M/1 /ueue 2o!!ecting 9esu!ts with the #robe (dit 0he #robe (ditor wi!! be used to co!!ect the queue si.e and queue de!a" statistics*

1) Fro the Fi!e enu $choose Ne,$ then se!ect Probe Model and c!ick O8% DD 0he #robe (ditor opens% 6hen using the #robe (ditor to co!!ect statistics$ "ou ust specif" the network ode! fro which "ou wish to co!!ect statistics* 1) Fro the Ob1ects enu$ choose !et Net,ork Model+ 3) 2hoose the <initials>_mm1net-mm1 network ode! fro the !ist of avai!ab!e ode!s% /M/1 /ueue 2o!!ecting 9esu!ts with the #robe (ditor 'ow that the network ode! is set correct!"$ "ou need to set the probes% 0o set the queue de!a" probe* 1) 2!ick on the Create Node !tatistic Probe action button and a probe appears be!ow 'ode 5tatistic #robe in the workspace%

)ou can either anua!!" t"pe in the attributes for the probe$ or "ou can use the auto atic se!ection ethod to set the attributes as fo!!ows* 1) 9ight-c!ick on the probe and se!ect C.oose Probed b(ect fro the pop-up enu% 3) 2!ick on the arrow ne&t to the 1 node to show its co ponents% 4) 2!ick on the queue odu!e in the node diagra % 7) 2!ick O8 to dis iss the dia!og bo&% =) 9ight c!ick on the probe and se!ect Edit Attributes fro the pop-up enu% >) 5et the na e attribute to %ueue Dela/+ @) 5et the submodule attribute to sub&ueue 0$1+ Instructions are continued on the ne&t page% C) -eft-c!ick in the ;a!ue co!u n of the statistic row% DD 0he Avai!ab!e 5tatistics dia!og bo& appears% 0his dia!og bo& !ists both the statistic and the group it be!ongs to% B) 5e!ect &ueue+&ueuin) dela/ fro the !ist and c!ick O8% DD In the (dit Attributes dia!og bo&$ the group attribute changes to queue and the statistic attribute changes to queuing de!a"% 1?)2!ick O8 to c!ose the probe:s Attribute dia!og bo&% M/

M /1 /ueue 2o!!ecting 9esu!ts with the

'e&t$ "ou need to specif" the re aining probe for queue si.e in packets% 1) 2!ick on the Create Node !tatistic Probe action button% 3) 9ight-c!ick on the new probe and se!ect Edit Attributes+ 2hange the attributes of the probe to the fo!!owing va!ues*

4) 2!ick O8 to c!ose the probe:s Attribute dia!og bo&%

DD 0he changes appear in the #robe (ditor% 'ow that "ou have set up the probes correct!" to co!!ect the desired statistics$ save the probe fi!e* 1) Fro the Fi!e enu$ choose !ave% 'a e the fi!e <initials>_mm1probe+ 3) 2!ose the #robe (ditor% 'ow that "ou have created probes to co!!ect statistics during si u!ation$ "ou need to run the si u!ation% In the previous !esson$ "ou ran the si u!ation fro the #ro1ect (ditor% For this !esson$ "ou wi!! use the 5i u!ation 0oo!%

1) In the #ro1ect (ditor$ choose Con'i)ure !imulation 2Advanced3 fro 5i u!ation enu%

the

DD 0he 5i u!ation 0oo! opens% 3) 9ight-c!ick on the si u!ation set icon in the workspace and se!ect Edit Attributes+ 4) 5et the probe fi!e to <initials>_mm1probe4 the seed to 741$ and simulation duration to @ hours% 7) 2!ick O8 when "ou are finished$ then c!ick on the (&ecute 5i u!ation 5equence action button to begin the si u!ation% ()ou can go on to the ne&t page whi!e the si u!ation runs%)% M/M/1 /ueue ;iewing 9esu!ts Aepending on the speed of "our achine$ the si u!ation shou!d take !ess than a inute to co p!ete% 6hen the 5i u!ation 5equence dia!og bo& shows that the si u!ation has co p!eted$ "ou can view the resu!ts co!!ected% In the first !esson$ "ou viewed the resu!ts ro "our si u!ation direct!" in the #ro1ect (ditor% )ou can a!so use the Ana!"sis 0oo! to view resu!ts* 1) Fro the #ro1ect (ditor:s Fi!e enu$ choose pen+ 3) Fro the pu!!-down enu in the Open dia!og bo&$ change the t"pe of fi!e to open to Anal/sis Con'i)uration$ then se!ect Einitia!sDF 1net1 and c!ick O8% DD 0he Ana!"sis 0oo! opens as a new window in O#'(0% 0he Ana!"sis 0oo! provides severa! features for viewing resu!ts that are not avai!ab!e in the #ro1ect (ditor%

0he first statistic of interest is the ean queuing de!a"$ which shows the de!a" e&perienced b" packets in the queue during the si u!ation% 0o view the ean queuing de!a"* 1) -eft-c!ick on the create a )rap. o' a statistic action button%

DD 0he ;iew 9esu!ts dia!og bo& opens% 3) In the ;iew 9esu!ts dia!og bo&$ !eft-c!ick on the fo!!owing hierarch" !eve!s* 5ile !tatistics6 <initials>_mm1net-mm16 b(ect !tatistics6 m16 &ueue6 sub&ueue 0$16 &ueue+ 4) -eft-c!ick on the queuing de!a" statistic% DD A check- ark appears in the bo& ne&t to the statistic na e%

/ueue ;iewing 9esu!ts

7) Fro the pu!!-down !ist of fi!ters$ se!ect average% =) 2!ick on the 5how button (the graph is shown on the ne&t page)% M/M /1 /ueue

;iewing 9esu!ts

0he graph of the average queuing de!a" appears be!ow* 0he !arge change ear!" in the si u!ation ref!ects the sensitivit" of averages to the re!ative!" s a!! nu ber of sa p!es co!!ected% 0owards the end of the si u!ation$ the average stabi!i.es%

You might also like