ns-3 Direct Code Execution (DCE) ns-3 Annual Meeting June 2018

Slides:



Advertisements
Similar presentations
Programs in Memory Bryce Boe 2012/08/29 CS32, Summer 2012 B.
Advertisements

INTRODUCTION TO SIMULATION WITH OMNET++ José Daniel García Sánchez ARCOS Group – University Carlos III of Madrid.
Lots of content, the hope is that they will be used as reference material after the presentation.
An Introduction to NS-2 * Gayatri Swamynathan CS 276 TA *some slides are from a presentation by Haobo Yu & Nader Salehi, USC/ISI.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
NDT Tools Tutorial: How-To setup your own NDT server Rich Carlson Summer 04 Joint Tech July 19, 2004.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
NdnSIM Tutorial.
Squiggle Lan Messenger.
Central Online Grading System COGS Dec15-21 dec1521.sd.ece.iastate.edu.
BRITE integration with ns-3 Joshua Pelkey and Dr. George Riley Wns3 March 25, 2011.
Wave Relay System and General Project Details. Wave Relay System Provides seamless multi-hop connectivity Operates at layer 2 of networking stack Seamless.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Ns-3 Training Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/13/2013.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
QuikTrac 5.5, a validated Motorola Software Solution, allows you to take your Host ERP screens and extend them out to fixed or mobile devices including.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
Oracle Data Integrator Agents. 8-2 Understanding Agents.
1 uClinux course Day 2 of 5 Using configuration tools and the tool chain.
Mark E. Fuller Senior Principal Instructor Oracle University Oracle Corporation.
Paradyn Project Paradyn / Dyninst Week Madison, Wisconsin April 12-14, 2010 Binary Rewriting with Dyninst Madhavi Krishnan and Dan McNulty.
Linux Operations and Administration
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
Sung-Dong Kim Dept. of Computer Engineering, Hansung University Chapter 3 Programming Tools.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Program Execution in Linux David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Getting Started as an EdgeX Developer
Introduction to Operating Systems Concepts
Computer System Structures
Computer System Structures
6. The Open Network Lab Overview and getting started
Architecture Review 10/11/2004
Fundamental of Databases
Node.js Modules Header Mastering Node.js, Part 2 Eric W. Greene
Operating System Overview
Getting & Running EdgeX Docker Containers
Development Environment
Computer System Laboratory
Programming Assignment
CCNA Routing and Switching Routing and Switching Essentials v6.0
Getting Started as an EdgeX Developer
Introduction to ZBOSS Embedded Systems Software Training Center
Program Execution in Linux
Chapter 10: Device Discovery, Management, and Maintenance
Virtualization overview
CCNA Routing and Switching Routing and Switching Essentials v6.0
Direct Attached Storage and Introduction to SCSI
Advanced Network Training
Dynamic DNS support for EGI Federated cloud
Session 2. Logging과 Command Line Argument 사용법
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
Chapter 10: Device Discovery, Management, and Maintenance
ns-3 Waf build system ns-3 Annual Meeting June 2017
What does an Operating System Do?
Lecture Topics: 11/1 General Operating System Concepts Processes
Configuration Of A Pull Network.
Tornado Training Workshop
Chapter 15: File System Internals
Ns-3 Tutorial Xin Li.
Program Execution in Linux
Ns-3 Training Emulation support ns-3 training, June 2016.
Tornado Training Workshop
ns-3 Direct Code Execution ns-3 Annual Meeting June 2016
Basic Dynamic Analysis VMs and Sandboxes
Operating System Concepts
Operating System Concepts
Ns-3 Training Simulator core ns-3 training, June 2016.
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

ns-3 Direct Code Execution (DCE) ns-3 Annual Meeting June 2018 ns-3 training, June 2018

Outline DCE Introduction Download and Installation of DCE with Bake DCE examples with custom application: iperf ping Q&A ns-3 training, June 2018

Credits DCE originated with Mathieu Lacage (INRIA), was substantially developed by Emilio Mancini and Frederic Urbani (INRIA), and finished off by Hajime Tazaki DCE leverages the bake build system substantially developed by Daniel Camara (INRIA) DCE is presently maintained by Hajime Tazaki and Matthieu Coudron. ns-3 training, June 2018

Goals Lightweight virtualization of kernel and application processes, interconnected by simulated networks Benefits: Implementation realism in controlled topologies or wireless environments Model availability Debugging a whole network within a single process Limitations: Not as scalable as pure simulation Tracing more limited C or C++ applications only ns-3 training, June 2018

Direct Code Execution DCE/ns-3 framework requires the virtualization of a series of services Multiple isolated instances of the same protocol on the same machine System calls are captured and treated by DCE Network stack protocols calls are captured and redirected To perform its work, DCE re-implements the Linux program loader and parts of libc and libpthread ns-3 training, June 2018

DCE Components ns-3 training, June 2018

DCE modes DCE modes in context of possible approaches Figure source: DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism, Tazaki et al, WNS3 2013. ns-3 training, June 2018

References Direct Code Execution: Revisiting Library OS Architecture for Reproducible Network Experiments Tazaki et al, CONEXT 2013 http://hal.archives-ouvertes.fr/docs/00/88/08/70/PDF/con013- hal.pdf DCE Cradle: Simulate Network Protocols with Real Stacks for Better Realism Tazaki et al, WNS3 2013 http://hal.archives-ouvertes.fr/docs/00/78/15/91/PDF/wns3- 2013.pdf NetDev 1.1 talk (Feb. 2016): "LibOS as a regression test framework for Linux networking" https://www.youtube.com/watch?v=FNGkMFmboEc ns-3 training, June 2018

bake overview "bake" tool Open source Integration tool to simplify the build process by automatically builds the software with required dependencies. "bake" tool (Lacage and Camara) Components: build client "module store" server module metadata Figure source: Daniel Camara ns-3 training, June 2018

bake basics bake can be used to build the Python bindings toolchain, Direct Code Execution, Network Simulation Cradle, etc. Steps to setup DCE and using Bake export BAKE_HOME=`pwd`/bake // Set environment variables export PATH=$PATH:$BAKE_HOME // to locate bake export PYTHONPATH=$PYTHONPATH:$BAKE_HOME ./bake.py configure -e <module> ./bake.py check // bake tool dependency ./bake.py show // <module> related dependency ./bake.py download // Download <module> specific source ./bake.py build // Build the source code ns-3 training, June 2018

Placeholder slide for demoing bake Demo: bake.py configure -e ns-allinone-3.25 Look at: build/ libraries and executables Manual available at: https://www.nsnam.org/docs/bake/tutorial/html/index.html ns-3 training, June 2018

bakeconf example <module name="ns-allinone-3.28"> <source type="none"/> <depends_on name="netanim-3.108" optional="True"/> <depends_on name="nsc-0.5.3" optional="True"/> <depends_on name="pybindgen-ns3.27-castxml" optional="True"/> <depends_on name="pyviz-prerequisites" optional="True"/> <depends_on name="click-ns-3.25" optional="True"/> <depends_on name="openflow-ns-3.25" optional="True"/> <depends_on name="pygccxml-1.9.1" optional="True"/> <depends_on name="BRITE" optional="True"/> <depends_on name="ns-3.28" optional="False"/> <build type="none"/> </module> ns-3 training, June 2018

Iperf example in DCE ns-3-dce/example/dce-iperf.cc iperf: it is a widely used tool for network performance measurement and tuning. [text source: Wikipedia] iper f client iper f server Node 0 Node 1 5Mbps 10.1.1.1 10.1.1.2 1 ms ns-3 training, June 2018

Step by step example - What we need to do! Create the nodes Create stack Create devices Set addresses Connect devices Create DCE Configuration the applications to run Set start time for server and client Set simulation time Start simulation ns-3 training, June 2018

Step by step example - What we need to do! Create the nodes Create stack Create devices Set addresses Connect devices Create DCE Configuration the applications to run Set start time for server and client Set simulation time Start simulation Standard ns-3 procedures DCE specific ns-3 training, June 2018

Application configuration in DCE DceApplicationHelper dce; dce.SetStackSize (1 << 20); // 1MB, default: 8kB dce.SetBinary ("application"); dce.ResetArguments (); dce.ResetEnvironment (); dce.AddArgument ("first"); dce.AddArguments ("second"); dce.AddArguments ("third"); dce.Install (nodes.Get (0)); Sample Command: application first second third ns-3 training, June 2018

Step by step example iperf int main (int argc, char *argv[]) { // Select network stack std::string stack = "ns3"; // Node Container creation NodeContainer nodes; nodes.Create (2); // Device and channel creation PointToPointHelper pointToPoint; NetDeviceContainer devices;   ns-3 training, June 2018

Step by step example iperf // Select Stack type if (stack == “ns3”) { InternetStackHelper stack; stack.Install (nodes); dceManager.Install (nodes); } else if (stack == “linux”) { dceManager.SetNetworkStack ( “ns3::LinuxSocketFdFactory ”, “Library”, StringValue (“liblinux.so”)); LinuxStackHelper stack; } else if (stack == “freebsd”) { ... } ns-3 training, June 2018

Step by step example iperf // Node0-Node1 setup Ipv4AddressHelper address; // Node0-Node1 addresses address.SetBase ("10.1.1.0", "255.255.255.252"); NetDeviceContainer devices; // connecting nodes devices = p2p.Install (nodes.Get (0), nodes.Get (1)); // assign addresses Ipv4InterfaceContainer interfaces = address.Assign (devices);   // setup ip routes Ipv4GlobalRoutingHelper::PopulateRoutingTables (); if (stack == "linux") { LinuxStackHelper::PopulateRoutingTables (); } ns-3 training, June 2018

Step by step example iperf DceManagerHelper dceManager; dceManager.Install (nodes);   DceApplicationHelper dce; ApplicationContainer apps;   dce.SetStackSize (1 << 20); // 1MB stack dce.SetBinary ("iperf"); // Launch iperf client on node 0 dce.ResetArguments (); // clean arguments dce.ResetEnvironment (); // clean environnent dce.AddArgument ("-c"); // client dce.AddArgument ("10.1.2.2"); //target machine address dce.AddArgument ("-i"); // interval dce.AddArgument ("1"); dce.AddArgument ("--time"); // how long dce.AddArgument ("10");   apps = dce.Install (nodes.Get (0)); //install application apps.Start (Seconds (0.7)); //start at 0.7 simulation time apps.Stop (Seconds (20)); //stop at 20s simulation time dce.SetBinary ("iperf"); // Launch iperf server on node 2 dce.ResetArguments (); // clean arguments dce.AddArgument ("-s"); // server dce.AddArgument ("-P"); // number of paralell servers apps = dce.Install (nodes.Get (2)); apps.Start (Seconds (0.6)); DCE Setup ns-3 training, June 2018

Step by step example iperf // Simulation stop time Simulator::Stop (Seconds (40.0)); // Run Simulator::Run (); // Stop Simulator::Destroy ();   return 0; } ns-3 training, June 2018

With/without linux kernel ns-3 stack -./waf --run "dce-iperf --stack=ns3" Linux stack ./waf --run "dce-iperf --stack=linux" More options - ./waf --run "dce-iperf --PrintHelp" ns-3 training, June 2018

Step by step example – iperf, ns-3 Generated elf-cache – program files exitprocs – execution process information files-0 files-1 – execution filesystem files-x files-x corresponds to “/” of the machine x files-x/var/log/<pid>/ cmdline – command executed status – execution information stderr – standard error output stdout – standard output syslog – syslog output ns-3 training, June 2018

Build Custom Application for DCE: Ping Collect the source code and untar: wget http://www.skbuff.net/iputils/iputils-s20101006.tar.bz2 tar xvjf iputils-s20101006.tar.bz2 Add extra LDFLAGS in Makefile LDFLAGS+=-pie -rdynamic Build ping application make CFLAGS=-fPIC ping Check binary is read to execute in DCE readelf -h ping ns-3 training, June 2018

Header Section of Ping binary Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: DYN (Shared object file) Machine: Advanced Micro Devices X86-64 Version: 0x1 ns-3 training, June 2018

Running Ping Example Ping example: ns-3-dce/myscripts/ping/dce-ping.cc ./waf --run dce-ping Need to update DCE_PATH to external application assert failed. cond="exeFullPath.length () > 0", msg="Executable 'ping' not found ! Please check your DCE_PATH and DCE_ROOT environment variables.", file=../model/dce-manager.cc, line=262 Fix the DCE_PATH export DCE_PATH=$DCE_PATH:/path/to/ping ns-3 training, June 2018

Tuning DCE ns-3 training, June 2018

Practical issues All software must be re-compiled with –fpic and linked with –pie to generate the code as Position Independent Code (PIC) Executables need to be installed to a place where DCE can find it Applications may require system dependencies Requires coverage of selected POSIX calls Execution must be managed (e.g. start/stop time) How much stack size to allocate to programs? Programs generate output (stdout, stderr, files) ns-3 training, June 2018

Advantages of DCE Simulation with Linux network stack. Allow userspace applications to run inside ns-3. Debug posix based applications in single address space. ns-3 training, June 2018

Future Work Support for latest linux kernel using Linux Kernel Library (LKL). ns-3 training, June 2018