Priority Based Load Balancing in Cloud and Fog

1 downloads 0 Views 457KB Size Report
The authors conduct master fuzzy context (MFC) for provisional fuzzy logic and fuzzy rules are ... in MIPS (Million Instructions Per Second). 3.2 Capacity of VMs.
Priority Based Load Balancing in Cloud and Fog Based Systems Subhan Tariq, Nadeem Javaid∗ , Mahad Majeed, Fahad Ahmed, Saqib Nazir

Abstract Fog computing idea is presented to reduce the burden on cloud and deliver similar facilities as cloud. However, fog encompasses small area relatively to cloud by saving the data for shorter amount of time and sending it to cloud for permanent storage. In this paper, a joint cloud and fog centered environment for efficient energy supervision of buildings is proposed. It caters for the data of groups of buildings at buyers’ end. 12 fogs are utilized for 6 different regions in the world which are based on 6 continents. Additionally, each fog is linked to a group of buildings and two fogs are linked to two groups. Each group comprises of multiple smart buildings and these buildings has at least 100 apartments. To manage the energy requirement of consumers, micro grids (MGs) are available near the buildings and accessible by the fogs. Energy is managed for the apartments and fog helps the consumers to fulfill their load demands through nearby MGs and cloud servers’ communication. So, the load on cloud and fog should be balanced and load balancing algorithms are used to manage the load using VMs. These algorithms are round robin (RR) and throttled and Priority Based load balancing and these algorithms are compared for a single service broker policy. Service broker policy considered in this paper is; dynamically reconfigure with load. Priority based load balancing is proposed for balancing the load on fog and results of proposed balancing algorithm are compared with other algorithms. While considering the proposed algorithm, results are compared with two load balancing algorithms and from this, the proposed algorithm gives better results than RR algorithm rather than throttled. Key words: Cloud computing, Fog computing, Load balancing, Micro grid

COMSATS University, Islamabad 44000, Pakistan ∗ Correspondence: www.njavaid.com, [email protected]

1

2

Subhan Tariq et al.

1 Introduction Demand Response (DR) programs serves a significant part in the sustainability of the Smart Grid (SG). These programs can be used to let consumers know about their energy expenditure and electricity bills in future smart cities. With this knowledge, consumers decides how and when to use electricity. The growth of Internet of Things (IoT) technology aids in transferring consumer’s energy consumption data to the cloud. It can also set in motion a Demand Side Management (DSM) program on cloud to organize the consumer’s smart appliances [1]. Without SG applications, smart cities cannot be established[19, 20]. IoT substructure is used to administer energy distribution, transmission and consumption intelligently in different areas of the power network. In the current years, the growth of the IoT applications makes the smart cities smarter than before. Based on the above discussion, two major tasks are needed to be taken into account in future Demand Side Management (DSM). One is technical aspect and the other is economical aspect. Technical aspect reflects on the large size data of the appliances which must be administered within the specific time limitation and by keeping its computational complexity. Whereas, economical aspect includes that on the whole the newly created businesses and buildings are not contributing in Information and Communications Technology (ICT) framework in early phases and it turns out to be difficult to uphold its consistency without their partaking. Particularly, computational needs lacks from the variations due to consumers demands for DSM services. Therefore, assigning the ICT services: processing power, storage capacity and resource availability are the important issues [2]. The fog computing idea is suggested in [3], to prevail over these issues. The fog puts the cloud computing at the corner or edge of the network. It sanctions information to be processed beforehand, where latency constraint is compulsory and to endorse the scalability, interoperability, consistency also better associations among devices. The indicated traits of fog computing are most advantageous such as: location awareness, minimum latency, geographical distribution, huge number of devices, mobility, real-time applications and heterogeneity [4]. While SG deals with some challenges, that is latency requirements, resource-constrained devices, network bandwidth and cyber-physical systems. When these devices are linked to internet, new security issues, protecting resource-constrained devices, upholding security status also, up to date software for all the smart devices, measuring the security status of large distributed systems in a consistent way and solving the security confrontations without making excruciating difficulties that is not satisfied by cloud computing. In [5], the fog computing is a networking architecture which distributes computing, storages, control and system administrations nearer the end-user devices. Therefore, this paper explains on presenting a viable architecture for SG in light of combining two rising technologies: cloud and fog computing.

Priority Based Load Balancing in Cloud and Fog Based Systems

3

1.1 Motivation Enhancements done over the past few years in the field of Smart Grids (SG) arises the need of a better communication infrastructure and information processing power [6]. Fortunately, cloud computing has been around for past decade and can be used as a communication infrastructure in SG. Cloud computing provides a large amount of storage and scalable processing power, however there are some limitations like security and variance in response time based on geographical distance [7]. To overcome the limitations in cloud computing, fog computing is introduced by cisco. Fog computing reduces the load on cloud by providing computation power and temporary storage. If the computation load exceeds the limitations of fog, it refers the request to some other fog or send the request directly to cloud, which increases the response time for that request, so load balancing on fog is an important aspect in cloud or fog based communication. Cloud charges the consumers based on the resources used by the consumer, which is another reason why load balancing is important. In this paper authors balances the load on virtual machines (VMs) inside a fog using priority based load balancing technique.

1.2 Contributions In this paper, a fog based environment is designed, which covers a large area based on six continents of the world. Each continent is considered as single region with large number of consumers to send requests on fog for access to required resources. The contributions of this work are summed up as follows: • The fog computing concept is integrated to improve the latency (request time, processing time), reliability and flexibility of the access to electricity and web services for IoT devices used by consumers in the residential area throughout the world. • The residential buildings of the world are classified into six regions based on the six continents to monitor and manage the energy in a balanced fashion. • The requests among VMs in the fog environment are balanced using VM load balancing algorithm and three algorithms are tested for three scenarios. These scenarios are considered on the basis of different number of VMs. The remainder of the paper is organized as follows; related work is described in Section 2. The proposed system model and VM load balancing algorithms in Section 3 and 4. However, simulation results and discussions are presented in Section 5 and conclusion in Section 6.

2 Related Work The concept of nanogrids is added in sustainable smart buildings for multi-tenant cloud environment in [6]. A stochastic model is used by consumers to schedule their own strategies for shifting load in cloud computing based framework for DSM in

4

Subhan Tariq et al.

SG. Proposed method is used to create small energies hub for users. Peak to Average Ratio (PAR) and cost is reduced by shifting load from peak hours by Monte Carlo method [8]. In addition, a game theory technique using the coalition for energy management in SG cyber physical system is discussed in [9]. A payoff function is formulated by examining every player’s data (i.e., transmission and service delay data) using conditional entropy. Furthermore, a dynamic workflow management is developed to run the jobs in virtual cloud environment. In this case, multiple VMs are used in a coalition to execute the tasks in an efficient manner. Authors in [10] analyze the effect of packet loss and latency on the functioning of the equilibrium between electricity supply and demand. By a zero-mean random variable with normal distribution. The author in [11], proposed a cloud load balancing (CLB) algorithm for load balancing on cloud and compare the results with other algorithms discussed before. The performance of this algorithm is better than others and it is successfully balance the load when multiple number of users logged in at the same time. The author in [12] proposed a certificate less provable data possession (CL-PDP) method. The method is proposed for cloud based SG applications. The main focus of the paper is to provide sufficient storage, processing capacity and security using data management system proposed to support SG applications. A unique nanogrid based on cloud is proposed for energy efficiency in SG. RES is integrated with building using nanogrid. Cloud controllers are utilized to evaluate automation of energy. suggested solution decreases the time of various jobs to be executed and the performance of selected parameters, is found satisfactory [13]. After reviewing the literature it gets clear that fog computing efficiently reduces the load on cloud platforms. And to make fog computing more efficient, resource utilization and load balancing on VMs are essential requirements. The authors in [14] used wavelet recurrent neural network (WRNN) predictors. The solutions are given for cloud distributed model and balance for energy management is also achieved for available devices by means of prediction. The power is used according to the requests coming from consumer side due to predictions made using WRNN predictors.Cloud computing facilitates the customers with: computing, storage and networking capacities. However, it suffers from latency, security and downtime issues. A new scheme is proposed in [15] and implemented using using devices profile for Web services (DPWS), which presents energy management as a service using fog computing environment. Two energy management prototypes are developed in this methodology: home energy management prototype and MG energy management prototype for cost minimization and latency reduction. Author in [16] solved the resource allocation problem with resources allocation based on ant colony system (MORAACS). The authors compared processing time, energy consumption and standard deviation with RR algorithm. In this algorithm, two objective are resolved and these objectives are minimizing energy consumption by balancing the load on cloud.

Priority Based Load Balancing in Cloud and Fog Based Systems

5

In [17], the author proposed an architecture which is decentralized cloud computing based architecture. The authors aimed to schedule the requests coming from consumer side in a real time environment. For this purpose, they have done simulations for real time electric load data of Toronto city in Canada. However, a pricing model is proposed for energy load optimization during the on peak hours by maintaining stability of MG. A new service broker policy is proposed for data center selection in [18]. The authors conduct master fuzzy context (MFC) for provisional fuzzy logic and fuzzy rules are designed for SG response time and data center priority

3 Problem Formulation In this section, the problem of balancing the load on VMs is formulated mathematically.

3.1 Capacity of a VM Let V define a set containing all the VMs on a Host Server (HS).

V = {V1 ,V2 ,V3 , . . . ,Vn } (1) Then capacity of VMi is denoted by Capi and formulated as:

Capi = NUM (coresi ) ∗Capcore (2) Where Coresi represents the number of cores assigned to VMi and Capcores defines capacity of a single core.Capacity of the VMs as well as the cores will be measured in MIPS (Million Instructions Per Second).

3.2 Capacity of VMs The capacity of all VMs running on a single HS represented by Capsum , formulated as:

6

Subhan Tariq et al.

n

Capsum = ∑ Capi i=1

(3)

Capsum ≤ CapHS (4) Here CapHS represent the capacity of the HS the VMi is running on.

3.3 Workload of VM Workload of VMi is represented by Wi and formulated as:

Wi =

Taskssize Capi (5)

Where Taskssize is the sum of size of tasks waiting in the queue of ith VM and is formulated as:

m

Taskssize =

∑ Tj

j=1

(6) Tj is measured in MIPS.

3.4 Completion Time of a Task Completion Time of a task j running on VMi is represented as CTij and formulated as:

CTi j = T j /Capi

Priority Based Load Balancing in Cloud and Fog Based Systems

7

(7)

3.5 Waiting Time for a task Waiting Time for a task j, waiting in the queue of ith VM is represented as WTij and formulated as:

W Ti j = AT j +CTi( j−1) (8) Here ATj is arival time of task j. Waiting time of task j will be the sum of completion time for the task before j in the queue of VMi and arrival time of task j.

3.6 Makespan Makespan of taks will be represented as Mk and formulated as:

Mk = MAX{CTi j +W Ti j } (9) Finally, we can formulate the problem mathematically as an optimization problem given below: Minimize Wi Minimize Mk Minimizing the workload of all the VMs on a HS will reduce the fog processing time. Whereas reducing the makespan will give a better response time.

4 Proposed Methodology A fog and cloud based is proposed in this section, a tool for simulating cloud and fog systems. In this scenario 6 regions are taken around the globe, each region have 2 fogs and those 2 fogs handles 2 clusters of buildings in that region, containing a random amount of buildings between 50 to 80 buildings. Each building contains a random amount of homes varying from 80 to 100. Each fog can have a maximum

8

Subhan Tariq et al.

of 50 VMs, every VM can handle 100 requests at a time and every request can be of 100 bytes.

Cloud

Service Provider

Fog 1

Fog N

Fog 2 Task 1

Task 2

...

Task n

Task 1

Priority-Based Load Balancer

Task 2

...

... VM 1

Buildings

VM 2

Task 1

... Task n

Priority-Based Load Balancer

Task 2

...

... VM N VM 1

VM 2

VM N

Buildings

Micro Grid

Buildings

... Task n

Priority-Based Load Balancer

VM 1

Buildings Micro Grid

Buildings

VM 2

VM N

Buildings Micro Grid

Fig. 1 Proposed System Model.

System model proposed in this paper is a three tier architecture as shown in the figure 1, tier 1 consists of clusters of buildings and MGs, tier 2 consists of fogs and tier 3 consists of cloud and service providers. Any home in any cluster of buildings generate a request or a demand for electric load which is transferred to the nearest available fog. The fog then processes the request and ask the nearest available MGs for electric load. If that MGs is able to supply the demanded load, the fog will connect that house with that MGs keep a record in the temporary storage of the transaction, which will later on be store on the cloud. If the MGs is unable to provide the demanded load, fog, then ask the cloud for the nearest available MGs which can handle the request. Cloud will store this transaction record in storage. In this model every request has to go through fog, a house or a building cannot directly communicate with the MGs.

4.1 Load Balancing Load balancing is an important aspect in cloud or fog based systems, service providers charge the consumer based on the resources used in a fog or cloud. If the resources are not used properly, then this solution is going to be costly instead of being cost effective. There are some basic algorithms for balancing the load in

Priority Based Load Balancing in Cloud and Fog Based Systems

9

cloud or fog are already implemented in the Cloud Analyst tool. Following are the some of these algorithms:

4.2 Round Robin(RR) In this load balancing algorithm, whenever a request is generated by user, the algorithm assigns the request to VM next to current VM. If all the VMs have been assigned a request then it assigns the request to the starting VM. In this way all the VMs will have approximately the same amount of load.

4.3 Throttled Whenever a request arrives to the fog, this algorithm search for a VM which is in "Available" state and assign that request to this VM. After assigning the request it makes the state of that VM, "Busy". If all the VMs are busy the request is placed into a queue and have to wait for a VM to get the available state. This algorithm balances the load, however, do not utilizes the feature of running multiple request on a single VM as it assigns the busy state to a VM after a single request assignment.

4.4 Priority Based Load Balancing This algorithm generates a priority map for all the VMs in the fog. The priority map gets updated every time there is a task allocation to a VM, so the priority to a VM is assigned based on the number of tasks, that particular VM is running at that moment. Also this algorithm caters for the VM state, which basically means if a VM is running more than 100 tasks at a time that VM will be labeled busy, and no more task will be assigned to that VM, unless it gets the available status. The available status will be assigned to a VM if it has less than 100 tasks running.

10

Subhan Tariq et al.

Algorithm 1 Algorithm for Priority Based Load Balancing Input: V mStateList , V mAllocationCount Output: V mId Initialisation : MaxAllocation = 100 Finding priorities : 2: for i = 1 to V mStateList.size() do if ((V mAllocationCount(i)6= MaxAllocation) then 4: Priority(i) = High for bigger VmAllocationCount value else 6: Priority(i) = Not Available end if 8: end for Finding best VmID : for i = 1 to V mStateList.size() do 10: Max = 0 if Priority(i)>Max then 12: Max = i end if 14: end for V mId = Max 16: return V mId

5 Simulation and Discussion For simulation purposes, comparison is done between RR, Priority based load balancing and throttled, based on fog response time, processing time and total cost. Cloud Analyst is used as a simulation tool.

5.1 Simulation Setup Simulations are performed on a laptop having Core i3 processor, 8 GB of ram and windows 7 operating system.

5.2 Discussions Figure 2 shows comparison between response times of RR, Priority based load balancing and Throttled.

Priority Based Load Balancing in Cloud and Fog Based Systems

11

120 Round Robin Priority Based Throttled

Response Time(ms)

100 80 60 40 20 0 C1

C2

C3

C4

C5

C6

C7

C8

C9

C10 C11 C12

User Base

Fig. 2 Average Response Time.

Response time of Priority based load balancing and throttled is much better as compared to RR because, RR assign tasks without checking the task allocation count on that VM, which increases the load on VM and increase the response time.

Processing Time(ms)

60 Round Robin Priority Based Throttled

50 40 30 20 10 0

Fog1 Fog2 Fog3 Fog4 Fog5 Fog6 Fog7 Fog8 Fog9 Fog10Fog11Fog12

Fogs

Fig. 3 Average Processing Time.

Figure 3 shows the average time a fog takes to process a request when RR, Priority based and Throttled algorithms are being used on that fog. Once again RR has the worst performance due to the same reason that is mentioned above.

600 Round Robin Priority Based Throttled

500

Cost ($)

400 300 200 100 0 Fog1 Fog2 Fog3 Fog4 Fog5 Fog6 Fog7 Fog8 Fog9 Fog10Fog11Fog12

Fogs

Fig. 4 Total Cost.

12

Subhan Tariq et al.

Figure 4 shows the total cost of every fog running RR, Priority based and throttled algorithm, each fog handled multiple requests from clusters. Total cost includes VM cost, cost for MGss and data transfer cost. Figure 5 shows the comparison between the average response time achieved by different load balancing algorithms, using the same broker policy.

Fig. 5 Response Time comparison

We can see that the proposed Priority Based load balancing algorithm performs much better than RR. While the difference between throttled and proposed algorithm is not that much. Figure 6 shows the comparison between average processing time achieved by different load balancing algorithms.

Fig. 6 Total Cost Comparison

In figure 6 it can be seen clearly that RR performs the worse, while the proposed algorithm and throttled gives much better results.

Priority Based Load Balancing in Cloud and Fog Based Systems

13

Figure 7 shows the comparison between the average total cost of all VMs attained by different load balancing algorithms.Figure 7 shows that there is not much difference between the costs of all algorithms.

Fig. 7 Total Cost.

6 Conclusion A joint fog and cloud based model is suggested to calculate the energy use of the residential buildings in 6 regions of the world. The reason of this work is to administer the energy requirement of buildings, as it has been examined formerly that the energy management is significant for apartments, buildings and MGs. For this reason, a unique energy management model is shown and applied as services over fog and cloud computing platform. This application gives real time features required for energy management, flexibility, connectivity and interoperability. Simulations are performed on JAVA platform in eclipse. The new load balancing algorithm is proposed for efficient selection of virtual machines inside a fog, where consumers get fast response and minimum delay. However, results compared to throttled are not much better and when compared to RR the proposed algorithm performs very well.

References 1. Yaghmaee, Mohammad Hossein, Morteza Moghaddassian, and Alberto Leon-Garcia. “Autonomous two-tier cloud-based demand side management approach with microgrid.” IEEE Transactions on Industrial Informatics 13, no. 3 (2017): 1109-1120. 2. Zhao, J., Wan, C., Xu, Z., and Wang, J. (2017). Risk-based day-ahead scheduling of electric vehicle aggregator using information gap decision theory. IEEE Transactions on Smart Grid, 8(4), 1609-1618. 3. Aazam, Mohammad, and Eui-Nam Huh. “Fog computing and smart gateway based communication for cloud of things.” In Future Internet of Things and Cloud (FiCloud), 2014 International Conference on, pp. 464-470. IEEE, 2014.

14

Subhan Tariq et al.

4. Bonomi, Flavio, Rodolfo Milito, Jiang Zhu, and Sateesh Addepalli. “Fog computing and its role in the internet of things.” In Proceedings of the first edition of the MCC workshop on Mobile cloud computing, pp. 13-16. ACM, 2012. 5. Chiang, Mung, and Tao Zhang. “Fog and IoT: An overview of research opportunities.” IEEE Internet of Things Journal 3, no. 6 (2016): 854-864. 6. Cao, Zijian and Lin, Jin and Wan, Can and Song, Yonghua and Zhang, Yi and Wang, Xiaohui. (2016). Optimal Cloud Computing Resource Allocation for Demand Side Management. IEEE Transactions on Smart Grid. 1-13. 10.1109/TSG.2015.2512712. 7. Itrat Fatima, Nadeem Javaid, Muhammad Nadeem Iqbal, Isra Shafi, Ayesha Anjum, and Ubed Memon, "Integration of Cloud and Fog based Environment for Effective Resource Distribution in Smart Buildings", in 14th IEEE International Wireless Communications and Mobile Computing Conference (IWCMC-2018). 8. Moghaddam, M. H. Y., Leon-Garcia, A., & Moghaddassian, M. (2017). On the performance of distributed and cloud-based demand response in smart grid. IEEE Transactions on Smart Grid. 9. Kumar, N., Vasilakos, A. V. and Rodrigues, J. J. (2017). A multi-tenant cloud-based DC nano grid for self-sustained smart buildings in smart cities. IEEE Communications Magazine, 55(3), 14-21. 10. M. Pruckner, A. Awad and R. German, "A study on the impact of packet loss and latency on real-time demand response in smart grid," 2012 IEEE Globecom Workshops, Anaheim, CA, 2012, pp. 1486-1490. doi: 10.1109/GLOCOMW.2012.6477805 11. Chen, S. L., Chen, Y. Y., & Kuo, S. H. (2017). CLB: A novel load balancing architecture and algorithm for cloud services. Computers & Electrical Engineering, 58, 154-160. 12. He, D., Kumar, N., Zeadally, S., & Wang, H. (2018). Certificateless Provable Data Possession Scheme for Cloud-Based Smart Grid Data Management Systems. IEEE Transactions on Industrial Informatics, 14(3), 1232-1241. 13. Fang, Baling, Xiang Yin, Yi Tan, Canbing Li, Yunpeng Gao, Yijia Cao, and Jianliang Li. “The contributions of cloud technologies to smart grid.” Renewable and Sustainable Energy Reviews 59 (2016): 1326-1331. 14. Capizzi, G., Sciuto, G. L., Napoli, C., & Tramontana, E. (2017). Advanced and Adaptive Dispatch for Smart Grids by means of Predictive Models. IEEE Transactions on Smart Grid. 15. Al Faruque, M. A., & Vatanparvar, K. (2016). Energy management-as-a-service over fog computing platform. IEEE internet of things journal, 3(2), 161-169. 16. Pham, N. M. N., & Le, V. S. (2017). Applying Ant Colony System algorithm in multi-objective resource allocation for virtual services. Journal of Information and Telecommunication, 1(4), 319-333. 17. Chekired, D. A., Khoukhi, L., & Mouftah, H. T. (2018). Decentralized cloud-SDN architecture in smart grid: A dynamic pricing model. IEEE Transactions on Industrial Informatics, 14(3), 1220-1231. 18. Islam, N., & Waheed, S. (2017). Fuzzy based Efficient Service Broker Policy for Cloud. International Journal of Computer Applications, 168(4). 19. Lyu, L., Nandakumar, K., Rubinstein, B., Jin, J., Bedo, J., & Palaniswami, M. (2018). PPFA: Privacy Preserving Fog-enabled Aggregation in Smart Grid. IEEE Transactions on Industrial Informatics. 20. Hussain, M., Alam, M. S., & Beg, M. M. (2018). Fog Computing in IoT Aided Smart Grid Transition-Requirements, Prospects, Status Quos and Challenges. arXiv preprint arXiv:1802.01818.

Suggest Documents