# Weighted-CAPIC Caching Algorithm for Priority Traffic in Named Data Network
## 6 Simulation Results and Analysis
This parameter involves the overall cache hit ratio for all traffic classes in the network/system. Figure 5 shows that the higher the number of request levels, the higher the cache hit ratio of the Weighted-CAPIC and Dynamic-CAPIC schemes. Weighted-CAPIC cache hit ratio is higher than Dynamic-CAPIC, and at request level 6, Weighted-CAPIC gives the most significant cache hit ratio, which is 11% higher than Dynamic-CAPIC. Static-CAPIC provides the smallest cache hit ratio for the higher request levels. This condition happens because Static-CAPIC cannot adjust its rules when requests come in arbitrary patterns. Figure 4: Cache hit ratio and path stretch of class 3 for various level of request. Figure 3: Cache hit ratio and path stretch of class 2 for various level of request. ```
Initialization; \(D\): number of content class ; \(i\): content ; \(C\): capacity of content store ;  Function WeightedCAPIC(input: \(D,C,i\)) ; ifrequest=\(i\)then  Check last-location \(i\); ifhop\(i\)=1 then  hop\(i\)=hop\(i\)-1 ; else  hop\(i\)=1 else  end process % calculate number of content variation for each class; form=1:Ddo \(Total_{X}\)=+\(X_{m}\);  Sorting(\(Xm\))for\(d=1:D\)do  give the \(\omega_{d}\) based on \(X_{m}\) % calculate cache portion of content class \(d\); \(c_{d}=\frac{X_{d},\omega_{d}}{\sum_{m=1}^{D}X_{i}\cdot\sum_{m=1}^{D}\omega_{m}}C\);  Check capacity of \(c_{d}\); ifcapacity not fullthen  save i in part-of-Content-store; else  do replacement algorithm;  save i in part-of-Content-store;  send i to consumer ;
```  
**Algorithm 1** FunctionWeighted-CAPIC  
In the 'difference in request rate' scenario, Weighted-CAPIC provides the most significant value compared to other schemes for class 1. As in Figure 6, its cache hit ratio is 45% higher than Dynamic-CAPIC. The cache hit ratio of Weighted-CAPIC is fluctuates 1-4% around its average value and decreases further for more considerable request rate  
Figure 5: Network cache hit ratio for various level of request. differences. This means that Weighted-CAPIC can accommodate the various consumer request rates, with the low or high gap between each traffic class. Dynamic-CAPIC gives the cache hit ratio variation 1-3% around the average value and falls for the more significant request rate difference value. It drops dramatically compared to the average, with the difference in request rate increasing up to 50%. At the same time, Static-CAPIC is more stable with a difference of only 1% compared to the average value. For the path stretch parameter, Weighted-CAPIC has the same value as Dynamic-CAPIC. Weighted-CAPIC provides the lowest path stretch for this first class. It means that content can be obtained with the lowest hop distance, shorter than the other strategies. Weighted-CAPIC gives the smallest path stretch compared to the all comparison scheme. LCD+Sharing provides the largest cache hit ratio for the second class, followed by Dynamic-CAPIC and Weighted-CAPIC. This happens because the second class has a lower priority than the first class, so Weighted-CAPIC provides a smaller cache portion and results in a smaller cache hit ratio. The Weighted-CAPIC path stretch is the same as Dynamic-CAPIC and is between the Static-CAPIC and LCD+Sharing stretch path values, as shown in Figure 7. In the second class, Weighted-CAPIC provides a relatively more extensive path stretch for increasing the demand gap between classes. This means that the greater the request rate, the higher the number of hops that must be passed to obtain the desired data. This happens because the greater the number of requests, the greater the variety of data requested. The largest cache hit ratio is given by the Static-CAPIC scheme for class 3, as shown in Figure 8, because it has the highest rate compared to other classes. Static-CAPIC has accommodated this condition by providing the largest cache portion in class 3. The cache hit ratio of Weighted-CAPIC fluctuates around 3-8% of the average value. The cache hit ratio of Dynamic-CAPIC fluctuates about 1-4% of the average value.