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
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
What 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