ns-3 Waf build system ns-3 Annual Meeting June 2017

Slides:



Advertisements
Similar presentations
05/11/2001 CPT week Natalia Ratnikova, FNAL 1 Software Distribution in CMS Distribution unitFormContent Version of SCRAM managed project.
Advertisements

A NoC Generation and Evaluation Framework
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Copyright node This presentation is a subset of the one presented by:
Design Synopsys System Verilog API Donations to Accellera João Geada.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Using Ant to build J2EE Applications Kumar
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
NETWORK SIMULATOR 3 Reporter: Chechieh Lin. O UTLINE Introduction NS3 vs. NS2 NS-3 Modules Key Abstractions A First ns-3 Script.
The Pipeline Processing Framework LSST Applications Meeting IPAC Feb. 19, 2008 Raymond Plante National Center for Supercomputing Applications.
Scalable Game Development William Roberts Senior Game Engineer
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Graphene So what’s the most efficient way to spam all your Facebook friends? Team Adith Tekur (System Architect/Tester) Neha Rastogi (System Integrator)
Session 1: Monday May 11 ns-3 Annual meeting May ns-3 Training.
Introductions of SDN in NS-3
Event Sources and Realtime Actions
Start-SPPowerShell – Introduction to PowerShell for SharePoint Admins and Developers Paul BAker.
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
Data Virtualization Demoette… Logging in CIS
Development Environment
Introduction to InVEST ArcGIS Tool
VAB™ for INFINITY Tutorial
Lab 1: Using NIOS II processor for code execution on FPGA
Topics Designing a Program Input, Processing, and Output
User-Written Functions
Topics Introduction to Functions Defining and Calling a Void Function
Self Healing and Dynamic Construction Framework:
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
INTRODUCING Adams/CHASSIS
Topics Introduction to Repetition Structures
PYTHON: AN INTRODUCTION
Deploying and Configuring SSIS Packages
Functions CIS 40 – Introduction to Programming in Python
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
Introduction to Events
Ns-3 Training Session 1: Monday 8:30am ns-3 Annual Meeting May 2014.
ns-3 Training ns-3 Annual Meeting June 2017
Virtual Machine Emulator Tutorial
What is Bash Shell Scripting?
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
Topics Introduction to File Input and Output
Introduction to Ansible
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
CS703 - Advanced Operating Systems
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.
C++ Concerns: Timing Code, Random Numbers, Memory
Configuration Of A Pull Network.
Good Testing Practices
Tornado Training Workshop
Last Class We Covered What makes “good code” good Top down design
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
Topics Introduction to Functions Defining and Calling a Function
Ns-3 Tutorial Xin Li.
Topics Designing a Program Input, Processing, and Output
C++ Concerns: Timing Code, Random Numbers, Memory
Topics Designing a Program Input, Processing, and Output
Tornado Training Workshop
CST8177 Scripting 2: What?.
Topics Introduction to File Input and Output
Where real stuff starts
Ns-3 Training Debugging support ns-3 training, June 2016.
Ns-3 Training Simulator core ns-3 training, June 2016.
SharePoint 2013 Best Practices
Presentation transcript:

ns-3 Waf build system ns-3 Annual Meeting June 2017 ns-3 Training, June 2017

Software introduction Download the latest release wget http://www.nsnam.org/releases/ns-allinone- 3.26.tar.bz2 tar xjf ns-allinone-3.26.tar.bz2 Clone the latest development code hg clone http://code.nsnam.org/ns-3-allinone Q. What is "hg clone"? A. Mercurial (http://www.selenic.com) is our source code control tool. ns-3 Training, June 2017

Software building Two levels of ns-3 build 1) bake (a Python-based build system to control an ordered build of ns-3 and its libraries) Network Simulation Cradle pybindgen click routing ns-3 2) waf, a build system written in Python module 3) build.py (a custom Python build script to control an ordered build of ns-3 and its libraries) <--- may eventually be deprecated ns-3 Training, June 2017

ns-3 uses the 'waf' build system Waf is a Python-based framework for configuring, compiling and installing applications. It is a replacement for other tools such as Autotools, Scons, CMake or Ant http://code.google.com/p/waf/ For those familiar with autotools: configure ./waf configure make ./waf build ns-3 Training, June 2017

waf configuration Key waf configuration examples ./waf configure --enable-examples --enable-tests --disable-python --enable-modules Whenever build scripts change, need to reconfigure Demo: ./waf --help ./waf configure --enable-examples --enable-tests --enable-modules='core' Look at: build/c4che/_cache.py ns-3 Training, June 2017

wscript example ns-3 Training, June 2017 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): obj = bld.create_ns3_module('csma', ['network', 'applications']) obj.source = [ 'model/backoff.cc', 'model/csma-net-device.cc', 'model/csma-channel.cc', 'helper/csma-helper.cc', ] headers = bld.new_task_gen(features=['ns3header']) headers.module = 'csma' headers.source = [ 'model/backoff.h', 'model/csma-net-device.h', 'model/csma-channel.h', 'helper/csma-helper.h', if bld.env['ENABLE_EXAMPLES']: bld.add_subdirs('examples') bld.ns3_python_bindings() ns-3 Training, June 2017

Once project is configured, can build via ./waf build or ./waf waf will build in parallel on multiple cores waf displays modules built at end of build Demo: ./waf build Look at: build/ libraries and executables ns-3 Training, June 2017

Running programs ./waf shell provides a special shell for running programs Sets key environment variables ./waf --run sample-simulator ./waf --pyrun src/core/examples/sample- simulator.py ns-3 Training, June 2017

Configuring a build type is done at waf configuration time Build variations Configuring a build type is done at waf configuration time debug build (default): all asserts and debugging code enabled ./waf -d debug configure optimized ./waf -d optimized configure static libraries ./waf --enable-static configure ns-3 Training, June 2017

Controlling the modular build One way to disable modules: ./waf configure --enable-modules='a','b','c' The .ns3rc file (found in utils/ directory) can be used to control the modules built Precedence in controlling build 1) command line arguments 2) .ns3rc in ns-3 top level directory 3) .ns3rc in user's home directory Demo how .ns3rc works ns-3 Training, June 2017

Building without wscript The scratch/ directory can be used to build programs without wscripts Demo how programs can be built without wscripts ns-3 Training, June 2017

ns-3 Training ns-3 training, June 2017

Simulator and Scheduler Command line arguments Random variables Simulator core Simulation time Events Simulator and Scheduler Command line arguments Random variables Execute a function (may generate additional events) Virtual time Advance the virtual time to the next event (function) ns-3 training, June 2017

Simulator example ns-3 training, June 2017

Simulator example (in Python) ns-3 training, June 2017

Simulation program flow Handle program inputs Configure topology Run simulation Process outputs ns-3 training, June 2017

Command-line arguments Add CommandLine to your program if you want command-line argument parsing Passing --PrintHelp to programs will display command line options, if CommandLine is enabled ./waf --run "sample-simulator --PrintHelp" ns-3 training, June 2017

Time in ns-3 Time is stored as a large integer in ns-3 Minimize floating point discrepancies across platforms Special Time classes are provided to manipulate time (such as standard operators) Default time resolution is nanoseconds, but can be set to other resolutions Note: Changing resolution is not well used/tested Time objects can be set by floating-point values and can export floating-point values double timeDouble = t.GetSeconds(); Best practice is to avoid floating point conversions where possible ns-3 training, June 2017

Events are just function calls that execute at a simulated time Events in ns-3 Events are just function calls that execute at a simulated time i.e. callbacks this is another difference compared to other simulators, which often use special "event handlers" in each model Events have IDs to allow them to be cancelled or to test their status ns-3 training, June 2017

Simulator and Schedulers The Simulator class holds a scheduler, and provides the API to schedule events, start, stop, and cleanup memory Several scheduler data structures (calendar, heap, list, map) are possible "RealTime" simulation implementation aligns the simulation time to wall-clock time two policies (hard and soft limit) available when the simulation and real time diverge ns-3 training, June 2017

Random Variables Currently implemented distributions from src/core/examples/sample-rng-plot.py Currently implemented distributions Uniform: values uniformly distributed in an interval Constant: value is always the same (not really random) Sequential: return a sequential list of predefined values Exponential: exponential distribution (poisson process) Normal (gaussian), Log-Normal, Pareto, Weibull, triangular ns-3 training, June 2017

Random variables and independent replications Many simulation uses involve running a number of independent replications of the same scenario In ns-3, this is typically performed by incrementing the simulation run number not by changing seeds ns-3 training, June 2017