/
Some Utilization Analyses for ALOHA and CSMA Protocols Some Utilization Analyses for ALOHA and CSMA Protocols

Some Utilization Analyses for ALOHA and CSMA Protocols - PDF document

natalia-silvester
natalia-silvester . @natalia-silvester
Follow
404 views
Uploaded On 2015-04-27

Some Utilization Analyses for ALOHA and CSMA Protocols - PPT Presentation

Only one station can transmit at time so if two or more stations attempt to use the channel at the same time a collision all of their frames will be garbled and some mechanisms must be de vised to a detection the problem and b to arrange for retran ID: 55490

Only one station can

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Some Utilization Analyses for ALOHA and ..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

SomeUtilizationAnalysesforALOHAandCSMAProtocolsNormanMatloffUniversityofCaliforniaatDavisMay18,20001Contention-BasedLANsIncontention-basedlocal-areanetworkswehaveallstationsonacommonchannel,suchasacableoraspecicradiofrequency,andthestationscontendwitheachotherforaccesstothatchannel.Onlyonestationcantransmitatatime,soiftwoormorestationsattempttousethechannelatthesametime(acollision),alloftheirframeswillbegarbled,andsomemechanismsmustbedevisedto(a)detectiontheproblemand(b)toarrangeforretransmission.Herewewillbeinterestedintheefcienciesofsuchnetworks.2NotationandAssumptionsLetSdenotethemeannumberof“original”framesgeneratedatallnodesofacontention-basednetwork(ALOHA,CSMA,etc.)perunittime.By“original”wemeanthatwearenotincludingretransmittedframes.ThenletGdenotethemeannumberofallframes,originalorretries,generatedperunittime.Scaletimesothataframetakesoneunitoftimetotransmit.Thensincewecantransmitatmostoneframeperunitoftime,wemusthave.Accordingly,Sistheutilizationofthechannel,thatistheproportionofthetimethatthechanneliscarryingdatawhichreachtheirdestinationintact.(Thinkaboutwhathappensoveratimeintervalof,say,length10000.Thechannelwillbebusysendingframes(notcountingretransmits)for\n ofthistime10000,thusSproportionofthattime.)WewillbeinterestedinderivingSasafunctionofG,andinacquiringsomequalitativeinsightfromthatfunction.Notethat\r,whereistheprobabilitythatnootherframewillbetransmittedduringthetimeagivenframe,whichwewillcallthereferenceframe,isbeingsent.(Ofcourse,thisincludesthecaseinwhichaframeoverlapswiththereferenceframebyevenasmallamount;thisstillisacollision,andthusstillrequiresretransmission.)So,ourtasknowistoexpressintermsofG.Wewillassume,asiscommoninsuchanalyses,thatthenumberofframestransmittedhasaPoissondistribution:Theprobabilitythatkframesaretransmittedduringintervaloflengthsis! "!#$"%\r&$$(')$+*,*,*(1)1 3ALOHAThisalsomeansthatthetimesbetweensuccessiveframeshasanexponentialdistributionwithmean1/G.(ItcanbeproventhatthisisapropertyofPoissonprocesses—eventcountshaveaPoissondistributionifandonlyiftheintereventtimesareexponentiallydistributed.)3ALOHAALOHAwasdevelopedattheUniversityofHawaiibyNormanAbramsonandothers.Itconsistedofaradiolinkbetweenstationsonseveralislands.Theprotocolwassimple:Astationwouldtransmitwheneverithaddatatosend.Ifitwereunluckyenoughthatsomeotherstationhasdatatosendaroundthattime(whetherearlierorlater),andthetransmissiontimeintervalsofthestationsoverlap,thenofcoursethedestinationstationwouldneverreceiveitproperly,andthusneversendanACK.Thesendingstationwouldthentimeout,andretransmit.3.1UtilizationAnalysis:OrdinaryALOHALet-denotethetimeourreferenceframebeginstransmission.Thetransmissionwillbesuccessfulifandonlyiftherearenoothertransmissionswhichbeginduring-/.$-102.Settings=2(sincetheintervallengthis2)andk=0inourPoissonformula,1wehave3\r&4657.So,8\r9657*(2)Setting:7;:\r,wendthatSismaximumwhenG=0.5,andthatatthattime9\r=�57.(NotethatGisnotunderourcontrol,sothespecicvalueofGwhichmaximizesSisnotsoimportant.WearesimplyinterestedinknowinghowlargeScanget,inthiscase1/(2e).)Inotherwords,thebest-caseutilizationofALOHAisabout18%,ratherpoor.ThisofcoursewasthelatermotivationforALOHArenementsandothermethods.3.2UtilizationAnalysis:SlottedALOHAIfyoutakeanotherlookattheanalysisofALOHAabove,itisclearthatALOHAsuffersfromtheverywide“windowofvulnerability”-.$-0.ThewholeideaofslottedALOHAistomakethiswindownarrower,thusimprovingperformance.Heretransmissionsareallowedtooccuronlyatintegertimepoints,1,2,3,...Aframewillbetransmittedat-ifandonlyifitbecame“ready”during-.$-?(eitheritoriginatedduringthattime,orbecamereadyforretransmissionafterfailinginthepast).Thesameanalysisaswehaveabovethenyields@\r9%*(3)1Youmaywonderwhywedonotsetk=1.ThepointisthatwearegiventhatthereisatransmissionatACB,soweareactuallyinterestedintheconditionaldistributionofthetimesofotherframessent,givenatransmissionatACB.ButthoseotherframesstillfollowthePoissonprocessdescribedabove.Thisisasubtlepoint,whosecarefulderivationwouldbewellbeyondthescopeofourcourse,butcanbeatleastseeninoutlineformbyrecallingthatthetimesbetweensuccessiveframeshasanexponentialdistribution.Sincetheexponentialdistributionis“memoryless,”thechancesofhavingaframein,say,DEA,B(FGACBIHKJMListhesame,whetherornotwehavetheknowledgethataframetransmissionbeganatAB.ContentionProtocols:2 3.3ComparisonThisgivesamaximumutilizationof1/e,doublethatofnonslottedALOHA,about37%.3.3ComparisonTherelationsbetweenSandGforALOHAandslottedALOHAareplottedinthisgure:00.050.10.150.20.250.30.350.400.511.522.533.54G*exp(-2*G)G*exp(-G)Notethatbothcurvesfalloffquicklyoncewepasstheirpeaks.Themoreloadweplaceonthechannel,thelessactuallygetsthrough.However,slottedALOHAisclearlythesuperiorperformer.4CSMATheCarrierSenseMultipleAccess(CSMA)protocol,ormorepreciselyitsrenement,CarrierSenseMul-tipleAccess/CollisionDetect(CSMA/CD),wasdevelopedbyRobertMetcalfeatXeroxCorp.(wholaterfounded3-Com)andothers.ItiscommonlyknownasEthernet,andisinverywideusage.Whenitrstbecamepopular,itusedasitsmediumcoaxialcable,thoughthesedaysmorecomplexarrangementsarecommon.TheideaofCSMAis“listenbeforetalk.”Beforeattemptingtotransmit,astation,sayX,willsensethecableforacarriersignal,which,ifpresent,signiesthatsomeotherstation,sayY,issending.Insuchacase,stationXreschedulesafutureretransmission,bygeneratingarandomwaittime.ThisiscallednonpersistentCSMA.Avariationis1-persistentCSMA,inwhichstationXcontinuestolistentotheline,andthensendsimmediatelyafterYnishes.Theproblemwith1-persistentCSMAisthatathirdstation,sayZ,alsowantstosendwhileYissending;inthiscase,XandZwouldcolliderightafterYisdone.Thusacommonvariationisp-persistentCSMA,inwhichstationsXandZwouldgeneraterandomnum-ContentionProtocols:3 4.1UtilizationAnalysis:NonpersistentCSMAbers,andtransmitrightafterYisdoneonlywithprobabilityp.Iftherandomnumbertellsastationtowait,itwaits—“backsoff”—forrandomamountoftimeandthentriesagain.TheadvantageisthattheprobabilityXandZcollideintheabovescenarioisonlyN5.Ontheotherhand,if,say,onlyZhadbeenwaitingbutnotX,thenZmightbackoffunnecessarily.Evenifastationwithamessagetosendchecksthelineand“hears”nothing,acollisionmaystilloccur,becauseanotherstationmaybecurrentlytransmittingbutduetopropagationdelayitsframemaynothavearrivedyetattherststation.Forthatreason,theCDmechanismwasaddedtoCSMA:Whileastationissending,itcontinuestomonitortheline,tocheckwhetheritsframeisonthelineintact.Ifacollisionoccurs,bothstationswilldetectthisandceasetransmission.So,acollisionwillbedetectedmuchearlierthanitwouldifwemerelyjustwaitforanACK(orlackofone),asintheALOHAcase.4.1UtilizationAnalysis:NonpersistentCSMA(AdaptedfromModelingandAnalysisofComputerCommunicationsNetworks,byJeremiahHayes,pub.byPlenum,1984.)Thelinewillbeidleforawhile,thenbusyforawhile(whetherwithsuccessfultransmissionoracollision),thenidle,thenbusy,andsoon.LetBandIdenoterandomvariablesrepresentingthelengthsofthebusyandidletimes,respectively.Themeanlengthofabusy/idlecyclewillbeOQP0OSR(4)Duringabusy/idlecycle,letTbethetimespentsuccessfullysendingamessage.Ineachbusy/idlecycle,therewillbeeithernosuccessfultransmissions(thebusyperiodhadacollision)orexactlyonesuccessfultransmission.2Bydenitionofbusyperiod,therewillbeatleastonestationwithsomethingtosend.Considerthestationwhichsendsrst,andlet-denotethetimeitstarts,sothatitsendsduring-$-0.(Notealsothat-isthetimethisbusyperiodstarts.)Theprobabilitynootherstationcollideswithitis,inthesamemannerwesawforALOHA,6!T(5)So,OVU1\rWYX?6IT0ZX.6!T[\r\!T(6)Theutilizationofthelineis]\rOVUOSP0OQR(7)Let^denotetheratioofend-to-endpropagationdelayinthecabletotheframetransmissiontime.Duetoourtimescaling,^isalsotheend-to-endpropagationdelay.2ThisiswhereweusethefactthatwehavenonpersistentCSMA.WithpersistentCSMA,asecondsuccessfultransmissioncouldfollowrightontheheelsofapreviousone,ifthesecondstationseestherstbusyandthenstartssendingrightaftertherstonenishes.ContentionProtocols:4 4.1UtilizationAnalysis:NonpersistentCSMAToderiveE(B),notethatifthereisnocollision,thenBwillequaltheframetransmittimeplusthepropaga-tiondelay,whichonaveragewillbeP\r_0`a^(8)assumingthestationsareuniformlyspreadoutalongthelengthofthecable.Ontheotherhand,ifthereisacollision,thenBwillequalP\rW0`a^0cb(9)whereDisdenedasfollows:Againsomestationwillbethersttostart,attime-.ThenDistheamountoftimelaterthatthelaststationtosendinthisbusyperiodstarts,thatisthelaststationstartsattime-0db.3WeneedtondE(B),soweneedE(D).Tothisend,notethatwemusthaveb^;recallthatthisishowthecollisionsoccurintherstplace—astationthinksthelineisfreebuthasnotreceivedatransmissioninprogressyet,duetopropagationdelay.Nowdrawanumberlineshowing-,-0\b,-0\eand-0^,inthatorder,andyouwillseewhybeifandonlyiftherearenotransmissionsduringthetimeinterval-0ce$-0^.Theprobabilityofthateventis6fgThhij(10)So,bek\r\6f,Tl)ij(11)Thus,theprobabilitydensityfunctionofDismmeben\rmme6fgTl)ij\r96fgThhij(12)forpoeo^.ThusOb1\r\qTeX(6fgTl)ij\r^..6!T(13)So,OQP[\rW0*srt^0^..6!T(14)FinallythequantityE(I)iseasilydeterminedasfollows.Iisthetimeuntilthersttransmissionfollowingacertaintime(-00^),soithasanexponentialdistributionwithmean1/G.Thus,3NotethathereweareusingthefactthatthisisCSMA,notCSMA/CD.ContentionProtocols:5 4.2RenementsofEthernet]\rOVUOQP0OSR\r%6IT0*urt^06!T(15)Forverysmall^,wehave]wv%x02,suggestingthatCSMAcanbeveryefcient.4.2RenementsofEthernetOriginallythe10megabitspersecondtransmissionspeedofEthernetseemedsufcient.(Thetokenringsatthetimesentattherateof4megabitspersecond.)However,withtheadventofmuchfasterprotocolssuchasFDDI,andmostimportantlythetremendousgrowthinnetworkapplicationsandneedforspeed,theoriginalEthernetspeedisconsideredslowtoday.AnewertechnologyisFastEthernet,whichusesaregularCSMA/CDprotocolbutincreasesspeedto100megabitspersecondviathefollowingmodications:yTransmissionisonthreelinesinsteadofone.y8B6TcodingisusedinsteadofMachester.yTheclockrateis25MHzinsteadof20MHz.FurtherrenementshaverecentlyledtoGigabitEthernet,withspeed1000megabitspersecond.Moreover,insteadoftheoldersingle-cableEthernettopology,Ethernethubsandswitcheshavebecomepopular.Wewilldiscussthisinanotherhandoutlater.5SimulationAnalysesManynetworkprotocolanalysesaremathematicallyintractable,sothatsimulationmustbeusedinstead.Followingisanexampleofhowthisisdone.123/*Samplesimulationprogram:ALOHAprotocol,witha"p-persistent"4featureadded.56ThereareNNodesnetworknodeswhichtransmitonthesamechannel.7Timeisslotted,i.e.transmissioncanbeginonlyatintegertimes.8Ifmorethanonestationattemptstransmissionduringagivenslot,9theywill"collide,"corruptingeachothers'messages,andthey10musttryagain.Toavoidrepeatedcollisions,astationwhichhas11aframetobetransmittedwilldosoonlywithprobabilityP.Its12interfacehardwaregeneratesarandomnumberbetween0and1,and13transmitsonlyifthenumberislessthanP;otherwiseitwaits14untilthenextslotandrepeatstheprocess.ContentionProtocols:6 5SIMULATIONANALYSES1516WesayastationisACTIVEifithassomethingtosend;otherwise17itisIDLE.AnIDLEstationwillbecomeactiveinanygivenslot18withprobabilityNewMsgProb.1920Weareinterestedinthelong-runaveragemessagedelay.Our21approximationto"long-run"willbe10,000timeslots.*/222324#include&#xstdl;&#xib.h;/*neededforRAND_MAX*/252627#defineIDLE028#defineACTIVE129#defineNSLOTS1000030#defineMAXNODES100313233intNNodes,/*numberofnodesinthenetwork*/34State[MAXNODES],/*currentnodestates,IDLEorACTIVE*/35Delay[MAXNODES],/*delayssofartomessage,ifany,ateachnode*36NMsg,/*numberofsuccessfullytransmittedmessagessofar*/37SumDelay;/*overalltotaldelaysaccumulatedsofar*/383940floatP,/*probabilitythatanACTIVEnodewillsend*/41NewMsgProb;/*probabilitythatanIDLEnodewillbecomeACTIVE*/424344/*thefunctionRnd(Prob)simulatesarandomeventofprobability45Prob,withthereturnvalue1meaningtheeventoccurredand046meaningthatitdidnotoccur*/4748intRnd(Prob)49floatProb;5051{return((rand()Prob*RAND_MAX));}525354Init(argc,argv)55intargc;char**argv;5657{intNode;5859sscanf(argv[1],"%f",&NewMsgProb);ContentionProtocols:7 5SIMULATIONANALYSES60sscanf(argv[2],"%f",&P);61sscanf(argv[3],"%d",&NNodes);6263SumDelay=0;64NMsg=0;65for(Node=0;NodeNNodes;Node++)66State[Node]=IDLE;67}686970main(argc,argv)71intargc;char**argv;7273{intSlot,NTry,Node,TryNode;7475Init(argc,argv);767778/*simulatethesystemforNSLOTStimeperiods*/79for(Slot=0;SlotNSLOTS;Slot++){80NTry=0;81/*foreachnode,checkwhetherithaschangedfromIDLEto82ACTIVE,andifACTIVE(fromjustnoworbeforehand)check83whetheritwillattempttotransmit*/84for(Node=0;NodeNNodes;Node++){85if(State[Node]==IDLE&&Rnd(NewMsgProb)){86State[Node]=ACTIVE;87Delay[Node]=0;88}89if(State[Node]==ACTIVE){90Delay[Node]++;91/*decidewhethertotransmit*/92if(Rnd(P)){93NTry++;94TryNode=Node;95}96}97}98/*asuccessfultransmissionwilloccurifexactlyonenode99attemptedtransmission*/100if(NTry==1){101NMsg++;102SumDelay+=Delay[TryNode];103State[TryNode]=IDLE;104}ContentionProtocols:8 5SIMULATIONANALYSES105}106107if(NMsg�0)108printf("long-runaveragedelay=%f\n",SumDelay/((float)NMsg));109else110printf("NMsg=0\n");111}ContentionProtocols:9