# An Improved Opportunistic Routing Protocol Based on Context Information of Mobile Nodes
## 2 Proposed Protocol  
In the proposed protocol, whenever a node delivers a message to its destination node, it updates average distance travelled and average time elapsed from the reception of the message. Average distance and average time of node A are denoted as E[D\({}_{\rm A}\)] and E[T\({}_{\rm A}\)], respectively, and they are updated, as follows:  
\[{\rm E[D_{A}]}\ =\ \frac{\rm{TotD}}{\rm{cntDest}} \tag{4}\]  
\[{\rm E[T_{A}]}\ =\ \frac{\rm{TotT}}{\rm{cntDest}} \tag{5}\]  
where TotD, TotT, and cntDest are total distance travelled, total time elapsed, and total number of messages for all of the delivered messages, respectively. Figure 2 shows a scenario of update of average distance and average time when node A and node B contact each other. Since node A has message M2 with node B as a destination node, it firstly delivers the message M2 to node B. Then, node A updates average distance and average time by using the distance travelled and time elapsed, since it received the message M2 from another node firstly. Also, since node B has message M6 with node A as a destination node, it updates average distance and average time similarly. In the proposed protocol, we deliver a message to a node with smaller values of average distance and average time, as well as higher delivery predictability to a destination node, since a node with a smaller average distance and average time is more expected to contact the destination node because of its higher contact characteristic. That is, the proposed protocol considers both a collective property using average distance and average time, and it considers an individual property using delivery predictability to determine a better forwarder. In order to promote message dissemination in its early dissemination phase, a message generated originally at a node is forwarded based on a less strict condition, which will be explained in detail later. Figure 2: A scenario of update of average distance and average time. In the proposed protocol, we consider delivery predictability of PRoPHET protocol for message forwarding basically. Also, we consider the average distance travelled and the average time elapsed from the reception of the message to the delivery to the destination message additionally. In order to apply the message forwarding condition efficiently, we firstly check the existence of average distance and average time value at a node and we classify a message into two classes, depending on the hop count of the messages. Hop count is defined as the number of nodes that a message has forwarded so far. If a message is generated at a node, the hop count of the message is defined as 0, and the hop count increases by 1 whenever it is forwarded to another node. If average distance and average time information are not available since it has not delivered a message to a destination yet, different forwarding conditions are applied, depending on the hop count of the message. If the hop count is 0, a message is forwarded if the delivery predictability of the contact node is higher. This is because if the hop count is 0, which means that the message is originally generated at the current node, we promote the dissemination of such message since it has not been forwarded much, and thus active message forwarding is more favorable for message delivery. Thus, we forward such as message, if the basic condition of delivery predictability is met. On the other hand, if the hop count is larger than 0, which means that the message was forwarded from another node, the message is not forwarded in the proposed protocol. This is because the average distance and average time information are not available, and thus we defer the forwarding for such an already forwarded message until we have enough information to make a good forwarding decision. If average distance and average time information are available, we apply different forwarding conditions, depending on the hop count of a message.