# Leveraging IPv6 and ICMPv6 for Delay-Tolerant Networking in Deep Space
## 3 Architecture Proposal
### DTN Module
#### 3.1.3 Storage Function  
The Storage Function constitutes the core element of the store-and-forward paradigm, an essential part of the DTN architecture. Its principal function is to remember DTN packets when immediate transmission is not feasible due to contact unavailability.  
This function must be capable of efficiently managing data storage and retrieval to support interactions with other components, particularly the DTN Controller. When a packet is received and the next contact is unavailable, the Storage Function keeps the packet until it can be forwarded. In Figure 2, upon receiving a request from the DTN Controller (message 4. retrieve pck), the Storage Function retrieves the stored packet and makes it available for transmission.  
In addition to basic storage functionality, the function must incorporate advanced features to ensure smooth operation in a DTN environment. For instance, it must manage packet queuing and prioritize packets based on urgency, taking into account factors such as expiration times or quality of service (QoS) requirements. The management of storage resources is an issue not bound to a single protocol or solution. Active Queue Management (AQM) will surely be required, as it is in any node that implements buffers (or long-term storage, as in our case). A deeper analysis is left for future use case study, since different algorithms can impact the final performance. Given the often constrained resources of DTN nodes, the function must also optimize storage utilization by employing memory-efficient data structures and algorithms. Ensuring the integrity and reliability of stored data is critical, and the function should implement mechanisms to verify data integrity and prevent data loss caused by storage failures or power failures. For this reason, it is also crucial that these functionalities are implemented with persistent memory.  
Furthermore, the Storage Function must include capabilities for removing expired or redundant packets to free up space for new packets. Upon packet deletion, the DTN Controller must be notified, as illustrated in Figure 2 (message 5: report deletion). This triggers signaling messages, such as DTN-PCK-DELETED, which inform other DTN nodes of the deletion event and its causes. Detailed explanations of these and other signaling messages are provided later in this document.  
One of the key challenges in implementing the Storage Function is balancing limited storage resources with the potentially high volume of delayed traffic. The implementation must incorporate timers to manage the lifecycle of stored packets. Timers must be used to periodically ask the DTN Controller if there is a new opportunity to forward the stored packets, and to ensure that stored packets are retained only for their valid duration, aligning with quality of service (QoS) requirements and preventing the storage system from being overwhelmed by outdated or irrelevant traffic. By discarding packets after their expiration, the system can free up storage space for new incoming traffic and maintain overall efficiency.