# Performance Analysis of Cache Based on Popularity and Class in Named Data Network
## 2 Basic of Cache Based on Popularity and Class
### Caching Strategy of CAPIC  
There are several routers involved in communication network, with its members optimally utilized to improve network performance. To accommodate this strategy, a Cache Based on Popularity and Class (CAPIC) scheme for Named Data Network (NDN) is proposed. This scheme is accommodated in two things, namely the popularity of the content and the class of content services. This means, there are two steps in the CAPIC mechanism. The first step aims to guarantee the content placement based on priority, while the second step guarantees the consideration of content class in this system. The popularity of the content determines the router the content will be cached in, while the content class determines the proportion of its cache storage. The detailed mechanism of the CAPIC algorithm is carried out in the following two steps:  
1. In the first step, the content popularity determines the cache location (cache placement). Every time consumers request content, these data are sent, and a copy is stored in the one-hop downstream router that is closer to the consumer. The more popular content, the closer it is cached to the consumer. The mechanism implemented in CAPIC continues to the second step.
2. In the second step, the proportion of cache storage (cache policy) is determined on the router based on its content class. However, only a certain proportion of the router's content store is used for store certain content class data. When the section's capacity is full, data are deleted using the cache replacement technique. For the Static-CAPIC, the content store's size of each class is pre-determined, based on request pattern observation over a certain period. The changing proportion of Static-CAPIC is still carried out manually. Meanwhile, in the Dynamic-CAPIC, the cache proportion is determined dynamically following the new proposed formula of Dynamic-CAPIC, and it can change in real-time based on the consumer request pattern.  
The CAPIC mechanism flowchart is shown in Figure 1. After the NDN routing protocol is established, consumers send the interest packet to request a data to the network. When the interest packet enters the NDN router, its content is checked to determine possible initial existence. Assuming the router already has the data requested by the consumer, a copy is sent to the closest router with a copy sent to the consumer. This procedure is the first step of the CAPIC algorithm that is conducted based on the content popularity and its ability to move the data one hop closer for every request until it reaches the edge router. The second step is based on the class of content. Therefore, when the router decides to save the copy of data, it needs first to calculate the amount of data a specific content class can save in its content store. This is because content that belongs to a particular class is not being stored in the storage that is intended for other classes. This second step is conducted with dependency on the type of CAPIC, that is Static or Dynamic. For the Static-CAPIC and Dynamic-CAPIC, the proportions are followed by the pre-determined size and Dynamic-CAPIC formula, respectively. This step is carried out every time the router needs to save the data. When the content store is full, the content replacement scheme is performed. In this research, the LFU mechanism is used to carry out this activity [21] because of its strength and effectiveness with request pattern following the Zipf-Mandelbrot distribution [3].