# A Green Routing Protocol with Wireless Power Transfer for Internet of Things
## 5 Proposed OF for RPL  
In this Section, we propose an efficient metric jointly based on the nodes battery level and the possibility to recharge a node by the SWIPT technique. In more details, the proposed approach is focused on dynamically adjusting the routing strategy based on the network state as represented by a proper metric for enhancing the network lifetime and, hence, minimizing its energetic footprint. It is equivalent to the solution of the following optimization problem:  
\[\text{(OP)}\qquad\underset{w_{i,j}}{\text{maximize}} \theta(\pi_{s,R})\] (3) subject to: \[s,R\in\mathcal{G}\] \[i,j\in\pi_{s,R}\]  
where \(\mathcal{G}\) represents the overall network graph, \(s\) a generic source node, \(R\) the unique destination (root node), \(\pi_{s,R}\) a possible path connecting \(s\) to \(R\), and \(i,j\) two generic adjacent nodes along \(\pi_{s,R}\). Moreover, \(\theta(\pi_{s,R})\) is the minimum time interval in which all the nodes along the path \(\pi_{s,R}\) are jointly available. Figure 2: Low-Power and Lossy Network (LLN) network model. It is worth recalling that in principle the solution of OP problem (3) can be easily obtained by applying the centralized Dijkstra algorithm, once a proper set of weights \(\mathbf{w}\) is derived for every link. However, we adopted a distributed approach based on an enhanced RPL protocol to update the time varying weight set \(\mathbf{w}(t)\!\!=\!\!\{w_{ij}(t)\}\), associated to the link connecting the \(i\)-th and \(j\)-th nodes. The concept of RPL is extremely flexible as it allows to define new OF and also Routing Metric and Constraints. For this purpose, two RPL options are very important: \"DODAG Configuration\" and \"DAG Metric Container\". The OCP field in the RPL option \"DODAG Configuration\" identifies the OF. In the field OCP, the OF (e.g., the default OF0, MRHOF or a new OF) can be defined. The Type of \"Routing Metric/Constraint\" (the link-based or node-based metric or constraint) can be specified in the field \"Routing-MC-Type\" of the \"DAG Metric Container\" [2,3]. The energy consumption of sensors in the IoT network is mainly due to the sensing/data processing and communications. By assuming the sensing/data processing consumption constant for each node, in the proposed metric we only consider the consumption due to transmit/receive a packet. Moreover, the energy consumption and recharge capability are different according to the role of the node in the DODAG. Following the RPL topology, each node can be directly connected to the root node or connected to intermediate node(s), i.e., the parent nodes. In this second case, the node is called _child_. In our RF power transfer metric, we suppose that a fraction of the received power at the intermediate node from a child can recharge the parent's battery. In addition, in the network a limited number of child nodes have a sufficient battery level to recharge nodes in their surrounding, as explained in Section 4. Therefore, assuming a data transmission flow in the network with destination to the root node, our model considers the following cases according to the nodes' role:  
* Root node can receive and can recharge. * Parent nodes can receive, transmit, and recharge. * End-child nodes can only transmit. * Some end-nodes have the maximum level of power equal to \(P\). The operation of energy-harvesting nodes relies on the concept of the energy balancing which for nodes with ideal storage and without any inefficiency in charging can be defined on a period \(T_{p}\) which is the transmission time of a packet, as ref. [37]  
\[\int_{0}^{T_{p}}P_{c}(t)dt\leq\int_{0}^{T_{p}}P_{h}(t)dt+E_{0}\;\;\forall T_{p }\in[0,\infty] \tag{4}\]  
where \(E_{0}\) is the initial energy level (which is related to the battery level \(B\)), \(P_{c}(t)\) is the consumed power at time \(t\) to transmit or to receive and \(P_{h}(t)\) denotes the harvested power from the energy source, that in our case, considering SWIPT operation, is a fraction of the received power from the child.