## 3 Proposed Model
### Model Phases  
The protocol consists of five phases aimed at efficient message exchange in an opportunistic network. In Phase 1, upon establishing a connection between nodes, acknowledged messages are purged from buffers, encounter timestamps are updated, and deliverable messages are prioritized for exchange. Phase 2 focuses on exchanging deliverable messages between connected nodes, optimizing delivery and conserving energy. Phase 3 handles non-deliverable messages by selecting them for transmission based on encounter timestamps and meeting times with destination nodes. In Phase 4, the sender gathers message metadata and awaits responses from the receiver for each message, determining whether or not to proceed with transmission based on received replies. Finally, Phase 5 occurs at the receiver side, where messages are accepted based on energy levels and buffer capacity, and responses are sent to the sender confirming message acceptance or indicating low resources. Together, these phases facilitate efficient message exchange, prioritize delivery, and optimize resource utilization in the network. * **Phase 1: Initialization** After establishing a connection between two nodes, this phase begins with the goal of clearing all acknowledged messages from the buffers of both nodes while updating their encounter timestamps. Removing acknowledged messages helps alleviate buffer congestion, creating space for newly received messages and preventing redundant transmission and processing, thus conserving transmitting and processing resources. In Algorithm 1, upon connection establishment, both nodes exchange their \"Acknowledged Messages Tables\", merging delivered messages from the received table into their own and subsequently removing these messages from their buffers. Preserving the IDs of delivered messages in a table and exchanging it during connection establishment proves more efficient than flooding the network with acknowledgment messages for each delivered message. This approach reduces overhead, mitigates buffer overflow, and conserves energy. Additionally, utilizing the acknowledgment table enables the sender node to confirm message delivery. After clearing acknowledged messages, both nodes update their encounter timestamps if the other node is listed in their \"Hosts Table\"; otherwise, the node is added to the table along with its encounter time. Upon completion, the routing protocol advances to the next phase. * **Phase 2: Exchange Deliverables** The main goal of this phase is to prioritize the exchange of deliverable messages intended for the directly connected node. By giving precedence to these messages, the delivery process is optimized, increasing the likelihood of successful message transmission. This prioritization is crucial as the buffer contains both deliverable messages and those intended for other nodes in the network. Prioritizing deliverable messages allows nodes with lower power to efficiently serve as direct delivery nodes, as outlined in Phase 5. Additionally, in cases where the connection between nodes abruptly closes due to factors like node speed or malfunctions, prioritizing deliverable messages ensures their prompt delivery, thus enhancing overall delivery reliability. During this process, both nodes collect deliverable messages and exchange them accordingly, updating their \"Acked Messages Table\" with the newly delivered messages. If a node's energy level exceeds the predefined threshold, the routing protocol proceeds to the next phase to handle other messages in  
Figure 3: Message overhead. the buffer. Conversely, if the node's energy falls below the threshold, the connection is terminated to conserve energy, and the node operates as a direct delivery node, as illustrated in Algorithm 2.