# Smart Collaborative Caching for Information-Centric IoT in Fog Computing
## 4 Validation and Discussion
### Scenario One: Simple Status Inquiry (One Request and One Response)  
Suppose each subscriber requests one piece of content from 100 publishers. The corresponding applications might be data collections, remote control, etc. All the information sent by the publishers can be compressed into one packet inside the rendezvous server. We first carried out a theoretical analysis for multiple candidates. Both the packet number and transmission latency will be checked carefully. For the packet number, when the subscribers want to achieve contents, the best case is: the first subscriber initiates one request to the cluster 1. If the packet can reach the rendezvous server through one hop, it is the shortest path. Then the rendezvous server sends one request packet to each publishers. When receiving these requests, the publishers should return 100 responses back to the rendezvous server. Since all these responses will be aggregated into a content packet and returned back to cluster 1, only one packet appears in the network. Finally, this packet is forwarded to subscriber 1. During previous procedures, there are \(1+1+100+100+1+1\) packets in total, i.e., \(P_{1B}=204\) (\(P\) for \"Packet number\", 1 for \"the first subscriber\" and \(B\) for \"Best\"). The worst case is: after the subscriber sends the request, such packet reaches the rendezvous server through \(N\)-1 clusters, which is the longest path. In this case, \(N-1\) packets will be forwarded. Then 100 request packets are transmitted from the rendezvous server to 100 publishers. Since the reverse direction of data flow will generate the same packet, the total packet number \(P_{1W}\) (\(W\) for \"Worst\") can be calculated via Equation (2):  
\[P_{1W}=1+(N-1)+100+100+(N-1)+1=200+2N \tag{2}\]  
When the \(i\)th subscriber initiates the request (\(i\
eq 1\)), since the request of previous subscriber(s) had been received, the aggregation of required content should be stored inside the rendezvous server. Therefore, the interaction between rendezvous server and publishers can be waived. To minimize the number of packets in the network, the path should be as short as possible. The best case is: it takes one hop to reach the rendezvous server and the required content returns back to the subscriber in the same way. During such procedures, there are \(1+1+1+1\) packets in total, i.e., \(P_{iB}=4\). The worst case is: it takes \(N-1\) hops in both forward and backward directions inside network. The total packet number \(P_{iW}\) should be equal to \(2N\). To illustrate the mean level of all cases, we calculate their value range by using Equation (3):  
\[\left[\sum_{i=1}^{100}P_{iB}/100,\sum_{i=1}^{100}P_{iW}/100\right]=[6,2+2N] \tag{3}\]  
For the transmission latency, it is defined as the period between request sending and content receiving. All the Round Trip Times (RTTs) are equivalently set and the fluctuations of jitters are set to 5 ms. We assume that the delay of each link is half of \(RTT\) and the 100 publishers receive (send) the requests (responses) simultaneously. In forward direction, when the first subscriber initiates a request, it has to pass by several clusters and the rendezvous server before arriving at the publishers. The minimum latency is \(3\times RTT/2\), i.e., only \(1\) cluster is involved. In backward direction, when all publishers have returned 100 responses, the aggregation delay inside the rendezvous server can be ignored since the \(RTT\) is relative large. If the reverse path is maintained, the overall minimum latency \(L_{1B}\) (\(L\) for \"Latency\") should be \(3\times RTT\). Similar with previous analysis, the maximum latency will appear if all clusters are involved in both directions. The calculation of \(L_{1W}\) is shown in Equation (4):  
\[L_{1W}=\frac{RTT}{2}\times(1+(N-1)+1+1+(N-1)+1)=RTT\times(1+N) \tag{4}\]  
When the \(i\)th subscriber initiates the request (\(i\
eq 1\)), it will take 1 (\(N-1\)) hop(s) between the first cluster and the rendezvous server in the best (worst) case.