Network Simulator: ns-2



Similar documents
ns-2 Tutorial Exercise

Exercises on ns-2. Chadi BARAKAT. INRIA, PLANETE research group 2004, route des Lucioles Sophia Antipolis, France

Daniele Messina, Ilenia Tinnirello

TCP Performance Simulations Using Ns2. Johanna Antila 51189d TLT

SystemC - NS-2 Co-simulation using HSN

Network simulation and simulators. Lecturer: Dmitri A. Moltchanov

Study of Active Queue Management Algorithms ----Towards stabilize and high link utilization

Tutorial: The ns-2 Network Simulator. Outline. Michael Welzl Institute of Computer Science University of Innsbruck, Austria

Outline. Tutorial: The ns-2 Network Simulator. Some thoughts about network simulation. What to use it for. Michael Welzl

Evaluation and Comparison of Wired VoIP Systems to VoWLAN

Simulation and Evaluation for a Network on Chip Architecture Using Ns-2

Performance Analysis on VoIP over LTE network Website:

The network we see so far. Internet Best Effort Service. Is best-effort good enough? An Audio Example. Network Support for Playback

Assignment #3 Routing and Network Analysis. CIS3210 Computer Networks. University of Guelph

Multiple Fault Tolerance in MPLS Network using Open Source Network Simulator

IASTED ASM 2004 Tutorial:

ENSC 427 Communications Network Spring 2015 Group 8 Samuel Chow <spc12 at sfu.ca> Tenzin Sherpa <tserpa at sfu.

How To Monitor Performance On Eve

Introduction VOIP in an Network VOIP 3

Comparative Analysis of Congestion Control Algorithms Using ns-2

Performance Analysis of AQM Schemes in Wired and Wireless Networks based on TCP flow

Performance Evaluation of AODV, OLSR Routing Protocol in VOIP Over Ad Hoc

A Comparison Study of Qos Using Different Routing Algorithms In Mobile Ad Hoc Networks

Investigation and Comparison of MPLS QoS Solution and Differentiated Services QoS Solutions

Authors Mário Serafim Nunes IST / INESC-ID Lisbon, Portugal mario.nunes@inesc-id.pt

Performance Monitoring on Networked Virtual Environments

Transport Layer Protocols

STUDY OF COMPUTER NETWORK ISSUES AND IMPROVISING DROP RATE OF TCP PACKETS USING NS2

Capacity Estimation of VOIP Channels on Wireless Networks

EXPERIMENTAL STUDY FOR QUALITY OF SERVICE IN VOICE OVER IP

Basic Multiplexing models. Computer Networks - Vassilis Tsaoussidis

Queuing Algorithms Performance against Buffer Size and Attack Intensities

QoS Strategy in DiffServ aware MPLS environment

CROSS LAYER BASED MULTIPATH ROUTING FOR LOAD BALANCING

Analysis of IP Network for different Quality of Service

Effect of Packet-Size over Network Performance

Application Level Congestion Control Enhancements in High BDP Networks. Anupama Sundaresan

Figure 1: Network Topology

Improving QOS in IP Networks. Principles for QOS Guarantees. Principles for QOS Guarantees (more) Principles for QOS Guarantees (more)

Using IPM to Measure Network Performance

Quality of Service (QoS)) in IP networks

1 M.Tech, 2 HOD. Computer Engineering Department, Govt. Engineering College, Ajmer, Rajasthan, India

Computer Networks CS321

Lecture 16: Quality of Service. CSE 123: Computer Networks Stefan Savage

SECURE DATA TRANSMISSION USING INDISCRIMINATE DATA PATHS FOR STAGNANT DESTINATION IN MANET

COMPARATIVE ANALYSIS OF ON -DEMAND MOBILE AD-HOC NETWORK

Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer

OPNET Network Simulator

A Preferred Service Architecture for Payload Data Flows. Ray Gilstrap, Thom Stone, Ken Freeman

Improving Quality of Service

Congestion Control Review Computer Networking. Resource Management Approaches. Traffic and Resource Management. What is congestion control?

Keywords: DSDV and AODV Protocol

An Efficient AODV-Based Algorithm for Small Area MANETS

LABORATORY: TELECOMMUNICATION SYSTEMS & NETWORKS PART 1 NCTUNS PROGRAM INTRODUCTION

Optimization of VoIP over e EDCA based on synchronized time

Performance Evaluation of DVMRP Multicasting Network over ICMP Ping Flood for DDoS

Chapter 2 Quality of Service (QoS)

Programming Assignments for Graduate Students using GENI

Distributed Systems 3. Network Quality of Service (QoS)

Performance Evaluation of Quality of Service Assurance in MPLS Networks

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

- QoS and Queuing - Queuing Overview

A Policy-Based Admission Control Scheme for Voice over IP Networks

Telecommunication Services Engineering (TSE) Lab. Chapter III 4G Long Term Evolution (LTE) and Evolved Packet Core (EPC)

"Charting the Course to Your Success!" QOS - Implementing Cisco Quality of Service 2.5 Course Summary

Network Simulator: A Learning Tool for Wireless Technologies

Implementing Cisco Quality of Service QOS v2.5; 5 days, Instructor-led

EXPLORER. TFT Filter CONFIGURATION

Introduction to Quality of Service. Andrea Bianco Telecommunication Network Group

Technote. SmartNode Quality of Service for VoIP on the Internet Access Link

QoS in IP networks. Computer Science Department University of Crete HY536 - Network Technology Lab II IETF Integrated Services (IntServ)

Comparison of Wireless Protocols. Paweł Ciepliński

Control of Multiple Packet Schedulers for Improving QoS on OpenFlow/SDN Networking

Robust Router Congestion Control Using Acceptance and Departure Rate Measures

Tools for Peer-to-Peer Network Simulation

IMPLEMENTING CISCO QUALITY OF SERVICE V2.5 (QOS)

Internet structure: network of networks

Cisco Quality of Service and DDOS

Chapter 7 outline. 7.5 providing multiple classes of service 7.6 providing QoS guarantees RTP, RTCP, SIP. 7: Multimedia Networking 7-71

PFS scheme for forcing better service in best effort IP network

Performance Analysis of VoIP Traffic in WiMAX using various Service Classes

Requirements for Simulation and Modeling Tools. Sally Floyd NSF Workshop August 2005

Wireless Mesh Networks Impact on Voice over Internet Protocol. Mohammad Tariq Meeran PhD Student Institute of Informatics, Tallinn University

Chapter 5 Configuring QoS

Quality of Service using Traffic Engineering over MPLS: An Analysis. Praveen Bhaniramka, Wei Sun, Raj Jain

A NOVEL RESOURCE EFFICIENT DMMS APPROACH

VoIP Network Dimensioning using Delay and Loss Bounds for Voice and Data Applications

TCP, Active Queue Management and QoS

Quality of Service Analysis of site to site for IPSec VPNs for realtime multimedia traffic.

Chapter 4 Rate Limiting

Evaluation AMQP protocol over unstable and mobile networks

Per-Flow Queuing Allot's Approach to Bandwidth Management

Introduction to Exploration and Optimization of Multiprocessor Embedded Architectures based on Networks On-Chip

Quality of Service (QoS) on Netgear switches

Transcription:

Network Simulator: ns-2 Antonio Cianfrani Dipartimento DIET Università Sapienza di Roma E-mail: cianfrani@diet.uniroma1.it

Introduction Network simulator provides a powerful support to research in networking area Design of new protocols, traffic characterization, etc Comparison among different protocol versions It is an open source software The code is shared among users and can be modified so that to support new features, models, etc.. In this way software reliability is improved It is the unique simulator implementing the whole TCP/IP stack

Features of ns-2 Wired networks Routing DV, LS, PIM-SM Trasport: TCP, UDP, SCTP Traffic generator: web, ftp, telnet, cbr, stocastiche Queuing scheduling policies :drop-tail, RED, FQ, SFQ, DRR QoS: IntServ and Diffserv Wireless networks Ad hoc routing and mobile IP Directed diffusion, sensor-mac Satellitar networks Tracing, animations, other utilities.

ns-2 components ns, the simulator Nam, the network animator tool Pre-processing: Traffic and topology generators Post-processing: Traces analysis (Awk, Perl, o Tcl scripts)

Discrete event simulator NS-2 discrete event simulator used to study packet based networks Two programming languages are used C++ : simulation engine OTcl (Object-oriented tool commande language): to manage the user/simulator interface OTcl Interpreter C++ NS simulator: - Event scheduler - Network components

The C++ simulator The C++ simulator is the engine of ns-2; it implements the supported protocols: Network protocols (MAC, routing, transport) Traffic generators(cbr, FTP, On/Off, ) Queue scheduling policies (FIFO, RED, ) Wireless protocols It is based on classes definition: node, link, etc.

The OTcl Interpreter Used by the user to describe the simulation scenario, to configure the network topology and to schedule the events

User role The user must describe the simulation scenario by means of an OTcl script; then results evaluation can be done.

The OTcl language

The OTcl language The OTcl language is an extension of Tcl scripting language: it is an Object Oriented language Il Tcl language makes use of the Tk (Tool Kit) library, that allows the creation of symple graphical interfaces Information about OTcl available at www.isi.edu/nsnam/otcl/doc/tutorial.html

OTcl commands (1/4) The command to assign a value to a variable is set: set a 5 The variable is not declared before. All variables are of string type: if needed the interpreter performs numerical convertion The value of a variabile is identified with the symbol $: set b $a The command to perform a arithmetic operation is expr : set c [ expr $a * $b /2] (c=a*b/2) To insert a comment the symbol # is used

OTcl commands (2/4) To send an output to the screesn the puts command is used: puts $a puts Ciao To write into a file: opening: set file [ open filename w ] writing: puts $file $a closing: close $file

OTcl commands (3/4) FOR for {set i 0} {$i < 100} {incr i} { istruzioni } WHILE while {$i < 100} { istruzioni incr i } IF if {$i < 10} { istruzioni }

OTcl commands (4/4) A procedure is a function that can be called within the script. The proc command is used: proc positivo { numero } { } if {$numero < 0} { return $numero } return 0 The command to call the procedure is: set valore [ positivo num ]

How to create a simulation scenario

The OTcl script The first step is the OTcl script: - to describe the network topology; - to schedule the events list. NS-2 provides classes. The most used classes are: Simulator Node Link Agent Application

The OTcl classes Network scenario: Simulator Node Link Agent Application Results collecting: Trace Monitor

Simulator It is the basic NS-2 class Must be defined at the beginning of every script set ns [ new Simulator ] Within the simulator (ns) it will be possible to: create a network scenario monitor the simulation evolution (trace) manage the events scheduler At the end of a script the following command must be inserted: $ns run

Simulator class: the scheduler The scheduler allows to introduce events in specific time instants. Commands: at t : at instant t after p : after p seconds Example set ns [ new Simulator ] $ns at 2,5 generate an IP packet $ns after 3 exit 0

The Node class It represents an IP node, implementing all network layer functionalities: Addressing Routing To create a node: set n1 [ $ns node] To create N different nodes: for {set i 0} {$i < N} {incr i} { set n($i) [$ns node] }

The Link class (1/2) It represent the IP link among two nodes. Set of parameters: Link type Interconnected nodes Features: delay, bandwidth Queing policy $ns duplex-link $n0 $n1 1Mb 10ms DropTail Bi-directional link Nodes Link Capacity Propagation delay Queuing policy

The Link class (2/2) A link is implemented by means of an ingress queue If the link is bidirectional there will be two different buffers It is possible to set the maximum queue size $ns queue-limit $n1 $n2 queue-limit The default value is 50.

The Agent class (1/3) It represents the transport layer of an IP node: Agent1 Nodo1 Agent2 Nodo2

The Agent class (2/3) The transport protocol must be specified: TCP or UDP. The Agent role: transmitter set agent_tcp [new Agent/TCP] set agent_udp [new Agent/UDP] receiver set null [new Agent/Null] (drop) set tcpsink [new Agent/TCPSink] (reply with ack) set sink0 [new Agent/LossMonitor] (collect statistics)

The Agent class (3/3) The agent must be associated to a node $ns attach-agent $node $agent The transmitter and the receiver agents must be connected: $ns connect $agent1 $agent2 The first command must be always executed before the second one.

The Application class It represents an application : FTP, Telnet, HTTP, traffic generator,.. set application1 [new Application / TYPE ] The application must be associated to an Agent $application1 attach-agent $agent1 FTP Agent1 Nodo1 Agent2 Nodo2

Traffic generator (1/4) Traffic generator definition: set traffic [new Application / Traffic / Type ] EXPOO_Traffic: Exponential On/Off distribution. Packets are sent at a fixed rate during on periods, and no packets are sent during off periods. On and off periods are taken from an exponential distribution. Packets are constant size. packetsize_ the constant size of the packets generated burst_time_ the average on time for the generator idle_time_ the average off time for the generator rate_ the sending rate during on times

Traffic generator (2/4) POO_Traffic: generates traffic according to a Pareto On/Off distribution. This is identical to the exponential On/Off distribution, except the on and off periods are taken from a Pareto distribution. packetsize_ the constant size of the packets generated burst_time_ the average "on" time for the generator idle_time_ the average "off" time for the generator rate_ the sending rate during "on" times shape_ the "shape" parameter used by the pareto distribution

Traffic generator (3/4) CBR_Traffic: generates traffic according to a deterministic rate. Packets are constant size. rate_ the sending rate interval_ (Optional) interval between packets packetsize_ the constant size of the packets generated random_ flag indicating whether or not to introduce random noise in the scheduled departure times (default is off) maxpkts_ the maximum number of packets to send (default is 2 28 )

Traffic generator (4/4) TrafficTrace: generates traffic according to a trace file. Each record in the trace file consists of 2 fields. The first contains the inter-arrival time (in microseconds), the second contains the length (in bytes). set tfile [new Tracefile] $tfile filename example-trace

CBR Traffic CBR definition: parameters set cbr [new Application / Traffic / CBR] $cbr set packetsize_ 500 (byte) $cbr set interval_ 0.005 (seconds) ($cbr set rate_ 800kb ) $cbr attach-agent $agent Traffic scheduling $ns at 0.5 "$cbr start" $ns at 4.5 "$cbr stop"

The ERROR MODEL Class It is possible to introduce network failures in the simulation Inserting/removing a link: Example: $ns rtmodel-at <time> up down $n0 $n1 $ns rtmodel-at 1.0 down $n(1) $n(2) $ns rtmodel-at 2.0 up $n(1) $n(2)

The Trace class The Trace class generates a report (trace) with the whole events list. The report can also be related to a single link (queue). A trace must be always associated to a file (to be opened when starting the simulation). The file must also be closed when the simulation ends.

The Trace class: commands set traccia [ open traccia.tr w] $ns trace-all $traccia ($ns trace-queue $S1 $S2 $traccia) close $traccia set traccia [ open traccia.tr r]

The Trace class: how to monitor a queue To focus on a single link (from n1 to n2): $ns trace-queue $n1 $n2 $traccia Also specific events can be selected $ns create-trace type fileid $n1 $n2 where type field can be: Enqueue Dequeue Drops

The trace file format

The Monitor class (1/2) The Monitor class is able to monitor specific simulation variables. The QueueMonitor element set coda1_2 [ $ns monitor-queue $n1 $n2 [ $ns get-ns-traceall]]

The Monitor class (2/2) QueueMonitor fields: size_ pkts_ parrivals_ barrivals_ pdepartures_ bdepartures_ pdrops_ bdrops_ queue length (bytes) at t number of packets in queue at t total number of received packets total number of received bytes total number of sended packets total number of sended bytes total number of dropped packets total number of dropped bytes A specific procedure (record) can be used to exploits QueueMonitor features.

The record procedure proc record { } { global ns f1 f2 coda1_2 set ns [Simulator instance] set time 0.1 set lung_coda [$coda1_2 set pkts_ ] set drops [$coda1_2 set pdrops_ ] set now [$ns now] puts $f1 "$now $lung_coda" puts $f2 "$now $drops" $ns at [expr $now + $time] "record } exec xgraph traccia1.tr -geometry 640x400 &