Introduction to ns-2: “The” Network Simulator

Slides:



Advertisements
Similar presentations
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
Advertisements

Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2004) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
Wireless Communication : LAB 3
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-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.
Winter 2008 Evaluation Tools1 Brief Overview of Networking Evaluation Methods and Tools.
NS TUTORIAL Padma Haldar USC/ISI 09/04/02.
Assignment #2 Due Sunday Sept 17, 11:55pm. Objectives  Getting to know ns-2  Manipulate ns-2 as a black box.  Configure/Script.
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)
1 Ns Tutorial Alhussein A. Abouzeid Elect. Eng. Dept./U. of Washington Parts of this educational presentation use examples available.
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
1 Network Simulator (NS-2) Tutorial These slides can be downloaded from:
Wireless Sensor Network for Tracking the Traffic in INTERNET Network Routers Supervisor: Mark Shifrin Students: Yuriy Kipnis Nir Bar-Or Networked Software.
EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings.
Ns Simulation of IEEE SC546 Project (Fall 2002) SOO IL KIM JISUN YOON
Network Simulator 2(NS2) Yingyue Xu 8/25/2015. Overview: The Network simulator (NS): discrete event simulator for networks. supports wired, wireless,
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.
10b_ns: CSci551 SP2002 Friday © 2002 John Heidemann1 NS Tutorial, Class 10 CSci551: Computer Networks SP2002 Friday Section John Heidemann.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
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.
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
NS-2 Tutorial. Motivation What’s NS-2 Network simulator –Discrete event simulator It covers multiple layers –Application layer, transport layer, network.
Simulation Tutorial By Bing Wang Assistant professor, CSE Department, University of Connecticut Web site.
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.
Lab 2, Network Simulator ns2 Shiv Kalyanaraman Yong Xia (TA) Satish Raghunath Sept 4,
Network Simulation Motivation: r learn fundamentals of evaluating network performance via simulation Overview: r fundamentals of discrete event simulation.
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.
© Algirdas Pakstas CS3026N Network Analysis, Design and Simulation 1 CT3020: Network Planning and Simulation Week 6b Prof.DrTech. Algirdas Pakštas.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
ECE 6610 Sandeep Kakumanu GNAN research Lab
DMET 602: Networks and Media Lab
(Modified from Polly Huang’s and last year’s original)
Network Simulator Tutorial
Analysis the performance of vehicles ad hoc network simulation based
Choe, Hyun Jung (Stella)
Khiem Lam Jimmy Vuong Andrew Yang
Ns Tutorial: Case Studies
Ns By Kulveer Singh.
Karthik Sadasivam Banuprasad Samudrala
Ns-3 Tutorial Xin Li.
Project-2 (20%) – DiffServ and TCP Congestion Control
Presentation transcript:

Introduction to ns-2: “The” Network Simulator Goals: tutorial overview of ns flavor of ns: simple example, model specification, execution and trace analysis Daniel Figueiredo November, 2004

Ns-2, the network simulator Academic project over 10 years old freely distributed, open source Currently maintained by ISI DARPA + NSF projects ~ 200K LoC, ~400 page manual Large user base mostly academics “de facto” standard in networking research Main website: www.isi.edu/nsnam/ns

Ns Functionality Discrete event simulator Traffic models and applications Web, FTP, telnet, audio, sensor nets Transport protocols TCP (Reno, SACK, etc), UDP, multicast Routing and queuing static routing, DV routing, multicast, ad-hoc routing queuing disciplines: drop-tail, RED, FQ Link layer wired, wireless, satellite Infrastructure tracing, visualization, error models, etc modify or create your own modules

Ns 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/

Ns 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 change

Steps 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 intervals

Creating a Basic Ns Model Create the event scheduler Create nodes and links Create connection Create traffic sources/sinks Enable tracing

Creating Event Scheduler Create scheduler set ns [new Simulator] Schedule event $ns at <time> <event> <event>: any legitimate Ns/TCL commands Start scheduler $ns run

Creating Network (Nodes + Links) 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, DRR

Transport 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 protocol

Creating 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_dst

Creating 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”

Creating 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_dst

Creating 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”

Tracing Trace packets on individual links Tracefile format: packet <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 15 r 1.00234 0 2 tcp 900 ------- 1 0.0 3.1 7 15 packet type packet flags time seq number packet ID + enqueue dequeue r receive d drop packet length flow ID nodes involved in this event source dest addresses

Tracing via Monitors Queue monitor Flow 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]

Walk-through example FTP/TCP 10 FTP/TCP dest 2 FTP/TCP sources sources TCP SACK W_max = 32 MSS = 1400 TCP NewReno W_max = 32 MSS = 1400 1 CBR/UDP source FTP/TCP dest 10 FTP/TCP sources 2 FTP/TCP sources 1 2 acks acks 1 On-Off (voice) UDP source OnOff/UDP CBR/UDP dest 2 Mbps full duplex 5 msec prop delay 100 packet buffer Drop-tail policy 1 Mbps full duplex 10 msec prop delay 700 packet buffer Drop-tail policy

Ns Trace file : NS-trace.txt ... + 11.533441 1 2 tcp 1440 ------- 12 1.2 2.4 96 2092 r 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 1530 r 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 2095 r 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 1534 r 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 1537 r 11.571694 1 2 tcp 1440 ------- 12 1.2 2.4 67 1534 r 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

Flow Monitor Trace : packet-trace.txt ... 10 356 1394.6939635123624 1262 906 0 4 7 3 0 10.5 367 1575.3875777393503 1325 958 0 8 15 7 0 1 1 0 0 11 366 1759.8340061666161 1384 1018 0 8 15 7 0 1 1 0 0 11.5 370 1944.0583990191849 1448 1078 0 8 15 7 0 1 1 0 0 12 380 2131.710863713804 1512 1132 0 8 15 7 0 1 1 0 0 12.5 382 2325.178644727122 1558 1176 0 8 15 7 0 1 1 0 0 13 382 2516.7615454470124 1613 1231 0 8 15 7 0 1 1 0 0 13.5 395 2710.8647514290892 1676 1281 0 8 15 7 0 2 3 1 0 14 421 2912.3462186990751 1747 1326 0 16 31 15 0 2 3 1 0 14.5 432 3130.3858423193769 1805 1373 0 16 31 15 0 2 3 1 0 15 436 3344.5896974377333 1862 1426 0 16 31 15 0 2 3 1 0 15.5 462 3571.3811182311597 1937 1475 0 16 31 15 0 2 3 1 0 16 477 3804.653159658757 1995 1518 0 16 31 15 0 2 3 1 0 16.5 495 4049.5929326563519 2057 1562 0 16 31 15 0 2 3 1 0 17 531 4303.9211771379323 2136 1605 0 16 31 15 0 2 3 1 0

Results - Queue Statistics Red - instantaneous Green - running average Blue - average w/o transient Light blue - packet drops

Results - Flow Statistics Red - TCP flow 1 Green - TCP flow 2 Number of packets in queue mimics TCP Window behavior

Performance Queue Statistics Multiple runs to obtain confidence intervals