## 5 Message Forwarding
### Message Forwarding in MPMF  
The message-forwarding policy decides the maximum number of message replicas of a message that a selected one-hop relay or one- and two-hop relays can further replicate. Let an initial value \(L\) indicate the maximum number of replicas that can be created for a message in the network. We consider the following cases when deciding the number of replicas that a selected relay node can replicate. 1. Assuming that a message-carrying node encounters more than one node at the one-hop distance, i.e., case 1, the MPMF considers both one- and two-hop relays to receive only one message copy. Let \(s\) be the message-carrying node and create a new message \(m_{i}\) for \(d\). When a one-hop relay receives this message copy from \(s\), it replicates this message to the two-hop-selected relay node. Node \(s\) then updates the remaining message copies, denoted as \(L_{rem}=L-2\) for the transferred message \(m_{i}\) in its buffer, and both the one- and two-hop relays update \(L_{rem}=1\) in their respective buffers for the same message. Both nodes will transfer this message to the \(d\) only. However, \(s\) cancontinue to replicate the message to any encountered node until \(L_{rem}=1\) and then wait for \(d\) to transfer the message directly. 2. In the presence of only one relay at one-hop distance, i.e., case 2, a one-hop relay receives half of the remaining copies to distribute in the network. When \(s\) forwards a message to a one-hop relay, both \(s\) and the one-hop relay update \(L_{rem}=L/2\) copies for the message in their respective buffers. Then, both nodes can replicate this message further to other encountered nodes and reduce \(L_{rem}\). When \(L_{rem}=1\), the replication stops, and a relay node waits for the destination node to transfer the message. Let \(N_{i}\) denote a set of one-hop neighbor nodes in \(r\) of the message-carrying node \(s\) and \(N_{i,j}\) denote a set of one-hop neighbor nodes of \(n_{i}\in N_{i}\). Any \(n_{i,j}\in N_{i,j}\) is at the two-hop distance from \(s\). Suppose \(s\) contains \(m_{i}\) with a remaining time-to-live period, denoted as \(\mathrm{TTL}_{i}^{m}\). With the information of location and the vector of every node in \(N_{i}\) and \(N_{i,j}\), \(s\) and \(n_{i}\) can compute \(\theta_{i}\) and \(\theta_{i,j}\), respectively. To transfer \(m_{i}\) to \(n_{i}\), \(s\) applies the MPMF message scheduling, as specified in Algorithm 1. This algorithm consists of two sub-routines: two-hop message forwarding and one-hop message forwarding. In the sub-routine of two-hop message forwarding, \(n_{i}\) receives \(m_{i}\) from \(s\) and then replicates it to \(n_{i,j}\in N_{i,j}\). In the sub-routine of one-hop message forwarding, only \(n_{i}\) receives \(m_{i}\) from \(s\). Regarding the two-hop message forwarding, the summation angle \(\theta_{i}\) is checked inside each iteration of a for-loop procedure (lines 6-19), while \(\theta_{i,j}\) is checked inside each iteration of a for-loop procedure (8-17). If \(s\) has more than one neighbor node in its vicinity as line 5, it seeks to filter out neighbor nodes that are moving away from \(d\) and select \(n_{i}\) with \(\theta_{i}\leq\frac{\pi}{2}\), as lines 6-7. In lines 8-9, a two-hop relay \(n_{i,j}\) is selected by calculating the summation angle \(\theta_{i,j}\). Provided that \(\theta_{i,j}\leq\frac{\pi}{2}\), \(\theta_{m}\leq\epsilon\), and \(W_{p}>W_{0}\), \(n_{i}\) will receive \(m_{i}\) from \(s\) and transfer it to \(n_{i,j}\) as lines 9-12. After the message transfer, \(s\) will update \(L_{rem}=L_{rem}-2\) and both \(n_{i}\) and \(n_{i,j}\) will update \(L_{rem}=1\) for \(m_{i}\) in their respective buffers, as lines 13-14. Regarding the sub-routine of one-hop message forwarding, if the number of nodes in \(N_{i}\) equals to 1, then the summation angles \(\theta_{i}\) and \(\theta_{d}\), directional vectors, and centrality values of \(n_{i}\) and \(d\) are compared (lines 21-30).