# Provisioning of Fog Computing over Named-Data Networking in Dynamic Wireless Mesh Systems
## 3 The Proposed Solutions
### Adaptive Forwarding Strategy  
The NDN Forwarding Daemon supports modular design and extensibility for NDN protocol. At the data plane, its main functionalities are related to switching packets between its internal components. When the Forwarder receives a packet from an underlying link-layer service, it will consult a forwarding strategy for handling the packet, i.e., inserting, deleting, or updating any needed information in supplementary tables. Thus, by implementing a forwarding strategy, it is possible to control packet flows by making decisions on whether, when, and where to forward the packets. To evaluate fog computing in dynamic wireless meshes, we considered a self-learning strategy considered in [37]. In our setting, this strategy attempts to find and maintain all (or at least a set of) possible routes by not only forwarding an interest through the already known route but also by probing other faces. This approach is also known as the probing mechanism in the Adaptive Smoothed Face-routing (ASF) strategy. The combined strategy leverages the benefits of the dynamic Face management system. The high-level algorithm behind the proposed combined strategy is illustrated in Figure 5 and consists of the following steps:  
* _Initial broadcast search._ The incoming Interest packet is forwarded over all the outgoing interfaces when there is no knowledge available locally about the requested Name. Upon receiving such an Interest packet, a corresponding routing information entry is created. * _Receiving data reply._ Receiving the Data packet over a certain Face implies that the producer is available via that Face. Thus, it can be further utilized for forwarding further Interest packets with the same Name. * _Unicast search._ For a predefined time window, any other similar Names are forwarded directly through the explored direction (Face). During this time, all other Faces are not used. This allows the strategy to minimize broadcasting overhead. * _Periodic probing._ Once in a predefined time window, after a new Interest packet with the already known Name is received, this Interest is sent over all the outgoing Faces that previously did not yield a data reply. This step is needed for both counteracting any possible network topology changes and discovery of other producers. The algorithm of the considered strategy can be presented in two separate pipelines: Figure 6 shows inbound Interest packet processing and Figure 7 inbound Data packet processing. In both cases, the information about the packet passes from the Forwarder to the Strategy to decide how to proceed with this. See also Table 1.  
Figure 4: Illustration of the proposed modifications. Figure 5: Illustration of the proposed window forwarding strategy. Figure 6: Inbound Interest handling. Figure 7: Inbound Data handling. The Interest-handling algorithm is illustrated in Figure 6. Upon receiving an Interest packet, the Self-Learning Strategy utilizes current local knowledge to decide which Faces to use for forwarding. If an Interest packet with a new prefix arrives, the Self-Learning Strategy creates a new entry for all available Faces. For all the previously explored Names, the Self-Learning Strategy holds a decaying time window. If a Face is marked positively, it means that a Data packet with the same Name has been handled before. Thus, this Face has the highest chance of receiving a reply again, and the Self-Learning Strategy forwards a copy of this Interest packet via this Face. At the same time, the strategy checks if the Face was marked positively for a certain period of time (the default value is 10 s, but it can be adjusted depending on the network dynamics) without receiving any Data replies. If this is the case, the strategy marks it as negative and sets a timer _FValue_. When a Face is marked negatively, it is no longer used for forwarding purposes, while the values of _FValue_ timer decreases with each time step. When the _CurFValue_ timer reaches zero, and a copy of Interest is forwarded via this Face for probing.