Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.

Slides:



Advertisements
Similar presentations
Introduction to NS-3 Part - 2 Katsaros Konstantinos PhD Student PGSDP Workshop on NS-3 2 April 2012.
Advertisements

DEV-13: You've Got a Problem, Here’s How to Find It
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
1 THE ARCHITECTURE FOR THE DIGITAL WORLD TM THE ARCHITECTURE FOR THE DIGITAL WORLD Embedded Linux for ARM Architecture.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
© 2008 Intel Corporation; made available under the EPL v1.0 | February 12, 2008 | Integrating a custom tool-chain in CDT.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training module provides an overview of optimization techniques used in.
Ns-3 Training Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/13/2013.
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
Developing C/C++ applications with the Eclipse CDT David Gallardo.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Active-HDL Interfaces Debugging C Code Course 10.
Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.
Debugging and Profiling With some help from Software Carpentry resources.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
Eclipse 24-Apr-17.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
Debugging Ensemble Productions CAMTA Meeting 11 th November 2010 John Murray.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Copyright © 2009 Ericsson, Made available under the Eclipse Public License.
Pre-Compiler Directives for TTCN-3 Ina Schieferdecker in response to CR5089 and 5090.
Custom Authentication Providers For DotNetNuke v5.0 Stan Schultes – Sarasota, FL Florida Community Leader
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
DEBUG.
The Distributed Application Debugger (DAD)
ns-3 Training 5/08/2017 Computer and Communication Network Lab
Build and Test system for FairRoot
Visual Basic.NET Windows Programming
How to Contribute to System Testing and Extract Results
Muen Policy & Toolchain
Testing Tutorial 7.
Dept of Computer Science University of Maryland College Park
CSE 374 Programming Concepts & Tools
PVS-Studio static analyzer: advanced features
LESSON 20.
Ns-3 Training Session 2: Monday May 11 ns-3 Annual meeting May 2015.
SharePoint Framework Extensions
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
Important terms Black-box testing White-box testing Regression testing
Eclipse 20-Sep-18.
Many-core Software Development Platforms
HP C/C++ Remote developer plug-in for Eclipse
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
Important terms Black-box testing White-box testing Regression testing
11/12/2018 6:58 PM © 2004 Microsoft Corporation. All rights reserved.
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
Using Visual Studio and VS Code for Embedded C/C++ Development
Tivoli Common Reporting v1.2 Overview
System Concept Simulation for Concurrent Engineering
ns-3 Waf build system ns-3 Annual Meeting June 2017
Testing, debugging, and using support libraries
Chapter 7 –Implementation Issues
Ns-3 Tutorial Xin Li.
Ns-3 Training Debugging support ns-3 training, June 2016.
ns-3 training Tom Henderson ns-3 annual meeting 2019
Makefiles, GDB, Valgrind
Ns-3 Training ns-3 Objects ns-3 training, June 2016.
3.8 static vs dynamic thread management
Dynamic Binary Translators and Instrumenters
Presentation transcript:

ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014

Writing and debugging your own examples NS-3 Annual Meeting May 2014

Writing and debugging new programs Choosing between Python and C++ Reading existing code Understanding and controlling logging code Error conditions Running programs through a debugger NS-3 Annual Meeting May 2014

Python bindings ns-3 uses the 'pybindgen' tool to generate Python bindings for the underlying C++ libraries Existing bindings are typically found in the bindings/ directory of a module Some methods are not provided in Python (e.g. hooking trace sources) Generating new bindings requires a toolchain documented on the ns-3 web site NS-3 Annual Meeting May 2014

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 can be done, but callbacks and templates make it more challenging than usual NS-3 Annual Meeting May 2014

Debugging support Assertions: NS_ASSERT (expression); Aborts the program if expression evaluates to false Includes source file name and line number Unconditional Breakpoints: NS_BREAKPOINT (); Forces an unconditional breakpoint, compiled in Debug Logging (not to be confused with tracing!) Purpose Used to trace code execution logic For debugging, not to extract results! Properties NS_LOG* macros work with C++ IO streams E.g.: NS_LOG_UNCOND (”I have received ” << p->GetSize () << ” bytes”); NS_LOG macros evaluate to nothing in optimized builds When debugging is done, logging does not get in the way of execution performance NS-3 Annual Meeting May 2014

Debugging support (cont.) Logging levels: NS_LOG_ERROR (...): serious error messages only NS_LOG_WARN (...): warning messages NS_LOG_DEBUG (...): rare ad-hoc debug messages NS_LOG_INFO (...): informational messages (eg. banners) NS_LOG_FUNCTION (...):function tracing NS_LOG_PARAM (...): parameters to functions NS_LOG_LOGIC (...): control flow tracing within functions Logging ”components” Logging messages organized by components Usually one component is one .cc source file NS_LOG_COMPONENT_DEFINE ("OlsrAgent"); Displaying log messages. Two ways: Programatically: LogComponentEnable("OlsrAgent", LOG_LEVEL_ALL); From the environment: NS_LOG="OlsrAgent" ./my-program NS-3 Annual Meeting March 2014

Running C++ programs through gdb The gdb debugger can be used directly on binaries in the build directory An easier way is to use a waf shortcut ./waf --command-template="gdb %s" --run <program- name> NS-3 Annual Meeting May 2014

Running C++ programs through valgrind valgrind memcheck can be used directly on binaries in the build directory An easier way is to use a waf shortcut ./waf --command-template="valgrind %s" --run <program-name> Note: disable GTK at configure time when running valgrind (to suppress spurious reports) ./waf configure --disable-gtk --enable-tests ... NS-3 Annual Meeting May 2014

Testing Can you trust ns-3 simulations? ns-3 strategies: Can you trust any simulation? Onus is on the simulation project to validate and document results Onus is also on the researcher to verify results ns-3 strategies: regression and unit tests Aim for event-based rather than trace-based validation of models on testbeds reuse of code NS-3 Annual Meeting May 2014

Test framework ns-3-dev is checked nightly on multiple platforms Linux gcc-4.x, i386 and x86_64, OS X, FreeBSD clang, and Cygwin (occasionally) ./test.py will run regression tests Walk through test code, test terminology (suite, case), and examples of how tests are run NS-3 Annual Meeting May 2014

Improving performance Debug vs optimized builds ./waf -d debug configure ./waf -d debug optimized Build ns-3 with static libraries ./waf --enable-static Use different compilers (icc) has been done in past, not regularly tested

Creating a new module (case study, time permitting) NS-3 Annual Meeting May 2014

Questions? NS-3 Annual Meeting May 2014