In RPL upward routes are discovered and configured using DAG Information Object(DIO) messages. Node listen to DIO to handle changes in the topology that can affect routing.The information in DIO messages determines parents and best path to the DODAG root.
Nodes establish Downward routes by advertising their parent set toward the DODAG root using a Destination Advertisement Object(DAO) messages. DAO messages allow nodes to inform their parents of their presence and reach ability to descendants.
Based on RPL control messages, each node select and Identify our Parent in DODAG set.
Open file location contiki-ng/os/net/routing/rpl-lite/rpl-neighbor.c
Here, the function handling the preferred parent selection.
Run the simulation.