NS2 Tutorial – Part II Internet Computing KUT Youn-Hee Han.

Slides:



Advertisements
Similar presentations
Vacha Dave, University of Texas at Austin 1 Network Simulator Tutorial Advanced Computer Networks (CS378)
Advertisements

Network Simulator and problems in installing. Introduction Problems in installing Wired networks modified example2.tcl commands in OTcl usual problems.
Network Simulator (NS-2)
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
Introduction to nam Tim Buchheim 21 November 2002 ns tutorial - fall 2002.
Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2004) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
1 Multicast in ns-2 報告者 : 陳沐恩. 2 Multicast 簡介 3 Multicast Routing set ns [new Simulator] $ns multicast Or set ns [new Simulator – multicast on] set mproto.
Wireless Communication : LAB 3
NS-2 (network simulator) NS by example παρουσίαση Κων/νος Τρούλος.
Ns Tutorial 成功大學電機所電腦與網路組 博士候選人 柯志亨
NS2-TCP Internet Computing KUT ( Youn-Hee Han It is licensed under a Creative Commons Attribution.
Wireless and Mobile Computing Simulations Lecture 27.
Introduction to Network Simulator NS-2 Part I
1 ns-2 Tutorial, part 2 Dave Anderson, Xiaowei Yang (Modified from Polly Huang’s slides)
1 NS Fundamentals (contd..) Padma Haldar USC/ISI.
Network Simulation One tool to simulation network protocols for the Internet is the network simulator (NS) The simulation environment needs to be set-
An Introduction to NS-2 * Gayatri Swamynathan CS 276 TA *some slides are from a presentation by Haobo Yu & Nader Salehi, USC/ISI.
NS-2 Shahin Shayandeh December 2004 Session 2. Ns programming  Create the event scheduler  Turn on tracing  Create network  Setup routing  Insert.
Brief Intro to ns2: The most widely used Network Simulator COMP5416 Advanced Network Technologies Based on: Marc Greis's
Ns-2 Tutorial Exercise (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Adopted from Nicolas’s slides Jianping Wang,
NS Tutorial (For CMPE 252 A) By Duy Nguyen 10/25/2012.
Ns-2 tutorial Karthik Sadasivam Banuprasad Samudrala CSCI 5931 Network Security Instructor : Dr. T. Andrew Yang.
Network Simulator (NS) Prof. Nelson L. S. da Fonseca State University of Campinas, Brazil.
How to Add a New Protocol in NS2 Xu Leiming CSCW Lab. at CS Dept., Tsinghua Univ. June 1, 2001.
5-Jul-141 S.Pushpalatha, Associate Professor, PSNACET.
Introduction to NS. Information Main website Documentation, mailing list archive, tutorial Location of Source codes –C++ files.
Dongsoo S. Kim 1.
Network Simulator 2 Tejas Vasavada.
Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2003) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
CprE 543x – ns-2 Tutorial Zak Abichar, Dept of Electrical and Computer Engineering Iowa State University Ames,
Computer Networks NS. Features F Event driven simulator –developed at UC Berkeley F Network Topologies –nodes (connectivity), links (bandwidth, delay)
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
1 Modified Schedule Day 2 Network AniMator (nam) Examples simple.tcl mcast.tcl Day 3 Wireless (ad-hoc)
Submitters: Stella Pantofel Michael Halperin Igor Berman
Wireless Network Simulation on NS By Edward Mulimba.
EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings.
Network Simulator (NS2) 1 Tutorial on Network Simulator (NS2) Hemant Kumar Rath Infonet Lab, Dept of Electrical Engineering IIT Bombay, Mumbai
Wireless Networking and Systems CSE 590 ns2 tutorial.
NS2 - Wireless Network Ming-Feng Yang. 2 2 Outline Basic wireless model Extensions wireless model Example - Ad hoc network Example – WLAN Example – Mobile.
Role and Mechanism of Queue Internet Engineering.
NS2 - Appendix Ming-Feng Yang. 2 2 Outline NS2 Models NS2 Directory Structure Extending NS2 in OTcl Extending NS2 in C++ NS2 related links.
JIA-HUI HUANG INSTITUTE OF COMPUTER SCIENCE AND INFORMATION ENGINEERING NATIONAL TAIPEI UNIVERSITY OF TECHNOLOGY Network Simulator – NS-2 1.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
TNK092: Network Simulation - Nätverkssimulering Lecture 3: TCP Vangelis Angelakis.
NetFlow Very useful for traffic analysis Very useful for traffic analysis Standard sampler: Standard sampler: –Cisco Netflow –Juniper Traffic Sampling.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
Internet Computing KUT Youn-Hee Han
Quality evaluation of MPEG4 video transmission over GPRS networks.. Presented by: Abdullah M. Rana Multimedia Communication.
1 NS Fundamentals. USC INFORMATION SCIENCES INSTITUTE 2 OTcl and C++: The Duality C++ OTcl Pure C++ objects Pure OTcl objects C++/OTcl split objects ns.
Ns-2 Tutorial (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Jianping Wang, 2002 cs757 1.
1 Introduction to NS-2 r Tutorial overview of NS m Create basic NS simulation r Walk-through a simple example m Model specification m Execution and trace.
NS2-TCP Internet Computing KUT ( Youn-Hee Han It is licensed under a Creative Commons Attribution.
Lab 2, Network Simulator ns2 Shiv Kalyanaraman Yong Xia (TA) Satish Raghunath Sept 4,
Network Simulator Tutorial Wireless Networks. Acknowledgements Material is taken from the presentations by Jim Kurose, University of Massachusetts, Amherst.
Network Simulator 2. Introduction Open source network simulator NS uses two languages: C++ and OTcl  C++ is fast to run but slower to change Kernel 
The Creation of NS2 Simulated Environment ( 1 ) LI Chengbo
TNK092: Network Simulation - Nätverkssimulering Lecture #1: Course basics and a first taste of NS2 Vangelis Angelakis Ph.D.
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
Lab 2, Network Simulator ns2
Network Topology. Network Topology Cont. Sender = 0 and Receiver = 5 Sender = 0 and Receiver = 5 Sender transmits ftp traffic over TCP/IP to receiver.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
NS-2 Simulator 최 종 훈 Contents  About NS  Installation  Based on Linux  Based on Windows  Architecture  Using NS-2  Example  References.
DMET 602: Networks and Media Lab
(Modified from Polly Huang’s and last year’s original)
Network Simulator Tutorial
Basics of NS-2 Training in TCL script
Choe, Hyun Jung (Stella)
Introduction to ns-2: “The” Network Simulator
Ns Tutorial: Case Studies
Karthik Sadasivam Banuprasad Samudrala
Presentation transcript:

NS2 Tutorial – Part II Internet Computing KUT Youn-Hee Han

Introduction to NS22 A good example set ns [new Simulator] #Open the Trace files set tracefile1 [open out.tr w] $ns trace-all $tracefile1 #Open the NAM trace file set namfile [open out.nam w] $ns namtrace-all $namfile #Define a 'finish' procedure proc finish {} { global ns tracefile1 namfile $ns flush-trace close $tracefile1 close $namfile exec nam out.nam & exit 0 } #Define different colors for data flow (for NAM) $ns color 1 Blue $ns color 2 Red Ns2 for beginner, p15~

Introduction to NS23 A good example #Create six nodex set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] set n5 [$ns node] #Create links between the nodes $ns duplex-link $n0 $n2 2Mb 10ms DropTail $ns duplex-link $n1 $n2 2Mb 10ms DropTail $ns simplex-link $n2 $n3 0.1Mb 100ms DropTail $ns simplex-link $n3 $n2 0.1Mb 100ms DropTail $ns duplex-link $n3 $n4 0.5Mb 40ms DropTail $ns duplex-link $n3 $n5 0.5Mb 30ms DropTail #Give node position (for NAM) $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns simplex-link-op $n2 $n3 orient right $ns simplex-link-op $n3 $n2 orient left $ns duplex-link-op $n3 $n4 orient right-up $ns duplex-link-op $n3 $n5 orient right-down

Introduction to NS24 A good example #Set Queue Size of link (n2-n3) to 20 $ns queue-limit $n2 $n3 5 $ns simplex-link-op $n2 $n3 queuePos 0.5 #Setup a TCP connection set tcp [new Agent/TCP] $ns attach-agent $n0 $tcp set sink [new Agent/TCPSink] $ns attach-agent $n4 $sink $ns connect $tcp $sink $tcp set fid_ 1 $tcp set packetSize_ 552 #Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp

Introduction to NS25 A good example #Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $n1 $udp set null [new Agent/Null] $ns attach-agent $n5 $null $ns connect $udp $null $udp set fid_ 2 #Setup a CBR over UDP connection set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $cbr set packetSize_ 1000 $cbr set rate_ 0.01Mb $cbr set random_ false $ns at 0.1 "$ftp start" $ns at 1.0 "$cbr start" $ns at "$ftp stop" $ns at "$cbr stop“ $ns at "finish" $ns run

Introduction to NS26 A Node Architecture Classifier Agent Link Agent Node Addr Port Node entry point Local Link - Agents are either protocol endpoints or related objects that generate/fill-in packet fields. - Classifiers: packet demultiplexers.

Introduction to NS27 A Link Architecture Enq Trace Deq TraceRcv Trace Drp Trace DelayTTLQueue Link entry point Agent/Null Links: keeps track of “from” and “to” node objects.

Introduction to NS28 An Application/Node/Link Architecture Link Application N1 N2 Classifier Agent Node Addr Port Local Classifier Agent Node Addr Port Local Enq TraceDeq TraceRcv Trace Drp Trace DelayTTL Drop head Queue Application

Introduction to NS29 Tracing Trace packets on all links set tracefile1 [open out.tr w] $ns trace-all $tracefile tcp tcp r tcp tcp tcp r tcp tcp tcp r tcp ack ack r ack ack ack r ack ack ack r ack [DIY 1] - grep "+ " out.tr > qqq - grep "+ " out.tr | grep "0 2 tcp" > qqq [DIY 2] - Insert the following into ex1.tcl set linkTraceFile [open out_link.tr w] $ns trace-queue $n0 $n2 $linkTraceFile - grep "+ " out_link.tr > qqq2

Introduction to NS210 “grep” command Some more example of “grep” command grep "+ " out.tr | grep "0 2 tcp" > qqq  To obtain a file containing all lines of out.tr that begin with “+ “ and includes “0 2 tcp” phrase. grep “^r” out.tr > out2.tr  To obtain a file containing all lines of out.tr that begin with the letter ‘r’. grep -r text *  To obtain a lines which has ‘text’.  The lines come from all files of the current directory. grep –r text *.c  To obtain a lines which has ‘text’.  The lines come from all files of the current directory and the extension is ‘*.c’ grep text */*.c  To obtain a lines which has ‘text’.  The lines come from all files of the current directory’s subdirectory and the extension is ‘*.c’

Introduction to NS211 gnuplot Ex1] Make the file, named ‘testplot’ Execute ‘gnuplot’ Type the followings  plot ‘testplot’ w lines 1  plot ‘testplot w points 9  q Ex2] Type the followings  grep "+ " out.tr | grep "0 2 tcp" > qqq Execute ‘gnuplot’  plot ‘qqq’ 2:6 t “size” w lines 1 Ex3] Make the files, ‘fn1’, ‘fn2’, ‘fn3’. Make the file, ‘plotting’, including the codes introduced in Page 37. Execute ‘gnuplot’  Load ‘plotting’