# Performance Analysis of Cache Based on Popularity and Class in Named Data Network
## 4 Dynamic-CAPIC: Cache Based on Popularity and Class with Dynamic Cache Proportion
### Analysis of Determining the Content Variation \(X_{k}\)  
The Frequency Limit Factor needs to be determined before calculating the proportion of cache using Equation (12). The Frequency Limit Factor \(F_{RK}\) has determined the following three stages:  
1. Determine the value of parameter D, which is the percentage of content class that is likely to be considered in the system (e.g., 10%, 20%, etc.).
2. Calculate parameter \(R\), using \(N_{k}\) as a total number of content in class \(k\) \[R=D\ \times\ N_{k}\] (13)
3. Calculate the Frequency Limit Factor \(F_{RK}\),  
\[F_{RK}=p\left(R\right)\times\ \lambda_{k} \tag{14}\]  
These three initial stages can be carried out by analyzing general patterns of traffic on a network with classes 1, 2, or 3 used as a reference. However, for the case \(\lambda_{1}<\ \lambda_{2}<\ \lambda_{3}\), the value of \(F_{R1}<~{}F_{R2}<~{}F_{R3}\). For example, classes 1, 2, and 3 have the amount of content 500, 700, and 1000 and their demands are 10, 20, and 30 \(request/time-unit\). In case we decided to use \(D=30\%\), the parameter R can be calculated as follows:  
\[R=D~{}\cdot N_{1}~{}=~{}30\%~{}\cdot 500~{}=~{}150\]  
The Frequency Limit Factor that will be used in the system is calculated following the first class reference (\(k=1\))  
\[F_{Rk} =p\left(R\right)\times~{}\lambda_{k}\] \[F_{R1} =p\left(150\right)\times~{}\lambda_{1}\]  
Figure 6 is a graphical representation of the explanation for clarity. The red arrow points to the rank of content, called parameter \(R\), which is 150. The horizontal black line points the Frequency Limit Factor, \(F_{R1}\). Therefore, to get \(X_{k}\) for each class, the number of content which is requested more than the Frequency Limit Factor is checked. The value of \(X_{k}\) for \(k=1,2\) and 3 can be written as:  
\[X_{1} =150\left(\text{indicated by the red arrow}\right)\] \[X_{2} =309\left(\text{indicated by the green arrow}\right)\] \[X_{3} =513\left(\text{indicated by the blue arrow}\right)\]  
Thus, the proportion of each class can be calculated (for \(k=1,2,3\)) using Equation (12). In the case of a total content store size of 100, it can be defined that:  
\[\begin{array}{l}c_{1}=\frac{150}{150+309+513}~{}\times 100\approx 15\\ c_{2}=\frac{150+309+513}{150+309+513}~{}\times 100\approx 32\\ c_{3}=\frac{513}{150+309+513}~{}\times 100\approx 53\end{array}\]  
The value of \(X_{k}\) can change dynamically and in real-time. This formula can be used even if the system (or router) does not know the total amount of content for each class.  
Unlike the Static-CAPIC algorithm, in Dynamic-CAPIC a formula is used to dynamically calculate the proportion of cache for each content. One of the parameters used is the Frequency Limit Factor which determines the amount of top content needed to calculate the proportion of cache in the content store for each class. For example, as an illustration, the communication system has the total frequency of request 10,000. Figure 7 shows that in first class (red line) the number of top content that has many requests greater than Frequency Limit Factor of 25, is approximately 87 contents. For a Frequency Limit Factor of 75, the number of top content calculated is approximately 21.  
Figure 6: Illustration of Request Distribution Pattern and Frequency Limit Factor.