Open NetSim, Select Examples->IOT-WSN->Internet of Things->Working of RPL Protocol in IoT then click on the tile in the middle panel to load the example as shown in Figure 4‑4.
Figure 4‑4: List of scenarios for the example of Working of RPL Protocol in IoT
The following network diagram illustrates, what the NetSim UI displays when you open the example configuration file.
Figure 4‑5: Network set up for studying the Working of RPL Protocol in IoT
Settings done in sample network:
Grid length(m) 100m, Side Length(m) 50, Manually via Click and Drop.
Routing protocol has set as RPL for 6LOWPAN Gateway and Sensor. Go to properties Network Layer Routing Protocol as shown Figure 4‑6.
Figure 4‑6: Routing Protocol to RPL in Network layer
In Adhoc Link Properties change Channel characteristics Path Loss only, Path Loss Model Log Distance and path loss exponent 3.5
Application properties has set as shown in below Table 4‑1.
|Application ID||Application Type||Source Id||Destination Id|
Table 4‑1: Application properties
Procedure to get detailed RPL log file:
Go to NetSim Home page and click on Your work.
Click on Source code and then click on Open Code and open > the codes in Visual Studio. Set x64 according to the NetSim > build which you are using.
Go to the RPL Project in the Solution Explorer. Open RPL.h file and > change //#define DEBUG_RPL to #define DEBUG_RPL as shown > below Figure 4‑7.
Figure 4‑7: Visual Studio
Right click on the RPL project in the solution explorer and > click on rebuild.
After the RPL project is rebuild successful, go back to the network > scenario.
In NetSim GUI Plots are Enabled. Run simulation for 100 sec and go > to Result window Log Files, open rpl log file.
Figure 4‑8: Simulation Result window
Figure 4‑9: RPL log file
The observations of rpl log file which is generated in NetSim is given in the below Table 4‑2.
|Node||Rank||Updated Rank||Parent list||Updated Parent Node ID||Sibling Node ID||Received DIO From Node ID|
|Node 1||30||28||Node 2, Node 4||Node 2||Node 3||
|Node 2||15||15||Node 6||Node 6||Node 4||Node 4, Node 6|
|Node 3||28||28||Node 2, Node 4, Node 5||Node 4||Node 1||
Node 1, Node 2,
Node 4, Node 5
|Node 4||15||15||Node 6||Node 6||Node 2||
|Node 5||27||27||Node 4||Node 4||-||Node 4|
Table 4‑2: RPL Log file contains Rank, Updated Rank, parent list, Updated Parent Node ID, Sibling Node ID and Received DIO From Node ID etc.
The above table can be summarized as follows:
DIO message is sent by the root node, i.e. LowPAN Gateway, with Rank 1 to Sensor 2 and Sensor 4 as shown Figure 4‑10.
Figure 4‑10: DIO messages sent by the LOWPAN Gateway to Sensors
On receiving the DIO message, Node 4 will recognize the DODAG Id of Root Node and identifies it as Parent node. Rank of Node 4 will get updated to 15. Also, Node 2 is recognized as sibling of Node 4.
Now, node 4 will broadcast DIO message to other nodes as shown Figure 4‑11.
Figure 4‑11: Wireless Sensor 4 broadcasting DIO message to other Sensors
Node 1 receives DIO message from Node 4 and it identifies the DODAG Id of Node 4. Hence, Node 1 recognizes Node 4 as the Parent Node. Rank of Node 1 will get updated to 30. As Node 3 is within the range of Node1, Node 3 is identified as a sibling of Node1.
Node 1 will then broadcast DIO messages as shown Figure 4‑12.
Figure 4‑12: Wireless Sensor 1 broadcasting DIO message to other Sensors
Node 2 receives the DIO message from Node 6 and identifies it as Parent node. The Rank of Node 2 gets updated to 15. Node 2 now broadcasts the DIO message to other nodes as shown Figure 4‑13.
Figure 4‑13: Wireless Sensor 2 broadcasting DIO message to other Sensors
Node 3 receives DIO message from Node 2 and the rank of Node 3 gets updated to 28. Node 2 is identified as the parent node of Node 3.
Node 3 then broadcasts DIO message to other nodes as shown Figure 4‑14.
Figure 4‑14: Wireless Sensor 3 broadcasting DIO message to other Sensors
Node 5 receives DIO message from Node 3, hence, it identifies Node 4 as th parent node. The rank of Node 5 gets updated to 27.
Node 5 then broadcasts DIO message as shown Figure 4‑15.
Figure 4‑15: Wireless Sensor 5 broadcasting DIO message to other Sensors
Further, Node 1 receives DIO message from Node 2 and the parent list of Node 1 gets updated to Node 4 and Node 2. Also, the rank of Node 1 gets updated to 28.
According to the link quality, DODAG is formed.
Node 2 and Node 4 are siblings and their parent is Node 6 (Root > Node). Rank is 15.
Node 1 and Node 3 are siblings.
Node 1 established its parent as Node 2. Rank is 28.
Node 3 establishes its parent as Node 4. Rank is 28.
Node 5 doesn’t have any siblings and establishes its parent as > Node 4. Its rank is 27.
Figure 4‑16: Based on link quality, DODAG is formed and Rank assigned to sensors and lowpan gateway