TheNetworkSimulatorNS2
h8p://www.ce.uniroma2.it/courses/MMI/
h8p://www.uniroma2.it/dida?ca/MMI
EmilianoCasalicchio‐[email protected]
Agenda
• Conce?fondamentali• EvenFeScheduler• Archite8ura• Esempio
• NodieRouFng• Workloadelivellodiapplicazione
• Generaziondedelletopologiedirete
EmilianoCasalicchio‐[email protected]
Documentazione
• Questalezioneèbasatasulmaterialeseguente• h8p://www.isi.edu/nsnam/ns/
– MarcGreis'stutorial– "NSforBeginners"byAltmanandJimenez– NsManual– “NSbyExample”byJ.ChungandM.Claypoolh8p://nile.wpi.edu/NS/– Variepresentazionietutorial“nsworkshopsandpresentaFons”
• Tcl/tk,h8p://www.tcl.tk/• Otcl,h8p://bmrc.berkeley.edu/research/cmt/cmtdoc/otcl/index.html• Altrichetroveretenelseguito…
EmilianoCasalicchio‐[email protected]
Installazioneh8p://www.isi.edu/nsnam/ns/ns‐build.html
All‐in‐one(Consigliata–Linux/Windows/Mac):UlFmaversione(Jun17,2009)h"p://sourceforge.net/projects/nsnam/files/allinone/ns‐allinone‐2.34/
– Tclrelease8.4.18(requiredcomponent)– Tkrelease8.4.18(requiredcomponent)– Otclrelease1.13(requiredcomponent)– TclCLrelease1.19(requiredcomponent)– Nsrelease2.33(requiredcomponent)– Namrelease1.13(opFonalcomponent)– Xgraphversion12(opFonalcomponent)– CWebversion3.4g(opFonalcomponent)– SGBversion1.0(?)(opFonalcomponent,buildssgblibforallUNIXtype
plaiorms)– Gt‐itmgt‐itmandsgb2ns1.1(opFonalcomponent)– Zlibversion1.2.3(opFonal,butrequiredshouldNambeused)
Oppure…InstallazioneeconfigurazioneseparatadeisingolicomponenA
EmilianoCasalicchio‐[email protected]
Cos’èNS2• Discrete‐eventsimulator
– Sviluppatoall’UCBerkeley• SimulazionealivellodipaccheEo• ModellazionedallivelloDataLinkalivelloApplicazione
– protocollilivelloMAC(persimulazioniLAN)– AlgoritmidirouFng:Dijkstra,etc…– MeccanismidigesFonedellecodedeirouter:DropTail,RandomEarly
DetecFon/Drop(RED)e(Class‐BasedQueueing)CBQ– Protocollidirete:TCP,UPD(overIPeIPv6)– SorgenFditraffico:FTP,Telnet,Web,CBReVBR,
• Opensource(vastacomunitàdisviluppatoriedutenF)• Basatosu
– C++persimulaFonengineemodelli– Tcl/OTcl(ObjectToolCommandLanguage)perconfigurazionescenarie
logicadisimulazione
EmilianoCasalicchio‐[email protected]
Vistautente:conce?fondamentali
• Otclpersetupedesecuzionesimulazione– inizializzazioneeventscheduler,– SetuptopologiauFlizzando“networkobject”e“plumbingfuncFon”– Specificareinizioefinegenerazionetraffico(evenF)
• Evento=(packetID,ScheduleTime,ObjPointer)– L’ObjèunnetworkobjectchegesFràilpacche8o
• L’EventScheduler– ManFeneiltemposimulato– Estrae(fire)tu?glievenF(pacche?)cheoccorronoaltempotinvocandoirelaFvi
componenFdirete(networkobject/component)– Loschedulerèsinglethread(noproblemilocking/compeFzionerisorse)
• IcomponenFdiretecomunicanoscambiandosipacche?EmilianoCasalicchio‐[email protected]
Agenda
• Introduzione• EvenFeScheduler• Archite8ura• Esempio
• RouFng• Workloadelivellodiapplicazione
• Generaziondedelletopologiedirete
EmilianoCasalicchio‐[email protected]
Stru8uradaFEvent• ungenericoeventocomprendegeneralmenteunfiringFmeeunafunzione
manipolatrice(de8a“handler”)• LaclassedenominataHandlerconFenesemplicementeunafunzionevirtuale,che
quindidovràesserespecializzatatramiteleclassidaessaderivate
EmilianoCasalicchio‐[email protected]
EventScheduler
EmilianoCasalicchio‐[email protected]
A seconda di come gestisco la coda ho diverse prestazioni, e.g 1) massimizzare il numero di eventi che riesco a processare nell’unità di
tempo (reale), e quindi aumentare la velocità della simulazione 2) massimizzare la quantità di eventi che riesco a gestire,
indipendentemente dalla loro velocità di processamento (dimensione della coda!!), per aumentare la dimensione dei sistemi che riesco a simulare
3) 1) e 2) strettamente correlati
SchedulerinNS‐2
• Listscheduler
• Heapscheduler
• Calendarscheduler(default)
• Real‐Fmescheduler
• “All made the same task with different performances”
EmilianoCasalicchio‐[email protected]
Es: set ns [new Simulator] $ns use-scheduler Heap
ListScheduler
• Thelistscheduler(Scheduler/List../ns‐2/scheduler.cc)implementstheschedulerusingasimplelinked‐liststructure
• ThelistiskeptinAme‐order(earliesttolatest),– soeventinserFonanddeleFonrequirescanningthelisttofindtheappropriate
entry
• ChoosingthenexteventforexecuFonrequirestrimmingthefirstentryofftheheadofthelist– ThisimplementaFonpreserveseventexecuFoninaFIFOmannerforsimultaneous
events.
EmilianoCasalicchio‐[email protected]
HeapScheduler
• Theheapscheduler(Scheduler/Heap../ns‐2/scheduler.cc)implementstheschedulerusingaheapstructure.
• Aheapisaspecializedtree‐baseddatastructurethatsaFsfiestheheapproperty:ifBisachildnodeofA,thenkey(A)≥key(B).
• Thisstructureissuperiortotheliststructureforalargenumberofevents,asinserFonanddeleFonFmesareinO(logn)fornevents.
EmilianoCasalicchio‐[email protected]
Calendarscheduler• Thecalendarqueuescheduler(Scheduler/Calendar../ns‐2/scheduler.cc)
usesadatastructureanalogoustoaone‐yeardeskcalendar,inwhicheventsonthesamemonth/dayofmulFpleyearscanberecordedinoneday.
• TheoriginalimplementaFonofCalendarqueuesinnsv2wascontributedbyDavidWetherall.– AnewimplementaFonfromXi(2005)h8p://netlab.caltech.edu/projects/
ns2tcplinux/ns2patch/
• TheoriginalNS‐2.28usesaCalendarQueuetoimplementthepriorityqueue,whichstorethefutureeventsinthesimulaFon.
EmilianoCasalicchio‐[email protected]
OriginalCalendarscheduler• Thecalendarqueuestoresevents
intoanarrayofbuckets.– Abucketcorrespondstoa"day"
inarealcalendar.
– AbucketcanholdmulFpleevents,asyoucanwritedownmulFplenotesineachdayinarealcalendar.
– Thewholebucketarraycorrespondstoa"year".Ifeventsinthesame"day"butindifferent"years"sharethesamebucket.
– Whenaneweventisinserted,wecancalculatetherightbucketinO(1)andinserttheeventintothisbucketvialinearsearch.
– Thesizeofthearraymaybedoubledifthenumberofeventsgrowslarger,orhalvedifthenumberofeventsgrowssmaller.EmilianoCasalicchio‐
R. Brown. 1988. Calendar queues: a fast 0(1) priority queue implementation for the simulation event set problem. Commun. ACM 31, 10 (October 1988), 1220-1227.
OriginalCalendarscheduler• Theefficiencyofthecalendarqueueseemstodependonthewidthof
eachbucket.– Ifthewidthofabucketistoolong,manyeventsmaybeputintoonebucket
wherelinearsearchhappenswhenaneweventisinserted
– Ifthewidthofabucketistoosmall,mostoftheeventsinthebucketsareofdifferentyearsandthereisalargeoverheadfordequeue(linearsearchoverthecalendardays).
EmilianoCasalicchio‐[email protected]
OriginalCalendarscheduler• TheopFmalsoluFonforbucketwidth,istheaverageintervalbetweenadjacentevents.
• Tocalculatetheaverageintervalbetweenadjacentevents,onehastotraversethewholequeueandcalculatetheaverageintervals.
• NS‐2calculatestheaverageintervalbetweenadjacentevents:
1)pickupthefullestbucket(withlargestnumberofevents),
2)calculatetheaverageintervalinthatbucket,assuggestedinDynamicCalendarQueue
3)setbucketsize=averageinterval*4.(4isprobablytheheurisFcnumberthatkeeptheinqueueanddequeuecomplexitybalanced)
• Steps1‐3mayresultinawidthvaluemuchlargerthanthesuggestedopFmialvalue.
• Ifinthefullestbuckettherearesomeeventsindifferent"years"andmostoftheeventsareclusteredwithin"seconds”
– eachbucketwillhaveawidthinunitof"years"and
– mostoftheevents(clusteredwithinseconds)willgointoafewbucketsof"years".
• NS2doesnotadopttheDynamicCalendarQueue'sresizetriggeringalgorithm.
– Oncethebucketwidthissettobeavalue,itwon'tchangeunlessthebucketnumberneedstobechanged(bysignificantchangeonnumberofeventsinthequeue)
EmilianoCasalicchio‐[email protected]
JongSuk Ahn, SeungHyun Oh. "Dynamic Calendar Queue,"
SpeedingupNS‐2scheduler• AnewimplementaFonfromXi(2005)
– h8p://netlab.caltech.edu/projects/ns2tcplinux/ns2patch/
• ThreechangestotheoriginalCalendarScheduler:
1)TheesFmaFonofthebucket_size:Thepatches1matesthebucket_sizebytheaverageintervalofdequeuedeventsinthepastwindow.Thisisclosertotherealdistribu1onunlesstheeventarrivalpaAernsignificantlychanges.
2)SNOOPyCalendarQueuedynamicadjustmentisimplementedtoreacttothechangeofeventarrivalpaAern.
3)Forthe"insert"funcFon,theoriginalcodetraversesfromtheheadtothetail.Thepatchtraversesfromthetailtothehead,whichmaytraverselessnodesifeventsareoReninsertedtotheendofthepriorityqueue.
EmilianoCasalicchio‐[email protected]
Kah Leong Tan, Li-Jin Thng, "SNOOPy Calendar Queue", Proceedings of the 32nd conference on Winter simulation, Orlando, Florida, Pages: 487 - 495, 2000,
Confrontodiprestazionitraschedulers
EmilianoCasalicchio‐[email protected]
Xi (2005) http://netlab.caltech.edu/projects/ns2tcplinux/ns2patch/
RealTimescheduler
• Thereal‐Fmescheduler(classScheduler/RealTime)a8emptstosynchronizetheexecuFonofeventswithreal‐Fme.– Itiscurrentlyimplementedasasubclassofthelistscheduler.
• Thereal‐FmecapabilityisusedtointroduceanNSsimulatednetworkintoareal‐worldtopologytoexperimentwitheasily‐configurednetworktopologies,cross‐traffic,etc.– ThisonlyworksforrelaFvelyslownetworktrafficdatarates,asthe
simulatormustbeabletokeeppacewiththereal‐worldpacketarrivalrate,andthissynchronizaFonisnotpresentlyenforced.
EmilianoCasalicchio‐[email protected]
TimePrecision• Precisionoftheschedulerclockcanbedefinedasthesmallest
Ame‐scaleofthesimulatorthatcanbecorrectlyrepresented.
• Theclockvariablefornsisrepresentedbyadouble.– AspertheIEEEstdforfloaFngnumbers,adouble,consisFngof64bits
mustallocatethefollowingbitsbetweenitssign,exponentandmanFssafields:sign=1bitexponent=11bitmanFssa=52bit
– AnyfloaFngnumbercanberepresentedintheformX*2nwhereXisthemanFssaandnistheexponent.
• ThustheprecisionofFmeclockinnscanbedefinedas– 1/(252)=2.2204e‐16sec.
EmilianoCasalicchio‐[email protected]
Agenda
• Conce?fondamentali• EvenFeScheduler• Archite8ura• Esempio
• RouFng• Workloadelivellodiapplicazione
• Generaziondedelletopologiedirete
EmilianoCasalicchio‐[email protected]
Archite8ura• C++usatoperprocessareIpache?:
– SchedulereNetworkcomponentsscri?inC++
– Veloce,de8agliato,controllocompleto
• Otclusatoperilcontrollo,– setupdellasimulazione,configurazione,azionioccasionali
– Rapidodascrivereemodificare
• C++eOTclcondividonolastessagerarchiadiclassi.– Corrispodenza(OTcllinkage‐TclCL)traogge?C++eOtcl
C++obj–TclCL–Otclobj
– Solopergliogge?chemodellanonetworkcomponent
EmilianoCasalicchio‐[email protected]
Tcl
OTcl
TclCL
ns‐2
EventScheduler
NetworkComponents
C/C++
Archite8ura:Overview
• Thesimulatorsupports– AclasshierarchyinC++,and
– AsimilarclasshierarchywithintheOtclinterpreter
• Thetwohierarchiesarecloselyrelatedtoeachother;fromtheuser’sperspecFve,thereisaone‐to‐onecorrespondence
– TherootofthishierarchyistheclassTclObject• Userscreatenewsimulatorobjectsthroughtheinterpreter
– TheseobjectsareinstanFatedwithintheinterpreter,andarecloselymirroredbyacorrespondingobjectinthecompiledhierarchy.TheinterpretedclasshierarchyisautomaFcallyestablishedthroughmethodsdefinedintheclassTclClass.
– UserinstanFatedobjectsaremirroredthroughmethodsdefinedintheclassTclObject.
– ThereareotherhierarchiesintheC++codeandOTclscripts;theseotherhierarchiesarenotmirroredinthemannerofTclObject.
EmilianoCasalicchio‐[email protected]
Classiprincipali• TclObjectisthebaseclassformostoftheotherclassesintheinterpreted
andcompiledhierarchies.• EveryobjectintheclassTclObjectiscreatedbytheuserfromwithintheinterpreter.
• Anequivalentshadowobjectiscreatedinthecompiledhierarchy.Thetwoobjectsarecloselyassociatedwitheachother.
• TheclassTclClasscontainsthemechanismsthatperformthisshadowing.
– TclClassisapurevirtualclass.• ClassesderivedfromthisbaseclassprovidetwofuncFons:constructtheinterpretedclasshierarchytomirrorthecompiledclasshierarchy;and
• providemethodstoinstanFatenewTclObjects.
• EachsuchderivedclassisassociatedwithaparFcularcompiledclassinthecompiledclasshierarchy,andcaninstanFatenewobjectsintheassociatedclass.
EmilianoCasalicchio‐[email protected]
Agenda
• Introduzione• EvenFeScheduler• Archite8ura• Esempio
• NodieRouFng• Workloadelivellodiapplicazione
• Generaziondedelletopologiedirete
EmilianoCasalicchio‐[email protected]
NodeandRouFng
Unicast‐ $nsrtprototype
(type:StaFc,Session,DistanceVector,cost,mulF‐path)MulFcast‐ $nsmulFcast(righta}erset$ns[newScheduler])‐ $nsmrtprototype
(type:CtrMcast,DM,ST,BST)EmilianoCasalicchio‐[email protected]
Tracing
• $nstrace‐allfileor• $nsnamtrace‐allfile
• $nscreate‐trace{typefilesrcdst}EmilianoCasalicchio‐
Agenda
• Conce?fondamentali• EvenFeScheduler• Archite8ura• Esempio
• RouFng• Workloadelivellodiapplicazione
• Generaziondedelletopologiedirete
EmilianoCasalicchio‐[email protected]
Basictclproc test { a b } { set c [expr $a + $b] set d [expr [expr $a - $b] * $c] for {set k 0} {$k < 10} {incr k} {
if {$k < 5} { puts “k < 5, pow = [expr pow($d, $k)]” } else { puts “k >= 5, mod = [expr $d % $k]” } } }
test 43 27
%oppure
set aa 43 set bb 27 Test $aa $bb
Output
EmilianoCasalicchio‐[email protected]
HelloWorld‐InteracFveMode
swallow 71% ns % set ns [new Simulator] _o3
% $ns at 1 “puts \“Hello World!\”” 1
% $ns at 1.5 “exit” 2 % $ns run Hello World! swallow 72%
EmilianoCasalicchio‐[email protected]
HelloWorld‐BatchMode
simple.tcl set ns [new Simulator] $ns at 1 “puts \“Hello World!\”” $ns at 1.5 “exit” $ns run
swallow 74% ns simple.tcl Hello World!
swallow 75%
EmilianoCasalicchio‐[email protected]
InstancesimulaFonobject• setns[newSimulator]:generatesanNSsimulatorobject
instance,andassignsittovariablens.ToinstaFateaSimulatorobjectmeans:– IniFalizethepacketformat
– Createascheduler(defaultiscalendarscheduler)– Selectthedefaultaddressformat
• The"Simulator"objecthasmemberfuncFonsto:– Createcompoundobjectssuchasnodesandlinks
– Connectnetworkcomponentobjectscreated
– Setnetworkcomponentparameters(mostlyforcompoundobjects)
– CreateconnecFonsbetweenagents– SpecifyNAMdisplayopFons
• The"Simulator"objectmemberfuncFonimplementaFonsarelocatedinthe"ns‐2/tcl/lib/ns‐lib.tcl"file.
EmilianoCasalicchio‐[email protected]
NAMsetup
• $nscolorfidcolor:– istosetcolorofthepacketsforaflowspecifiedbytheflowid(fid).– isfortheNAMdisplay,andhasnoeffectontheactualsimulaFon.
• $nsnamtrace‐allfile‐descriptor:– tellsthesimulatortorecordsimulaFontracesinNAMinputformat.
– givesthefilenamethatthetracewillbewri8entolaterbythecommand$nsflush‐trace.
– Similarly,thememberfuncFontrace‐allisforrecordingthesimulaFontraceinageneralformat.
EmilianoCasalicchio‐[email protected]
Networkobjectsetup
• procfinish{}:– funcFonthatspecifypost‐simulaFonprocesses– iscalleda}erthesimulaFonisoverbythecommand$nsat5.0"finish”
• setn0[$nsnode]:– createsanode.AnodeinNSiscompoundobjectmadeofaddressandportclassifiers
– UserscancreateanodebyseparatelycreaFnganaddressandaportclassifierobjectsandconnecFngthemtogether.
– Toseehowanodeiscreated,lookatthefiles:"ns‐2/tcl/libs/ns‐lib.tcl"and"ns‐2/tcl/libs/ns‐node.tcl".
EmilianoCasalicchio‐[email protected]
• $nsduplex‐linknode1node2bandwidthdelayqueue‐type:– createstwosimplexlinksofspecifiedbandwidthanddelay,andconnectsthetwospecifiednodes.
– InNS,theoutputqueueofanodeisimplementedasapartofalink,thereforeusersshouldspecifythequeue‐typewhencreaFnglinks.
– IntheabovesimulaFonscript,DropTailqueueisused.– Linksourcecodescanbefoundin"ns‐2/tcl/libs/ns‐lib.tcl"and"ns‐2/tcl/libs/ns‐link.tcl"files.
– theusercaninserterrormodulesinalinkcomponenttosimulatealossylink EmilianoCasalicchio‐
• $nsqueue‐limitnode1node2number:– setsthequeuelimitofthetwosimplexlinksthatconnectnode1andnode2tothenumberspecified.
– takealookat"ns‐2/tcl/libs/ns‐lib.tcl"and"ns‐2/tcl/libs/ns‐link.tcl",orNSdocumentaFonformoreinformaFon.
• $nsduplex‐link‐opnode1node2...:– EffecttheNAManimaFonshowingflowsofpackets– Toseetheeffectsoftheselines,userscancommenttheselinesoutandtrythesimulaFon.
EmilianoCasalicchio‐[email protected]
SetupTrafficAgents• settcp[newAgent/TCP]:
– createsaTCPagent.Butingeneral,userscancreateanyagentortrafficsourcesinthisway.
– Agentsandtrafficsourcesareinfactbasicobjects(notcompoundobjects),mostlyimplementedinC++andlinkedtoOTcl.Therefore,therearenospecificSimulatorobjectmemberfuncFonsthatcreatetheseobjectinstances.
– Tocreateagentsortrafficsources,ausershouldknowtheclassnamestheseobjects(Agent/TCP,Agnet/TCPSink,ApplicaFon/FTPandsoon).
– ThisinformaFoncanbefoundintheNSdocumentaFonorpartlyinthisdocumentaFon.Butoneshortcutistolookatthe"ns‐2/tcl/libs/ns‐default.tcl"file.Thisfilecontainsthedefaultconfigurableparametervaluese?ngsforavailablenetworkobjects. EmilianoCasalicchio‐
• $nsaEach‐agentnodeagent:– a8achesanagentobjectcreatedtoanodeobject.Actually,whatthisfuncFondoesiscallthea8achmemberfuncFonofspecifiednode,whicha8achesthegivenagenttoitself.Therefore,ausercandothesamethingby,forexample,$n0a8ach$tcp.Similarly,eachagentobjecthasamemberfuncFona8ach‐agentthata8achesatrafficsourceobjecttoitself.
• $nsconnectagent1agent2:– toestablishalogicalnetworkconnecFonbetweentwoagents.ThislineestablishesanetworkconnecFonbyse?ngthedesFnaFonaddresstoeachothers'networkandportaddresspair.EmilianoCasalicchio‐
Scenariosetup
• $nsat1me"string":– makesthescheduler(scheduler_isthevariablethatpointstheschedulerobjectcreatedby[newScheduler]commandatthebeginningofthescript)toscheduletheexecuFonofthespecifiedstringatgivensimulaFonFme.
– Forexample,$nsat0.1"$cbrstart"willmaketheschedulercallastartmemberfuncFonoftheCBRtrafficsourceobject,whichstartstheCBRtotransmitdata.
– InNS,usuallyatrafficsourcedoesnottransmitactualdata,butitnoAfiestheunderlyingagentthatithassomeamountofdatatotransmit,andtheagent,justknowinghowmuchofthedatatotransfer,createspacketsandsendsthem.
EmilianoCasalicchio‐[email protected]
Agenda
• Introduzione• EvenFeScheduler• Archite8ura• Esempio
• NodieRouFng• GenerazionedelWorkload
• Generaziondedelletopologiedirete
EmilianoCasalicchio‐[email protected]
ApplicaFon• App.toAgent:systemcall
– send– sendmsg– close– listen
• AgenttoApp.:upcall– recv– resume
• innsthereisnoactualdatabeingpassedbetweenapplicaAons
EmilianoCasalicchio‐[email protected]
TypeofapplicaFon
• H8pApp• ApplicaFon/
– TcpApp– FTP– Telnet
• ApplicaFon/Traffic/*– ExponenFalOn/Off– ParetoOn/Off– CBR– Traffictrace EmilianoCasalicchio‐
ExponenFalOn/Off• AnExponenFalOn/OffobjectisembodiedintheOTclclassApplicaFon/
Traffic/ExponenFal.
• Themembervariablesthatparameterizethisobjectare:– packetSize_theconstantsizeofthepacketsgenerated– burst_Fme_theaverage“on”Fmeforthegenerator
– idle_Fme_theaverage“off”Fmeforthegenerator
– rate_thesendingrateduring“on”Fmes
• AnewExponenFalOn/Offtrafficgeneratorcanbecreatedandparameterizedasfollows:
EmilianoCasalicchio‐[email protected]
ParetoOn/Off• AParetoOn/OffobjectisembodiedintheOTclclass
ApplicaFon/Traffic/Pareto.
• Themembervariablesthatparameterizethisobjectare:– packetSize_theconstantsizeofthepacketsgenerated– burst_Fme_theaverage"on"Fmeforthegenerator
– idle_Fme_theaverage"off"Fmeforthegenerator
– rate_thesendingrateduring"on"Fmes– shape_the"shape"parameterusedbytheparetodistribuFon
• AnewParetoOn/Offtrafficgeneratorcanbecreatedasfollows:
EmilianoCasalicchio‐[email protected]
CBR• ACBRobjectisembodiedintheOTclclassApplicaFon/Traffic/
CBR.
• Themembervariablesthatparameterizethisobjectare:– rate_thesendingrate– interval_(OpFonal)intervalbetweenpackets– packetSize_theconstantsizeofthepacketsgenerated– random_flagindicaFngwhetherornottointroducerandom“noise”
inthescheduleddepartureFmes(defaultisoff)
– maxpkts_themaximumnumberofpacketstosend
EmilianoCasalicchio‐[email protected]
TrafficTrace• ATrafficTraceobjectisinstanFatedbytheOTclclassApplicaFon/Traffic/Trace.
– TheassociatedclassTracefileisusedtoenablemulFpleTraffic/Traceobjectstobeassociatedwithasingletracefile.
– TheTraffic/Traceclassusesthemethoda8ach‐tracefiletoassociateaTraffic/TraceobjectwithaparFcularTracefileobject.
– ThemethodfilenameoftheTracefileclassassociatesatracefilewiththeTracefileobject.
• ThefollowingexampleshowshowtocreatetwoAp‐plicaFon/Traffic/Traceobjects,eachassociatedwiththesametracefile(called"example‐trace"inthisexample).
• ToavoidsynchronizaFonofthetrafficgenerated,randomstarFngplaceswithinthetracefilearechosenforeachTraffic/Traceobject.
EmilianoCasalicchio‐[email protected]
EmilianoCasalicchio‐[email protected]
Webtraffic(Webcachemodel)
• Therearethreemajorclassesrelatedtowebcache,asitisintherealworld:– client(browser),– server,and– cache
WebPageandPagePool• WebPage
– name,size,modificaFonFme,age
• PagePool– Math
• onepage,whosesizecanbegeneratedbyagivenrandomvariable.
• PagemodificaAonsequenceandrequestsequencearegeneratedusingtwogivenrandomvariables.
– CompMath• introducesacompoundpagemodel.
• acompoundpage=mainpage+severalcomponentobjects.
• Allcomponentobjectshavethesamesize;
– ProxyTrace• [<serverID><URL_ID><PageSize><AccessCount>]
– WebTraffic(togeneratetrafficonlyandnotheaderinfo)
EmilianoCasalicchio‐[email protected]
Internettopologies• ToeffecFvelyengineertheInternet,crucialissuessuchasthelargescale
structureofitsunderlyingphysicaltopology,– itsFmeevoluFonandthecontribuFonofitsindividualcomponentstoitsoverallfuncFonneed
tobewellunderstood.• DuringthedesignphaseofanInternet‐basedtechnology,extensive
simulaFonsareusuallyperformedtoassessitsfeasibility,intermsofefficiencyandperformance.
• Ingeneral,InternetstudiesandsimulaAonsassumecertaintopologicalproperAesorusesyntheAcallygeneratedtopologies.
• IfsuchstudiesaretogiveaccurateguidanceastoInternet‐widebehavioroftheprotocolsandalgorithmsbeingstudied,thechosentopologiesmustexhibitfundamentalproperAesorinvariantsempiricallyfoundintheactualextantstructureoftheInternet.Otherwise,correctconclusionscannotbedrawn.
EmilianoCasalicchio‐[email protected]
BRITEtopologygenerator
• BRITE:BostonuniversityRepresentaFveInternetTopologygEnerator
• h8p://www.cs.bu.edu/brite/
• Routertopologymodel
• AStopologymodel
• Hierarchical– Top‐downtopology model
– Bo8om‐uptopologymodelEmilianoCasalicchio‐
RouterWaxman• BasicallyreferstoageneraFonmodelforarandomtopologyusing
Waxman'sprobabilitymodelforinterconnecFngthenodesofthetopology,whichisgivenby:
P(u,v)=a*e‐d/(b*L)
where0<a,b<=1,
distheEuclideandistancefromnodeutonodev,andListhemaximumdistancebetweenanytwonodes.
EmilianoCasalicchio‐[email protected]
RouteBarabasi‐Alberttopology• RouterBarabasiAlbertmodelthatimplementsamodelproposedbyBarabási
andAlbert
• Thismodelsuggeststwopossiblecausesfortheemergenceofapowerlawinthefrequencyofoutdegreesinnetworktopologies:incrementalgrowthandpreferenFalconnecFvity.– IncrementalgrowthreferstogrowingnetworksthatareformedbytheconFnual
addiFonofnewnodes,andthusthegradualincreaseinthesizeofthenetwork.– PreferenAalconnecAvityreferstothetendencyofanewnodetoconnectto
exisFngnodesthatarehighlyconnectedorpopular.
• RouterBarabasiAlbertinterconnectsthenodesaccordingtotheincrementalgrowthapproach.Whenanodeijoinsthenetwork,theprobabilitythatitconnectstoanodejalreadybelongingtothenetworkisgivenby:
P(i,j)=di/S
wherediisthedegreeofthetargetnodeandSisthesumofoutdegreesofallnodesthatpreviouslyjoinedthenetwork.
EmilianoCasalicchio‐[email protected]
AS‐leveltopology• TheprovidedAS‐levelmodelsareverysimilartothemodels
providedforgeneraFngrouter‐leveltopologies.
• Themaindifferencebetweentheserouter‐levelandAS‐levelmodelsisthefactthatASmodelsplaceASnodesintheplaneandthesehavethecapabilityofcontainingassociatedtopologies.
• NotethatthisdoesnotmeanthattherearenoAS‐levelandrouter‐levelmodelsthatdiffersubstanFallyfromeachother.TheideaofseparaFngrouter‐levelfromAS‐levelfromthebeginningistoallowfortheflexibilityofdevelopingindependentmodelsforeachscenario.
• ThetwoAS‐levelmodelsprovidedwiththeiniFaldistribuFonofBRITEareWaxmanandBarabasiAlbert
EmilianoCasalicchio‐[email protected]
Top‐downtopology• Top‐downmeansthatBRITEgeneratesfirstanAS‐leveltopology(1)according
tooneoftheavailableflatAS‐levelmodels(e.g.Waxman,ImportedFile,etc.).
• Next,foreachnodeintheAS‐leveltopologyBRITEwillgeneratearouter‐leveltopology(2)usingadifferentgeneraFonmodelfromtheavailableflatmodelsthatcanbeusedattherouter‐level.
• (3)BRITEusesanedgeconnecFonmechanismtointerconnectrouter‐leveltopologiesasdictatedbytheconnecFvityoftheAS‐leveltopology.
– PerformingthisinterconnecFonofrouter‐leveltopologiesinarepresentaFvewayisanopenresearchquesFon.
EmilianoCasalicchio‐[email protected]
EmilianoCasalicchio‐[email protected]