# Clustered and Distributed Caching Methods for F-RAN-Based mmWave Communications
## 5 Caching Placement in mmWave F-RAN  
The received traffic from various MS terminals at the fog nodes differs in terms of the processing capacity, lifetime, and delay bound. Along with this, the goal is to place popular NFs at the edge of the network at the F-RAN without offloading to the cloud BBU. However, given the limited available resources of F-RAN, efficient cache placement methods are proposed on the fog nodes.  
Two schemes are studied to distribute cached content across the fog nodes. Namely, clustered caching and distributed caching methods. In the earlier groups, all the popular NFs across a single fog node in Layer III, given the abundant resources across the secondary fog nodes. Meanwhile, the distributed caching method allocates a single popular NF across every node in each cluster. The interconnection between the cluster nodes yields in the total cached NFs, where each host fog is directly connected to an adjacent node that caches another popular NFs. Consider the details of the caching methods.  
_Clustered Caching Method:_ Consider an incoming request \(r\) that generates from an MS terminal \(m\), requesting \(\mathbf{F}_{r}\) set of NFs. This request is received as the _src_ node, which is the closest fog node to the terminal. The traffic traverses to Layer III, which contains the cached NFs. If any of the NFs is not supported at the node, then mapping is conducted across the direct neighbor in Layer II, which is in the direction of the path toward the _src_ node. Consider the set of popular NFs as \(\mathbf{S}=\{s\}\) for each batch requests \(\mathbf{R}=\{r\}\). This set is group mapped on the secondary fog node as,  
\[\sum_{s\in\mathbf{S}}n_{j}\ =\ 1,\forall n_{j}\in\mathbf{N},\forall r\in\mathbf{R}. \tag{8}\]  
Now the path for request \(r\) to the host secondary node is established to minimize the function \(\mathbf{F}=min\ (D(src,\ n_{j}))\),  
\[Path(r)= \big{\{}n_{i}\,,\ e|min\ (D(n_{i}\,,\ n_{j}))\big{\}},\ \forall r\in \mathbf{R} \tag{9}\]  
where \(D(.,.\.)\) is the path delay between any two nodes across Layer II and III.  
Here, a set of shortest paths result based on the end-to-end delay, which are sorted in ascending order, after which the least-delay path is selected. If any of the requested NFs in  
Figure 2: Content Popularity for Network Functions [32].  
\(\mathbf{F}_{r}\) does not exist in \(\mathbf{S}\), then mapping is performed across the closest primary fog node in Layer II, which is termed as the host primary node \(\overline{n}_{i}\), i.e.,  
\[\overline{n}_{i}\gets n_{i}|minD\big{(}n_{i},n_{j}\big{)},\forall n_{i} \in\ Path(r)|d\big{(}n_{i},n_{j}\big{)}\ =\ 1. \tag{10}\]  
where mapping is formulated as,  
\[\mathbf{F}_{map}\ =\ \mathbf{F}_{r}-\mathbf{S},\textit{i.e.},\sum_{\forall f_{i} \in\mathbf{F}_{map}}\overline{n}_{i}\ =\ 1,\forall f\
otin\mathbf{S}. \tag{11}\]  
Distributed Caching MethodThe popular NFs are cached separately across the fog nodes of each cluster. Then, incoming requests are routed to the sequence of interconnected nodes that host the entire cached NFs. The rationale behind this distribution mechanism is to avoid increased traffic directed toward a single node and link, i.e., in effort to avoid node/link congestion and failure. Accordingly, a single popular NF \(s\in\mathbf{S}\) is cached on each host node \(\overline{n}_{i}\) in Layer II,  
\[\sum_{\forall s\in S}\overline{n}_{i}\ =\ 1,\forall n_{i}\in\mathbf{N} \tag{12}\]  
The result is a set of interconnected nodes and links that form the cached path, \(\textit{Path}(\mathbf{S})\), where all incoming requests are routed across it, \(\textit{Path}(\mathbf{S})=\{\overline{n}_{i},\) e\(\}\). Along with this, an incoming request demands \(\mathbf{F}_{r}\) NFs. If any \(f_{t}\exists[\overline{n}_{i}|\overline{n}_{i}\in Path(\mathbf{S})]\), \(\forall f_{t}\in\mathbf{F}_{r}\) then the method maps \(f_{t}\) on the first node in the path closest to the MS \(m\).