Presentation is loading. Please wait.

Presentation is loading. Please wait.

OPNET TM Modeler CS 541 Advanced Networking Spring 2009.

Similar presentations


Presentation on theme: "OPNET TM Modeler CS 541 Advanced Networking Spring 2009."— Presentation transcript:

1 OPNET TM Modeler CS 541 Advanced Networking Spring 2009

2 Outline  Getting Started  Implement Custom Protocols  Wireless Network Issues  Debugging

3 Introduction  OPNET (www.opnet.com)www.opnet.com  Discrete time simulation  Shipped with lots of models written in C  Platform: Windows/Linux  Programming Languages: C/C++  GUI/command line simulation

4 Getting Started  Modeler Tutorials: [Help - Tutorials]  Go through all of them  Module Tutorials  Creating a Wireless Network

5 General Simulation Steps  Create network scenario(s)  Configure nodes  Create traffic  Configure/run simulation  Choose statistics  Configure/run simulation  View results (Export data)

6 OPNET Object Hierarchy C/C++ Code Process Node Subnet Scenario Project

7 Communication Entities  Packets  Inter/intra node communication  Recursively organized  Structure vs. Physical Layout  ICI (Interface Control Information)  Within a node, between different layers/process models

8 Implement Custom Protocols  Create new process models  Modify existing process models  Create new packet formats  Create/modify node models

9 MANET routing protocols ip_dispatch manet_mgraodv_rtedsr_rtegrp_rte…

10 Node Model: manet_station_adv

11

12 Process Model: manet_mgr

13 Create a New Process Model  Easier to copy and modify on exist model  Modifications:  The FSM (finite state machine)  State variables  Header/Function/… blocks, excecutives  External files (.h,.ex.c,.ex.cpp)  Add/modify attributes: model/global  Add/modify statistics: local/global

14 Add Support for New Model  Modify corresponding.h files, adding constants and enums  Declare pf_rte as child process of manet_mgr  Modify manet_mgr model:  Add attributes for pf_rte  Add code to create and invoke pf_rte process  Add code to dispatch packets to pf_rte  Use text search tools to help

15 OPNET Wireless Suite  Pipeline Stages  Node Mobility  Antenna Pattern  Terrain Effects

16 Understand Pipeline Stages  Pipeline – sequence of calculations  Point-to-Point Pipeline Models  Bus Pipeline Models  Radio Pipeline Models

17 Radio Pipeline Stages (Tx side) 1. Receiver Group 2. Transmission Delay 3. Link Closure 4. Channel Match 5. Tx Antenna Gain 6. Propagation Delay

18 Radio Pipeline Stages (Rx side) 7. Rx Antenna Gain 8. Received Power 9. Interference Noise 10. Background Noise 11. Signal-to-Noise Ratio 12. Bit Error Rate 13. Error Allocation 14. Error Correction

19 Default Pipeline Stages  Default stages  / /models/std/links  / /models/std/wireless  Default stage prefixes  dpt_* - default point-to-point  dbu_* - default bus  dra_* - default radio

20 Customize Pipeline Stages  Write own.ps.c /.ps.cpp  Interface: void pipeline_stage (Packet *);  Compilation  GUI – compile button  CMD – op_mko -type ps -m  Generate.ps.o /.ps.obj

21 Assign Pipeline Stage to Module In node model, set the attributes of radio transmitter or receiver objects An attribute for each pipeline stage

22 Skip Pipeline Stages  To speed up simulations  Set the pipeline stage attribute to NONE  A fixed pre-determined value will be used.

23 Modeling Node Mobility  4 methods:  Use trajectory files  Specify a “motion vector” via attributes  Random Waypoint Model  Update node position programmatically

24 Trajectory Files  Path of a mobile node during a simulation in a text file (.trj)  Absolute / relative positions

25 Motion Vector  Move along a great circle around the earth  Bearing / ground speed / ascent rate (advanced attributes)

26 Random Waypoint  Node moves randomly from one waypoint to another  Trajectory recording

27 Mobility KPs  op_ima_obj_pos_get ()  op_ima_obj_pos_get_time ()  op_ima_obj_pos_notification_register ()  op_ima_obj_pos_query_proc_set ()  op_ima_obj_pos_set_geocentric ()  op_ima_obj_pos_set_geodetic ()

28 Antenna Modeling  Antenna Pattern Editor  Visualize pattern in 3D  Specify gains (φ, θ)  Normalization  Consult Naraj

29 Terrain Effects  Calculated in pipeline stage: Closure  Without TMM module:  LOS (Line Of Sight) with earth curve considered  With TMM module:  Free space  Longley-Rice  TIREM

30 Find and Install Terrain Data  DTED files .dt0,.dt1,.dt2  USGS DEM files .dem

31 Display Elevation Maps.el files, can be generated by OPNET using terrain data

32 Select a Propagation Model

33 Debugging  Strategy  Select Kernel  ODB  C/C++ Debugger

34 Debugging Strategy  Looking for clues:  Compiler warnings  DES Log  Error Log  OPNET Debugger (ODB)  Memory tracking  Animation and live statistics  Narrow down the problem  Time (simulation time, event#, packet#)  Location (node, module, process, code)

35 Simulation Kernels  Development Kernels  Allows ODB  OPNET Profiler  Detailed error messages  Slower simulation execution  Slightly higher memory usage  Optimized Kernels  Use for production

36 ODB Features  Graphical interface  Step through events  Breakpoints for specific  Event, time, module, process, packet  Trace Kernel Procedures (KPs)  Print out current status of simulation entities  Print out memory usage statistics  Pass control to and from a C/C++ debugger

37 Make codes easy to debug  Prefer op_prg_odb_print () over printf ().  Use op_sim_error () for errors.  Use FIN/FOUT/FRET in every function.  Helps OPNET to display the function call stack  Write traces and label them.  Write diagnostic blocks  Only invoked in ODB

38 Use a C/C++ Debugger  Compiling a process model generates a C/C++ file:.pr.c or.cpp  Primary functions  unchanged  Executives / transitions  macros  Temporary variable block  local variables  State variables  fields of a struct  var_name  op_sv_ptr->var_name

39 Use a C/C++ Debugger with ODB  Run the simulation with ODB enabled  The simulation stops before the first event  Attach the C/C++ debugger to the simulation process  Set breakpoints in ODB or the C/C++ debugger  Continue from the C/C++ debugger  Continue in ODB

40 Questions?


Download ppt "OPNET TM Modeler CS 541 Advanced Networking Spring 2009."

Similar presentations


Ads by Google