## 7 Performance Evaluation
### Comparative Tracking Performance Returned by DeepFogSim
The first scenario, presented in Figure 15, refer to the case in which \(\text{Fog}(1,3)\) and \(\text{Fog}(2,3)\) nodes sequentially fail under \(T2\) topology. This figure illustrates the obtained dynamic behaviors of the total and networking energy \(\mathcal{E}_{\text{TOT}}^{(best)}\) and \(\mathcal{E}_{NET}^{(best)}\), as well as the Lagrange multipliers \(\lambda_{1}\) and \(\lambda_{4}\) associated to the first and last constraints on the inference times in (23b). Figure 15 shows that increasing values of the \(a_{MAX}\) clipping factor speed-up the convergence of Algorithm 1 and the Fog platform of Figure 3_self_-adapts its resources in within 70 iterations (see the third and fourth plots in Figure 15). In addition, we can argue that the tracking behavior is robust to the settings of the \(a_{MAX}\) parameter, so that the resulting technological platform of Figure 3 is capable of self-react and promptly adapt to abrupt failures of some of FNs composing the execution platform within a broad range of values of the \(a_{MAX}\) clipping factor. A careful examination of the second and fourth tracts of the curves of Figure 15 (i.e., the index intervals 90-180 and 270-360) shows that the energy  
Figure 15: Tracking performance of _DynDeFog_TRACKER_ under the sequential failure of nodes \(\text{Fog}(1,3)\) and \(\text{Fog}(2,3)\) of topology \(T2\). assumes the same steady-state values. This behavior is justified by the symmetry of the considered topology after failure events. In fact, in both the segments, the failure event involves one of the two FNs located at _tier_ #3 of \(T\)2 in Figure 8 that share the same values of the underlying resources. In both cases, after the failure, _tier_ #3 remains with a single active FN, and then it consumes the same energy. Finally, the second scenario featured by Figure 16 refers to the case in which \(\text{Fog}(1,3)\) and \(\text{Fog}(4,2)\) nodes of the topology \(T\)2 sequentially fail. This figure suggests a convergence behavior similar to the previous scenario, and once again the platform is capable of automatically and promptly adapting its resource allocation for coping with the experienced failure event. However, in this case, differently from the first scenario, the failures involve nodes located at different tiers of the \(T\)2 topology, and this gives rise to asymmetric steady-state behaviors. In fact, a careful examination of the curves in Figure 16, specifically in the second and fourth tracts (i.e., over the index intervals 90-180 and 270-360), shows that the steady-state energy assumes different values. Specifically, the total energy \(\mathcal{E}_{\text{TOT}}^{(\text{best})}\) after the failure of \(\text{Fog}(4,2)\) is about 17 (Joule) greater than the corresponding one after the failure of \(\text{Fog}(1,3)\). This behavior is justified by both the convexity of the energy model introduced in Section 4 and the fact that the workload to be processed at each tier reduces going up in the topology, towards the Cloud node, since a considerable fraction of the workload undergone early exits. This observation implies, in turn, that the failure of FNs at lower tiers (such as \(\text{Fog}(4,2)\)) causes a greater energy consumption than the failure of FNs at higher tiers (such as \(\text{Fog}(1,3)\)). Figure 16: Tracking performance of _DynDeFog_TRACKER_ under the sequential failure of nodes \(\text{Fog}(1,3)\) and \(\text{Fog}(4,2)\) of topology \(T\)2. To summarize, the proposed _DeepFogSim_ toolkit can be considered as an effective software tool for simulating and testing the energy-vs.-delay performance of the technological Fog platform supporting the distributed execution of the inference phase of CDNNs with early exits.