# An Improved Opportunistic Routing Protocol Based on Context Information of Mobile Nodes
## 2 Proposed Protocol
If the hop count of a message at a node is 0, we promote a dissemination of such a message, and thus, a message is forwarded, if either (1) the delivery predictability of the contact node is higher or (2) both average distance and average time of the contact node are smaller is met. On the other hand, if the hop count is larger than 0, we selectively forward the message by using more strict condition. That is, a message is forwarded, if both of the conditions are met. Figure 3 shows the flowchart of the proposed protocol. Whenever node A contacts node B, they exchange summary vectors that include the list of messages they have and the destination node information for the stored messages. If node A has a message with node B as a destination node it delivers the message to node B, and updates the average distance and average time. Otherwise, node A and B check if they have average distance and average time already. If they both have those values, they compare average distance, average time, and delivery predictability. Then, node A checks the hop count of a considered message. If the hop count of a message is 0, a message is forwarded if the following condition is met:  
\[\left(\text{E}[\text{D}_{\text{A}}]>\text{E}[\text{D}_{\text{B}}]\text{ AND }\text{ E}[\text{T}_{\text{A}}]>\text{E}[\text{T}_{\text{B}}]\right)\text{ OR }\left(\text{P}(\text{A},\text{D})<\text{P}(\text{B},\text{D})\right) \tag{6}\]  
In Equation (6), the basic idea is to promote a dissemination of a message by allowing for a forwarding if any of the two conditions, i.e., \(\text{E}[\text{D}_{\text{A}}]>\text{E}[\text{D}_{\text{B}}]\text{ AND }\text{ E}[\text{T}_{\text{A}}]>\text{E}[\text{T}_{\text{B}}]\) or \(\text{P}(\text{A},\text{D})<\text{P}(\text{B},\text{D})\), is met, if the hop count of the message is 0. If the hop count of a message is larger than 0, a message is forwarded only if the following condition is met:  
\[\left(\text{E}[\text{D}_{\text{A}}]>\text{E}[\text{D}_{\text{B}}]\text{ AND }\text{ E}[\text{T}_{\text{A}}]>\text{E}[\text{T}_{\text{B}}]\right)\text{ AND }\left(\text{P}(\text{A},\text{D})<\text{P}(\text{B},\text{D})\right) \tag{7}\]  
In Equation (7), the basic idea is to restrict a dissemination of a message by allowing a forwarding only if all of two conditions are met, if the hop count is larger than 0, since it has been forwarded already, and thus, forwarding should be carried out more selectively in order to reduce traffic overload, which is a major factor to decrease delivery ratio. If two contact nodes do not have average distance and average time value yet, only a message with hop count of 0 is forwarded, if the delivery predictability of the contact node is higher. The same procedure is repeated for all of the messages of node A. Figure 4 shows an example of the operation of the proposed protocol. Before contact occurs, node A and node B have messages with delivery predictability information as well as average distance and average time information, as shown in Figure 4a. In the example, it is assumed that both nodes have delivered a message to a destination node, and thus they have average distance and average time information, and those values of node B are smaller than those of node A. Since the destination node of message M4 of node A is node B, it is delivered to node B, and then, both average distance and average time values of node A are updated. The message M4 is removed from the buffer of node A after delivery. The message M1 of node A is forwarded to node B, since both average distance and average time values of node B are smaller than those of node A, although the delivery predictability of node B is not larger than that of node A, in order to disseminate the message M1 more, which is the forwarding condition when the hop count of a message is 0 and both average distance and average time information are available, as in Equation (6).