# IMU: A Content Replacement Policy for CCN, Based on Immutance Content Selection
## 3 Proposed Content Replacement Policy  
Content replacement policy is an integral part of CCN cache management. The nodes in CCN need to free up space over time, due to limited cache space, so that new contents are cached. It is a crucial decision to evict content from the cache, which, in turn, increases or decreases network performance and the cache hit ratio. Numerous content replacement policies decide to evict content from the cache using various criteria, such as time in the cache, frequency, popularity, and node centralization. These policies do not use content immaturity for eviction. The proposed policy selects immature content from the cache that stays for a long time in the cache and has a lower frequency in a particular time window. Thus, the proposed policy avoids unnecessary content occupation in the cache space. Due to immature content eviction, network nodes contain more requested content within the cache space. Therefore, more customer interests are satisfied within the network. The proposed technique determines the mature/immuture contents. Algorithm 1 elaborates the procedure to label a content, \(s_{i}\) is mature or immature. The proposed policy keeps track of each content's arrival time and frequency at each node. The current time and the frequency of the node \(s_{i}\) is denoted by \(\mathbb{T}_{cfs_{i}}\) and \(\bar{F}_{cS_{i}}\) respectively. The proposed technique calculates the content period, \(\mathbb{T}_{p,s_{i}}\), with the help of content frequency, \(\bar{F}_{cS_{i}}\), and content arrival time, \(\mathbb{T}_{cfs_{i}}\). Therefore, it determines the duration of the content \(s_{i}\) in the cache space. Then, the proposed policy calculates the maturity index \(\mathbb{M}_{c\bar{I},s_{i}}\) by dividing the frequency of the content \(\bar{F}_{cS_{i}}\) and content period \(\mathbb{T}_{p,s_{i}}\). The maturity classifier \(\mathbb{M}_{k}\) is calculated using the median of maturity indexes \(\mathbb{M}_{k}\leftarrow\textit{Median}\Big{(}\mathbb{M}_{c\bar{I},s_{n}} \Big{)}\). Content \(s_{i}\) whose maturity index \(\mathbb{M}_{c\bar{I},s_{i}}\) exceeds the value of \(\mathbb{M}_{k}\) is classified as mature content; otherwise, it is immature content. The median is used for finding the relevant mean value of the maturity index \(\mathbb{T}_{c\bar{I},s_{i}}\), because it is not affected by lower or extreme high set values. Thus, this provides a fair value to the maturity classifier \(\mathbb{M}_{k}\). ```
Input: Suppose \(S\in\{s_{1},s_{2},s_{3},\ldots,s_{n}\}\) is set of contents. Output: Categorization of contents. \(\mathbb{T}_{cfs_{i}}\) is the arrival time of \(i\)th content. \(\mathbb{F}_{cS_{i}}\) is the frequency of \(i\)th content. \(\mathbb{W}_{T}\) is the size of the time window. \(\mathbb{T}_{p,s_{i}}\) is the time period of \(i\)th content. \(\mathbb{M}_{c\bar{I},s_{i}}\) is the maturity index of \(i\)th content. \(\mathbb{M}_{k}\) is the maturity classifier. 1. for\(i=1:n\) \(\mathbb{T}_{p,s_{i}}\gets W_{T}-\mathbb{T}_{cfs_{i}}\) \(\mathbb{M}_{c\bar{I},s_{i}}\leftarrow\mathbb{F}_{cS_{i}}/\mathbb{T}_{p,s_{i}}\) \(\mathbb{M}_{k}\leftarrow\textit{Median}\Big{(}\mathbb{M}_{c\bar{I},s_{n}} \Big{)}\) \(\mathbb{M}_{k}\leftarrow\textit{Median}\Big{(}\mathbb{M}_{c\bar{I},s_{n}} \Big{)}\) \(\mathbb{M}_{c\bar{I},s_{i}}\succeq\mathbb{M}_{k}\) \(s_{i}\) is mature else \(s_{i}\) is immature
```  
**Algorithm 1**Determine the mature and immature content. Algorithm 2 describes the next part of our proposed policy. When a node \(v\) receives an interest packet for content \(s_{i}\), and the time window has not expired, then the proposed policy finds the requested content \(s_{i}\) in the local cache. In the case of a cache hit, the proposed policy increments the frequency of content \(s_{i}\) by one and associates a new arrival time \(\mathbb{T}_{cfs_{i}}\). Moreover, node \(v\) discards the interest packet from PIT and replies through thedata packet to the requested consumer. Otherwise, a cache miss means that the requested content \(\text{s}_{i}\) is being cached for the first time in CS.