If the entire system is fully relying on one approach, it may not be adaptive due to the dynamic nature of mobile network environment. For example, in some cases, utilizing the classic mobile peer-to-peer (MP2P) communication can be more efficient than utili- zing Fog when the participants are sending small size messages. On the other hand, Fog can be more efficient than MP2P when the participants intend to share large size media files. Furthermore, in the case where the participant is situated in a high-density area, where Wi-Fi and Bluetooth signal interaction is occurring frequently, which can make the short range based communication extremely slow, the Cloud-based approach may become a better option. With this in mind, the proposed FSN framework also contains an adaptive resource-aware Cost-Performance Index (CPI) scheme, which can autono- mously decide which is the best route to deliver the messages for MMSN nodes based on the runtime context factors. This section provides the details of the CPI scheme.
Let O = {oi : 0 ≤ i ≤ N} be a set of routing options (e.g. via mobile P2P, via Fog,
via Cloud etc.).
Cost of an option ox ∈ O (denoted by costx) is computed by:
costx = |C| X j=0 vjx P|O| i=0v i j × 1 − q 1 − (wj)2 ! (4) where:
– vx
j denotes the value of the cost element cj of option ox.
– vji denotes the value of the cost element cj of option oi.
– wj is the weight of the cost element cj.
Figure 7 illustrates the generated value from 1 − p1 − (wj)2 where γ = 1 −
p1 − (wj)2, which defines the stimulus of weight to the cost.
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 γ Wj
Figure 7. The weight calculation.
The weight w is a dynamic value influenced by the hardware usage. The higher the current hardware usage, the higher the weight can be.
The weight of a cost element cy ∈ C (denoted by wy) is computed as below:
wy = (Uy)con P|C| j=0(Uj)con (5) where:
– U is the current average resource usage value. It is between 1 to 100 (representing 1% to 100% of the resource usage). For example, “CPU = 67" denotes CPU currently has 67% usage of its available threshold; “battery = 30" denotes battery has been used up to 30% (i.e. 70% left) of its available threshold.
– con is the value that can influence the constraint of the weight and con ≥ 1. By default, con is 2, in which the variety of the weight increases explicitly high when it is closer to the threshold.
Note that the available threshold does not necessarily equal to the total availability of the hardware resource. The user can decide for example that the total available threshold of the energy is 70% of the hardware battery capacity. The details of how the user can
define the threshold will involve the user interface design, which is out of the scope of this thesis.
The performance of each option is measured based on their timespan. LetT = {τi :
0 ≤ i ≤ N} be a set of timespan values of the options, where τidenotes the timespan of
oi. Let τxbe the normalized timespan value of option ox ∈ O, which is computed by:
τx= P|Ex| l=0 S Ml−EDl P|T | i=0τi (6) where: – Ex = {e
l: 0 ≤ l ≤ N}is a set of node pairs for delivering a message from sender
to the receiver involved in option ox.
– S is the size of the data that needs to be sent from the sender to the receiver(s). It is formatted in Megabit (Mb).
– Ml is the default transmission speed of pair el in Megabit per second (Mbps),
which depends on the protocol used by the involved nodes.
– ED is the sum of the delays of all the environmental delay factors D. D = {Dm :
0 ≤ m ≤ N}, which are dynamic delay value influenced by the environmental network conditions. For example, in a high-density environment, a large number of wireless network transmissions are happening, the ED can be high.
Let τ0 be the normalized value of τ . For option ox ∈ O, its normalized τ value
(denoted by τx0) is computed by:
τx0 = P τx
i∈|O|τi
(7) Afterward, the performance rank of an option ox ∈ O (denoted by perfx) is com-
puted by:
perfx= 1 − τx0 (8)
where the lower timespan the option involves, the higher performance rank it has. Finally, the CPI score of option ox ∈ O (denoted by CP Ix) is computed by:
CP Ix =
perfx
costx
(9) Higher CPI values imply a more cost efficient approach, while lower values indicate that the cost is higher than the gained performance value.
5.3
Summary
This chapter introduced Fog Social Network, a framework to enhance the reliability and cost efficiency of Mobile Mesh Social Network.
Initially, the overview of the environment described various aspects of the multi- layered Fog Social Network approach.
These aspects included the elements of the Cloud layer, the Edge network and its characteristics, sign-in process, adaptation of the system in relation to various charac- teristics (e.g., the agility of a given routing option, etc.).
In addition, the author introduced the Cost-Performance Index (CPI) scheme, in or- der to improve the system’s ability to adapt to different scenarios caused by the dynamic nature of the mobile network environment. The decision is made by weighing the per- formance of the possible routing approach to the cost, by calculating the CPI value of the approaches.
6
Evaluation
This chapter consists of the experimental evaluation of the previously introduced chap- ters and concepts of the thesis, corresponding to the Fog service discovery, mobile Fog computing and the proposed Fog Social Network.
6.1
Prototype System Architecture
Figure 8. Components of the prototype system architecture.
Figure 8 illustrates the main components of the proposed prototype architecture, which consists of the components of Fog server node on the top and the components of the end-user node (i.e., mobile host) on the bottom. Correspondingly, the descriptions of the components are as follows.
Fog server
Work Processor is responsible for the actual processing of the work, by running the runnable to process the data.
Monitoring service is responsible for handling the information regarding the current hardware usage of the Fog node. This is the component that will have the most influence in the context of whether or not work will be stolen or executed.
Work Managerhandles the work items and runnables. On the Fog node it is responsible for requesting and distributing of work runnables, work items and results. It would
also be responsible for the downloading of any runnables, such as the jar file or Docker image.
Communication managerenables the interaction between the Fog server and the MASN peers, IoT sensors, and other external entities.
Local Storagecomponent is responsible for the local persistence of the work items and runnables. This is also the parent component for the work item queue.
Message Controlleverages the interaction among the components of the system. Mobile host
Communication managerreceives or transmits the requests and responses between the the user’s device and the Fog node or any other possible external entities, such as interaction with the MASN peers, IoT sensors, etc.
Fog Service Adaptor is a component responsible for keeping the user’s device con- nected to a Fog node, including the autonomous seeking and reconnecting with a new Fog node (with the assistance from the other components) in the case of a disconnection.
Location Serviceconsists of map capabilities and GPS mechanism. It provides a cur- rent location for the other components when necessary.
MASN Discoverycomponent handles the peer discovery in MASN.
Work Manager handles the work items and runnables. Its responsibilities would in- clude the distribution of the work runnables, work items and also for receiving the results of the processing.
Routing Information component handles the knowledge of which peers the device should send the message to in order to let the message reach the destination node. It records the intermediate peers that previously have provided a connection to a certain node, based on the peer-to-peer traffic and peer requests.
User Application represents the end-user application which requires the assistance from Fog.
Other Adaptors denotes the other components the system uses to interact with IoT services and other external entities. Generally, these are the components that utilize RESTful APIs to interact with external service providers.
Local Storage component is responsible for the local persistence of the work items, runnables and the messages regarding discovery, e.g., Fog Discovery messages. Message Controlleverages the interaction among the components of the system.