# Dynamic-RPL: Enhancing RPL-Based IoT Networks with Effective Support of Dynamic Topology Management
## 5 Design
### Global-Parent Selection  
To enable such a flexible global-DODAG establishment presented in the previous section, the global-parent selection strategy needs to be slightly modified. This is important to also ensure the dynamic management of the multi-DODAG network. Figure 3 presents the modified algorithm for global-parent selection, which is run upon the reception of a new global-DIO message. It first ensures that only eligible global-nodes process the message and join the global-DODAG. The message is discarded if it indicates a source that is currently the receiver's global-parent or advertising a higher or equal rank. It is also discarded in cases such as providing no update about a member of the receiver's global-parent set. These also include advertising an irrelevant global-DODAG (any possibly initiated global-DODAG other than GD1, which represents the main global-DODAG in an RPL instance). Figure 3: Operational overview of the global-parent selection strategy. Otherwise, the receiver proceeds to process the message and add the source as a member of its global-parent set. It then attaches to the source as its global-parent unless other options are available in the set. In this case, the receiver needs to select the best available option based on the advertised global-OF. This is also applied in case the message is indicating updated information about a source already added to the global-parent set. The process starts by grouping the well-performing nodes among the least-ranking members of the set. It then first tries to select the best of those not locally attached to its local-DODAG. If no such options exist, it then selects the best among all the grouped options. These considerations are oriented to the operation of the dynamic multi-DODAG algorithm as explained later in the following subsection. In case all the members of the global-parent set are not performing well, the global-parent selection is run for all the available members. Finally, the receiver attaches to the selected global-parent. After completing the attachment process, a global-node needs to participate in the establishment of the up-routes of the global-DODAG as per the RPL specification. It unicasts a global-DAO message indicating its local-DODAG prefix to its global-parent. This helps enable simple management of inter-routing among the different local-DODAGs as illustrated later in Section 5.4. The global-parent selection process is performed based on a new global-OF, referred to as Load and Stability Objective Function (LSOF). It is customized to enable effective dynamic topology management considering two main network aspects. These are the network load and topology stability, which are measured for local-DODAGs using a set of different metrics. For load measurement, the size of the local-DODAG is an important consideration to assess how much a local-DODAG can be scaled up in a dynamic topology. It is also critical to factor in the data Forwarding Rate to consider how busy a local-DODAG is. Another important metric is the Maximum Hop Count in the local-DODAG in order to consider how expandable it is. Different measures can also be incorporated to indicate topology stability. These include global and local repair rates, which provide information on how long the topology is maintained unchanged. Other parameters such as the parent change rate and No-Path Message Rate are also important to consider how much the local-DODAG is stable. Note that LSOF runs only in a global-DODAG considering the specific metrics explained above whereas any OF can be applied in the local-DODAGs within a local-instance. For example, the local-DODAGs can have one of the default OFs, OF0 or MRHOF, or any application-oriented OF running in each of them. This is very applicable since the global-DODAG and local-DODAGs operate in different instances. All the LSOF measures are collected locally using each global-node and then exchanged globally in the global-DIO messages.