## 3 Problem Statement
### Calculating Data Freshness
Each producer node is connected to three sensors, which collect data and send it to the requesting consumer. The sensors are Wi-Fi stations connected to a wireless access point (producer node) in infrastructure mode. All communications in this topology are wireless and the routers are Mikrotik Netmetal 5 devices with MIPS architecture. ### Simulation Parameters

Table 2 summarizes the parameters used to simulate the proposed approach scenario. In the simulations, messages are randomly generated using MATLAB. Each data request message includes the request number, applicant number, request time, requested sensor number, and data item type. Once generated, the data request message is sent according to their request times. According to the topology in Figure 2, each requesting node sends its message along a specific path to the data producer identified in the request. Each path consists of multiple hops and the data request message passes through several intermediate routers. If the cache cannot fulfill the request, it is forwarded to the producer. In this simulation scenario, network delays are modeled by considering each data exchange's propagation and transmission delays and the processing time and data handling at each router. The size of the exchanged data packets determines the traffic load for each period. The scenario is simulated using the LRU method and the proposed approach, each tested separately in eight modes based on simulation time, period length, and the number of requests. MATLAB version R2022 was used for all simulations. Figure 1: Topology of the simulated scenarios. Simulation metrics included:

* **Cache Success Rate**: The percentage of data requests the cache satisfies;
* **Network Traffic Load**: Total network bandwidth utilized for data retrieval;
* **Response Time**: Time taken to retrieve requested data. ### Discussion

The proposed method integrates time series analysis to handle the temporal nature of data freshness in IoT environments. Each data packet is tagged with time stamps, including the Cached Data Time Stamp (CDTS) and Request Time (RT), to calculate a freshness score dynamically. This approach ensures that cache decisions are based on the temporal relevance of the data, prioritizing recently updated or frequently requested information. Additionally, the time-dependent patterns observed in request frequencies are considered in predictive models, such as the Artificial Neural Network (ANN), to optimize caching decisions proactively. These time-dependent variables enable the method to effectively handle the ever-changing nature of data generated in IoT environments. The ANN employed in this study was designed to predict key performance metrics, such as cache hit ratios and network delays, under various simulation scenarios. The ANN architecture consisted of three hidden layers, each comprising sixty-four neurons. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter Description** & **Parameter Value** \\ \hline Router cache size & 10 records \\ \hline Data item type & The average of the last 5 min, 10 min, 15 min, \\  & 20 min, and 30 min \\ \hline The distance of the consumer to the & 95 m \\ connected router & 7 km \\ \hline Distance between routers & 7 km \\ \hline The distance of the producer to the & 10 km \\ connected router & 10 km \\ \hline Wireless propagation speed & \(3\times(10^{8})\) m per s \\ \hline Propagation delay & \
\begin{tabular}{c} Distance \\ Wireless speed \\ \end{tabular} \\ \hline Transmission delay &
\begin{tabular}{c} Load size \\ Wireless BW \\ \end{tabular} \\ \hline Wireless bandwidth & 200 Mbps \\ \hline Packet size & 1472 bytes \\ \hline Constant (\(\alpha\)) & 0.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters. Figure 2: Cache hit ratio of the caching methods in Model 1. The ReLU activation function introduced non-linearity, ensuring the model could capture complex relationships between input features.