# Path Segmentation-Based Hybrid Caching in Information-Centric Networks
## 3 Path Segmentation-Based Hybrid Caching
### Caching in User-Edge Area  
Each cache node in the user-edge area of the data return path makes the caching decision individually. To achieve better caching, each node \(i\) in the user-edge area can consider the following optimization problem when deciding on caching:  
\[MAX\ E[h_{i}]\ \ \ \ \ s.t.\ E[d_{i}]<\delta \tag{1}\]  
Or  
\[MIN\ E[d_{i}]\ \ \ \ s.t.\ E[h_{i}]>\delta \tag{2}\]  
\(E[h_{i}]\) is the average hit probability of the cache node \(i\) while serving the requests. \(E[d_{i}]\) is the average end-to-end latency. To improve cache performance, we consider two common performance metrics: user access latency and cache hit ratio. For the optimal caching placement, each cache node \(i\) should ensure the caching of content, leading to low user access latency and high cache hit probability.  
In our proposal, to achieve a more practical solution, we can focus on optimizing one goal and relaxing the optimization of another.  
To implement the above optimization problem for each cache node \(i\), we consider calculating the cache value \(CV_{i}(k)\) for each incoming content \(k\). The higher the popularity, the closer the content is to the user, and the more noteworthy it is to be cached. We maintain a cache value for each content cached by the node. The cache value of the hit content is updated when the user request hits on this node. In addition, cache replacement and migration are carried out according to the cache value of the cached content. To prevent cache space from being occupied by high cache value content that has not been accessed for a long time, we set a time period for each cached content. Expired content that is not accessed will be expelled. According to the mechanism, the following formula is used to calculate the cache value \(CV_{i}(k)\) of each content \(k\):  
\[CV_{i}(k)=f1*D_{i}(k)+f2*P_{i}(k) \tag{3}\]  
where \(f1\) and \(f2\) are weighting constants, \(D_{i}(k)\) is the data transmission distance normalized by the distance between the requesting user and the hit node, and \(P_{i}(k)\) is the content popularity normalized with the maximum popularity \(p_{max}\) of cached content. If the current node is a hit node, the cache value of the hit content is updated to \(f2*\left(P_{i}(k)+\frac{1}{p_{max}}\right)\).  
The process of cache management in the user-edge area is described in Algorithm 1. The cache value is calculated for each incoming content (Step 2). We check the remaining cache space. When the cache space is insufficient, we select the content with the lowest cache value to replace, and we migrate the replaced content to the migration node carried by the packet (Steps 3-9).  
```
current node: \(i\)

remaining cache space: \(B_{i}\)
```
1:for each incoming content \(k\)
2:\(CV_{i}(k)=f1*D_{i}(k)+f2*P_{i}(k)\)
3:if\(B_{i}==0\)then
4:if\(CV_{i}(k)<\min\{CV_{i}(n)\;\;\forall n\}\)then
5: do not cache \(k\)
6:else
7: find \(m\) where \(CS_{i}(m)==\min\{CS_{i}(n)\;\;\forall n\}\)
8: content \(m\) is replaced with \(k\)
9: forward \(m\) to \(k\). migrate_node_address
10:endif
11:else
12: cache content \(k\)
13:endif
14:if any content expires then
15: expel the content
16:endif ```
**Algorithm 1**Caching in User-Edge Area