# Energy-Efficient Check-and-Spray Geocast Routing Protocol for Opportunistic Networks
## 3 Proposed EECSG Routing Protocol
The forwarding algorithm is designed for a message carrier to always identify the best node with a higher chance to relay the message to its destination. This involves the following considerations: 1. Buffer scheduling policy: In order to reduce the energy consumption, buffer management should be taken care of, for instance, by deciding on which buffer scheduling policy is to be adopted, which will result in a minimum packets delivery loss. In that sense, in our simulation experiment, the following four scheduling policies can be considered: (1) the First-In-First-Out (FIFO)--where the messages are forwarded to the nodes in the that order that they have been received; (2) Last-In-First-Out (LIFO)--where the messages are forwarded to the nodes in the reverse order that they have been received; (3) Highest-Time-to-Live-First-Out (HTFO)--where the message with the longest lifetime is first forwarded, followed by others; and (4) Lowest-TTL-First-Out (LTFO)--where the message with the shortest lifetime is first forwarded, followed by others. For most of our simulations, we have considered the default buffer scheduling policy, i.e., random policy--meaning that the messages are randomly selected from the node's buffer when a node encounters another one. 2. Energy efficiency: In an OppNet, the energy consumption of a node is a critical issue which frequently occurs when the node sends and receives the data packets or when one packet is sent many times by the node to other nodes. In order to save the node's battery life, thereby increase the chance of successful packet delivery, it is desirable to route the packets only through those nodes that have enough remaining battery power, in such a way that the delivery ratio of packets is maximized. In our proposed EECSG protocol, the energy level of the receiving nodes have been taken into account when deciding on the suitable relay nodes to carry the message towards its destination. Indeed, during the first phase of the EECSG protocol, while forwarding the message to its destination, the energy level of any neighboring node \(n\) of a source node is checked. If it is below a prescribed energy threshold level, the message is not forwarded to that node \(n\). Once in the geocast region, the energy level of the receiving nodes is again checked. If the energy level of such receiving node it is less than the prescribed energy threshold, such a node will only receive one data packet and will be prevented from transmitting the messages further. For the calculation of the energy threshold \(ET\), the residual energy of each neighbour node of the source node is calculated. We consider CurrentEnergy(node) the residual energy of the source/intermediate node and neighbourEnergy(node) the residual energy of the neighbor node of the source node. These are calculated as \[CurrentEnergy(node)=getCurrentEnergy(srce/inter,node)\] (1) \[neighbourEnergy(node)=getCurrentEnergy(neighbour),\] (2) where \(getCurrentEnergy()\) is a function that returns the residual energy of the corresponding node. The energy threshold level \(ET\) of a node is obtained as: \[ET=neighbourEnergy(node)/count,\] (3) where \(count\) is the total number of neighbours of the current node. It should be noted that in this work, \(ET\) is referred to as a forwarding utility metric because the selection of a suitable relay node to forward the message is based on the above mentioned formulae. 4. Selecting a relay node based on the forwarding utility metric. 5. Message dissemination using the Check-and-Spray controlled flooding methodology: The message dissemination within the cast is a typical floating content issue, which offers an opportunity to enable the localized information sharing without the need for an infrastructure, data collection or central control. Ultimately, it offers some degree of privacy by not allowing the remote access to the content within a defined geographical location. Besides, flooding a message is resource consuming, but can guarantee an optimum message delivery ratio.