Applicable Versions
NetSim Academic
NetSim Standard 
NetSim Pro



As of v11 and higher versions, static routes for sensors can be configured through the GUI.


Refer the following article to configure static routing in Netsim devices through GUI:

https://support.tetcos.com/en/support/solutions/articles/14000076254-how-to-setup-static-route-ip-in-netsim-



Applicable Releases
v10.2



As of v10.2 static routes for sensors cannot be configured through the GUI.

Following is a temporary workaround to perform static routing using text files and modifications to the configuration file:


Static routing file format:

route ADD <NETWORK_ADDRESS> MASK <SUBNET_MASK> <GATEWAY_IP> METRIC <INTEGER_VALUE> IF <INTERFACE_ID>

Eg:

route ADD 10.0.0.0 MASK 255.255.0.0 10.0.0.2 METRIC 1 IF 1


A separate Static routing file is required for each device. It is advised to save each file with the file-name containing the device name. For example, the static routing file for Sensor A can be saved as SENSOR_A_STATIC_IP_ROUTE.txt. 


Steps to be followed:


1. Consider the following network scenario with 5 sensor nodes and a sink node:


2. To statically route packets in the following way:


SENSOR A->SENSOR B

SENSOR B->SENSOR C

SENSOR C->SENSOR D

SENSOR D->SENSOR E

SENSOR E->SINKNODE F


With the following default IP assignment:

Device Name

IP Address

Sensor A

10.0.0.1

Sensor B

10.0.0.2

Sensor C

10.0.0.3

Sensor D

10.0.0.4

Sensor E

10.0.0.5

Sink node F

10.0.0.6


We will have to create five static route text files, one for each sensor node

SENSOR_A_STATIC_IP_ROUTE.txt

contains:

route ADD 10.0.0.0 MASK 255.255.0.0 10.0.0.2 METRIC 1 IF 1

SENSOR_B_STATIC_IP_ROUTE.txt

contains:

route ADD 10.0.0.0 MASK 255.255.0.0 10.0.0.3 METRIC 1 IF 1

SENSOR_C_STATIC_IP_ROUTE.txt

contains:

route ADD 10.0.0.0 MASK 255.255.0.0 10.0.0.4 METRIC 1 IF 1

SENSOR_D_STATIC_IP_ROUTE.txt

contains:

route ADD 10.0.0.0 MASK 255.255.0.0 10.0.0.5 METRIC 1 IF 1

SENSOR_E_STATIC_IP_ROUTE.txt

contains:

route ADD 10.0.0.0 MASK 255.255.0.0 10.0.0.6 METRIC 1 IF 1


3. Enable packet trace using the packet trace icon, run simulation and save the network scenario created in the GUI to obtain the Configuration.netsim file.

4. Open the Configuration.netsim file and in the properties of the sensor nodes where you want to perform static routing the following changes(highlighted in red):


<LAYER TYPE="NETWORK_LAYER">


  <ROUTING_PROTOCOL NAME="DSR" SETPROPERTY="TRUE">


    <PROTOCOL_PROPERTY ACK_TYPE="LINK_LAYER_ACK"/>


  </ROUTING_PROTOCOL>


  <PROTOCOL NAME="IPV4" SETPROPERTY="true">


    <PROTOCOL_PROPERTY STATIC_IP_ROUTE="SENSOR_A_STATIC_IP_ROUTE.txt"/>


  </PROTOCOL>


</LAYER>


Here the variable "STATIC_IP_ROUTE" will contain the name of the text file containing the static routes for that specific sensor device.


5. Save the Configuration file with the changes performed.

6. Create a new folder and place the configuration file along with the static routing text files that were created for the sensor nodes.

7. Run NetSim via CLI mode (ref section on running NetSim via CLI in NetSim User Manual) with iopath (input-output path) as the path of the new folder that was created in the previous step.

8. Upon simulation, all the scenario related result files will get created in the new folder. 

9. To access the packet_trace go to the temp path of Netsim (Run, %temp%\netsim).


10. In the XL sheet use 'Format as table' for better visualization and filter only custom packets in the column PACKET_TYPE

11. Now in the TRANSMITTER_ID column, if you filter a specific sensor node, say SENSOR-1 you will be able to see in the RECEIVER_ID column that all packets were sent to only SENSOR-2 as specified in the static route configuration.




For more information visit www.tetcos.com