Download presentation
Presentation is loading. Please wait.
Published byZoe Juliet Johnston Modified over 9 years ago
1
ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012
2
2 Outline Introduction Getting started Design Demonstration References
3
3 Introduction The ns-3 simulator is a discrete-event network simulator targeted primarily for research and educational use. The ns-3 project, started in 2006, is an open-source project developing ns-3.
4
4 Introduction Ns-3 is not an extension of ns-2. Ns-3 does not support the ns-2 APIs. Programs in ns-2 are scripted in OTcl. Some components of ns-2 are written in C++ and others in OTcl. In ns-3, the simulator is written entirely in C++, with optional Python bindings.
5
5 Introduction The ns-3 simulation core supports research on both IP and non-IP based networks. The large majority of its users focuses on wireless/IP simulations which involve models for Wi-Fi, WiMAX, or LTE for layers 1 and 2 and a variety of static or dynamic routing protocols such as OLSR and AODV for IP-based applications.
6
6 Getting started The waf build system Waf is a Python-based framework for configuring, compiling and installing applications. ./configure →./waf – d [optimized-debug] configure ./make →./waf Run programs:./waf – run [program name]
7
7 Getting started Downloading ns-3 ns-3 is primarily developed on GNU/Linux platforms, and the minimal requirements to run basic simulations are a gcc installation of gcc-3.4/g++-3.4 or greater, and python 2.4 or greater.
8
8 Getting started Downloading ns-3 Download and build development version: Ns-3 installation: http://www.nsnam.org/wiki/index.php/Installation
9
9 Design Where is everything located?
10
10 Design The basic model
11
11 Design Channel CsmaChannel PointToPointChannel WifiChannel … Net Device A net device is “ installed ” in a Node in order to enable the Node to communicate with other Nodes in the simulation via Channels.
12
12 Design Available modules
13
13 Design Adding a New Module to ns-3 Ns-3 manual: http://www.nsnam.org/docs/manual/html/ new-modules.html
14
14 Design Structure of an ns-3 program
15
15 Demonstration Run sample script: ns-3.*/examples/ ns-3.*/src/[module(ex. aodv)]/examples Run programs:./waf --run [program name]
16
16 Demonstration Debug(gdb):./waf --command-template="gdb %s" -- run [program name] Debug(LOG): export NS_LOG=[LOG component name]=[LOG level]
17
17 Demonstration Debug(LOG) LOG level NS_LOG_ERROR — Log error messages; NS_LOG_WARN — Log warning messages; NS_LOG_DEBUG — Log relatively rare, ad-hoc debugging messages; NS_LOG_INFO — Log informational messages about program progress; NS_LOG_FUNCTION — Log a message describing each function called; NS_LOG_LOGIC – Log messages describing logical flow within a function; NS_LOG_ALL — Log everything.
18
18 Demonstration first.cc Very simple script 2 nodes Daterate: 2Mbps Delay: 2ms Simulation time: 9s
19
19 Demonstration Run first.cc (ns-3.*/examples/first.cc) cd ns-3.*/examples./waf --run first
20
20 Demonstration Debug(LOG) (ns-3.*/examples/udp/udp-echo.cc) export NS_LOG=UdpEchoClientApplication=level_all./waf --run udp-echo
21
21 References ns-3: http://www.nsnam.org/ ns-3 tutorial: http://www.nsnam.org/docs/release/3.14/tutori al/singlehtml/index.html ns-3 Doxygen: http://www.nsnam.org/doxygen/index.html ns-3 users groop: http://groups.google.com/group/ns-3- users?hl=ja
22
THANK YOU!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.