## 3 Reducing Transmission Overhead without Compromising Throughput
### LARep Design
#### 3.2.3 Phase 3: Policy for Dropping Messages  
Two conditions can cause messages to be removed from the buffer. The first condition is TTL exhaustion and the second one is when the free buffer space is insufficient for holding generated or received messages. In the latter case, messages are removed based on the dropping policy in use. With the conventional FIFO policy, the message that was received first is dropped first. However, as observed in Section 2.4.2, this does not favor messages travelling longer distances. Under buffer constraints or high data traffic, messages with higher \(srcDstDist_{m}\) values tend to be dropped before they can travel close enough to the destination. Although the idea is that more copies of such messages may have been generated and forwarded to relay nodes along the way, the likelihood of encountering more suitable relay nodes may be low under high degrees of spatial locality (i.e., when the message is still in custody of a node that is located far from the destination node). Hence, depending on the \(srcDstDist_{m}\) and the forwarding utility of the custodian, the message may have been replicated to only few relay nodes. The message dropping policy proposed in this section, namely Locality Aware Message Dropping (LAMeD), minimizes the loss of messages with higher \(srcDstDist_{m}\), as well as those that have less copies in the network. The proposed policy creates room in the buffer based on a \"retain utility\", such that the message with the smallest retain utility is dropped first. \(retainUtility_{i}(m)\), the retain utility of a message \(m\), on node \(i\) that is destined for node \(d_{m}\) is given by Equation (6), where \(distToDst_{i}(m)\) is the Euclidean distance between the current location of node \(i\) and node \(d_{m}\). \[retainUtility_{i}(m)=\frac{U_{i}(d_{m})\times distToDst_{i}(m)}{w_{m}} \tag{6}\]  
With \(retainUtility_{i}(m)\) directly proportional to \(U_{i}(d_{m})\) in Equation (6), nodes tend to hold on to messages for which they have higher chances of delivery, while they are more likely to first drop the ones for which they can make less delivery contributions. With \(retainUtility_{i}(m)\) also directly proportional to \(distToDst_{i}(m)\) in the equation, the tendency to retain messages that are spatially farther away from their destination is increased. With \(retainUtility_{i}(m)\) inversely proportional to \(w_{m}\), the tendency to retain messages that have higher \(w_{m}\) is decreased, as copies of such messages are likely to be more in the network or may already be in custody of relays with higher forwarding utilities. With our proposed message dropping policy, the tendency of retaining messages is in accordance with the amount of contribution that can be made towards delivering them, the distance they are travelling and the expected extent to which they have been replicated. Therefore, whenever the free buffer space is insufficient for an incoming message, \(m\), the message with the least value of \(retainUtility_{i}(m)\) is dropped, and this continues until enough room is created. LAMeD requires messages to be associated with the \(w_{m}\) property. Hence, it should be able to coexist with other message dropping policies in case the buffer contains different sets of messages--for instance, a set of messages for the sensed data collection application and a set of messages generated by another application (i.e., external messages as described in Section 2.4.2)--for various services provided by the OppNet. When the remaining buffer space is insufficient for an incoming message, Algorithm 2 is used to determine the set from which to drop a message. First, \(B_{E}\), the amount of buffer space allocated to external messages, is determined by Equation (7), where \(B\) is the size of the buffer and \(M\) is the number of different sets of messages in the buffer (assuming equal priority is given to every message set). Then external message set is selected if \(E\), the size of the set, exceeds \(B_{E}\).