| 1. Receive packet from neighbor . |
| 2. Update neighbor table . |
| 3. { If } neighbor_hierarchy > this_node_hierarchy + 1 : |
| a. Set the neighbor as the parent (next node in the neighbor table); |
| b. It assigns itself a hierarchy level smaller than its parent : this_node_hierarchy = neighbor_hierarchy − 1 . |
| c. Send a ND packet to advertise its hierarchy in the neighborhood . |
| 4. If neighbor_hierarchy == this_node_hierarchy + 1 ,{ then } set the neighbor as another parent . |