The basic assumption of this tutorial is that you know the working of the Routing Protocol for Low-Power and Lossy Networks (RPL). Here the Contiki OS 2.7v implementation of RPL is used and explained.<br> The following are explained in this tutorial:
 
The basic assumption of this tutorial is that you know the working of the Routing Protocol for Low-Power and Lossy Networks (RPL). Here the Contiki OS 2.7v implementation of RPL is used and explained.<br> The following are explained in this tutorial:
 
* Different RPL related functions and their working
 
* Different RPL related functions and their working
* Modifying an existing RPL objective function
+
* Example scenarios and modification of RPL Objective Function
 
* Simulation in Cooja using DGRM model
 
* Simulation in Cooja using DGRM model
       
==== calculate_rank(rpl_parent_t *p, rpl_rank_t base_rank)====
 
==== calculate_rank(rpl_parent_t *p, rpl_rank_t base_rank)====
[[File:CalcRank.png|frame|right|If parent is NULL then base_rank is incremented by a default increment else it uses information about parent to increment the base_rank.]]
+
[[File:CalculateRank.png|border|300px|right|If parent is NULL then base_rank is incremented by a default increment else it uses information about parent to increment the base_rank.]]
 
<source lang=c>
 
<source lang=c>
 
static rpl_rank_t
 
static rpl_rank_t
    
==== best_parent(rpl_parent_t *p1, rpl_parent_t *p2) ====
 
==== best_parent(rpl_parent_t *p1, rpl_parent_t *p2) ====
[[File:BestParent.png|frame|right|Child c1 chooses Parent p1 according to OF.]]
+
[[File:BestParents.png|border|500px|right|Child c1 chooses Parent p1 according to OF.]]
 
<source lang=c>
 
<source lang=c>
 
static rpl_parent_t *
 
static rpl_parent_t *
 
* a new node appears in the neighborhood of the node
 
* a new node appears in the neighborhood of the node
   Exception encountered, of type "Error"