Configuring Static Routes for a WSN Network by using SDN

In this example static routes are configured in sensors using SDN commands executed in a SDN controller. The WSN network model in this example consists of the following configuration:

  • A subnet with 5 wireless sensor, 1 ad-hoc link, 1 wireless sink node, and a unicast sensor application running on one of the wireless sensors.
  • One wireless Sensor is configured as the SDN controller.
  • A unicast application from Wireless_Sensor_1 to Wireless_Sensor_5.
  • Simulation time of 500 seconds.
  • Packet trace is enabled.

To simulate the example for WSN using SDN:
Open NetSim and Select Examples > Software Defined Networks > WSN StaticRoute then click on the tile in the middle panel to load the example as shown in below screenshot
Figure3-22
The following network diagram illustrates the network setup considered in this example:
Figure3-33

  1. The following settings are done in the application layer properties of the devices for configuring SDN:

    Device Name Open_Flow SDN_Controller SDN_Controller_DeviceName
    Wireless_Sensor_1 Enable FALSE SDN_Controller
    Wireless_Sensor_2 Enable FALSE SDN_Controller
    SDN_Controller Enable TRUE NA
    Wireless_Sensor_4 Enable FALSE SDN_Controller
    Wireless_Sensor_5 Enable FALSE SDN_Controller
    WSN_Sink_6 Enable FALSE SDN_Controller
  2. Click on the Application icon present in the top ribbon/toolbar.
    a. Sensor Application from Wireless_Sensor_1 to Wireless_Sensor_5 with default Generation Rate (Packet Size: 50Bytes, Inter Arrival Time: 1000000µs).
    b. Set Transport Protocol to UDP.

  3. In NetSim GUI Plots and Packet Trace are enabled.
  4. Simulate the example. To do so:
    a. Click on the Run button. The Run Simulation pop-up window appears.
    b. Simulation time is set to 500 seconds.
    c. In the Run time Interaction tab, the Interactive Simulation option is set to True.
    d. Click Accept.
    e. Click OK.
    Simulation (NetSimCore.exe) starts to run. NetSimCore.exe displays the following message: waiting for first client to connect.
  5. To use the SDN CLI Console:
    a. Right-click SDN_Controller and click NetSim Console. Now, the client (NetSimCLI.exe) starts and attempts to establish a connection with NetSimCore.exe.
  6. Interpret the results.
    a. Click View Animation and see the Packet Animation. The packets reach Wireless_Sensor_5 from Wireless_Sensor_1 > SDN_Controller > Wireless_Sensor_5.
    Figure3-24
  7. Configure static routes such that the packets will go through Wireless_Sensor_1 to Wireless_Sensor_5 via SDN_Controller.
    To configure the static routes on SDN_Controller for Wireless_Sensor_1
    a. Run simulation again.
    b. Right-click SDN_Controller and click NetSim Console.
        Now, the client (NetSimCLI.exe) starts and tries to establish a connection with NetSimCore.exe.     NetSim CLI console opens.
    c. Type the following commands on the NetSim CLI console, in the <DeviceName with Device_ID> route add <destination IP address> MASK <subnet mask> <gateway IP address> <metric> if <interface #> format.
    Wireless_Sensor_1 route ADD 11.1.0.0 MASK 255.255.0.0 11.1.1.4 METRIC 1 IF 1
    SDN_Controller route ADD 11.1.0.0 MASK 255.255.0.0 11.1.1.6 METRIC 1 IF 1
  8. Interpret the results.
    a. Click View Animation and see the Packet Animation. The packets reach Wireless_Sensor_5 from Wireless_Sensor_4 > SDN_Controller to Wireless_Sensor_5.
    Figure3-25
    b. In the simulation results window select the Open Packet trace option in the left area. Once the packet trace opens apply filter in the CONTROL_PACKET_TYPE/APP_NAME column to show only OPENFLOW_COMMAND and OPENFLOW_RESPONSE messages.
    You will see that OpenFlow packets flow from Wireless_Sensor_4 to SDN_Controller as part of the static route configuration done via console.