DOC PREVIEW
UConn CSE 3300 - The Network Simulator

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 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 22 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 22 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 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Introduction to ns-2: “The” Network SimulatorNs-2, the network simulatorNs FunctionalityNs componentsNs Software Structure: C++ and OTCLSteps when using NsCreating a Basic Ns ModelCreating Event SchedulerCreating Network (Nodes + Links)Transport and Traffic ModelsCreating Transport Channels: TCPCreating Traffic over TCP ChannelsCreating Transport Channels: UDPCreating Traffic over UDP ChannelsTracingTracing via MonitorsWalk-through exampleNs Trace file : NS-trace.txtFlow Monitor Trace : packet-trace.txtResults - Queue StatisticsResults - Flow StatisticsPerformance Queue Statistics1Introduction to ns-2:“The” Network SimulatorDaniel FigueiredoNovember, 2004Goals: tutorial overview of nsflavor of ns: simple example, model specification, execution and trace analysis2Ns-2, the network simulatorAcademic project over 10 years oldfreely distributed, open sourceCurrently maintained by ISI DARPA + NSF projects~ 200K LoC, 392 page manualLarge user base mostly academics“de facto” standard in networking researchMain website: www.isi.edu/nsnam/ns3Ns FunctionalityDiscrete event simulatorTraffic models and applicationsWeb, FTP, telnet, audio, sensor netsTransport protocolsTCP (Reno, SACK, etc), UDP, multicastRouting and queueingstatic routing, DV routing, multicast, ad-hoc routingqueueing disciplines: drop-tail, RED, FQLink layerwired, wireless, satellite Infrastructuretracing, visualization, error models, etcmodify or create your own modules4Ns componentsNs, the simulator itself (this is all we’ll have time for)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 TclTutorial: http://www.isi.edu/nsnam/ns/tutorialNs by example: http://nile.wpi.edu/NS/5Ns Software Structure: C++ and OTCLUses two languagesC++ for packet-processingper packet processingfast to run, detailed, complete controlOTCL for control [our focus]simulation setup, configuration, occasional actionsfast to write and change6Steps when using NsCreate OTCL script with network modelnodes, links, traffic sources, sinks, etc.Parameterize simulation objectsqueue sizes, link speeds, TCP flavor and parameters (more than 30)Collect statisticsdump everything to trace, post process itgather stats during simulation within OTCL scriptmodify Ns source codeRun Ns multiple timesconfidence intervals7Creating a Basic Ns ModelCreate the event schedulerCreate nodes and linksCreate connectionCreate traffic sources/sinksEnable tracing8Creating Event SchedulerCreate schedulerset ns [new Simulator]Schedule event$ns at <time> <event><event>: any legitimate Ns/TCL commandsStart scheduler$ns run9Creating Network (Nodes + Links)Nodesset n0 [$ns node]set n1 [$ns node]Links: connect together two nodes$ns duplex-link $n0 $n1 <bandwidth> <delay> <queue_type><delay> determines propagation delay<queue_type> determines queueing policy•DropTail, RED, CBQ, FQ, SFQ, DRR10Transport and Traffic ModelsTwo layer approachTransports:TCP, UDP, multicast, etc.transport protocol instances attach to nodesTraffic (applications): (known as agents)Web, ftp, telnet, audio, etc.application instances attach to transport protocol instancesgenerates traffic into transport protocol11Creating Transport Channels: TCPsource and sinkset t_src [new Agent/TCP/Newreno]set t_dst [new Agent/TCPSink]“Newreno” flavor of TCP attach to nodes and each other$ns attach-agent $n0 $t_src$ns attach-agent $n1 $t_dst$ns connect $t_src $t_dst12Creating Traffic over TCP ChannelsFTPcreate traffic modelset ftp [new Application/FTP]default is “infinite” file sizeattach to TCP channel$ftp attach-agent $t_srcschedule start time$ns at <time> “$ftp start”13Creating Transport Channels: UDPsource and sinkset u_src [new Agent/UDP]set u_dst [new Agent/NULL]attach them to nodes, then connect to each other$ns attach-agent $n0 $u_src$ns attach-agent $n1 $u_dst$ns connect $u_src $u_dst14Creating Traffic over UDP ChannelsCBRset cbr [new Application/Traffic/CBR]$cbr set packetSize_ 512$cbr set interval_ 0.250$cbr attach-agent $u_src$ns at <time> “$cbr start”15Tracing Trace packets on individual linksTracefile format:<event> <time> <from> <to> <pkt> <size>--<flowid> <src> <dst> <seqno> <aseqno>+ 1 0 2 tcp 900 ------- 1 0.0 3.1 7 15- 1 0 2 tcp 900 ------- 1 0.0 3.1 7 15r 1.00234 0 2 tcp 900 ------- 1 0.0 3.1 7 15+ enqueue- dequeuer received droptimenodes involvedin this eventpackettypepacketlengthpacketflagsflowIDsourcedest addressesseqnumberpacketID16Tracing via MonitorsQueue monitorqueue to access the linkFlow monitorparticular flow within queueset fmon [$ns makeflowmon Fid]$ns attach-fmon $link $fmon$ns at <time> “puts $fmon set pdrops_”to specify a link, we need:•set link [$ns link $n0 $n1]17Walk-through example2 FTP/TCPsources1 On-Off (voice)UDP sourceacksFTP/TCPdestOnOff/UDPCBR/UDPdest2 Mbps full duplex5 msec prop delay100 packet bufferDrop-tail policy acks1 Mbps full duplex10 msec prop delay700 packet bufferDrop-tail policy10 FTP/TCPsources1 CBR/UDPsourceTCP SACKW_max = 32MSS = 1400TCP NewRenoW_max = 32MSS = 140001218Ns Trace file : NS-trace.txt...+ 11.533441 1 2 tcp 1440 ------- 12 1.2 2.4 96 2092r 11.535694 1 2 tcp 1440 ------- 12 1.2 2.4 65 1527- 11.537214 1 2 exp 180 ------- 100 0.2 2.13 284 1528- 11.538654 1 2 cbr 1440 ------- 101 1.11 2.14 155 1530r 11.547214 1 2 tcp 1440 ------- 12 1.2 2.4 66 1529+ 11.54728 1 2 tcp 1440 ------- 12 1.2 2.4 97 2095r 11.548654 1 2 exp 180 ------- 100 0.2 2.13 284 1528+ 11.55 1 2 cbr 1440 ------- 101 1.11 2.14 211 2096- 11.550174 1 2 tcp 1440 ------- 12 1.2 2.4 67 1534r 11.560174 1 2 cbr 1440 ------- 101 1.11 2.14 155 1530- 11.561694 1 2 exp 180 ------- 100 0.2 2.13 285 1532+ 11.56222 1 2 tcp 1440 ------- 12 1.2 2.4 98 2097- 11.563134 1 2 tcp 1440 ------- 12 1.2 2.4 68 1537r 11.571694 1 2 tcp 1440 ------- 12 1.2 2.4 67 1534r 11.573134 1 2 exp 180 ------- 100 0.2 2.13 285 1532- 11.574654 1 2 exp 180 ------- 100 0.2 2.13 286 1536...19Flow Monitor Trace : packet-trace.txt...10 356 1394.6939635123624 1262 906 0 4 7 3 0 10.5 367 1575.3875777393503 1325


View Full Document

UConn CSE 3300 - The Network Simulator

Documents in this Course
Load more
Download The Network Simulator
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 The Network Simulator 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 The Network Simulator 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?