Research Article

Popularity-Aware In-Network Caching for Edge Named Data Network

Algorithm 1

Pop caching decision algorithm.
Input:Data - Packet of Data;
   PIT - PIT table of NDN;
   N - Number of sub-Face;
   T - Threshold for caching content;
Output:Caching Decisions - (i). Cache & Forward; (ii). Only Forward.
//Deployed in all of caching nodes
1. While ( newDatais return ) {
2.  if (Data.CacheTag != 0 ) {
3.   Forward(Data) // This Data has cached in upstream node, just forward it
4.  }else{
5.   // N_cur is number of sub-Face which has requested this Data
6.   N_cur = Search(http://Data.name, PIT)
7.   Request_ratio = N_cur / N // Get Request_ratio
8.   if (Request_ratio >= T){
9.   // Data was requested on most sub-Face, it’s suitable for caching at downstream node
10.   Forward(Data) // Forward Data
11.  }else{
12.   // Data was requested on few sub-Face, it’s suitable for caching at here
13.   Data.SetCachedTag(1) // Set cached Tag = 1
14.   Cache(Data) // Cache Data
15.   Forward(Data) // Forward Data to downstream nodes
16.  }
17. }
18. }