Interfacing NetSim with MATLAB

NetSim now provides users the ability to interface with MATLAB in run time


Underlying Theory:
MATLAB provides API’s to start and end the MATLAB process and send data / commands to and from MATLAB. NetSim runs these functions during initialization to simultaneously start-up a MATLAB process and whenever required send data to & from MATLAB in run time. NetSim ends the MATLAB process upon completion of the simulation.

Interfacing: An interfacing file named as NetSim_MATLAB_Interface.c is used to control the MATLAB computational engine and contains the functions –

fn_netsim_matlab_init() – which starts the MATLAB Process

fn_netsim_matlab_run() – which sends data to and from MATLAB, and sends commands to be processed in MATLAB

fn_netsim_matlab_finish() – which ends the MATLAB Process

ExMATLABCall_Ver2_4web

 

Example of MATLAB call from WLAN PHY layer in NETSIM

Example Application: In this example, we replace NetSim’s default Rayleigh fading with the Nakagami fading model from MATLAB. Calls to the above functions are made at appropriate places in the NetSim code. So, for each packet, MATLAB calculates the Nakagami fading value in run time. This value returned by MATLAB is used by NetSim as the fading power instead of using the Rayleigh model. Note that instead of sending the commands directly from NetSim to MATLAB, we can also use a MATLAB .m file which will contain the commands to be executed by MATLAB.

Video: Interfacing NetSim with MATLAB is available at https://www.youtube.com/watch?v=-c9zGfwci2g

IOT : Accelerate your research using NetSim C libraries

IOT_Scenario_Blog-01
Research areas in IOT
  • Seamless integration of heterogeneous devices
  • Network architecture for IOT
  • Energy management and sustainable operation of IOT
  • 6LoWPAN based IOT design
  • Modeling and simulation of large scale IOT network
Write your own code
  • Create custom protocols using NetSim’s simulation API’s
  • Interface with other software products like MATLAB
  • Debug your code (step-in, step-out, step-over, continue) and watch your variables in sync with simulation
NetSim IOT features
  1. Create scenario , simulate and observe the performance of 6LoWPAN network
  2. Devices: Sensor Motes, 6LoWPAN Gateway, Routers, Switches, AP and Nodes can be used for the scenario building and simulation
  3. Data Link layer: Unslotted CSMA/CA, Slotted CSMA/CA, CCA
  4. Physical layer: Received Power Calculation, Fading, Shadowing, SINR calculation, BER calculation, Collision and error checking
  5. Sensor Mobility model, Sensing parameters, Packet generation, Packet Reception
  6. Radio Energy and Power Management
  7. Network layer can run both on IPV4 and IPv6
  8. Routing via AODV (RFC 3561), OLSR (RFC 3626), ZRP
  9. 6LoWPAN gateway will switch the packet from one network to another
  10. Facility to conduct various experiments for differing input / output parameters
  11. Input: Beacon Order, Super frame Order, Back off Exponent, Power Consumption, Battery life extension, CCA type, Receiver Sensitivity, ED Threshold, Channel Characteristics
  12. Output: Routing Overhead, Delay, Power Consumption, Lifetime of motes, Packet Delivery ratio, Routing Time, Actual Vs. Sensed path of agent

NetSim Emulator – Run live applications over virtual networks

Emulator_BlogWhat is a network emulator?
A NetSim emulator enables you to run real applications over virtual networks with wide selection of network conditions like error, delay, loss etc. Use of an emulator from development through pre-deployment phases obviates the need of redesigning, testing and tuning your applications, thus saving time, effort and eventually cost of setting up a network.

What you can do with NetSim Emulator?
• Network design and validation – Military radios, SCADA, Metro rail etc
• Application performance testing
• R&D in new protocol design
• Perform what-if analysis

What are the benefits of NetSim Emulator?
• Emulate a wide range of technologies – Switching, Routing, MANETs, Cognitive Radio networks, 4G-LTE networks, ZigBee networks
• A cost effective alternative to hardware emulators that have high costs and limited scale
• Reduced learning curve through agile testing in lab without complicated configuration

How does it work?
• Create the desired network in the Emulation server using NetSim GUI
• Run emulation client in the PC’s/VM’s where your live applications run
• Set the device IP addresses per the real PC/VM in the simulated network. Each live PC/VM corresponds to a node in the simulated network.
• Run your application and the emulation server
• Measure your application performance

You may view this introductory video on network emulation and how NetSim emulator works  https://www.youtube.com/watch?v=OwOw10LuYbQ