DOC PREVIEW
Berkeley ELENG 122 - Network simulator 2

This preview shows page 1-2-3-4-5 out of 15 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

EECS 122 Introduction to Computer Networks (Fall 2003) Network simulator 2 (ns-2)EECS 122: Introduction to Computer Networks Network Simulator ns2OutlineWhat is ns-2?Why simulate?ns-2 componentsDiscrete event simulationDiscrete event exampleoTcl overviewBasic ns-2Examplenam visualization demoAnalysisProject 2: ns2 -- overviewProject 2: ns2 -- requirementsKatz, Stoica F04EECS 122Introduction to Computer Networks(Fall 2003)Network simulator 2 (ns-2)Department of Electrical Engineering and Computer SciencesUniversity of CaliforniaBerkeleySlides: K. Fall, J. Heidemann, P. Huang, K. Lai, A. Parekh, I. Stoica, S. Shenker, J. WalrandKatz, Stoica F04EECS 122: Introduction to Computer Networks Network Simulator ns2Computer Science DivisionDepartment of Electrical Engineering and Computer SciencesUniversity of California, BerkeleyBerkeley, CA 94720-17763Katz, Stoica F04OutlineGoalsDiscrete event simulationBasic ns-2 ExamplesProject requirements4Katz, Stoica F04What is ns-2?Discrete event simulatorModels network protocols-Wired, wireless, satellite-TCP, UDP, multicast, unicast-Web, telnet, ftp-Ad-hoc routing, sensor networks-Infrastructure: stats, tracing, error models, etc.Multiple levels of detail in one simulator5Katz, Stoica F04Why simulate?Can examine protocol in controlled environmentRepeatable experimentsAlternatives:-Experimentation: operational details, but: limited scale, limited flexibility-Analysis: can provide deeper understanding, but: ignores implementation details6Katz, Stoica F04ns-2 componentsns: the Network Simulation engine-executes tcl scripts containing simulation setup and eventsnam: the Network AniMator-visualize ns outputtcl script(specificationof experiment)ns-2trace file (output)nam7Katz, Stoica F04Discrete event simulationmodel world as events-maintain queue of events, ordered by time-maintain [virtual time]-repeat: •extract event at head, set [virtual time]=event’s time•process it•if processing generates another event, add it to queueeach event takes predefined amount of virtual time, arbitrary amount of real time-having a slow CPU makes simulation run slower (in real time), but doesn’t change result8Katz, Stoica F04Discrete event exampleTIME EVENTA. 1s S decides to send pkt to DS starts sending pktdelay valuetransmission0.005spropagation 0.01sDSSDB. 1.005s S finishes transmitting pkt to DC. 1.01s D begins to recv pktD. 1.015s D recvs entire pkt and delivers to applicationB.D.C.A.Event queue9Katz, Stoica F04oTcl overviewprogramming language used for setting up simulation environment-object oriented-interpreted (slow)Used for-Setting up topology-Placing agents-Injecting events-Configuring tracingExamples:variables-set x 10-puts “x is $x”expressions-set y [pow x 2]-set y [expr x+x*3]control-if ($x>0) { return $x } else { return [expr -$x] }-while ($x >0) { puts $x•set x [eval x+1] }10Katz, Stoica F04Basic ns-2Create scheduler-set ns [new Simulator]Create node-set <var> [$ns node]-example: set n0 [$ns node]Create link-$ns <link-type> <node1> <node2> <bandwidth> <delay> <queuetype>-example: $ns duplex-link $n0 $n1 10Mb 100ms DropTailSchedule event-$ns at <time> <event>-example: $ns at 10.0 “$ftp start”Start scheduler-$ns run11Katz, Stoica F04Examplen0 n1ftptcp#Create a simulator objectset ns [new Simulator]#Create three nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]#Create link between the nodes$ns duplex-link $n0 $n1 4Mb 10ms DropTail$ns duplex-link $n2 $n1 1Mb 10ms DropTail$ns queue-limit $n1 $n2 10#Create a TCP agent and attach it to node n0set tcp0 [new Agent/TCP]$ns attach-agent $n0 $tcp0#Create a TCP sink agent and attach it to node n2set sink [new Agent/TCPSink]$ns attach-agent $n2 $sink#Connect both agents$ns connect $tcp0 $sink# create an FTP source set ftp [new Application/FTP]$ftp set maxpkts_ 1000$ftp attach-agent $tcp0#Inject starting events$ns at 0.0 "$ftp start"$ns at 10.0 "$ftp stop"$ns at 10.1 "finish"#Run the simulation$ns runtcp-sinkn212Katz, Stoica F04nam visualization demoNow I show a an instance of nam running the example on the previous slide…tcl script(specificationof experiment)ns-2trace file (output)namWe just saw this… Now I will show you this…13Katz, Stoica F04Analysis14Katz, Stoica F04Project 2: ns2 -- overviewGoal: investigate performance of TCP in a variety of conditions-background traffic-different TCP flavors-flows of different RTTs, access bandwidths-explicit congestion notification-random lossInvestigate-throughput, delay-search for inefficiencies-think about how to improve15Katz, Stoica F04Project 2: ns2 -- requirementsProject details:-http://www.cs.berkeley.edu/~mccaesar/ee122/proj2/project2.htmlYou MUST:1. sign up for interactive grading during -Weds 10/29 thru Fri 10/31.-you must sign up before midnight Tues 10/282. use the version of ns2 supplied on the instructional machines3. be familiar with the simulation results and the contents of your report, be prepared to answer questionsProject due on Weds October


View Full Document

Berkeley ELENG 122 - Network simulator 2

Documents in this Course
Lecture 6

Lecture 6

22 pages

Wireless

Wireless

16 pages

Links

Links

21 pages

Ethernet

Ethernet

10 pages

routing

routing

11 pages

Links

Links

7 pages

Switches

Switches

30 pages

Multicast

Multicast

36 pages

Switches

Switches

18 pages

Security

Security

16 pages

Switches

Switches

18 pages

Lecture 1

Lecture 1

56 pages

OPNET

OPNET

5 pages

Lecture 4

Lecture 4

16 pages

Ethernet

Ethernet

65 pages

Models

Models

30 pages

TCP

TCP

16 pages

Wireless

Wireless

48 pages

Load more
Download Network simulator 2
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 Network simulator 2 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 Network simulator 2 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?