Download - NS3 Tech Talk

Transcript
Page 1: NS3 Tech Talk

NS3 Tech Talk

in1010 - Redes de Computadores 2015.1 [email protected]

Page 2: NS3 Tech Talk

NS3● Open source simulator for networking

research and education● Core is written entirely in C++● User code (protocols and scenarios)

○ C++○ Python wrappers

● Library-based usage○ http://www.nsnam.org/getting_started.html

Page 3: NS3 Tech Talk

NS3● extensive parameterization system● embedded tracing system● standards outputs

○ txt logs○ PCAPs

Page 4: NS3 Tech Talk

NS3● Discrete event simulator

○ Simulation time moves discretely from event to event○ Schedule events to occur at specific simulation times○ A simulation scheduler orders the event execution○ Simulator execute events one by one ○ Simulation stops at specific time or when events end

Page 5: NS3 Tech Talk

NS3● NS3 vs NS2

○ not a extension○ does not have an OTcl API

Page 6: NS3 Tech Talk

NS3● Nodes

○ Contains Applications, Stacks and NetDevices● NetDevices

○ represents the technology used to communication● Channels

○ NetDevices are strongly bound to Channels of a matching type

Page 7: NS3 Tech Talk

NS3

Page 8: NS3 Tech Talk

NS3

Page 9: NS3 Tech Talk

NS3● Internet Stacks

○ Provides IPv4/IPv6 models● Routing

○ implement the routing protocol class, like Ipv4RoutingProtocol

Page 10: NS3 Tech Talk

NS3

Page 11: NS3 Tech Talk

NS3● Applications

○ a list of application is stored in the Node○ applications are like processes○ make use of a sockets-like API

■ Application::Start() may call ns3::Socket::SendMsg() in a lower layer

Page 12: NS3 Tech Talk

NS3

Page 13: NS3 Tech Talk

NS3● Mobility

○ could set the mobility, position, direction and velocity

Page 14: NS3 Tech Talk

NS3

Page 15: NS3 Tech Talk

NS3

Page 16: NS3 Tech Talk

NS3

Page 17: NS3 Tech Talk

NS3● everything is object

○ similar objects can be grouped in containers○ every object can have attributes

Page 18: NS3 Tech Talk

NS3● Waf build system

○ is a python-based framework for configuring, compiling and installing applications.

○ similar to other tools such as Autotools, CMake, Ant○ http://code.google.com/p/waf/

Page 19: NS3 Tech Talk

NS3● waf key commands

○ configure■ ./waf -d [optimized|debug] configure

○ make■ ./waf

○ run programs■ ./waf --run simple-point-to-point

○ run visualizer■ ./waf --run <program_name> --vis

Page 20: NS3 Tech Talk

NS3● Pyviz Visualizer

Page 21: NS3 Tech Talk

NS3● Writing scripts

○ Create nodes○ Create netDevices with MAC and PHY○ Attach netDevices to nodes and set interconnections○ install protocol stack in nodes○ set network address for interfaces○ setup routing○ install applications in nodes○ set application start and stop time○ set simulation start time○ run simulation

Page 22: NS3 Tech Talk

NS3● Debugging

○ Assertions: NS_ASSERT(expression)■ aborts the program if expression evaluates to

false■ unconditional breakpoints: NS_BREAKPOINT();

○ GDB commands

Page 23: NS3 Tech Talk

NS3● Logging

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.NS_LOG_UNCOND – Log the associated message unconditionally.

Page 25: NS3 Tech Talk

Q&ARodrigo Melo (@rodrigodma)

http://www.slideshare.net/rodrigodma/ns3-tech-talk


Top Related