| Algorithm 1 Processing Interest Packet | |
| OnInterest (interest) | |
| 1 | // Check PIT entries for matching interest. 0 means not found. if PIT (interest) == 0 then |
| 2 | Create a PIT entry for interest |
| 3 | else merge interest to PIT, drop interest and break |
| 4 | end if |
| 5 | data = Create Data () |
| 6 | // Check CS entries for matching interest. 1 means found. if CS (interest) !=0 then |
| 7 | // Check CS entries for matching probe. if CS (interest.probe) !=0 then |
| 8 | add routerID to probe-response |
| 9 | add probe-response to data |
| 10 | add content to data |
| 11 | Returndata |
| 12 | end if |
| 13 | // If no matching interest in CS, then continue to check CS entries for matching probe. else if CS (interest.probe) !=0 then |
| 14 | add routerID to probe-response |
| 15 | // Check if interest needs to add a probe. else if interest.probe == 0 then |
| 16 | // select a probe in PIT or FIB name = find an entry in PIT (max popular) or FIB (max cost) |
| 17 | add name to interest.probe |
| 18 | end if |
| 19 | // outgoing interface = FIB (min cost) |
| 20 | // Get routerID sequentially from FIB entry for each routerID in FIB: |
| 21 | // Get the cost of routerID from SPT and find routerID with lowest cost if SPT (routerID) < mincost |
| 22 | mincost = SPT (routerID) |
| 23 | outgoing interface = routerID |
| 24 | end if |
| 25 | Forward interest |
| 26 | end if |
| 27 | end if |