Interactive Simulation is a powerful new feature introduced in NetSim v11. Prior to v11 users could only input the parameters before simulation started and analyze the output after completion. Now with v11 and higher versions, Interactive Simulation allows users to control/change simulation during runtime. It offers a run-time interface. Each device in NetSim has a device console that can be accessed during the simulation.
Users can perform various operations to control simulation and modify route tables and firewall rules, etc as the simulation is progressing.
Interactive Simulation can be enabled before running simulations using the Run time interaction tab present in the Run Simulation window as shown below:
NetSim device console can be accessed by right-clicking on any device and selecting the NetSim Console, after starting the simulation.
Shown below on the left is NetSim's simulation console where simulation has been started with Interactive Simulation set to true. On the right is the console of a device that is started by right-clicking on the device and selecting the NetSim console option.
In terms of simulation control, the interface allows users to pause, pause at a specified time, continue with the simulation, stop the simulation, reconnect the device console, and exit the simulation.
Users can access modify and remove entries from the route tables of the devices using various route commands like the windows route commands.
It also allows configuring access control rules on the go-to filter traffic at the routers. ICMP ping can be initiated from the device console using Device name or IP address and the same can be visualized using the Wireshark packet capture option.
Advantages of NetSim Socket Interface:
- NetSim’s socket interface can be used to implement new routing protocols.
- No changes to NetSim protocol source codes are required if the existing command set is sufficient for the implementation.
- Users can perform coding in any programming language of their choice, for the socket client.
- It is also OS independent, the client program can run in Windows/Linux/MAC environments.
- Users can add their own commands to NetSim’s CLI interpreter whose source codes are open for user modification.
Connections are made using the port and IP address/Loopback address of the system running NetSim.
NetSim provides a TCP socket with which a socket program/application written in any programming language can establish a connection. The conversation can remain until the connection is terminated by either side.
By default, NetSim users the port 8999 in which it listens for any incoming connections. Client programs can connect to the NetSim socket using the loopback/IP address of the system running NetSim along with the port number 8999.
A client socket program written in Python can connect to the NetSim Server process in a similar way as depicted here using the loopback address 127.0.0.1 and port 8999.
Please refer to the following knowledge base article which explains an example related to the NetSim python interface along with source codes and procedure: