Featured Examples
NetSim provides inbuilt examples to get started with the SDN module. To access these examples, you can go to Examples > Software-Defined-Networks in the NetSim Home Screen. You can change the default values of the parameters in these examples and see how they affect the performance of the SDN network.
Configuring SDN
Configuring One SDN Controller in a Simple Internetwork
The Internetwork model in this example consists of the following configuration:
A subnet with 2 wired nodes, 3 routers, and a unicast application running on one of the wired nodes.
Only one router is configured as the SDN controller.
Open Flow protocol is enabled on all wired nodes and routers.
A unicast application is set between Wired Node 1 to Wired Node 2.
Set Transport Protocol to TCP in Application Properties.
Simulation time is set to 500 seconds.
Packet trace is enabled.
To simulate the example for One SDN controller in an Internetwork:
Open NetSim and Select Examples > Software Defined Networks > Configuring SDN > SDN Internetworks then click on the tile in the middle panel to load the example as shown in below
Figure-1: List of scenarios for the example of SDN Internetworks
The following network diagram illustrates what the NetSim UI displays when you open the example configuration file for SDN as shown Figure-2.
Figure-2: Network set up for studying the SDN Internetworks
In the application layer of the SDN Controller node:
SDN Controller option set to TRUE.
Open Flow protocol is enabled.
The following image illustrates the settings done in the SDN controller device:
Figure-3: Application Layer properties Window of SDN_Controller device
In the other devices (Routers and wired node) that are part of the network,
SDN Controller option is set to FALSE.
SDN Controller DeviceName is set as “SDN Controller” which is the name of the controller node.
Open Flow protocol is enabled.
The following image illustrates settings done in the other devices:
Figure-4: SDN Controller DeviceName is set as SDN Controller in Application layer
The following table lists the settings done in all the devices that are part of the network:
Device Name |
Open Flow |
SDN Controller |
SDN Controller DeviceName |
|---|---|---|---|
Wired Node 1 |
Enable |
FALSE |
SDN Controller |
Router 3 |
Enable |
FALSE |
SDN Controller |
SDN Controller |
Enable |
TRUE |
NA |
Router 5 |
Enable |
FALSE |
SDN Controller |
Wired Node 2 |
Enable |
FALSE |
SDN Controller |
Table-1: Set the properties for all the devices
Configure an application between any two nodes in the scenario by selecting an application from the Set Traffic tab.
CBR Application from Wired Node 1 to Wired Node 2 with 50 Mbps Generation Rate (Packet Size: 1460Bytes, Inter Arrival Time: 233.6µs).
Set Transport Protocol to TCP.
Before simulating the example, Right-click SDN Controller and select NetSim Console. Now, the client (NetSimCLI.exe) waits to establish a connection with NetSimCore.exe as shown below.
Figure-5: Connection Establishment
Follow the below steps to simulate an example.
Click on the Options tab. Select Run time interaction.
Figure-6: Run Time Interaction option in NetSim GUI
In the Run Time Interaction tab, set Interactive Simulation to True and click on OK.
Figure-7: Enable Interactive Simulation
Click on Run Simulation window and simulate it to 500 secs.
Figure-8: Run Simulation Window
Simulation (NetSimCore.exe) starts to run. NetSimCore.exe displays the following message: waiting for the first client to connect.
Figure-9: Waiting for first client to connect.
Use this console to execute SDN commands as explained in section CLI Commands for SDN in NetSim.
Configuring Multiple SDN Controllers in a Wireless Sensor Network
In this example, multiple SDN controllers are configured in a Wireless Sensor Network.
The Wireless Sensor Network model in this example consists of the following configuration:
A subnet with 4 wireless sensors,1 ad-hoc link, 1 WSN sink node, and a unicast sensor application running on one of the wireless sensors.
Set Transport Protocol to TCP in Application Properties.
Two wireless sensors are configured as SDN controllers.
Open Flow protocol is enabled on all wireless sensors and sink node.
NetSim uses the following defaults for this SDN example:
The unicast application transmits data from Wireless Sensor 3 to Wireless Sensor 5.
Simulation runs for 500 seconds.
Packet trace is enabled.
NOTE: For a WSN network, ping command is not supported on ZigBee device since these nodes do not support ICMP protocol.
To simulate the example for multiple SDN controllers in WSN for SDN:
Open NetSim and Select Examples > Software Defined Networks > Configuring SDN > WSN Setting Multiple SDN Controllers then click on the tile in the middle panel to load the example as shown in below screenshot
Figure-10: List of scenarios for the example of WSN Setting Multiple SDN Controllers
The following network diagram illustrates the network setup related to this example as shown below Figure-11.
Figure-11: Network set up for studying the WSN Setting Multiple SDN Controllers
The SDN Controller Sensors, Wireless Sensors and the sinknode are configured as SDN controllers with Open Flow protocol enabled in all the nodes.
The following image illustrates the settings done in the sensors configured as SDN controller as shown below Figure-12.
Figure-12: Application Layer properties Window
The sensor SDN Controller Sensor 1 is set as the SDN controller for Wireless Sensor 3 and SDN Controller Sensor 2 is set as the SDN controller for Wireless Sensor 5.
The following image illustrates the settings done in sensor 3 as shown Figure-13.
Figure-13: SDN Controller DeviceName is set as SDN Controller in Application layer
The following table lists the default setting for the wireless sensors.
Device Name |
Open Flow |
SDN Controller |
SDN Controller DeviceName |
|---|---|---|---|
SDN Controller Sink Node |
Enable |
TRUE |
NA |
SDN Controller Sensor1 |
Enable |
TRUE |
NA |
SDN Controller Sensor2 |
Enable |
TRUE |
NA |
Wireless Sensor3 |
Enable |
FALSE |
SDN Controller Sensor1 |
Wireless Sensor5 |
Enable |
FALSE |
SDN Controller Sensor2 |
Table-2: Set the properties for all the devices
Configure an application between any two nodes in the scenario by selecting an application from the Set Traffic tab.
Sensor Application from Wireless Sensor 3 to Wireless Sensor 5 with Packet Size: 50Bytes, Inter Arrival Time: 1000000µs).
Set Transport Protocol to TCP.
Packet trace is enabled under configure reports tab.
To use the SDN CLI Console:
Right-click SDN Controller Sensor1 or SDN Controller Sensor2 and click NetSim Console. Now, the client (NetSimCLI.exe) starts and tries to establish a connection with NetSimCore.exe.
The following image illustrates the NetSim CLI console.
Figure-14: Connection established.
Simulate the example. To do so:
Click on the Options tab. Select Run time interaction.
Figure-15: Run Time Interaction in NetSim GUI
In the Run time Interaction tab, Interactive Simulation option is set to True and click on OK.
Figure-16: Runtime Interaction window
Click on the Run Simulation window and simulate it to 500 sec.
Figure-17: Run Simulation Window
Figure-18: Waiting for first Client to Connect
You can execute various SDN commands that are supported in any of the SDN controller Sensor CLI in Figure-14.
Configuring Static Routes for a MANET Network by using SDN
In this example static routes are configured using the SDN controllers, in a MANET network.
The MANET network model in this example consists of the following configuration:
A subnet with 5 wireless nodes and 1 ad-hoc link, and a unicast CBR application running on one of the wireless nodes.
DSR is the routing protocol that is enabled on all wireless nodes.
One wireless node is configured as the SDN controller.
Wireless nodes do not have mobility.
A unicast application is configured from Wireless Node 1 to Wireless Node 5.
Simulation time is set to 500 seconds.
Packet trace is enabled.
To simulate the example for MANET using SDN:
Open NetSim and Select Examples > Software Defined Networks > MANET StaticRoute then click on the tile in the middle panel to load the example as shown in below screenshot
Figure-19: List of scenarios for the example of MANET StaticRoute
The following network diagram illustrates the network setup as shown Figure-20.
Figure-20: Network set up for studying the MANET Static Route
DSR routing protocol is configured in Network layer for all the nodes and set the nodes to be stationary.
Mobility model is set to NO MOBILITY in all the nodes.
ICMP protocol is enabled in the network layer properties of all the wireless nodes.
Open flow protocol is enabled in all the wireless nodes.
The following settings were done in the wireless nodes to configure Wireless Node 4 as SDN controller and other nodes as its clients.
Device Name |
Open Flow |
SDN Controller |
SDN Controller DeviceName |
|---|---|---|---|
Wireless Node 1 |
Enable |
FALSE |
SDN Controller |
Wireless Node 2 |
Enable |
FALSE |
SDN Controller |
Wireless Node 3 |
Enable |
FALSE |
SDN Controller |
SDN Controller |
Enable |
TRUE |
N/A |
Wireless Node 5 |
Enable |
FALSE |
SDN Controller |
Table-3: Set the properties for all the devices
Configure an application between any two nodes in the scenario by selecting an application from the Set Traffic tab.
CBR Application from Wireless Node 1 to Wireless Node 5 with 0.584 Mbps Generation Rate (Packet Size: 1460Bytes, Inter Arrival Time: 20000µs).
Set Transport Protocol to UDP.
Click on link , expand the right-side property panel and set Channel Characteristics: Path Loss Only, Path Loss Model: Log Distance, Path Loss Exponent: 2.5.
In NetSim Packet Trace is enabled under configure reports tab.
To use the SDN CLI Console:
Right-click SDN Controller and select NetSim Console. Now, the client (NetSimCLI.exe) starts and attempts to establish a connection with NetSimCore.exe.
Figure-21: Connection established.
Simulate the example. To do so:
Click on the Options tab. Select Run time interaction.
Figure-22: Runtime Interaction in GUI
In the Run time Interaction tab, Interactive Simulation option is set to True and click on OK.
Figure-23: Enabling Run Time Interaction option.
Click on Run simulation window and simulate it to 500 sec.
Figure-24: Run Simulation window
Simulation (NetSimCore.exe) starts to run. NetSimCore.exe displays the following message: waiting for the first client to connect.
Figure-25: Waiting for the first Client to connect.
Interpret the Results
In the simulation results window select the Traces option in the left area and open the packet trace file. Once the packet trace opens apply filter in the CONTROL PACKET TYPE/APP NAME for APP1 CBR.
The packets reach Wireless Node 5 from Wireless Node 1-> Wireless Node 3-> Wireless Node 5.
Figure-26 : Packet trace screenshot
For the same example, configure static routes such that the packets will go through Wireless Node 1 > Wireless Node 2, Wireless Node 3, SDN Controller to Wireless Node 5. To configure the static routes on SDN Controller for all the nodes.
Right-click SDN Controller and select NetSim Console.
Re- run the simulation.
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_Node_1 route ADD 192.168.0.6 MASK 255.255.255.0 192.168.0.3 METRIC 1 IF 1
Wireless_Node_2 route ADD 192.168.0.6 MASK 255.255.255.0 192.168.0.4 METRIC 1 IF 1
Wireless_Node_3 route ADD 192.168.0.6 MASK 255.255.255.0 192.168.0.5 METRIC 1 IF 1
SDN_Controller route ADD 192.168.0.6 MASK 255.255.255.0 192.168.0.6 METRIC 1 IF 1
Figure-27: NetSim Console Window
Interpret the Results.
Open Packet trace and filter CONTROL PACKET TYPE/APP NAME to APP1 CBR, you will see that data packets transmitted from Wireless Node 1 > Wireless Node 2 > Wireless Node 3 > SDN Controller to Wireless Node 5 as part of the commands executed for static route configuration.
Figure-28: Packet Trace Window
Configuring Static Routes for Internetworks using SDN
In the example the IP tables in the nodes and routers on an SDN network are modified using SDN CLI commands.
The network model in this example consists of the following configuration:
A subnet with 2 wired nodes, 5 routers, and a unicast application running on one of the wired nodes.
SDN controller running on one of the router.
Set Transport Protocol to TCP in Application. Open Flow protocol is enabled on all wired nodes and routers.
A unicast application set from Wired Node 1 to Wired Node 2.
OSPF is the routing protocol in the routers.
The node SDN Controller is configured to be the SDN controller.
Simulation time is set to 500 seconds.
Packet trace, and Event trace are enabled.
To simulate SDN and change the IP tables:
Open NetSim and Select Examples > Software Defined Networks > Internetworks StaticRoute then click on the tile in the middle panel to load the example as shown in below screenshot.
Figure-29: List of scenarios for the example of Internetworks StaticRoute
The following network diagram illustrates the network setup related to this example as shown below Figure-30.
Figure-30: Network set up for studying the Internetworks Static Route
Configure an application between any two nodes in the scenario by selecting an application from the Set Traffic tab.
CBR Application from Wired Node 1 to Wired Node 2 with 50 Mbps Generation Rate (Packet Size: 1460Bytes, Inter Arrival Time: 233.6µs).
Application Start time is 30 sec.
Set Transport Protocol to TCP.
Packet Trace and Event Trace features are enabled from Configure Reports.
To use the SDN CLI: Right-click SDN Controller and select NetSim Console. Now, the client (NetSimCLI.exe) starts and attempts to establish a connection with NetSimCore.exe.
Figure-31: Connection Establishment.
Simulate SDN. To do so,
In the Run time Interaction under options tab, Interactive Simulation option is set to True.
Click the Run button. The Run Simulation pop-up window appears.
Simulation time is set to 500 Seconds.
Interpret the results.
Open packet trace and filter the CONTROL PACKET TYPE/APP NAME to APP1 CBR, and PACKET ID to 1. Packets reach Wired Node 2 via Wired Node 1 > Router 3 > SDN Controller > Router 6 as shown in Figure-32.
Figure-32: Packet Animation window
Click View Results on the tool bar, Link metrics in the left area and check the Detailed View check box in the Link Metrics Table pop-up window. You will not see data packet transmissions in links 2, 3, and 4 as shown in below Figure.
Figure-33: Link Metrics table in Result Window
For the same example, configure static routes on Router 3 such that all traffic bound for the 11.0.0.18 subnet will go to a gateway 11.0.0.2, that is, from Router 3 > Router 4 > Router 5 > Router 6.
To configure the static routes for Router 3:
Simulate the network again by following below steps
Now, right-click SDN Controller and click NetSim Console.
Now, the client (NetSimCLI.exe) starts and attempts to establish a connection with NetSimCore.exe. NetSim CLI console opens.
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.
Router_3 route ADD 192.169.0.2 MASK 255.255.255.0 11.0.0.2 METRIC 1 IF 2
(Optional) To check the static routes on ROUTER 3, type ROUTER_3 route print. The following image illustrates step (c) and (d) as shown below Figure-34.
Figure-34: Route added to network and route printed in command.
Interpret the results.
Click packet trace from the results dashboard.
The packets reach Wired Node 2 via Router 3 > Router 4 > Router 5 > Router 6.
Click Link metrics in the left area and check the Detailed View check box in the Link Metrics Table pop-up window.
You will see data packet transmissions in Links 2, 3, and 4.
The following figure illustrates step (7c) as shown in below.
Figure-35: Link Metrics Table
In the simulation results window click on the Open Packet trace option in the left area. Once the packet trace opens, apply display filters to the
CONTROL PACKET TYPE/APP NAME column to show only OPENFLOW COMMAND and OPENFLOW RESPONSE packets.
You will see that OpenFlow packets flow between Router 3 to SDN Controller.
In Router 3 under application layer use routing protocol as RIP
Configure static routes for Router 3 as follows:
Simulate SDN (Refer step 4).
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.
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.
Router_3 route ADD 192.169.0.2 MASK 255.255.255.0 11.0.0.26 METRIC 1 IF 2
Interpret the results.
Click View Packets and see the Packet Trace. The packets reach Wired Node 2 via Router 3 > SDN Controller > Router 6.
Figure-36: Packet flow in trace file after executing the static routes for Router 3
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
Figure-37: List of scenarios for the example of WSN StaticRoute
The following network diagram illustrates the network setup considered in this example:
Figure-38: Network set up for studying the WSN Static Route
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 |
Table-4: Set the properties for all the devices
Configure an application between any two nodes in the scenario by selecting an application from the Set Traffic tab.
Sensor Application from Wireless Sensor 1 to Wireless Sensor 5 with default Generation Rate (Packet Size: 50Bytes, Inter Arrival Time: 1000000µs).
Set Transport Protocol to UDP.
Before Simulating the scenario, Right-click SDN Controller and click NetSim Console. Now, the client (NetSimCLI.exe) waits to establish a connection with NetSimCore.exe.
Figure-39: Connection Establishment.
Enable the packet trace from the Configure Reports tab and click on the Options tab and select Run time interaction.
Figure-40: Runtime Interaction in GUI
In the Run time Interaction tab, Set the Interactive Simulation option as True and click on OK.
Figure-41: Runtime Interaction Window
Click on Run simulation window and simulate it to 500 sec.
Figure-42: Run Simulation Window
Simulation (NetSimCore.exe) starts to run. NetSimCore.exe displays the following message: waiting for the first client to connect.
Figure-43: Waiting for Client to connect.
Observe the packet trace after simulation, you will see the direct communication between wireless sensor 1 and 5.
Figure-44: Direct communication between node 1 and node 5 in packet Animation window
For the same example, 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 in SDN Controller for Wireless Sensor 1 follow the above step 3 as explained above
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 192.168.0.6 MASK 255.255.255.0 192.168.0.4 METRIC 1 IF 1
SDN_Controller route ADD 192.168.0.6 MASK 255.255.255.0 192.168.0.6 METRIC 1 IF 1
Interpret the results.
Open Packet trace and filter the CONTROL PACKET TYPE/APP NAME to show only APP1 SENSOR APP, you will see that data packet flow from wireless sensor 1 to wireless sensor 5 through SDN Controller.
Figure-45: Communication between Sensor 1 > SDN Controller > Sensor 5 in packet trace window
Latest FAQs
You can refer to the up-to-date FAQs about NetSim’s SDN library at https://tetcos.freshdesk.com/support/solutions/folders/14000122307.