# Quality-of-Service-Linked Privileged Content-Caching Mechanism for Named Data Networks
## 4 QoS-Linked Privileged Content Caching
### An Illustration  
A computer network comprising IoT sensors, actuators, and resourceful NDN nodes (routers/gateways) interconnected by a wired or wireless medium is considered as an experimental scenario. All nodes of the experimental network are presented as \(M=\{m_{1},m_{2},m_{3},\ldots m_{k}\}\), where the content producers \(P=\{P_{1},P_{2}\}\), content consumers \(C=\{C_{1},C_{2},C_{3},C_{4}\}\), and QoS nodes \(Q=\{q_{1},q_{2},q_{3},q_{4}\}\) all belong to \(M\), i.e., \(P\in M\), \(C\in M\), and \(Q\in M\). The proposal caches the QoS content from the producers in QoS nodes. The producers generate both QoS and non-QoS data. The QoS data are cached by QoS nodes, and non-QoS data are cached in regular intermediate nodes (no privileged treatment). Let the QoS contents produced by producer nodes \(P\) be denoted as \(QContent=\{qc_{1},qc_{2},qc_{3},\ldots qc_{i}\}\), and let \(|QContent|\) show the amount of QoS content cached in the content store of a given QoS node. Content consumers issue and propagate the interest packets towards content producers. The set of interest packets that reach the NDN node at time \(t\) is denoted by \(Interest(t)=\{I_{1}(t),I_{2}(t),\ldots I_{j}(t)\}\), and \(ContentStore(m_{k},t)=\{(qc_{1},t),(qc_{2},t),\ldots(qc_{i},t)\}\) represents the content store content at time \(t\) for an NDN node \(m_{k}\), \(Served(Interest(t),ContentStore(m_{k},t))\) represents the number of interests packets that are served for \(t\), and the cached content hit rate is the ratio of the  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Content Name** & **Flow ID** & **Expire Time** & **Time Stamp** & **QoS Node Path of Adopted Flow ID** \\ \hline Netflix/Show1- & Show1-Prompt/Content1/S1 & Show1-Prompt & 8:15 PM & 7:59 AM & \(q_{3}\) \\ Temperature/Sensor1- & Sensor1- & Sensor1- & 1:15 PM & 12:35 PM & \(n_{8},q_{2}\) \\ Reliable/A/S1 & User1-Reliable/S1 & User1-Reliable & 3:05 PM & 2:40 PM & \(n_{8},q_{2},n_{2},n_{1},n_{10},q_{4}\) \\ Netflix/Show1- & Show1-Prompt & 2:55 PM & 2:45 PM & \(q_{3}\) \\ Prompt/Content1/S1 & & & & \\ \hline \end{tabular}
\end{table}
Table 4: QoS Table of \(q_{3}\).  
number of interest packet served by the content store to the total number of interest packets received and calculated using Equation (3).  
\[HitRate(ContentStore)=\frac{|Served(Interest(t),ContentStore(m_{k},t))|}{|Interest(t)|} \tag{3}\]  
An illustration of a case example of the proposed QoS-linked collaborative content caching is presented in this section, using the network scenario represented in Figure 3. Suppose that QoS content produced by \(P_{1}\)\(Netflix/Show1-Prompt/Content1/Segment1\) is requested by consumer \(C_{1}\) by issuing an interest packet and forwarding it to node \(q_{2}\) through \(n_{7}\). The content is served if it has been cached in the content store; otherwise, an entry is made in the PIT and the Flow Table, and the interest packet is forwarded to \(q_{3}\) through \(n_{8}\). The content is served if it has been cached in the content store; otherwise, an entry is made in the PIT and the Flow Table, and the interest packet is forwarded to \(P_{1}\). Producer \(P_{1}\) responds to the interest packet by issuing corresponding content towards \(C_{1}\) through the path \(q_{3}\), \(n_{8}\), \(q_{2}\), \(n_{7}\). The first encounter of the QoS content with a QoS node \(q_{3}\) invokes the admission-control algorithm for its content store, and leads to the adoption of the Flow ID for that content, so that all future content belonging to that Flow ID is cached in \(q_{3}\). \(q_{2}\) knows that the content Flow ID is adopted by \(q_{3}\) through interest/data packet exchange triggered by the admission-control algorithm, so the content is streamed through \(q_{2}\) without adoption or caching. The format of the QoS table for \(q_{3}\) is shown in Table 4.  
Figure 3: A representation of a path connecting content producers and consumers for illustration.