# Quality-of-Service-Linked Privileged Content-Caching Mechanism for Named Data Networks
## 4 QoS-Linked Privileged Content Caching
### QoS Table and Content Store Management  
Content store management deals with admission-control techniques for content caching and cached-content-replacement strategies. Admission control is the process of determining whether or not to cache the content. Replacement strategies dictate which content has to be replaced in the scenario of CS memory exhaustion. Admission control for the content follows the priority order \((prompt,reliable)>reliable>prompt>regular\)[14, 16]. CS management follows a federated approach for caching the content, with the aim of eliminating redundancy and saving precious memory space. QoS nodes implement the QoS Table, which is used to arbitrate the decisions of admission control and content replacement. Each CS of a given QoS node federates itself with other QoS nodes, based on traffic flows which are distinguished based on Flow ID. If a given flow is already being adopted by a QoS node, then content belonging to that Flow ID is cached by that QoS node. The format of the QoS Table is shown in Table 4.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Content Name** & **FlowID** & **Equivalence Class ID** & **Eviction Score** \\ \hline Netflix/Show1- & Show1-Prompt & Prompt & 31.59 \\ Prompt/Content1/S1 & Sensor1-Reliable & Reliable & 19.28 \\ Messenger/User1- & User1-Reliable & Reliable & 21.29 \\ Reliable/S2 & & Show1-Prompt & Prompt & 44.76 \\ Prompt/Content1/S1 & & & \\ \hline \hline \end{tabular}
\end{table}
Table 3: Flow Table format.  
CS memory is limited and may become exhausted with time. Therefore, to free up the memory, a content-eviction strategy is proposed in Algorithm 2. The content-eviction algorithm considers content freshness, usage frequency, and content privilege as criteria to evaluate the suitability for eviction. Expired content is evicted in the first pass, irrespective of its QoS privilege. Upon further requirements for memory, the strategy applies LFU and LFF on \"prompt\" content. Content that is overlapped by both algorithms is evicted first, followed by LFU content. If a further memory requirement persists, then \"reliable\" content is evicted based on overlapping LFU and LFF algorithms, followed by LFU content evictions. The content with (prompt, reliable) status is evicted only upon expiry.  
An admission-control strategy is proposed in Algorithm 3. Admission-control algorithms evaluate the suitability of content to be cached in the CS of a QoS node. If the CS memory is exhausted, the algorithm calls the content-eviction procedure. The content streamed through the NDN are part of a traffic identified by a Flow ID. The Flow ID is extracted using content name, as illustrated by the QoS Table in Table 4. Each QoS node caches the content in its CS, depending upon whether a given content belongs to an adopted Flow ID. If the Flow ID is adopted by the QoS node, then the content is cached. If the Flow ID is not adopted by QoS node, then an interest packet is issued to te NDN for the QoS Table update, which will indicate the latest status of the Flow ID adoption. The QoS table is searched to identify the QoS node where the Flow ID is adopted, and the given content is forwarded. If the Flow ID is not adopted by any node, and if the QoS table is not yet full, the current QoS node adopts the Flow ID and sets an expiry time for the adoption, which reflects the longest TTL value of the content belonging to the Flow ID. If the QoS node cannot adopt the Flow ID due to memory requirements, it forwards the traffic towards further QoS nodes for adoption.