ns-3 Direct Code Execution ns-3 Annual Meeting June 2016

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.
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.
1 Dynamic DNS. 2 Module - Dynamic DNS ♦ Overview The domain names and IP addresses of hosts and the devices may change for many reasons. This module focuses.
Uncovering Performance and Interoperability Issues in the OFED Stack March 2008 Dennis Tolstenko Sonoma Workshop Presentation.
PlanetLab Operating System support* *a work in progress.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Copyright node This presentation is a subset of the one presented by:
Introduction to Linux/UNIX. History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working.
1 MASTERING (VIRTUAL) NETWORKS A Case Study of Virtualizing Internet Lab Avin Chen Borokhovich Michael Goldfeld Arik.
Linux Operations and Administration
1 Lab 3 Transport Layer T.A. Youngjoo Han. 2 Transport Layer  Providing logical communication b/w application processes running on different hosts 
Simulation and Emulation with NCTUns
OMNET++. Outline Introduction Overview The NED Language Simple Modules.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
NdnSIM Tutorial.
Squiggle Lan Messenger.
Redes Inalámbricas Máster Ingeniería de Computadores 2008/2009 Tema 7.- CASTADIVA PROJECT Performance Evaluation of a MANET architecture.
Special Project Group 03 Chintan Shah Nisharg Patel Cynthia York.
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.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
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.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
11 CLUSTERING AND AVAILABILITY Chapter 11. Chapter 11: CLUSTERING AND AVAILABILITY2 OVERVIEW  Describe the clustering capabilities of Microsoft Windows.
Linux Operations and Administration
When you run a scenario, the Vusers on each host machine use the host’s IP address. You can define multiple IP addresses on a host machine to emulate a.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
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.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Access Grid Workshop – APAC ‘05 Node Services Development Thomas D. Uram Argonne National Laboratory.
Introductions of SDN in NS-3
Introduction to Operating Systems Concepts
Operating Systems {week 01.b}
6. The Open Network Lab Overview and getting started
Architecture Review 10/11/2004
ns-3 Training 5/08/2017 Computer and Communication Network Lab
Implementation of Embedded OS
Computer System Laboratory
Introduction to ZBOSS Embedded Systems Software Training Center
Virtualization overview
Ns-3 Training Session 1: Monday 8:30am ns-3 Annual Meeting May 2014.
Dynamic DNS support for EGI Federated cloud
IIS.
Session 2. Logging과 Command Line Argument 사용법
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
High Coverage Detection of Input-Related Security Faults
Ns-3 Training Emulation.
Karthik Sadasivam Banuprasad Samudrala
Chapter 2: The Linux System Part 1
IS3440 Linux Security Unit 7 Securing the Linux Kernel
ns-3 Direct Code Execution (DCE) ns-3 Annual Meeting June 2018
ns-3 Waf build system ns-3 Annual Meeting June 2017
Introduction to Linux/UNIX
What does an Operating System Do?
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.
APACHE WEB SERVER.
System calls….. C-program->POSIX call
Basic Dynamic Analysis VMs and Sandboxes
Ns-3 Training ns-3 Objects ns-3 training, June 2016.
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

ns-3 Direct Code Execution ns-3 Annual Meeting June 2016 ns-3 training, June 2016

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 2016

High-level overview of DCE Bake build system DCE examples: Outline High-level overview of DCE Bake build system Example: ns-allinone-3.25 via Bake DCE examples: iperf thttpd Quagga ospfd Q&A ns-3 training, June 2016

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 Configuration different C or C++ applications only ns-3 training, June 2016

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 2016

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 2016

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 2016

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) Programs may require: configuration files environment variables input files How much stack size to allocate to programs? Programs generate output (stdout, stderr, files) ns-3 training, June 2016

bake overview 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 Figure source: Daniel Camara ns-3 training, June 2016

bake basics bake can be used to build the Python bindings toolchain, Direct Code Execution, Network Simulation Cradle, etc. Manual available at https://www.nsnam.org/docs/bake/tutorial/html/index.html ./bake.py configure -e <module> ./bake.py check ./bake.py show ./bake.py download ./bake.py build ns-3 training, June 2016

Placeholder slide for demoing bake Demo: bake.py configure -e ns-allinone-3.25 Look at: build/ libraries and executables ns-3 training, June 2016

bakeconf example <module name="ns-allinone-3.25"> <source type="none"/> <depends_on name="netanim-3.107" optional="True"/> <depends_on name="nsc-0.5.3" optional="True"/> <depends_on name="pybindgen-0.17.0.post49+ng0e4e3bc" 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.0.0" optional="True"/> <depends_on name="gccxml-ns3" optional="True"/> <depends_on name="BRITE" optional="True"/> <depends_on name="ns-3.25" optional="False"/> <build type="none"/> </module> ns-3 training, June 2016

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 Configuration different ns-3 training, June 2016

DCE example walkthrough cd ns-allinone-3.25 export BAKE_HOME=`pwd`/bake export PATH=$PATH:$BAKE_HOME export PYTHONPATH=$PYTHONPATH:$BAKE_HOME cd bake bake.py configure -e dce-ns3-1.8 bake.py check bake.py show bake.py download bake.py build cd source/ns-3-dce ./waf --run dce-iperf ns-3 training, June 2016

The shared scenario is a simple two node network iperf/HTTPD iperf/wget 10.1.1.1 10.1.1.2 10.1.2.1 10.1.2.2 5 Mbps, 1 ms 5 Mbps, 1 ms

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

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

Tuning DCE ns-3 training, June 2016

What can go wrong (example: strfry not defined) Adding system calls What can go wrong (example: strfry not defined) % ./waf --run dce-udp-perf 'build' finished successfully (0.704s) /home/tazaki/hgworks/dce-dev/source/ns-3- dce/build/bin/dce-udp-perf: **relocation error: elf- cache/0/udp-perf: symbol strfry**, version GLIBC_2.2.5 not defined in file 0002.so.6 with link time reference Command ['/home/tazaki/hgworks/dce-dev/source/ns-3- dce/build/bin/dce-udp-perf'] exited with code 127 Manual describes how to deal with this ns-3 training, June 2016

Troubleshooting DCE Simulation process may exceed system limit of open files per process check 'ulimit -n' and edit limits on your system Maximum number of processes may exceed system limit check 'ulimit -u' and edit limits on your system DCE stack size default of 8192 may need to be increased (stack overflow exceptions) DceApplicationHelper dce; dce.SetStackSize (1<<20); ns-3 training, June 2016

Step by step example - iperf with ns-3 stack (I) int main (int argc, char *argv[]) { // Node Container creation NodeContainer nodes; nodes.Create (3);   // Linux stack creation InternetStackHelper stack; stack.Install (nodes); // For real time // GlobalValue::Bind ("SimulatorImplementationType", StringValue ("ns3::RealtimeSimulatorImpl")); // GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true)); // Device and channel creation PointToPointHelper p2p; p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps“)); p2p.SetChannelAttribute ("Delay", StringValue ("1ms"));

Step by step example - iperf with ns-3 stack (II) // Node0-Node1 setup Ipv4AddressHelper address; address.SetBase ("10.1.1.0", "255.255.255.252"); // Node0-Node1 addresses NetDeviceContainer devices; devices = p2p.Install (nodes.Get (0), nodes.Get (1)); // connecting nodes Ipv4InterfaceContainer interfaces = address.Assign (devices); // assign addresses   // Node1-Node2 setup devices = p2p.Install (nodes.Get (1), nodes.Get (2)); // connecting nodes address.SetBase ("10.1.2.0", "255.255.255.252"); // Node1-Node2 addresses interfaces = address.Assign (devices); // assign addresses // setup ip routes Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

Step by step example - iperf with ns-3 stack (III) 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

Step by step example - iperf with ns-3 stack (IV) // Simulation stop time Simulator::Stop (Seconds (40.0)); // Run Simulator::Run (); // Stop Simulator::Destroy ();   return 0; }

Step by step example – iperf, ns-3 Generated elf-cache – program files exitprocs – execution process information files-0 files-2 – 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

Step by step example - HTTP with ns-3 stack (I) int main (int argc, char *argv[]) { // Node Container creation NodeContainer nodes; nodes.Create (3);   // Linux stack creation InternetStackHelper stack; stack.Install (nodes); // For real time // GlobalValue::Bind ("SimulatorImplementationType", StringValue ("ns3::RealtimeSimulatorImpl")); // GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true)); // Device and channel creation PointToPointHelper p2p; p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps“)); p2p.SetChannelAttribute ("Delay", StringValue ("1ms"));

Step by step example - HTTP with ns-3 stack (II) // Node0-Node1 setup Ipv4AddressHelper address; address.SetBase ("10.1.1.0", "255.255.255.252"); // Node0-Node1 addresses NetDeviceContainer devices; devices = p2p.Install (nodes.Get (0), nodes.Get (1)); // connecting nodes Ipv4InterfaceContainer interfaces = address.Assign (devices); // assign addresses   // Node1-Node2 setup devices = p2p.Install (nodes.Get (1), nodes.Get (2)); // connecting nodes address.SetBase ("10.1.2.0", "255.255.255.252"); // Node1-Node2 addresses interfaces = address.Assign (devices); // assign addresses // setup ip routes Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

Step by step example - HTTP with ns-3 stack (III) // Launch the server HTTP dce.SetBinary ("thttpd"); dce.ResetArguments (); // clean arguments dce.ResetEnvironment (); // clean environnent dce.SetUid (1); // Set httpd for super user execution dce.SetEuid (1); apps = dce.Install (nodes.Get (0)); // install http daemon apps.Start (Seconds (1)); // start time // Launch the client WGET dce.SetBinary ("wget"); dce.AddArgument ("-r"); // recursive wget dce.AddArgument ("http://10.1.1.1/index.html"); apps = dce.Install (nodes.Get (2)); apps.Start (Seconds (2)); // start time DCE Setup

Step by step example - HTTP with ns-3 stack (IV) // Simulation stop time Simulator::Stop (Seconds (40.0)); // Run Simulator::Run (); // Stop Simulator::Destroy ();   return 0; }

With/without linux kernel with ns-3 stack ./waf --run "dce-httpd --kernel=0" with Linux stack ./waf --run "dce-httpd --kernel=1" ns-3 training, June 2016

DCE example 3: quagga ospfd Topology: from rocketfuel tool Routing: ospfd (IPv4), all in area 0 Traffic: ns-3's v4Ping application across topology ns-3 training, June 2016

Bugs in ns-3.25 version: 1) small typo in myscripts/ns-3-dce-quagga/wscript diff -r 088f43fecbd0 wscript --- a/wscript Tue Dec 01 11:26:23 2015 +0900 +++ b/wscript Tue Jun 14 09:42:43 2016 -0700 @@ -46,7 +46,7 @@ target='bin/dce-zebra-simple', source=['example/dce-zebra-simple.cc']) - module.add_example(needed = ['core', 'internet', 'dce-quagga', 'point-to-point', 'internet-apps,' 'applications', 'topology-read'], + module.add_example(needed = ['core', 'internet', 'dce-quagga', 'point-to-point', 'internet-apps', 'applications', 'topology-read'], target='bin/dce-quagga-ospfd-rocketfuel', source=['example/dce-quagga-ospfd-rocketfuel.cc']) 2) --vis option for DCE requires some symlinks in the bake/build/lib64/python2.7/site-packages directory ns-3 training, June 2016

DCE example 3 walkthrough cd ns-allinone-3.25 export BAKE_HOME=`pwd`/bake export PATH=$PATH:$BAKE_HOME export PYTHONPATH=$PYTHONPATH:$BAKE_HOME cd bake bake.py configure -e dce-ns3-1.8 dce-quagga-1.8 bake.py check bake.py show bake.py download bake.py build cd source/ns-3-dce ./waf --run dce-quagga-ospfd-rocketfuel (--vis) ns-3 training, June 2016