You are on page 1of 17

ns3:A30MinuteIntroduction

Presentedby: JoeKopena DrexelUniversity tjkopena@cs.drexel.edu

http://nsnam.org/

Overview

ns3isanopensourcediscreteeventsimulator fornetworkingresearchandeducation Thistalkaimstointroduceenoughns3basics togetstartedusingincourseworkorresearch


Wheretodownload,howtocompile Basicmodel/architecture Simplescenarios&applications

History

Onceuponatime,ns2wascreated

Basicallythetoolforacademicnetworkingresearch Butreallygnarlylotsofsystemevolution,waypast originaldesignintentandgoals

Multiplelanguagesinvolved(TCL/C) Lotsofmanualrecodingfornewmodules/features

ns3isacleanslatedesign,aimingtobean easiertouse,morereadilyextensibleplatform

BasicUsage

ns3iswrittenentirelyinC++

UsercodeprotocolsandscenariosalsoinC++ Pythonwrappersforusercodealsoexist

Basicusageparadigm:

Download&compilens3sourcetocreatelibrary Compile&linkusercodeagainstlibrary Thereisnons3programperse(atthemoment)

GettingStarted

Followinstructionshere:
http://www.nsnam.org/getting_started.html

Downloadandcompiletarballorrepository

RepositoriesuseMercurial Insteadofusual./configure; makecycle,ns3 useswaf:./waf configure; ./waf

Runanexampleprogram(w/correctlibpaths):
./waf --run simple-point-to-point

KeyCodeFeatures

Sophisticatedsimulationfeaturesincluded

Extensiveparameterizationsystem Configurableembeddedtracingsystem,with standardoutputstotextlogsorPCAP(tcpdump)

Veryobjectorientedforrapidcoding,extension

Automaticmemorymanagement Objectaggregation/queryfornewbehaviors&state

E.g.,addingmobilitymodelstonodes

KeySimulationFeatures

ModelstrueIPstack,w/potentiallymultiple devices&IPaddressesoneverynode BSDlookalike,eventbasedsocketsAPI Packetsincludewireformatted(serialized)bytes, tags&metadataforeasyextensionandtracing

SimulationNetworkArchitecture

LooksjustlikeIParchitecturestack
Application Application

Socketslike API Packet(s)

Application Application

Protocol stack Node NetDevice NetDevice

Protocol stack Node Channel NetDevice NetDevice

Channel

PicturefromTomHenderson,SimuToolsns3Tutorialslides

ArchitectureElements

Nodesmay/maynothavemobility,othertraits Nodeshavenetworkdevices

Networkdevicestransferpacketsoverchannels IncorporatingLayer1(Physical)&Layer2(Link)

Devicesinterfacew/Layer3(Network:IP,ARP) Layer3supportsLayer4(Transport:UDP,TCP) Layer4isusedbyLayer5(Application)objects

Scenario:SimulatorBasics

Sourcecode,basicsimulatorsetupstuff

Scenario:NetworkSetup

Sourcecode,creatingabasicnetworktopology

CompilingExampleScenario

Quicknotesonlinking,usingw/waformake Popout&showcodecompiling&running

Applications:BasicFramework

Sourcecode,basicstructureofanapp

Applications:SendingData

Sourcecode,howtosenddata

Applications:ReceivingData

Sourcecode,howtoreceivedata

Docs&Tutorials

Documentationforns3canbefound:

Intheexamples/andsamples/subdirectoriesofthe sourcedownloadpackage Inthedoxygenpages:http://nsnam.org/doxygen/ Ontheprojectwebsite:http://nsnam.org/

Alonger,morecomprehensivetutorialisonlineat:
http://www.nsnam.org/tutorials/simutools08/

TheEnd

Questions/comments: tjkopena@cs.drexel.edu

http://nsnam.org/

You might also like