Presentation is loading. Please wait.

Presentation is loading. Please wait.

EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings.

Similar presentations


Presentation on theme: "EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings."— Presentation transcript:

1 EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings 3. Example of a Network Simulator: NS Example of a Network Simulator: NS

2 EECS122 - UCB2 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 Result measure

3 EECS122 - UCB3 Modeling Process Real System Result measure Model generate measure Modeling Result infer There are Analytical models and Simulation models

4 EECS122 - UCB4 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 EECS122 - UCB5 Example: TCP Sequence Number Measured in Simulator and Reality Simulator Reality

6 EECS122 - UCB6 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 EECS122 - UCB7 Modeling Using the Network 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 EECS122 - UCB8 Simulation System tcl script (input) Gnuplot (output) NAM (output) #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] ns classes ns

9 EECS122 - UCB9 ns Architecture Object oriented (C++ and OTcl) Control operations in Otcl Class hierarchy (extract):

10 EECS122 - UCB10 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 EECS122 - UCB11 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 n0 set 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 EECS122 - UCB12 Tcl Script – Example (cont.) #open the nam trace file and measurement output file set 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 simulation exit 0” #start the execution $ns run

13 EECS122 - UCB13 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 EECS122 - UCB14 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 EECS122 - UCB15 Literature and Help for ns http://www.isi.edu/nsnam/ns/ FAQ ns-related mailing list Tutorial Manual


Download ppt "EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings."

Similar presentations


Ads by Google