Effective Resource Allocation in Fog for Efficient Energy Distribution Abdullah Sadam, Nadeem Javaid∗ , Muhammad Usman Sharif, Abdul Wasi Zia, Muhammad Yousaf, Syed Muhammad Saleh Arfi
Abstract Fog computing is used to distribute the workload from cloud, decrease Network Latency (NL) and Service Response Time (SRT). Cloud have the capability to respond to too many requests from consumer side, however, the physical distance between a consumer and cloud is far than the consumer and fog. Fog is limited to a specific location, moreover, fog is meant to deal requests locally and helps out in processing the Consumer’s Requests (CRs) and provide efficient response. A fog holds the consumer’s data temporarily, processes it and provides response then sends it to cloud for permanent storage. Apart from this, it also sends the consumer’s data when Micro Grids (MGs) are not able to fulfill the consumer’s energy demand. Cloud communicates with Macro Grid. Fog and cloud computing concepts are integrated to create an environment for effective energy management of a building in a residential cluster. Fog deals with requests at the consumer’s end, because it is nearer to the consumer than a cloud. The theme of this paper is efficient allocation of Virtual Machines (VMs) in a fog, therefore, Insertion Sort Based Load Balancing Algorithm (ISBLBA) is used for this purpose. Simulations have been conducted, comparing ISBLBA to Round Robin (RR) technique and results regarding fog performance, cluster performance and cost are elucidated in the Section 5. Key words: Insertion Sort Based Load Balancing Algorithm (ISBLBA), cloud Computing, Fog Computing, Micro Grid (MG), Macro Grid. COMSATS University, Islamabad 44000, Pakistan ∗ Correspondence: www.njavaid.com,
[email protected]
1
2
Authors Suppressed Due to Excessive Length
1 Introduction Efficient energy management is an intense need of today’s world. The goal is to stop wastage of energy which is produced with resources and efforts. The consumption of energy is increased due to the massive demographic growth [1]. Most of the energy is wasted at the consumer’s end and world needs such a system which conserves energy. Therefor, Home Energy Management Sytem (HEMS) integrated with cloud, is introduced for effective energy management [2]. However To Increase SRT and decrease the NL, different kinds of fog concepts are introduced in cloud environment [3] [4] [5] [6]. Many IoT devices operate at the consumer’s end and require energy. HEMS are introduced at the consumer’s end to manage these devices. HEMS put restrictions on off-peak and on-peak hour on different devices. If a consumer wants to run an appliance, the request is generated via HEMS. A controller communicates with the fog, shares the consumer’s data, Meter ID and the required load. A VM having its own operating system, memory and processing power is assigned to the request via ISBLBA. VM processes CR and forwards it to the MG which is a near by energy producing entity consists of Photovoltaic Cells (PVCs), batteries and generators. MG receives a request, and sends energy to the Meter ID provided by the fog. SG notifies the fog about its energy production status and amount of energy sent to the consumer, and fog decide whether the request needs to be sent further to the cloud. Fog shares all the processed data to cloud for permanent storage so that it could be possible to keep track of CRs for services and provided services. If MG fails to fulfill the requirement of a consumer, then cloud requests to the Macro Grid to supply energy to the cluster from where the request came from. Macro Grid is a smart grid [3] which keep track of cloud’s requests and produce energy as per requirements, so that resources wastage can be controlled. Macro Grid further sends the request and required energy to Utility. Utility is responsible for distribution and transmission of energy to geographical locations. Utility supplies energy to consumers and notifies the cloud. Cloud then keeps track of all the data.
2 Related Work Cloud and fog computing environments are used to facilitate consumers in Energy Management (EM). Researchers are delivering their best to automate this system. It is the need of this era that we have an automated system. No extra machines and human involvement is there. For this purpose, allocation of resources is a problem which needs to be solved. Authors in [7], have proposed an effective solution to this problem. To manage energy crises more efficiently, the idea of Nano Grid is introduced in [8]. Energy generation is empowered near to the consumer side. Nano Grids
Effective Resource Allocation in Fog for Efficient Energy Distribution
3
are energy generation grids at homes or buildings, which are meant to fulfill the energy demand of that building. In [9], Smart Grid is used to monitor the electricity consumption at the consumer’s end. It establishes many optimization approaches, where multiple numbers of energy consuming devices are scheduled in a organized manner. User comfort is considered in an on-peak and off-peak hours. The vital role of Smart Grid is elaborated. In [10], authors have proposed an energy management system for smart devices. Energy Aware Dynamic Task Scheduling (EDTS) algorithm is used for reducing energy consumption. Their simulations and results show that the proposed technique delivers high energy efficiency. In [11], it is described that to deal with too many consumers, greater computation power is required. The more devices are connected to the Utility Energy Management System, more data is generated, which ultimately increases data and computational complexity. In [12–16], authors explained that a platform is required where devices are made inter-operable, all operations are flexible and fast response is ensured. Such system is used for effective implementation of energy management system. It is also mentioned that the increasing number of consumers can cause the complexity of game theory based models with respect to space and time. To avoid such circumstances all the service providers are empowered to shift their services cloud [3]. In [17], authors have introduced a model which overcomes the overall service response time and network latency issues in the current cloud model. Their scenario is better for few limited devices when they request to cloud; however, it is really difficult to manage too many requests. In [18], authors have created a system model for Mobile Cloud Network (MCN), to efficiently manage the computational and network resources of an MCN. It enables the globally optimized placement of static and Mobile applications. Resource management tasks are done efficiently. In [19], authors have revealed the advantages of the combined Fog-to-Cloud architecture based on SRT, power consumption, service disruption probability and bandwidth occupancy parameters. The service disruption probabilities are addressed in terms of leaving and joining of a node. In [20], authors have introduced a new concept of decentralized distributed computing of Mobile and edge devices, suitable for IoT computational requirement. Since IoT devices need a decentralized and peer-to-peer connectivity, this paper has addressed all those concepts which are related to IoT infrastructure.
4
Authors Suppressed Due to Excessive Length
2.1 Motivation To acquiring high SRT and low NL, fog computing is the introduced solution to fulfill such need. Besides these features, fog computing provides scalability, reliability and virtualization. Fog is used to distribute the processing load from cloud, it responds to the CRs locally. As in [6], authors used a load balancing technique to distribute the work load of a cluster among different VMs of a fog to achieve high SRT. In the near future we are entering to the IoT world which will be based upon Ubiquitous computing. All kind of IoT devices need energy consumption, an effective management of energy might save us from energy crises in the future. The predicted number of IoT devices are 26 billion according to the scientists, which will be consuming a very high amount of energy. Thus, there is a need to bring such solutions to the market that can help us in the coming future. The motivation is that for all these things we need a system where we can efficiently distribute energy so that we become able to conserve as much energy as we can.
3 System Model In this paper addresses fog based environment, in three regions. Every region has three clusters, and each cluster contains a residential sector having five hundred buildings and one hundred houses per building. Multiple IoT devices operate in a house, and these devices require energy. All IoT devices of a house are connected to a controller. Every controller takes demand from these devices, communicates with fog and requests for energy. Fog is used to distribute load from centralized cloud. Fog is nearer to the cluster which increases SRT and decreases NL. The physical distance of a consumer to fog is less than the physical distance of consumer to cloud. Obviously, data packets reach fog in much lesser time than these packets reach to the cloud. So, NL is ultimately low, and the SRT of fog is high. Fog also has the functionalities of centralized cloud, however, these functionalities are limited. A fog communicates with MG for energy supply. MG is a local energy producer, consists of PVCs, batteries and electricity generators. When fog gets a CR, it must allocate a VM or resource to processes that request. ISLBLA is used for effective resource distribution in fog. To increase the efficiency of fog, optimized allocation of VMs is necessary. Different algorithms like RR and Throttled are used to efficiently assign VMs to CR. In this paper, ISBLBA is introduced for effective allocation of VMs. In our proposed scenario, every fog has six VMs. ISBLBA considers it as an array of VMs, thus sorts it according to the state of VM. If a VM state is free, ISBLBA considers it as the smallest value in the array and puts it on the
Effective Resource Allocation in Fog for Efficient Energy Distribution
5
Tier 1
MG
MG
Tier 2
Fog3
Fog1 VMs
Tier 3
Data Storage
Server
Cloud
Macro Grid
Legends 2-Way Data Transfer
Ulity
Electricity Supply
Fig. 1: Proposed System Model
first index. If a VM state is busy, ISBLBA considers it as the biggest value in the array and puts it on the last index of the array. This is how all VMs are sorted, so it efficiently allocates a free VM to CR. There is a minor physical distance between MG and clusters, and provide a limited amount of energy when requested. For exceeded energy demand,
6
Authors Suppressed Due to Excessive Length
fog requests cloud. Cloud is considered as a centralized computational service and storage platform. Cloud requests the Macro Grid, which is a Smart Grid, responds to cloud’s request by exchanging information and supplying required energy to Utility. Utility further supply energy to a specific cluster. Utility is considered as an electricity distributor through its transmission network all over the region. Utility supplies energy to the exact location via controllers and smart meters, thus, demand is managed efficiently. All tiers communicate with each other in a series of steps. The first tier contains clusters, buildings, houses, smart meters and controllers. The second tier consists a fog network, and a centralized cloud is in the third tier. This whole model is based on 3 tier architecture which is illustrated in Fig. 1.
4 Problem Formulation Allocation of resources to any service needs to be very efficient, sine the performance parameter require this task to be so. Services come from customers or consumers, which we assumed that a residential cluster contains multiple homes and requests are generated in these homes. Let assume that H represent a set of cluster containing n number of homes h, such that, H = {h1 , h2 , h3 , ...., hn }. A Service is a request from a consumer of house h for any particular job and it is divided into multiple of tasks tsk. Let S is a service consists of i number of tasks tsk came from house h, We can formulate this as, S=
n X (tski )
(1)
i=1
Every tsk has a status, and we denoted it as x. If tsk is allocated to any particular resource or V M , the status of that task is tskx = 1. If a tsk is not allocated to any resource the status is tskx = 0. A fog consists of Virtual Machine (VMs) which are used to execute tasks. Let f og = {V M1 , V M2 , V M3 , V M4 , V M5 , V M6 }. f og =
6 X (V Mj )
(2)
j=1
The number of VMs must not exceed six, because we have provided only six VM to a fog. A Virtual Machine Manager (VMM) knows the state of each VM, which is denoted by y. A V M is considered available where V My = 0, and V M is considered busy when V My = 1. Following are the two main problems that are identified and formulated consecutively.
Effective Resource Allocation in Fog for Efficient Energy Distribution
7
4.1 Service Response Time SRT is the time taken by the resources to respond to the consumer’s request for service. A Service is a collection of tasks tsk as shown in Equation 1. Every consumer request is responded, Let SRT be the Overall SRT, which is the sum of Processing Time (PT) and NL. SRT = P T + N L
(3)
Furthermore, P T is the time taken by V Mj to execute a task tski of Service S. We deduce that Pi,j is the PT of a single tski in a virtual Machine V Mj . Based on these we infer that y x X X
(Pi,j )x,y
(4)
i=1 j=1
is the total PT to complete a service S. The SRT can also be denoted as, SRT =
y x X X (Pi,j )x,y + N L.
(5)
i=1 j=1
4.2 Cost Cost is a monetarily expenditure which is estimated by the usage of resources of a particular utility. In this particular scenario, V M cost is calculated by the usage of V M s, M Gcost is the cost of MG, DT cost is the cost of Data Transfer over the network. We can say that T otalcost = V Mcost + M Gcost + DTcost
(6)
5 Simulations and results In this paper, ‘Cloud Analyst’ platform is used for simulation purposes. Through this tool service broker policies are compared with load balancing algorithms in order to evaluate the results. For results purpose, ISBLBA is compared with the RR technique against Closest Data Center Policy (CDCP). CDCP is considered as the least proximity from consumers. Proximity means least NL. Three regions are taken, containing two clusters and one fog each as illustrated in Fig. 2. Region distribution is shown in the Table 1.
8
Authors Suppressed Due to Excessive Length
Table 1: Regions Regions ID North America South America Europe Asia Africa Australia
R0 R1 R2 R3 R4 R5
Fig. 2: Visual representation of clusters and fog in regions
5.1 Closest Data Center Policy (CDCP) Two clusters in every region are considered, and single fog is offering services. The fog consists of VMs which are used for work load distribution. In our scenario, fog has six VMs having 8GB of RAM, 10TB HDD and 2.4GHz processing power. To manage the coming requests from consumers, fog take some PT. We have considered a single service broker policy which is the CDCP.
Effective Resource Allocation in Fog for Efficient Energy Distribution
9
5.2 Cluster performance in terms of SRT Consumers have generated requests which are managed in a local fog. Every request gets a response in some time, by the fog, which is called SRT. ISBLBA and RR algorithms are simulated using our scenario and their comparative cluster SRT is shown in Table 2.
Table 2: Cluster performance in terms of SRT Clusters C1 C1 C1 C1 C1 C1
Avg (ms) Min (ms) Max (ms) ISBLBA RR ISBLBA RR ISBLBA RR 49.77 49.82 38.32 38.36 63.79 63.79 50.23 50.21 39.31 39.31 62.82 62.86 50.06 50.04 38.52 38.52 66.27 66.29 49.98 49.98 39.77 39.77 60.78 60.82 50.19 50.26 41.81 41.08 61.80 61.83 50.08 50.12 40.56 40.56 60.80 60.83
70
70
60
60
50
50
40
30
Avg(ms) Minimum (ms) Maximum (ms)
20
10
Processsing time (ms)
Processing time (ms)
Fig. 3 and Fig. 4 of ISBLBA and RR respectively illustrate cluster performance with respect to SRT from the fog.
40
30
Avg(ms) Minimum (ms) Maximum (ms)
20
10
0
0 C1
C2
C3
C4
C5
C6
C1
Clusters
Fig. 3: RR cluster performance in terms of SRT
C2
C3
C4
C5
C6
Clusters
Fig. 4: RR cluster performance in terms of SRT
5.3 Fog performance in terms of PT The data coming from a consumer is managed in the fog. Load balancing algorithms are defined to distribute the load. We have compared our
10
Authors Suppressed Due to Excessive Length
proposed algorithm with RR technique and simulation shows that the proposed algorithm is working efficiently than RR technique. The comparative fog processing of both algorithms is shown in the Table 3.
Table 3: Fog performance in terms of PT Data Centers Fog1 Fog2 Fog3
Avg (ms) Min (ms) Max (ms) ISBLBA RR ISBLBA RR ISBLBA RR 0.42 0.44 0.02 0.02 0.87 0.89 0.42 0.43 0.02 0.02 0.83 0.83 0.39 0.40 0.01 0.01 0.82 0.82
Fig. 5 and Fig. 6 of ISBLBA and RR respectively show the fog performance with respect to SRT from the consumers.
0.9 0.9 0.8 0.8 0.7
Avg(ms) Minimum (ms) Maximum (ms)
0.5 0.4 0.3 0.2
Processing time (ms)
Processing time (ms)
0.7 0.6
0.6
Avg(ms) Minimum (ms) Maximum (ms)
0.5 0.4 0.3 0.2
0.1 0.1 0 Fog1
Fog2
Fog3
Data Center
0 Fog1
Fog2
Fog3
Data Center
Fig. 5: ISBLBA fog performance in terms of PT
Fig. 6: RR fog performance in terms of PT
5.4 Cost Cost of VM, MG, Data Transfer (DT) of using both ISBLBA and RR algorithms are the same. The total cost of both algorithms are shown in Table 4.
Effective Resource Allocation in Fog for Efficient Energy Distribution
11
Table 4: ISBLBA and RR comparative Cost Data Centers VM Cost($) MG Cost($) DT Cost($) ISBLBA RR ISBLBA RR ISBLBA RR Fog1 0.40 0.40 19.77 19.77 1.24 1.24 Fog2 0.20 0.20 19.83 19.83 1.24 1.24 Fog3 0.20 0.20 19.75 19.75 1.23 1.23
Total Cost($) 21.41 21.41 21.26 21.26 21.18 21.18
Fig. 7 and Fig. 8 of ISBLBA and RR respectively shown. A fog provides services to multiple CRs hourly. Minimum requests are serviced in peak hours, which minimized the cost. A fog has VMs, data transfer and MG cost, and total cost is also shown in the Fig. 7 and Fig. 8.
25
25
20
20
Cost ($)
VM cost ($) Microgrid cost ($) Data Transfer cost ($) Total cost ($)
15
10
10
5
5
0
VM cost ($) Microgrid cost ($) Data Transfer cost ($) Total cost ($)
Cost ($)
15
0 Fog1
Fog2
Data Center
Fig. 7: ISBLBA cost
Fog3
Fog1
Fog2
Fog3
Data Center
Fig. 8: RR cost
5.5 Discussions In this paper, two load balancing algorithms are compared based on the distribution of load on a fog, which is coming from the consumer’s side. Results related to processing time of fogs and clusters shows that our proposed algorithm performs well in the considered scenario. In ISBLBA, the Cost of VM, MG, and data transfer is exactly the same as RR. When we talk about CDCP, we keep low latency in our mind, that how to lower the latency of the network. Closest proximity means the closest available services which eventually decrease the latency. Quick responses are assured and network congestion is avoided. Cloud gets a sigh of relief by not having too many requests from consumers. We have taken two clusters, however, when it comes to the real world then there will be enormous requests from consumers. There will be million of residential sectors which might request
12
Authors Suppressed Due to Excessive Length
for services thus it would not be possible for a cloud to handle this much load at once. Fog computing is one of the best solutions to distribute load from cloud and in this paper, ISBLBA does the same. It reduces the request load from cloud by effectively managing the fog resources to get to every service request by any consumer. However, installing too many fog publicly require a huge monetarily disbursement from the utilities. In this paper, we have simulated that our proposed scheme shows a reduced cost, which can save a huge amount of investment to the utilities in the sector. Another important discussion is about the performance of fog. As much as cloud needs to be relieved of the consumer’s load, fog also needs to be relieved. Cloud has a huge computing capacity and fog does not, so it is still difficult for the fog to get to every request efficiently unless we configure it this way. VMs are the essential power of any cloud, which ultimately responds to every request, thus, managing VMs efficiently means an increase in fog performance. For this purpose, our proposed algorithm for load balancing is effectively managing VMs inside the fog. This algorithm puts all VMs in an array, by considering its state. If VM’s state is free, the algorithm puts the VM in the start index of the array, if VM’s state is busy, the algorithm puts the VM in the nth index of the array. If the second VM’s state is free, the algorithm puts the VM in the second index of the array, and if the VM’s state is busy, the algorithm puts the VM in the nth-1 index of the array. In this way, it continuously rearrange the VMs in an array by knowing its state.
6 Conclusion Fog is used to distribute the work load of cloud. A fog decreases NL and increases SRT because of its locality to the consumer’s end. ISBLBA is used to efficiently allocate the VMs of a fog, which ultimately increases the efficiency of the whole system. CRs are responded quickly and resources are allocated in an efficient manner and services are provide to consumers which increases the consumer’s satisfaction ultimately. Two load balancing algorithms are compared, and their results are discussed and elaborated in the respected sections. Though there is a very minor performance difference between ISBLBA and RR using the same scenario on CDCP, however, ISBLBA is performing slightly better than RR. RR algorithm is being used for load balancing purposes too many times, however, we have used Insertion Sort Algorithm for this purpose in this paper. It performs slightly better the RR. We can conclude that it is our contribution to use Insertion Sorting algorithm for load balancing purposes, to the best of our knowledge this is the first paper using this sorting algorithm for resource scheduling. So far this algorithm is performing well than RR algorithm already used for this purpose.
Effective Resource Allocation in Fog for Efficient Energy Distribution
13
References 1. Fady Y. Melhem, Nazih Moubayed, and Olivier Grunder. Residential energy management in smart grid considering renewable energy sources and vehicle-to-grid integration. IEEE Electrical Power and Energy Conference (EPEC), 12-14 Oct. 2016, Ottawa, ON, Canada, pages 1–6. 2. Mohammad Hossein Yaghmaee, Morteza Moghaddassian, and Alberto Leon Garcia. Power consumption scheduling for future connected smart homes using bi-level costwise optimization approach. In Lecture Notes of the Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering, LNICST, 2016. 3. Dragan S. Markovic, Dejan Zivkovic, Irina Branovic, Ranko Popovic, and Dragan Cvetkovic. Smart power grid and cloud computing. Renewable and Sustainable Energy Reviews, 24:566–577, 2013. 4. Songqing Chen, Tao Zhang, and Weisong Shi. Fog Computing. IEEE Internet Computing, 21(2):4–6, 2017. 5. Sakeena Javaid, Nadeem Javaid, Sheraz Aslam, Kamran Munir, and Masoom Alam. A Cloud to Fog to Consumer based Framework for Intelligent Resource Allocation in Smart Buildings. pages 1–10. 6. Itrat Fatima, and Nadeem Javaid. Integration of Cloud and Fog based Environment for Effective Resource Distribution in Smart Buildings. 7. Nguyen Minh Nhut Pham, and Van Son Le. Applying Ant Colony System algorithm in multi-objective resource allocation for virtual services. Journal of Information and Telecommunication, 1(4):319–333, 2017. 8. Zijian Cao, Jin Lin, Can Wan, Yonghua Song, Yi Zhang, and Xiaohui Wang. Optimal Cloud Computing Resource Allocation for Demand Side Management. IEEE Transactions on Smart Grid, 1–13. https://doi.org/10.1109/TSG.2015.2512712. pages 1–13. 9. Mohammad Abdullah Al Faruque, and Korosh Vatanparvar. Energy Management-asa-Service over Fog Computing Platform. IEEE Internet of Things Journal, 3(2):161– 169, 2016. 10. Feyza Yildirim, Okay, and Suat Ozdemir. A fog computing based smart grid model. In 2016 International Symposium on Networks, Computers and Communications (ISNCC), 2016. 11. WYC Wang, A Rashid, and HM Chuang. Toward the trend of cloud computing. . . . Electronic Commerce Research, 12(4):238–242, 2011. 12. Mondal A, Misra S, and Obaidat M. Storage in Smart Grid Using Game Theory, IEEE Systems Journal. pages 1–10, 2015. 13. Mengmeng Yu, and Seung Ho Hong. Supply – demand balancing for power management in smart grid : A Stackelberg game approach. APPLIED ENERGY, 164:702–710, 2016. 14. June S., Hong, and Mihui Kim. Game-Theory-Based Approach for Energy Routing in a Smart Grid Network. Journal of Computer Networks and Communications, 2016, 2016. 15. Jianmo Ni, and Qian Ai. Economic power transaction using coalitional game strategy in micro-grids. IET Generation, Transmission & Distribution, 10(1):10–18, 2016. 16. Chathurika P Mediwaththe, Edward R Stephens, and David B Smith. A Dynamic Game for Electricity Load Management in Neighborhood Area Networks, IEEE Transactions on Smart Grid, Volume: 7, Issue: 3, May 2016. pages 1–8. 17. Sa´ ul Alonso-Monsalve, F´ elix Garc´ıa-Carballeira, and Alejandro Calder´ on. A heterogeneous mobile cloud computing model for hybrid clouds. Future Generation Computer Systems, https://doi.org/10.1016/j.future.2018.04.005, 2018.
14
Authors Suppressed Due to Excessive Length
18. William T¨ arneberg, Amardeep Mehta, Eddie Wadbro, Johan Tordsson, Johan Eker, Maria Kihl, and Erik Elmroth. Dynamic application placement in the Mobile Cloud Network. Future Generation Computer Systems, 70:163–177, 2017. 19. Ramirez W., Masip-Bruin X., Marin-Tordera E., Souza V., Jukan A., Ren G., and Gonzalez de Dios O. Evaluating the benefits of combined and continuous Fog-to-Cloud architectures. Computer Communications, 113(February):43–52, 2017. 20. Radu Ioan Ciobanu, Catalin Negru, Florin Pop, Ciprian Dobre, Constandinos X. Mavromoustakis, and George Mastorakis. Drop computing: Adhoc dynamic collaborative computing. Future Generation Computer Systems, https://doi.org/10.1016/j.future.2017.11.044, 2017.