1 / 15

Measurements and Modeling Table of Contents

Measurements and Modeling Table of Contents. Measurements Modeling and its Shortcomings Example of a Network Simulator: NS. Problem with Measurements. Real system does not exist Implementation of real test system is too expensive too dangerous

trista
Download Presentation

Measurements and Modeling Table of Contents

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Measurements and ModelingTable of Contents • Measurements • Modeling and its Shortcomings • Example of a Network Simulator: NS

  2. Problem with Measurements • Real system does not exist • Implementation of real test system is • too expensive • too dangerous • Measurements would interfere with normal operation of the real system Real System measure Result

  3. generate Model measure infer ModelingResult Modeling Process • There are Analytical models and Simulation models Real System measure Result

  4. Disadvantage of Modeling • Models give only an indication of the behavior of the real system • Models are an abstraction of the reality • Many details are not considered • Real systems are complex • Therefore: • Differences between measurements in models and reality exist

  5. Example: TCP Sequence Number Measured in Simulator and Reality Simulator Reality

  6. EE122 Projects – S03 • Assignment No.2 and No.3: • Analysis of ns simulation runs, showing the behavior of flows under different control mechanisms(Different TCPs and router implementations) • Implementation of ns module to analyze the impact of end-user decisions (in C++)(Adaptive routing and call control)

  7. Modeling Using theNetwork Simulator: ns • ns is discrete event simulator targeted at networking research • ns started in 1985 • ns simulates • TCP, UDP, routing, and multicast protocols • over wired and wireless (local and satellite) networks

  8. Simulation System tcl script (input) #Create a simulator object set ns [new Simulator] #Define different colors for data flows $ns color 1 Bluens Simulator Basics $ns color 2 Red #Open the nam trace filens Simulator Basics set nf [open project_b_task_1I.nam w] $ns namtrace-all $nf #open the measurement output files set f0 [open project_b_task_1I_out0.tr w] set f1 [open project_b_task_1I_out1.tr w] set f2 [open project_b_task_1I_out2.tr w] NAM (output) ns classes ns Gnuplot (output)

  9. ns Architecture • Object oriented (C++ and OTcl) • Control operations in Otcl • Class hierarchy (extract):

  10. ns Simulator Basics • Simulator API is a set of methods belonging to a simulator object • Simulator object is created with “set netsim [new Simulator] ” (Tcl script) • initializes the packet format • creates a scheduler(handles time, timers, and events) • Scheduler access through simulator methods • Example: “$ns at 0.0 "$ftp start"” (Tcl script)

  11. Tcl Script - Example #create simulator set ns [new Simulator] #create node set n0 [$ns node]set n1 [$ns node] #create link between nodes$ns duplex-link $n0 $n2 10Mb 10ms DropTail #create a TCP agent and attach it to node n0set tcp0 [new Agent/TCP]$ns attach-agent $n0 $tcp0$tcp0 set window_ 40$tcp0 set packetSize_ 460 set sink [new Agent/TCPSink]$ns attach-agent $n1 $sink #create an FTP source "application” and attach it to tcp set ftp [new Application/FTP]$ftp attach-agent $tcp0

  12. Tcl Script – Example (cont.) #open the nam trace file and measurement output fileset nf [open project_b.nam w]$ns namtrace-all $nf set f0 [open project_b.tr w] #schedule events$ns at 0.0 “$ftp start” $ns at 3.0 “puts $nf “[$ns now] \t [$ns now]””$ns at 6.0 “$ftp stop” $ns at 6.01 “#dump simulation result into files $ns flush-trace#Execute ‘NAM’ and ‘Gnuplot’exec nam project_b.nam &exec pgnuplot project_b.dem &#stop the simulationexit 0” #start the execution $ns run

  13. NAM (Network Animator) • Reads trace file generated by ns • Example of trace file: V -t * -v 1.0a5 -a 0 A -t * -n 1 -p 0 -o 0xffffffff -c 31 -a 1 A -t * -h 1 -m 2147483647 -s 0 c -t * -i 1 -n Blue c -t * -i 2 -n Red n -t * -a 0 -s 0 -S UP -v circle -c black -i black ... NAM

  14. Gnuplot (Graphic Tool) • Is distributed under the gnu license • Needs a script file (e.g. project_b.dem) and • file containing the data which has to be plotted • Example plot:

  15. Literature and Help for ns • http://www.isi.edu/nsnam/ns/ • FAQ • ns-related mailing list • Tutorial • Manual

More Related