NetSim Simplifies Custom Code Development

Most simulation software demand considerable knowledge of the tool by the users before starting to develop code. This is a daunting task. An objective of NetSim is to make code modification and development simpler with a much shorter learning curve. Here are three simple steps on how to start customization of code.
Example: Printing “Hello world” inside NetSim’s TCP protocol.Step 1: Set up your project: Set your compiler such that your project code compiles into a Dynamic Link Library (DLL).Step 2: Copy source code: NetSim’s installation directory contains the source code for all protocols in folder ../NetSim/Simulation/src Copy paste the following files:
a. Header files related to TCP from the path ../src/simulation/include
b. Lib files related to TCP from the path ../src/simulation/lib
c. Source files related to TCP from the path ../src/Simulation/tcp
Step 3: Modify code and replace the binary: Open TCP.c and write the Hello World print statement just after the TCP init function. Then build your code and replace the existing binary of NetSim (libTCP.dll in../NetSim/Simulation/bin) with your libTCP.dll. Next, run a simulation you would see “Hello World” in command line.
Watch this video to see how to write custom code in NetSim

Comments are closed.