Towards Distributed Service Allocation in Fog-to-Cloud ... - IEEE Xplore

2 downloads 0 Views 985KB Size Report
integration of Fog Computing and Cloud Computing through the coordinated ... scenarios, the Cloud Computing architecture introduces a ..... cloud_preprint.pdf).
Towards Distributed Service Allocation in Fog-to-Cloud (F2C) Scenarios Vitor Barbosa Souza*§, Xavi Masip-Bruin§, Eva Marín-Tordera§, Wilson Ramírez§, Sergio Sánchez§ *

§

Informatics Department (DPI), Universidade Federal de Viçosa (UFV), Viçosa, Brazil Advanced Network Architectures Lab (CRAAX), Universitat Politècnica de Catalunya (UPC), Barcelona, Spain Email: [email protected], {xmasip, eva, wramirez, sergio}@ac.upc.edu

Abstract—The novel Fog-to-Cloud (F2C) computing paradigm has been recently proposed aiming at the enhanced integration of Fog Computing and Cloud Computing through the coordinated management of underlying resources, taking into account the peculiarities inherent to each computing model, and enabling the parallel and distributed execution of services into distinct fog/cloud resources. Nevertheless, studies on F2C are still premature and several issues remain unsolved yet. For instance, in an F2C scenario service allocation must cope with the specific aspects associated to cloud and fog resource models, requiring distinct strategies to properly map IoT services into the most suitable available resources. In this paper, we propose a QoS-aware service distribution strategy contemplating both service requirements and resource offerings. We model the service allocation problem as a multidimensional knapsack problem (MKP) aiming at an optimal service allocation taking into consideration delay, load balancing and energy consumption. The presented results, demonstrate that the adopted strategy may be applied by F2C computing reducing the service allocation delay, while also diminishing load and energy consumption on cloud and fog resources. Keywords—Fog-to-Cloud distributed systems

Computing;

service

allocation;

I. INTRODUCTION The advances on Cloud Computing observed on the last decade, aligned to the emergence of the Internet of Things (IoT) concept, led the IT companies to think up a new portfolio of services best suiting users’ demands and needs in the envisioned future internet scenario. The new services cover different sectors including Smart Home, Environmental Monitoring or Vehicular Networks, among others. Albeit several use cases have been successfully deployed in real scenarios, the Cloud Computing architecture introduces a number of limitations mainly concerning to the inherent inability of supporting real-time, no-delay-tolerant services, due the latency faced by cloud data centers when connecting to devices located at the edge of the network. The Fog Computing concept was introduced by [1] as a solution to reduce the delay perceived in IoT scenarios. Fog Computing proposes the use of idle computational resources available at edge devices, such as mobile phones and vehicles, as a shared and highly virtualized micro data center, enabling services to be executed “locally” at the edge of the network. Indeed, Fog Computing has shown encouraging results when deploying fogs in IoT scenarios extending the benefits beyond the low delays acquirement on service requests, being able to

avoid cloud servers overload, achieve network usage reduction, and build energy-efficient data centers [2, 3, 4]. Nonetheless, the Fog Computing’s goal is not to compete with Cloud Computing, rather, their symbiotic relationship turns out to bring benefits for both. In fact, services requiring plenty of resource capacity, such as CPU, storage, or energy, may not be able to run completely on constrained edge resources, hence, requiring computational power provided by conventional cloud data centers. On the other hand, services not requiring high processing capacities, or requiring low delay on data acquisition from real-time sensors, may be processed at edge devices, avoiding network and datacenter resources overload. In order to control and coordinate the usage of distinct fog and cloud resources in a parallel and distributed fashion, the Fog-to-Cloud (F2C) computing paradigm [5] has been recently proposed. Conceptually, the F2C architecture splits the fog and cloud resources into distinct logical layers, enabling service decomposition and parallel execution in distinct fog and cloud layers. To that end, F2C takes into account the suitability of resources to fit the requirements for each subservice produced by the service decomposition. The different logical layers may be created according to the underlying resources capacity, reliability and volatility, among other parameters, being a yet challenging F2C control plane responsible for decomposing, distributing, and aggregating the service to be executed. With the service distribution and parallel execution, the F2C architecture mirrors the benefits emerged in the high performance computing field, when parallelizing software execution through multicore platforms. Nevertheless, albeit the proposed F2C architecture may enable the deployment of QoSaware services in dynamic IoT scenarios, the allocation of services in F2C turns to be a challenging problem. Indeed, besides the challenges introduced by Fog Computing, the service distribution must be performed taking into account the distinct requirements for each subservice in conjunction with the distinct service types each F2C resource can allocate. Moreover, even admitting that several benefits may be attained by the allocation of services on devices at the edge of the network, a service allocation strategy must also ponder the fact that these devices, besides being constrained both in IT and energy availability, should always keep enough free resources in order to run user processes. In this work we present and discuss a strategy for service allocation in F2C structured as follows. In section 2, we present relevant works in service allocation in IoT scenarios. In section 3, we describe our strategy for service allocation in

978-1-5090-1328-9/16/$31.00 ©2016 IEEE

F2C as well as the model developed for this work. In section 4, we present the results obtained by the described model and finally in section 5, we conclude the paper. II. RELATED WORK Several works assessed the use of IoT devices as source of data for cloud services. Nevertheless, few works have explored the processing capacity of devices at the edge of the network, as first proposed by Fog Computing, and later by F2C Computing. Reference [6] aims at achieving low delay on service execution focusing on data acquisition delay, not considering the potential benefits in terms of response time of employing fog resources for computing purposes. In the same way, albeit the Real-Time Thing Allocation algorithm (RTTA), proposed by [7], is demonstrated to be a run-time computation efficient heuristic, only data collection nodes are considered and, besides that, only energy constraint is evaluated, assuming that all other resources are unlimited. On the other hand, [8] presents a strategy to divide a service into small tasks that may be run in parallel on edge devices, with further combination of results. However, the focus on the distributed execution of services with high processing requirements on edge devices yielded results worse than the centralized execution. Authors argue that their solution is useful for service providers with small/moderate budget running delay tolerant service. Albeit [9] presents a study of the energy consumption in Fog-Cloud computing systems, the studied architecture is not F2C-compliant. The work presented in [10] is the first to describe a strategy for service allocation in F2C computing. Nevertheless, the presented results are based on a model that simplifies the service allocation problem by assuming just one resource type. Therefore, the services differentiate just in terms of number of required resources. Some works have also proposed distinct strategies for mobile services distribution. The strategy proposed by [11] enables the service distribution between an edge device and a remote server by means of a static threshold to make offloading decisions. However, the strategy does not enable service partitioning and parallel execution. In order to enable service division, rather than employing language-based finegrain solutions, such as JVM (Java Virtual Machine), [12] proposes a coarse-grained and language-independent approach where a service developer with little training is able to quickly apply modifications to the code, tailoring complex applications, obtaining few errors and high quality. The service allocation strategy proposed in this paper differs from previous works on the following: (1) it does not limit the service allocation at the edge resources to data acquiring; (2) it contemplates distinct constraints inherent to edge devices such as processing and energy limitations; (3) it is compliant to F2C distributed and parallel service allocation. III.

SERVICE ALLOCATION IN F2C

In this section, we describe the service decomposition strategy introduced by F2C and how it is applied to the strategy proposed by this work in order to perform the service distributed allocation. Later in this section, we present the model for the service allocation strategy.

Fig. 1. Service matching example: (a) Atomized service requiments; (b) Services offered by F2C resources.

A. Service Atomization The strategy adopted by the F2C architecture for service decomposing is the so-called service atomization. The service atomization is responsible for splitting the service into distinct slices, tailored to enable parallel execution. Since a portion of the obtained slices –hereinafter called atomic services– may consist of low-effort tasks, such as low-complexity processing or raw data reading, they may be executed on constrained edge devices, whilst tasks with higher requirements may be allocated on robust resources and executed in parallel with smaller tasks. The service atomization strategy is depicted by the execution graph presented in Fig. 1(a), where nodes not dependent on each other directly or indirectly may be executed in parallel –such as the highlighted nodes–, and each atomic service must be allocated in a F2C resource implementing the required service, which is referred to by a service identifier (SID). Moreover, the F2C layered architecture presented in Fig. 1(b) is based on the innovative work presented in [10] where a F2C architecture (referred to as Combined Fog-Cloud) is described in a comprehensive way, splitting available fog resources into two layers according to underlying nodes capacity and mobility. Therefore, each fog/cloud in Fig. 1(b) presents the set of service types it can allocate –represented by a set of SIDs– and the service allocation is performed by

matching SIDs requested by atomic services and SIDs offered by F2C resources. B. Service Allocation Limitation With the advance of mobile technologies –enabling complex processing and data collection capabilities on edge devices–, using computational resources at the edge, as proposed by fog computing, is a trend. Nevertheless, service allocation in these scenarios must consider important issues regarding resources availability. For instance, whilst one smartphone may offer its idle CPU, its owner (or the phone itself) should limit the total capacity shared as a fog resource. Indeed, sharing idle CPU with no limitations might quickly drain portable devices energy. Furthermore, even if a device is plugged, stressing the CPU usually results on overheating, which might be harmful to the device1. Consequently, new business models may emerge and distinct policies must be created in order to define the amount of idle resources a fog may allocate on devices at the edge of the network. These policies must consider several aspects such as device type (e.g., smartphone, car, laptop, surveillance devices, etc.), its context (e.g., mobility, battery charge, IT resources load, etc.), as well as user sharing preferences, considering the category of services the user is willing to share (e.g., processing, storage, real-time data, etc.) and the maximum accepted resources load. C. Service Allocation Strategy In this work, the sharing relation between one device and its respective fog/cloud is given by the number of atomic services it may offer to be allocated by the fog/cloud, regardless to the service type (i.e., processing, storage or realtime data). This means that if one edge device may offer two distinct service types, e.g., SID:A and SID:B, and is willing to satisfy two service requests, the fog may allocate either one instance of SID:A and one instance of SID:B; two instances of the SID:A; or two instances of SID:B at the referred device. Thereby, in this example, the proposed policy prevents the allocation of three instances of the same SID, as well as the allocation of two instances of one SID and one instance of the other one. The rationale behind this strategy is the assumption that the overall amount of service requests satisfied by a device is more relevant than the number of allocations for each SID. Indeed, once the type of services a device is able to provide is defined, the user’s profile must also be used to define the overall amount of requests the device may allocate. Another example illustrating the benefits brought by the proposed strategy is the following. Let’s consider a device that may offer SID:A and SID:B but is constrained to the allocation of just one SID at a time –e.g., due to reduced available memory. In this scenario, the device is not expected to define one SID to be offered to F2C; instead, the F2C control plane may request the allocation of the service that may enable the optimal allocation of all atomic services. According to the described strategy, in order to accordingly represent the total capacity of F2C resources in terms of both supported SIDs and number of requests it can allocate, we use 1

Battery in portable devices may have reduced lifetime due overheating, as well as overclocked CPUs working continually at maximum capacity without adequate refrigeration.

Fig. 2. Allocation slots are linked to the respective underlying devices according to the each edge device sharing preferences.

the allocation slots concept (or simply slots), where a slot is the minimum service allocation unit and each slot is linked to one of the service requests each underlying device is willing to satisfy, as shown in Fig. 2. Indeed, since F2C resources are abstractions of the available underlying resources, the used strategy results in an architecture with service-agnostic allocation slots, where one slot may provide distinct service types, depending on the underlying device capabilities. To cope with the allocation of atomic services located at the same layer of an atomized service –i.e., being allocated in parallel–, the service request must be specified in terms of the number of slots of each required SID that should be allocated on F2C resources. The F2C control plane should be responsible for the distribution of the atomic services among the available slots, matching atomic service requirements and slot offerings. Moreover, as described in the next section, the allocation strategy aims at reducing the service allocation delay, providing load balancing and energy consumption balancing among distinct fogs. D. Service Allocation Model The service allocation model proposed in this paper aims at obtaining the optimal allocation of all services on the available resources, minimizing the delay for each service allocation, while considering both the amount of resources provided and the energy availability on the underlying devices. To model the former, we assume the delay added by each slot allocation as a constant value assigned according to the layer the respective F2C resource is located at, respecting the described F2C architecture. Therefore, resources located at lower layers, such as the first fog layer, present low service allocation delay, as they are close to the end user. On the other hand, higher cloud layers present high delay. To achieve the latter, we statically represent the resources availability by means of serviceagnostic slots. In a specific moment, each slot may provide at most one SID, according to the SIDs provided by the underlying devices. It is worth mentioning that, for sake of simplicity, we assume that all devices connected to the same fog may offer the same SIDs. In the energy availability side, to represent the consumed energy in the underlying devices, we use a similar concept, referred to as energy cells. Hence, each slot allocation consumes a number of energy cells and the total availability depends on the type of devices connected to the fog or cloud. For instance, a fog constituted by smartphones may have lower number of energy cells than a fog constituted by smart vehicles. On the other hand, fogs and clouds constituted by plugged devices, such as plugged smartphones, plugged electrical vehicles, or datacenters, may be considered with unlimited energy.

According to the described strategy, we model the service allocation problem in F2C as a multidimensional knapsack problem (MKP) where the objective is threefold: (1) minimizing the overall delay for the allocation of all services taking into account the observed delay on distinct F2C layers; (2) minimizing the overload of individual fogs in terms of processing capacity; and (3) minimizing the excessive energy consumption on energy constrained fog resources. Table 1 summarizes the list of symbols used in the presented model, whilst the objective –composed by three terms each representing one of the aforementioned goals– is given by: ∑𝑖∈𝑆 ∑𝑟∈𝑅 ∑𝑘∈𝐾𝑟 ∑𝑠∈𝑂𝑟 𝑌𝑖,𝑟,𝑘,𝑠 𝑇𝑟 

Min: 

∑𝑖∈𝑆 ∑𝑟∈𝑅 ∑𝑘∈𝐾𝑟 ∑𝑠∈𝑂𝑟 𝑌𝑖,𝑟,𝑘,𝑠 𝑊𝑟,𝑘 



∑𝑖∈𝑆 ∑𝑟∈𝑅 ∑𝑐∈𝐶𝑟 𝑍𝑖,𝑟,c 𝑉𝑟,𝑐 



where Y and Z are zero-one integer variables used to respectively indicate the slots allocation and the energy cells usage, so that: 𝑌𝑖,𝑟,𝑘,𝑠 = {

𝑍𝑖,𝑟,𝑐

1, if service 𝑖 is being allocated in resource 𝑟  slot 𝑘 for SID 𝑠 execution 0, otherwise

1, if service 𝑖 being allocated in resource 𝑟 ={ will consume energy cell 𝑐  0, otherwise

the services will never be higher than the resource capacity, which is specified by the total number of slots available on each resource. In addition to that, the constraint imposed by (4) is the one in charge of ensuring, for one requested service, the allocation of all atomic services expected to be executed in parallel, besides being responsible for the matching between the SID required by each atomic service and the SID offered by available F2C slots. It is worth mentioning that, in order to accomplish the matching between the service request and offer: i) we link each service type to a distinct SID, and ii) the amount of SIDs may vary according to the scenario being simulated as well as the services granularity. For instance, we may link processing, real-time data and storage services to SID:1, SID:2 and SID:3, respectively, and represent a fog node offerings as {1,2} if it is able to provide processing and realtime data services. Moreover, the set of atomic services to be allocated in parallel for a specific atomized service may be expressed by {1,2,2,2,3}, meaning that, according to the atomization graph, it is possible the parallel execution of one instance of SID:1 and SID:3, and three instances of SID:2. Moreover, a fine-grained approach for the atomic services allocation in the proposed model allows the specialization of the cited services, for instance, by distinguishing among realtime data types, as well as the creation of new atomic service types, such as data aggregation service. TABLE I.

SYMBOLS DEFINITION

Symbol

Definition

S



∑𝑖∈𝑆 ∑𝑠∈𝑂𝑟 𝑌𝑖,𝑟,𝑘,𝑠 ≤ 1 , ∀𝑟 ∈ 𝑅 ∧ ∀𝑘 ∈ 𝐾r 



Ui R

Set of services to be allocated Set of SIDs required by service i, i.e., a list containing its requirements in terms of service types Number of instances of SID s required by i Total number of slots required by service i, i.e., 𝑈𝑖 = ∑ 𝑁𝑠,𝑖 , ∀s ∈ 𝐿𝑖 Set of F2C resources, i.e., clouds and fogs



∑𝑖∈𝑆 ∑𝑘∈𝐾𝑟 ∑𝑠∈𝑂𝑟 𝑌𝑖,𝑟,𝑘,s ≤ |𝐾𝑟 | , ∀𝑟 ∈ 𝑅 



Kr

Set of slots provided by F2C resource r

Or

Set of SIDs offered by F2C resource r



∑𝑟∈𝑃𝑠 ∑𝑘∈𝐾𝑟 𝑌𝑖,𝑟,𝑘,𝑠 = 𝑁𝑠,𝑖 , ∀𝑖 ∈ 𝑆 ∧ ∀𝑠 ∈ 𝐿𝑖 



Ps



∑𝑖∈𝑆 𝑍𝑖,𝑟,c ≤ 1 , ∀𝑟 ∈ 𝑅 ∧ ∀𝑐 ∈ 𝐶r 



Set of all F2C resources able to offer SID s Delay added by the allocation of an atomic service in resource r, according to its layer Weight of the slot k in resource r



∑𝑟∈𝑅 ∑𝑐∈𝐶𝑟 𝑍𝑖,𝑟,c = 𝑈𝑖 𝐹𝑖 , ∀𝑖 ∈ 𝑆



Li

subject to:



Ns,i

∑𝑐∈𝐶𝑟 𝑍𝑖,𝑟,c = ∑𝑘∈𝐾𝑟 ∑𝑠∈𝑂𝑟 𝑌𝑖,𝑟,𝑘,𝑠 𝐹𝑖 , ∀𝑟 ∈ 𝑅 ∧ ∀𝑖 ∈ 𝑆

In the proposed model, the objective function presented in (1) comprises the three presented goals, where each term of the equation matches one of the goals respectively, i.e., minimizing latency, processing overload, and energy consumption. Therefore, constraints (2), (3) and (4) are responsible for slots allocation, as described in the following. Equation (2) ensures that two or more services will never be allocated in the same resource slot. Notice that, according to the presented service allocation strategy, each slot can offer distinct SIDs, hence, when an excessive allocation of slots providing, for instance, computing service, occurs, the allocation of slots for data collection shall be forbidden, as it is done by (2). Moreover, (3) is the capacity constraint, responsible for ensuring that the number of slots consumed by

Tr Wr,k Cr

Set of energy cells available in F2C resource r

Vr,c

Weight of the energy cell c in F2C resource r

Fi

Energy consumed by each slot of service i

On the other hand, (5), (6) and (7) are responsible for the correct energy cells usage, coherent and consistent to the slots allocation constraints. Whilst the constraint imposed for cells usage by (5) is analogue to the constraint imposed by (2) for slots allocation, (6) is in charge of assigning the exact number of energy cells consumed for each service, taking into account the number of atomic services that are supposed to be executed in parallel, whereas (7) creates the relationship between slots allocation and cells consumption on each resource, assuring that the number of cells consumed by a service on one resource depends on the number of allocated slots on that resource. In order to provide load balancing on F2C resources allocation, distinct weights are assigned to each resource slot according to the model parameters Wr,k and Vr,c. These values

(a)

(b)

Fig. 3. Comparisson of (a) amount of allocated slots and (b) energy consumption in distinct F2C layers.

are related to F2C resources’ load preferences. In other words, the set of slots with lower weight is totally allocated on each resource before the allocation of slots with higher weight takes place. This strategy, depicted by the second term of (1), achieves load balancing, since the allocation of lower weight slots is performed in other resources, if available and all constraints observed. In an analog fashion, the third term of (1) is responsible for balancing the energy consumption among distinct fog resources. IV. RESULTS In this section, we present the results obtained by the described model, assuming distinct simulation scenarios. For all presented results, we adopted the same base architecture, consisting in one cloud layer constituted of cloud data centers, and two fog layers, where constrained devices, such as smartphones, are grouped in the first fog layer, within 4 distinct fogs, whilst vehicles in a parking lot are clustered on the second fog layer, formed by 2 fogs. Moreover, we consider three distinct service types that may be possibly offered by each one of the F2C resources: (1) short-term storage – SID:1; (2) long-term storage – SID:2; and (3) processing – SID:3. The first simulated scenario consists in the employment of homogeneous F2C resources, where resources in the same layer offer not only the same set of SIDs, as Table 2 shows, but also the same number of slots and cells. Hence, we uniformly increase the number of slots into each layer and compare the distribution of the allocated slots among distinct layers of the F2C architecture. It is worth mentioning that this example aims

Fig. 4. Fog load in the first fog layer with homogeneous distribution.

at comparing the allocation of resources required for services not requiring real-time data from edge devices. The rationale behind this is to compare the behavior of service allocation on each layer as the amount of resources on the layers is modified from a traditional cloud environment to a F2C scenario with enough resources on each layer. Therefore, we show the advantages of using fog resources for processing and shortterm storage tasks. The results presented in Fig. 3 show that, in this example, the slots allocation and energy consumption in the cloud never reaches zero since a portion of the requested atomic services cannot be provided by fog layers, as depicted by Table 2. Moreover, the exclusive increasing on the total number of slots in the first fog layer results, in this example, on the diminishing of the cloud usage at most by half, since fog resources in this layer provide one single SID (see Table 2). Nevertheless, although the reduction of 50% on slots allocation at the cloud may be considered a reasonable achievement, the increment on the total number of slots in the second fog layer proved to be efficient in this example by diminishing the cloud slots usage below 50%, further turning into an energy consumption reduction on cloud servers. TABLE II. Parameter Delay to communicate with distinct F2C resources Requested services Offered SIDs Required atomic services SIDs Energy cells consumption Slots weight (Wr,k) Energy cells weight (Vr,c)

SIMULATION PARAMETERS Value Fogs in layer 1 = 1 time units Fogs in layer 2 = 2 time units Cloud = 10 time units 40 Fogs in layer 1 = {3} Fogs in layer 2 = {1,3} Cloud = {1,2,3} 90% of services= {1,3} 10% of services= {1,1,1,2,2,3,3,3,3,3} 70% of atomic services consume 2 cells 30% of atomic services consume 3 cells 0, if k between 0% and 60% of slots in r 1, if k between 60% and 80% of slots in r 3, if k between 80% and 100% of slots in r 1, if c between 0% and 60% of cells in r 2, if c between 60% and 80% of cells in r 5, if c between 80% and 100% of cells in r

Unlike the results presented in Fig. 3 showing the distribution of the allocated slots into distinct F2C layers, Fig. 4 presents the allocation distribution through distinct fogs into the first fog layer, obtained on the same scenario. As depicted by Fig. 4, load balancing is guaranteed by the deployed strategy where distinct weights are assigned to both

Fig. 5. Fog load in the first fog layer with heterogeneous distribution.

distinct slots and energy cells (see Table 2). For instance, if a fog has 60% of its slots allocated, the F2C controller shall avoid the allocation of a new slot in this fog if a less loaded fog is able to satisfy the requested atomic service. It is worth mentioning that the load distribution showed by Fig. 4 is observed due the fact that the first scenario is formed by homogeneous fogs, where the total number of slots and energy cells in the first fog layer is uniformly distributed among all nodes forming this layer. Consequently, as each fog in the first fog layer contains the same number of slots and cells, the distribution of weight values, defined by the parameters Wr,k and Vr,c showed in Table 2, are the same for all fogs. The second simulated scenario, on the other hand, takes into account a heterogeneous service offer considering distinct characteristics for each fog in a particular scenario –e.g. a shopping center, where fog premises are deployed into distinct sectors, such as cinema, hall, food court, supermarket, and parking, among others. In such scenarios, underlying devices may present a large heterogeneity in terms of mobility, system load, energy availability, as well as device type, impacting on the overall capacity. For comparison purposes, we maintained the same set of offered services used in the first scenario and redistributed the number of available resources –i.e., number of slots– in the first fog layer decreasing resources for fog 1 and fog 2, while increasing resources for fog 3 and fog 4. Targeting at the tailoring of the service allocation, the weights associated to slots and energy cells allocation for fog 1 and fog 2 were adjusted in order to reduce the allocation rate of the resources constituting these fogs. Therefore, instead of using the weights showed in Table 2, the slots weight for fog 1 and fog 2 were increased to 0, 3 and 5 respectively to slots from 0% to 50%, from 50% to 70%, and from 70% to 100% of the slots number, while the energy cells weight were adjusted to 1, 4 and 7 respectively to cells from 0% to 50%, from 50% to 70%, and from 70% to 100% of the cells number. Moreover, Fig. 5 shows the modified distribution of the service allocation mainly when the total number of slots is reduced. As the total amount increases and the average usage falls below 50%, the allocation tends to the same rate, since for all resources the weight is defined to same value when allocation is below 50%. V. CONCLUSION This work proposes a service allocation strategy for F2C computing taking into account the distributed and parallel nature of the F2C layered architecture also leveraging both the abundant resources in cloud servers and the limited resources

in fog servers formed by heterogeneous devices at the edge of the network. The presented strategy contemplates the distinct characteristics inherent to each F2C resource in terms of services offered by the underlying devices, thereby performing the service offers and atomic service requirements matching. Moreover, we model the service allocation as a MKP, achieving optimal solutions for the service allocation aiming at diminishing the allocation delay at the same time we enable an adaptive load and energy consumption balancing according to the resource and energy availability in each F2C resource. Furthermore, the introduced service-agnostic allocation slot strategy may be able to optimize the service allocation, avoiding resource underutilization. ACKNOWLEDGMENT This work was partially supported for UPC authors by the Spanish Ministry of Economy and Competitiveness and by the European Regional Development Fund under contract TEC2015-66220 (MINECO/FEDER). Vitor Barbosa Souza is supported by CAPES Foundation, Ministry of Education of Brazil, proc. no 11888/13-0. REFERENCES [1]

BONOMI, Flavio et al. Fog computing and its role in the internet of things. In: Proceedings of the first edition of the MCC workshop on Mobile cloud computing. ACM, 2012. p. 13-16. [2] ZHU, Jiang et al. Improving web sites performance using edge servers in fog computing architecture. In: IEEE 7th International Symposium on Service Oriented System Engineering (SOSE), 2013. IEEE, 2013. [3] LUAN, Tom H. et al. Fog computing: Focusing on mobile users at the edge. arXiv preprint arXiv:1502.01815, 2015. [4] JALALI, Fatemeh et al. Fog Computing May Help to Save Energy in Cloud Computing. IEEE Journal on Selected Areas in Communications (Volume:PP , Issue: 99 ). 2016. DOI: 10.1109/JSAC.2016.2545559 [5] MASIP-BRUIN, Xavi et al. Foggy clouds and cloudy fogs: a real need for coordinated management of fog-to-cloud (F2C) computing systems. IEEE Wireless Communications Magazine, in press, (preprint version at http://www.craax.upc.edu/images/Publications/journals/Fog-tocloud_preprint.pdf). [6] SIMOENS, Pieter et al. Challenges for orchestration and instance selection of composite services in distributed edge clouds. In: IFIP/IEEE International Symposium on Integrated Network Management (IM), 2015. IEEE, 2015. p. 1196-1201. [7] TANGANELLI, Giacomo; VALLATI, Carlo; MINGOZZI, Enzo. Energy-efficient QoS-aware service allocation for the cloud of things. In: IEEE 6th International Conference on Cloud Computing Technology and Science (CloudCom), 2014. IEEE, 2014. p. 787-792. [8] MUKHERJEE, Arjun et al. Angels for distributed analytics in iot. In: IEEE World Forum On Internet of Things (WF-IoT), 2014. IEEE, 2014. p. 565-570. [9] DENG, Ruilong et al. Towards power consumption-delay tradeoff by workload allocation in cloud-fog computing. In: IEEE International Conference on Communications (ICC), 2015. IEEE, 2015. p. 39093914. [10] SOUZA, Vitor B. et al. Handling Service Allocation in Combined FogCloud Scenarios. In: IEEE International Conference on Communications (ICC), 2016. IEEE, 2016. p. 1-5. [11] KWON, Young-Woo; TILEVICH, Eli. Energy-efficient and faulttolerant distributed mobile execution. In: IEEE 32nd International Conference on Distributed Computing Systems (ICDCS), 2012. IEEE, 2012. p. 586-595. [12] BALAN, Rajesh Krishna et al. Simplifying cyber foraging for mobile devices. In: Proceedings of the 5th international conference on Mobile systems, applications and services. ACM, 2007. p. 272-285.