Ns-3 Introduction Tom Henderson (University of Washington) July 2014 Modified by Sara Mehar (university of burgundy) April 2015.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO SIMULATION WITH OMNET++ José Daniel García Sánchez ARCOS Group – University Carlos III of Madrid.
Advertisements

1 The ns-2 Network Simulator H Plan: –Discuss discrete-event network simulation –Discuss ns-2 simulator in particular –Demonstration and examples: u Download,
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
ns-3 Introduction Tom Henderson (University of Washington) July 2014
2006 NSF CRI-PI Meeting1 ns-3 Project Plan Tom Henderson and Sumit Roy, University of Washington Sally Floyd, ICSI Center for Internet Research George.
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 tutorial Karthik Sadasivam Banuprasad Samudrala CSCI 5931 Network Security Instructor : Dr. T. Andrew Yang.
- walkthrough of classic hidden terminal problem in WiFi-
Copyright node This presentation is a subset of the one presented by:
WSN Simulation Template for OMNeT++
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
© 2010 VMware Inc. All rights reserved VMware ESX and ESXi Module 3.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
NDT Tools Tutorial: How-To setup your own NDT server Rich Carlson Summer 04 Joint Tech July 19, 2004.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
Android Introduction Platform Overview.
NdnSIM Tutorial.
2006 NSF CRI-PI Meeting1 ns-3 Project Plan Tom Henderson and Sumit Roy, University of Washington Sally Floyd, ICSI Center for Internet Research George.
Wns2 Workshop1 NS-3 Project Goals Tom Henderson and Sumit Roy, University of Washington Sally Floyd, ICSI Center for Internet Research George Riley, Georgia.
Introduction to HP LoadRunner Getting Familiar with LoadRunner >>>>>>>>>>>>>>>>>>>>>>
BRITE integration with ns-3 Joshua Pelkey and Dr. George Riley Wns3 March 25, 2011.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
Ns-3 Training Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/13/2013.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
1 ns-3 Premier Egemen Çetinkaya Department of Electrical Engineering & Computer Science The University of Kansas
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
4061 Session 25 (4/17). Today Briefly: Select and Poll Layered Protocols and the Internets Intro to Network Programming.
802.11n Sniffer Design Overview Vladislav Mordohovich Igor Shtarev Luba Brouk.
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.
PerfSONAR-PS Functionality February 11 th 2010, APAN 29 – perfSONAR Workshop Jeff Boote, Assistant Director R&D.
Computer Simulation of Networks ECE/CSC 777: Telecommunications Network Design Fall, 2013, Rudra Dutta.
TOPIC 7.0 LINUX SERVICES AND CONFIGURATION. ROOT USER Root user is called “super user” because it has power far beyond those of mortal user. As root,
Session 1: Monday May 11 ns-3 Annual meeting May ns-3 Training.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Geant4 is a toolkit to simulate the passage of particles through matter, and is widely used in HEP, in medical physics and for space applications. Ongoing.
Selenium server By, Kartikeya Rastogi Mayur Sapre Mosheca. R
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
Upgrade from 2013 to SDL Web 8 Road Map for Up-gradation.
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
Introductions of SDN in NS-3
Computer System Structures
ns-3 Training 5/08/2017 Computer and Communication Network Lab
How to Contribute to System Testing and Extract Results
Introduction to ns-2: “The” Network Simulator
Spyridon (Spyros) Mastorakis University of California, Los Angeles
Session 6. Wired LAN in ns-3
Ns-3 Training Session 1: Monday 8:30am ns-3 Annual Meeting May 2014.
ns-3 Training ns-3 Annual Meeting June 2017
Session 3. Pcap 출력, animator 사용법 및 ns-3 기본 제공 어플리케이션
Session 2. Logging과 Command Line Argument 사용법
Computer Simulation of Networks
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
NS3-Basic 문준영.
Ns-3 Training Emulation.
Karthik Sadasivam Banuprasad Samudrala
ns-3 Direct Code Execution (DCE) ns-3 Annual Meeting June 2018
ns-3 Waf build system ns-3 Annual Meeting June 2017
Module 01 ETICS Overview ETICS Online Tutorials
Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.
NS-3 Consortium Annual Meeting
Ns-3 Tutorial Xin Li.
ns-3 Training Visualization ns-3 Annual Meeting June 2016
Ns-3 Training Emulation support ns-3 training, June 2016.
ns-3 Direct Code Execution ns-3 Annual Meeting June 2016
Ns-3 Training Debugging support ns-3 training, June 2016.
Presentation transcript:

ns-3 Introduction Tom Henderson (University of Washington) July 2014 Modified by Sara Mehar (university of burgundy) April 2015

Getting started with ns-3 Agenda (ns-3 PART1) ns-3 project overview Why use ns-3? What is ns-3? Project organization Getting started with ns-3 Installation Examples Future directions

Goal!! Learn about the ns-3 project and its goals Understand the software architecture, conventions, and basic usage of ns-3 Read and modify an example ns-3 script Learn how you might extend ns-3 to conduct your own research

Why use ns-3? to study network performance or protocol operation in a controllable or scalable environment a tool aligned with the experimentation needs of modern networking research a tool that elevates the technical rigor of network simulation practice Full Oriented Object programming Much faster than other simulators Support group and mailing list You want to study network performance or protocol operation in a controllable or scalable environment You are comfortable writing C++ or Python code, and combining ns-3 with other code You like the idea of working on an active open source project

Why use ns-3? Project provides three annual software releases Users interact on mailing lists and using Bugzilla bug tracker Code may be proposed for merge Code reviews occur on a Google site Maintainers (one for each module) fix or delegate bugs, participate in reviews Project has been conducting annual workshop and developer meeting around SIMUTools through 2013 ns-3 Annual Meeting in Atlanta, May 2014 Google Summer of Code (March-August) five of the past six summers

ns-3: An Open Source Network Simulator ns-3 is a discrete-event network simulator targeted for research and educational use ns-3 software model developers Research Education NS-3 Consortium ns-3 maintainers

What is ns-3: Discrete event network simulator Model of the evolution of a networked system through discrete events in time Used for experimentation and education The system is observed at regular intervals at time t = nD for all constant elementary period D. An event occurs instantaneously and causes transitions from one discrete state to another . Time-driven systems Continuous time systems Discrete systems (driven by regular clock ticks) State transitions are synchronized by the clock Event-driven systems State changes at various time instants (may not be known in advance) with some event e announcing that it is occurring State transitions as a result of combining asynchronous and concurrent event processes. In the field of simulation, a discrete-event simulation (DES), models the operation of a system as a discrete sequence of events in time. Each event occurs at a particular instant in time and marks a change of state in the system.[1] Between consecutive events, no change in the system is assumed to occur; thus the simulation can directly jump in time from one event to the next.

ns-3 simulation basics Simulation time advances in discrete jumps from event to event C++ functions schedule events to occur at specific simulation times A simulation scheduler orders the event execution Simulation::Run() gets it all started Simulation stops at specific time or when events end

Software overview ns-3 is written in C++, with bindings available for Python simulation programs are C++ executables or Python programs ~350,000 lines of C++ (estimate based on cloc source code analysis) ns-3 is a GNU GPLv2-licensed project ns-3 is mainly supported for Linux, OS X, and FreeBSD ns-3 is not backwards-compatible with ns-2

Software overview The following platforms are lightly supported: Windows Visual Studio 2012 Windows Cygwin 1.7 Some aspects of ns-3 depend on Unix (or specifically Linux) support, such as the emulation or TapBridge (link) features, and those components are not enabled on the Windows versions cited above. https://www.nsnam.org/docs/release/3.9/doxygen/group___tap_bridge_model.html The Tap Bridge is designed to integrate "real" internet hosts (or more precisely, hosts that support Tun/Tap devices) into ns-3 simulations. The goal is to make it appear to a "real" host node in that it has an ns-3 net device as a local device. The concept of a "real host" is a bit slippery since the "real host" may actually be virtualized using readily available technologies such as VMware, VirtualBox or OpenVZ.

Software orientation Key differences from other network simulators: 1) Command-line, Unix orientation 2) Simulations and models written directly in C++ and Python

ns timeline 1990 2000 2010 1988: REAL (Keshav) regular releases 1990s: ns-1 1996: ns-2 1997-2000: DARPA VINT 2001-04: DARPA SAMAN, NSF CONSER 2006: NSF CISE CRI Awards Inputs: yans, GTNetS, ns-2 ns-3 core development (2006-08) June 2008: ns-3.1 June 2014: ns-3.20

ns is a discrete-event network simulator for Internet systems Relationship to ns-2 ns is a discrete-event network simulator for Internet systems protocol design, multiple levels of abstraction written in multiple languages (C++/OTcl)‏ ns has a companion network animator called nam hence, has been called the nsnam project ns-3 is a research-oriented, discrete event simulator

Relationship to ns-2 ns-3 is a new simulator, without backward compatibility Similarities to ns-2: C++ software core GNU GPLv2 licensing ported ns-2 models: random variables, error models, OLSR, Calendar Queue scheduler Differences: Python scripting (or C++ programs) replaces OTcl most of the core rewritten new animators, configuration tools, etc. are in work ns-2 is no longer actively maintained/supported

Software organization Two levels of ns-3 software and libraries 1) Several supporting libraries, not system-installed, can be in parallel to ns-3 Netanim pybindgen Click routing ns-3 2) ns-3 modules exist within the ns-3 directory module

ns-3 Software organization

ns-3 Software organization

ns-3 Software organization

Current models flow-monitor BRITE topology- read utilities stats config- store netanim visualizer bridge csma emu point-to- point spectrum tap-bridge virtual- net-device wifi lte wimax devices uan mesh lr-wpan nix-vector- routing aodv dsdv olsr click protocols openflow applications internet (IPv4/v6) propagation mobility mpi energy network core 19

Current models flow-monitor BRITE topology- read utilities stats config- store netanim visualizer bridge csma emu point-to- point spectrum tap-bridge virtual- net-device wifi lte wimax devices uan mesh lr-wpan nix-vector- routing aodv dsdv olsr click protocols openflow Node class NetDevice ABC Address types (Ipv4, MAC, etc.) Queues Socket ABC Ipv4 ABCs Packet sockets applications internet (IPv4/v6) propagation mobility mpi energy Packets Packet Tags Packet Headers Pcap/ascii file writing Smart pointers Dynamic types Attributes Callbacks Tracing Logging Random Variables Events Scheduler Time arithmetic network core 20

Example : AODV protocol

Example : AODV protocol

Python bindings ns-3 uses a program called PyBindGen to generate Python bindings for all libraries v v v v Intermediate Python program C++ bindings code Python module C++ header (py)gccxml PyBindGen C++ compiler

NetAnim "NetAnim" by George Riley and John Abraham see the 'ns-3share' channel on YouTube pyviz

Emulation support Support moving between simulation and testbeds or live systems A real-time scheduler, and support for two modes of emulation Linux is only operating system supported Must run simulator in real time GlobalValue::Bind (“SimulatorImplementationType”, StringValue (“ns-3::RealTimeSimulatorImpl”)); Must enable checksum calculations across models GlobalValue::Bind (“ChecksumEnabled”, BooleanValue (true)); Must sometimes run as root

ns-3 emulation modes ns-3 has been designed for integration into testbed and virtual machine environments. We have addressed this need by providing two kinds of net devices: The first kind, which we call an Emu NetDevice allows ns-3 simulations to send data on a “real” network. The second kind, called a Tap NetDevice allows a “real” host to participate in an ns-3 simulation as if it were one of the simulated nodes.

ns-3 emulation modes Various hybrids of the above are possible real machine ns-3 Testbed 2) testbeds interconnect ns-3 stacks real machine virtual machine virtual machine ns-3 1) ns-3 interconnects real or virtual machines Various hybrids of the above are possible

Getting started with ns-3 Agenda ns-3 project overview What is ns-3? Why use ns-3? Relationship to ns-2 Getting started with ns-3 Installation Examples Future directions

Getting started with ns-3 Finding what you need Contributing to the project

Resources Web site: Mailing lists: Wiki: Tutorial: http://www.nsnam.org Mailing lists: https://groups.google.com/forum/#!forum/ns-3-users http://mailman.isi.edu/mailman/listinfo/ns-developers Wiki: http://www.nsnam.org/wiki/ Tutorial: http://www.nsnam.org/docs/tutorial/tutorial.html IRC: #ns-3 at freenode.net

Work through the ns-3 tutorial Suggested steps Work through the ns-3 tutorial Browse the source code and other project documentation manual, model library, Doxygen, wiki ns-3 Consortium tutorials (March 2013) http://www.nsnam.org/consortium/activities/annual -meeting-march-2013/ Ask on ns-3-users mailing list if you still have questions We try to answer most questions

Most of the ns-3 API is documented with Doxygen APIs Most of the ns-3 API is documented with Doxygen http://www.stack.nl/~dimitri/doxygen/

Reading existing code Much insight can be gained from reading ns-3 examples and tests, and running them yourselves Many core features of ns-3 are only demonstrated in the core test suite (src/core/test) Stepping through code with a debugger is informative callbacks and templates make it more challenging than usual

Does ns-3 have a Windows version? FAQs Does ns-3 have a Windows version? Yes, for Visual Studio 2012 http://www.nsnam.org/wiki/Ns-3_on_Visual_Studio_2012 Does ns-3 support Eclipse or other IDEs? Instructions have been contributed by users http://www.nsnam.org/wiki/HOWTO_configure_Eclipse_with_ns-3 Is ns-3 provided in Linux or OS X package systems (e.g. Debian packages)? No

Any amount of help is appreciated! Contributing Any amount of help is appreciated! Reporting stale documentation to webmaster@nsnam.org Contributing small patches Writing new documentation Reporting bugs Fixing bugs Reviewing code of others Contributing new code Becoming a maintainer

Visit the wiki under "Project Ideas" tab New project ideas Visit the wiki under "Project Ideas" tab http://www.nsnam.org/wiki/Project_Ideas Students, consider to apply for Google Summer of Code 2015 A 10-week summer job that mentors a student project on ns-3 Students apply in March 2015 timeframe http://www.nsnam.org/wiki/GSOC2014Projects

Skills requirement To write a new protocols or modules C++ Python (plus) To do analysis and tests Shell, awk, or Python, …. Networking basic skills: IPv4 address utilization, Lan, wifi, …

Getting started This section is aimed at getting a user to a working state starting with a machine that may never have had ns-3 installed. It covers Ubuntu platform, prerequisites, ways to obtain ns-3, ways to build ns-3, and ways to verify your build and run simple programs.

Installation (Prerequisites) Link: https://www.nsnam.org/docs/tutorial/html/getting-started.html#overview https://www.nsnam.org/wiki/Installation Example for Ubuntu 14.10 release; other releases or other Debian-based systems may slightly vary. C++ (release): apt-get install gcc g++

Installation: (Prerequisites) Python (release): Note: qt4 development tools (Note: qt4, not qt5) needed for NetAnim animator …..Other libraries may be required (depends on the project) apt-get install python python-dev apt-get install qt4-dev-tools

Installation: ns-3 tarball $ cd $ mkdir workspace $ cd workspace $ wget http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2 $ tar xjf ns-allinone-3.22.tar.bz2 $ ls bake constants.py ns-3.22 README build.py netanim-3.105 pybindgen-0.16.0.886 util.py

Installation: Building ns-3 $ ./build.py --enable-examples --enable-tests Waf: Leaving directory `/path/to/workspace/ns-allinone-3.22/ns-3.22/build' 'build' finished successfully (6m25.032s) Modules built: antenna aodv applications bridge buildings config-store core csma csma-layout …. Modules not built (see ns-3 tutorial for explanation): brite click openflow Visualizer

Installation: Building ns-3 with WAF Configure the optimized code build $ ./waf clean $ ./waf --build-profile=optimized --enable-examples --enable-tests configure Or Configure the Debug build $ ./waf clean $ ./waf --build-profile=debug --enable-examples --enable-tests configure

Installation: Build The build system is now configured and you can build the debug versions of the ns-3 programs by simply typing ./waf Testing ns-3 $ ./test.py -c core 92 of 92 tests passed (92 passed, 0 failed, 0 crashed, 0 valgrind errors)

NS-3 installation video https://www.youtube.com/watch?v=Fbk89Nb-7M0&feature=youtu.be

Example ./waf --run hello-simulator Run: #include "ns3/core-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("HelloSimulator"); int main (int argc, char *argv[]) { NS_LOG_UNCOND ("Hello Simulator"); }

Example Run: ./waf --run hello-simulator

Path to examples /workspaceNS/ns-allinone-3.22/ns-3.22/examples/tutorial

Example2: First.cc 1 Server Client

Example2: First.cc

Example2: First.cc ///include #include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" #include "ns3/applications-module.h" ///ns3 namespace groups all ns-3-related declarations using namespace ns3; //declares a logging component called FirstScriptExample, allows you to enable and disable console message logging NS_LOG_COMPONENT_DEFINE ("FirstScriptExample"); Namespace :This groups all ns-3-related declarations in a scope outside the global namespace

Example2: First.cc int main (int argc, char *argv[]) {//time resolution to one nanosecond Time::SetResolution (Time::NS); LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO); ///Node creation NodeContainer nodes; nodes.Create (2); The next step is to create two nodes that we will connect via the point-to-point link.

Example2: First.cc ///PointToPoint link PointToPointHelper pointToPoint; pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); //NetDevice NetDeviceContainer devices; devices = pointToPoint.Install (nodes);

Example2: First.cc //Internet Stack InternetStackHelper stack; stack.Install (nodes); //Ipv4 network Ipv4AddressHelper address; address.SetBase ("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfaces = address.Assign (devices);

Example2: First.cc //Server UDP application configuration UdpEchoServerHelper echoServer (9); ApplicationContainer serverApps = echoServer.Install (nodes.Get (1)); serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (10.0));

Example2: First.cc //Client UDP application configuration UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9); echoClient.SetAttribute ("MaxPackets", UintegerValue (1)); echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0))); echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); ApplicationContainer clientApps = echoClient.Install (nodes.Get (0)); clientApps.Start (Seconds (2.0)); clientApps.Stop (Seconds (10.0));

Example2: First.cc //Start and stop the simulation Simulator::Run (); Simulator::Destroy (); return 0;

Example3: create new module Path where ns-3 is installed cd /home/master/1er/1erPhd/tools/tarballs/ns-allinone-3.17/ns-3.17/src/ 782 ./create-module.py dhvn Create a new module automatically, for example AAA ./create-module.py AAA

Getting started with ns-3 Agenda ns-3 project overview What is ns-3? Why use ns-3? Project organization Getting started with ns-3 Installation Example Future directions

Development Priorities Software modularity and long-term maintenance Improved integration of direct code execution Improved integration with container-based and testbed-based experiment infrastructures Simulation-based experiment management Usability

Modularity Open source project maintains a (more stable) core Models migrate to a more federated development process "bake" tool (Lacage and Camara) Components: build client "module store" server module metadata Bake is an integration tool which can be used to automate the reproducible build of a number of projects which depend on each other and which might be developed, and hosted by unrelated parties Figure source: Daniel Camara

SAFE: Simulation Automation Framework Data collection, transient analysis, management of independent replications, graphical configuration and visualization In ns-2 realm, similar to projects like ANSWER, ns2measure, and Akaroa2 ns-3 Simulation client Server host ns-3 Simulation client ns-3 Simulation client Experiment execution manager Results database Client hosts Figure source: Felipe Perrone

Usability Animation and visualization Linkage to external tools (topology, mobility, statistics) Improved helper APIs PyVis (Carneiro) NetAnim (Riley and Abraham) pyviz NetAnim

Questions?

Bibliography Tom Henderson (University of Washington), “ ns-3 overview,” https://www.nsnam.org/docs/tutorial/html/getting-started.html https://www.nsnam.org/wiki/Installation