# Context-Aware Pending Interest Table Management Scheme for NDN-Based VANETs
## 5 Context-Aware Pending Information Table Entry Management (CPITEM) Scheme
### Non-Safety PITE Priority
#### 5.2.4. PITE Priority
If all of the entries in the PIT are related to safety applications, the incoming Interest message (\(IntMsg\)) will be simply dropped in the event of PIT overload (Line 12, Algorithm 2). If the received Interest message is of type non-safety (Line 13, Algorithm 1) the priority of the incoming Interest \(PITE\) and priority of the lowest non-safety \(PITE\) in the PIT will be compared. If the priority of the incoming Interest \(PITE\) is greater than the priority returned by the method \(LowPriorityNonSafetyPITE()\), then the corresponding \(PITE\) in the PIT will be removed from the PIT. Afterwards, \(PITE\) for the incoming Interest will be added (Line 19, Algorithm 2). \(ComputePriority(IntMsg)\) method computes the priority of incoming Interest \(PITE\) considering Equation (4). Algorithm 3 illustrates the working of the \(LowPriorityNonSafetyPITE()\) method. If one or more non-safety \(PITE\)s exist in the PIT, this method returns the lowest-priority non-safety \(PITE\) reference and its priority. This method computes the priority of every \(PITE\) in the PIT considering Equation (1) to Equation (4). Afterwards, the non-safety-content \(PITE\) with the lowest priority is searched and returned. ```
1//Interest message \((IntMsg)\) include content name \((CACN)\)
2\(interestName\leftarrow\) IntMsg.Name
3\(CT\leftarrow\) GetContentType\((interestName)\)
4\(If\)\((CT==Safety)\)
5\(PITE\), Priority \(\leftarrow\)\(LowPriorityNonSafetyPITE()\)
6\(If\)\((PITE=Null)\)
7 RemovePITEinPIT(PITE)
8\(AddPITEinPIT(\)IntMsg)
9 Set IntMsg to Forward
10 Else
11//All PITE are related to safety in PIT. No space for new entry
12 Discard(IntMsg)
13 Else
14\(PITE\), Priority \(\leftarrow\)\(LowPriorityNonSafetyPITE()\)
15\(//\) ComputePriority(\(IntMsg\)) computes recent IntMsg PITE Priority using Equation (4)
16\(Priority1\)\(\leftarrow\) ComputePriority(\(IntMsg\))
17 If \((Priority1>Priority)\)
18\(RemovePITEinPIT(PITE)\)
19\(AddPITEinPIT(\)IntMsg)
20 Set IntMsg to Forward
21 Else
22//All PITEs in PIT have high priority compared to received message PITE priority. No space for new entry
23\(Discard(IntMsg)\)
```  
**Algorithm 2** Contextaware_PITE_Replacement (IntMsg)  
```
1//Interest message \((IntMsg)\) include content name \((CACN)\)
2\(PITLoad\gets 0\)
3\(interestName\leftarrow\) IntMsg.Name
4\(For\)\(each\)\(PITE_{j}\in PIT\)
5\(PITLoad\gets PITLoad+(Size_{PITE_{j}}*PEL_{PITE_{j}})\)
6\(LowestPITEPriority\leftarrow\beta//\beta\) is a Highest Value
7\(LowestPITE\leftarrow\) Null
8\(For\)\(each\)\(PITE_{i}\in PIT\)
9\(AppID\leftarrow\) GetAppID(interestName)
10\(Eminence_{PITE_{i}}\leftarrow\frac{PILapsed}{Eminence_{PITE_{i}}}\)
11\(Utility_{PITE_{i}}\leftarrow\frac{(Size_{PITE_{i}}*PEL_{PITE_{i}})}{Eminence_{PITE_{i}}}\)
12\(//\) Compute Application Popularity using Equation (3)
13\(Utility_{App}\leftarrow ComputeAppltility(AppID)\)
14\(Priority_{PITE_{i}}\leftarrow\)\(Utility_{PITE_{i}}+Utility_{App}\)
15 If \((Priority_{PITE_{i}}<LowestPITEPriorityity)\)
16\(LowestPITEPriority\gets Priority_{PITE_{i}}\)
17\(LowestPITE\leftarrow\)\(PITE(PITE_{i})\)
18 Return LowestPITE, LowestPITEPriority

## 6 Performance Evaluation

For evaluation of our proposed scheme called the CPITEM protocol, which exploits the CACN naming scheme, we implemented it in \(ndnSIM\)[11]. We compare our scheme's CPITEM performances with the HLLR [10; 26; 27]. A similar PIT-replacement scheme is presented in [10; 26; 27]. In the event of a PIT overflow in HLLR, the \(PITE\) with the longest lifetime and fewest requests is replaced with a \(PITE\) of the newly received Interest. In case of CPITEM, likewise, the original NDN-forwarding daemon, the consumer vehicle, sends an Interest message containing the default attributes including Nonce, \(InterestLifetime\), and hop count. The Data name is constructed based on our previously proposed context-aware content-naming scheme [9]. The CACN Data-naming scheme allows for the identification of both safety and non-safety contents.