Unformatted text preview:

ns-2 tutorialIntroductionGoals of nsns statusComponents of nsns Software Structure: C++ and OtcloTcl and C++: The DualityInstallation and documentationSteps to set up the simulationExample : TCPScript to start namScreenshotsReferencesns-2 tutorialKarthik Sadasivam Banuprasad SamudralaCSCI 5931 Network SecurityInstructor : Dr. T. Andrew YangIntroductionNs-2 is a discrete event simulator targeted at network researchfocused on modeling network protocolswired, wireless, satelliteTCP, UDP, multicast, unicastweb, telnet, ftpad hoc routing, sensor networksinfrastructure: stats, tracing, error models, etcGoals of nssupport networking research and educationprotocol design, traffic studies, etc.protocol comparisonprovide a collaborative environmentfreely distributed, open sourceshare code, protocols, models, etc.allow easy comparision of similar protocolsincrease confidence in resultsmodels provide useful results in several situationsmultiple levels of detail in one simulatorns statusplatforms: basically all Unix and Windowssize: about 200k loc each C++ and Tcl, 350 page manualuser-base: >1k institutions, >10k usersreleases about every 6 months, plus daily snapshotsComponents of nsns, the simulator itselfnam, the Network AniMatorvisualize ns (or other) outputGUI input simple ns scenariospre-processing:traffic and topology generatorspost-processing:simple trace analysis, often in Awk, Perl, or Tclns Software Structure: C++ and OtclUses two languagesC++ for packet-processingfast to run, detailed, complete controlOTcl for controlsimulation setup, configuration, occasional actionsfast to write and changepros: trade-off running vs. writing speed, powerful/documented config languagecons: two languages to learn and debug inoTcl and C++: The DualityOTcl (object variant of Tcl) and C++ share class hierarchyTclCL is glue library that makes it easy to share functions, variables, etc.C++otclInstallation and documentationhttp://www.isi.edu/nsnam/ns/download ns-allinoneincludes Tcl, OTcl, TclCL, ns, nam, etc.mailing list: [email protected]documentation (see url above)Marc Gries tutorialns manualSteps to set up the simulationInitialize the simulatorDefine files for output (tracing)Set up the topologySet up the “agents”Set up the traffic between the nodesStart the simulationAnalyze the trace files to compute the parameters of interestExample : TCPset ns [new Simulator]set n0 [$ns node]set n1 [$ns node]n0 n1set ftp [new Application/FTP]$ftp attach-agent $tcp$ns at 0.2 "$ftp start"$ns at 1.2 ”exit"$ns run$ns duplex-link $n0 $n1 1.5Mb 10ms DropTailset tcp [new Agent/TCP]set tcpsink [new Agent/TCPSink]$ns attach-agent $n0 $tcp$ns attach-agent $n1 $tcpsink$ns connect $tcp $tcpsinkScript to start namset nf [open out.nam w]$ns namtrace-all $nfproc finish {} { global ns nf $ns flush-trace close $nf exec nam out.nam & exit 0}# your code goes in here$ns at 12.0 "finish" # 12.0 is the simulation time in secsScreenshotsProject B.1 Project B.2References[1] slides by John Heidemannhttp://sce.cl.uh.edu/yang/teaching/csci5931netSecuritySpr05/johnh_class_slides_sp2003.ppt[2] ns2 website: http://www.isi.edu/nsnam/ns[3] ns-2 Tutorial: http://www.isi.edu/nsnam/ns/tutorial/nsindex.html [4] Tcl/Tk tutorial :


View Full Document

UHCL CSCI 5931 - CSCI 5931 LECTURE NOTES

Documents in this Course
Load more
Download CSCI 5931 LECTURE NOTES
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CSCI 5931 LECTURE NOTES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CSCI 5931 LECTURE NOTES 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?