Static Routing in WSN

Open NetSim, Select Examples->IOT-WSN->Wireless Sensor Networks->WSN Static Route then click on the tile in the middle panel to load the example as shown in Figure 4‑41.

Graphical user interface, application Description automatically generated

Figure 4‑41: List of scenarios for the example of WSN Static Route

The following network diagram illustrates, what the NetSim UI displays when you open the example configuration file.

Figure 4‑42: Network set up for studying the WSN Static Route

Without Static Route

Settings done in the network

  • The following Environment properties are already set, as Manually > Via Click and Drop.

  • Set Application type as SENSOR_APP Source_Id as 1 and Destination_Id > as 6

  • Enable Packet trace and Plot option.

  • Click on run simulation and set Simulation Time as 100 sec.

    Results: Open packet animation and check Sensor 1 would send packets directly to the destination.

    Chart Description automatically generated

Figure 4‑43: Packet animation window

Open packet trace and filter PACKET_TYPE column as Sensing and observe the packets flow.

Figure 4‑44: Packet Trace

With Static Route

Settings done in the network

  • In Without Static Route, we have changed Wireless_Sensor > properties as per the following.

Configuring Static Routes

Open Wireless_Sensor properties, go to network layer and Enable - Static IP Route ->click on Configure Static Route IP link, set Network Destination, Gateway, Subnet Mask, Metrics, and Interface ID as shown in below screenshot and click on ADD.

Figure 4‑45: Static IP Routing Configuring window

Device Network Destination Gateway Subnet Mask Metrics Interface ID
Wireless_Sensor_1 11.1.0.0 11.1.1.3 255.255.0.0 1 1
Wireless_Sensor_2 11.1.0.0 11.1.1.4 255.255.0.0 1 1
Wireless_Sensor_3 11.1.0.0 11.1.1.5 255.255.0.0 1 1
Wireless_Sensor_4 11.1.0.0 11.1.1.6 255.255.0.0 1 1

Table 4‑8: Static Route Configuration for Sensors

  • After setting the properties click on run simulation and set > Simulation Time as 100 sec.

    Results

    Open packet animation and check packets would reach the destination via the configured static route,

    SENSOR_1 SENSOR_2 SENSOR_3 SENSOR_4 SENSOR_5 SINKNODE_6

Figure 4‑46: Packets flow in animation window as specified in the static route configuration

Open packet trace and filter PACKET_TYPE column to Sensing and observe the packets flow as specified in the static route configuration.

SENSOR_1 SENSOR_2 SENSOR_3 SENSOR_4 SENSOR_5 SINKNODE_6

Figure 4‑47: Packet flow in Packet Trace