## 3 Problem Statement
### Calculating Data Freshness
IF MESSAGE_TYPE = \"REQUEST\" THEN

9. CHECK_CACHE(M.sensor_number, M.data_type)

10. IF (M.sensor_number, M.data_type) \(\in\) CS THEN

11. Cache_Status \(\leftarrow\) 1 //Cache hit

12. ELSE

13. Cache_Status \(\leftarrow\) 0 //Cache miss

14. END IF

//Step 3: Calculate Data Freshness

15. IF Cache_Status = 1 THEN

16. V \(\leftarrow\) 1 - (RT - CDTS)/R_type

17. IF V > 0 THEN

18. SEND_DATA_TO_CONSUMER()

19. ELSE

20. FORWARD_REQUEST()

21. END IF

22. ELSE

23. FORWARD_REQUEST()

24. END IF

//Step 4: Cache Hit or Cache Miss Decision

25. ELSE IF MESSAGE_TYPE = \"RESPONSE\" THEN

//Step 5: Check for Matching Data in Cache

26. IF (M.sensor_number, M.data_type) \(\in\) CS THEN

27. REMOVE_OLD_DATA(M.sensor_number, M.data_type)

28. CACHE_NEW_DATA(M)

29. ELSE

//Step 6: Check for Empty Space in Cache

30. IF AVAILABLE_CACHE_SPACE > 0 THEN

31. CACHE_NEW_DATA(M)

32. ELSE //Step 7: Check for Expired Data in Cache

33. FOR EACH DATA_ENTRY IN CS DO

34. Time_validation \(\leftarrow\) 1 - (NDTS - CDTS)/NDtype

35. IF Time_validation \(\leq\) 0 THEN

36. REMOVE_EXPIRED_DATA(DATA_ENTRY)

37. CACHE_NEW_DATA(M)

38. BREAK

39. END IF

40. END FOR

### Predicting Data Freshness

The CAL method incorporates a prediction mechanism using the Nonlinear Autoregressive (NAR) neural network to enhance caching efficiency. In the fourth step of the caching process, routers predict the data's freshness rate and calculate the validity of cached data based on the predicted freshness. This proactive approach reduces unnecessary data replacements and ensures that the cache retains the most relevant and current data. The NAR model forecasts future data freshness by analyzing past traffic patterns. Specifically:

* **Input Layer:** Processes historical request data, such as the sensor request number (SRN) and total requests (TRs) for specific data types;
* **Hidden Layer:** Configured with an optimized number of neurons to balance learning complexity and computational efficiency;
* **Output Layer:** Produces the predicted freshness rate (\(F_{rate_{pred}}\)) for the specified data;

For requests specific to a sensor ID or data type, the corresponding historical request counts are used as inputs to forecast the future request rate. These predictions are utilized in the CAL method to calculate data validity, guiding decisions about which data to retain or replace in the cache. The combination of historical traffic data and neural network predictions enables CAL to maintain high accuracy in its caching strategy while reducing computational overhead and network traffic. Predicted freshness values are computed as follows:

* The network uses past request data to predict PSRN (predicted SRN) and PTR (predicted total requests);
* Equation (14) calculates the predicted freshness rate (\(F_{rate}\)): \[F_{rate_{pred}}=\frac{SRN+PSRN}{TR+PTR}\] (14)
* Equation (15) evaluates the predicted validity (\(V_{pred}\)): \[V_{pred}(i,j)=\left(\alpha*F_{rate_{pred}}\right)+\left((1-\alpha)*\text{ Time\_validation}\right)\] (15)

The predicted freshness values guide the CAL method's caching decisions, allowing routers to prioritize more relevant data. This integration minimizes unnecessary cache replacements and enhances the overall efficiency of IoT data dissemination. ## 4 Evaluation

This section thoroughly analyzes the simulated scenario, including the selection and justification of the parameters used to accurately represent real-world conditions within thenetwork environment. The scenario aims to reflect typical usage patterns and operational constraints encountered in a NDN-based ICN-IoT architecture, ensuring the results. ### Simulation Scenario

As shown in Figure 1, the simulation scenario is a network consisting of six consumer nodes (servers), fifteen router nodes, and six data producer nodes. Each consumer node is connected to the producer nodes through different routes via multiple routers. The communication paths between each server and the producers are statically determined.