1 / 40

OPNET TM Modeler

OPNET TM Modeler. CS 541 Advanced Networking Spring 2009. Outline. Getting Started Implement Custom Protocols Wireless Network Issues Debugging. Introduction. OPNET ( www.opnet.com ) Discrete time simulation Shipped with lots of models written in C Platform: Windows/Linux

lillian
Download Presentation

OPNET TM Modeler

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OPNETTM Modeler CS 541 Advanced Networking Spring 2009

  2. Outline • Getting Started • Implement Custom Protocols • Wireless Network Issues • Debugging

  3. Introduction • OPNET (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

  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

  10. Node Model: manet_station_adv

  11. Process Model: manet_mgr

  12. 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

  13. 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

  14. OPNET Wireless Suite • Pipeline Stages • Node Mobility • Antenna Pattern • Terrain Effects

  15. Understand Pipeline Stages • Pipeline – sequence of calculations • Point-to-Point Pipeline Models • Bus Pipeline Models • Radio Pipeline Models

  16. Radio Pipeline Stages (Tx side) • Receiver Group • Transmission Delay • Link Closure • Channel Match • Tx Antenna Gain • Propagation Delay

  17. Radio Pipeline Stages (Rx side) • Rx Antenna Gain • Received Power • Interference Noise • Background Noise • Signal-to-Noise Ratio • Bit Error Rate • Error Allocation • Error Correction

  18. Default Pipeline Stages • Default stages • <opnet_dir>/<rel_dir>/models/std/links • <opnet_dir>/<rel_dir>/models/std/wireless • Default stage prefixes • dpt_* - default point-to-point • dbu_* - default bus • dra_* - default radio

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

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

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

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

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

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

  25. Random Waypoint • Node moves randomly from one waypoint to another • Trajectoryrecording

  26. 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 ()

  27. Antenna Modeling • Antenna Pattern Editor • Visualize pattern in 3D • Specify gains (φ, θ) • Normalization • Consult Naraj

  28. 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

  29. Find and Install Terrain Data • DTED files • .dt0, .dt1, .dt2 • USGS DEM files • .dem

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

  31. Select a Propagation Model

  32. Debugging • Strategy • Select Kernel • ODB • C/C++ Debugger

  33. 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)

  34. Simulation Kernels • Development Kernels • Allows ODB • OPNET Profiler • Detailed error messages • Slower simulation execution • Slightly higher memory usage • Optimized Kernels • Use for production

  35. 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

  36. Make codes easy to debug • Prefer op_prg_odb_print<major/minor> () 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

  37. Use a C/C++ Debugger • Compiling a process model generates a C/C++ file: <model_name>.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

  38. 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

  39. Questions?

More Related