Energy-Efficient Edge-Fog-Cloud Architecture for IoT-Based Smart Agriculture Environment

The current agriculture systems compete to take advantage of industry advanced technologies, including the internet of things (IoT), cloud/fog/edge computing, artificial intelligence, and agricultural robots to monitor, track, analyze and process various functions and services in real-time. Additionally, these technologies can make the agricultural processes smarter and more cost-efficient by using automated systems and eliminating any human interventions, hence enhancing agricultural production to meet future expectations. Although the current agriculture systems that adopt the traditional cloud-based architecture have provided powerful computing infrastructure to distributed IoT sensors. However, the cost of energy consumption associated with transferring heterogeneous data over the multiple network tiers to process, analyze and store the sensor’s information in the cloud has created a huge load on information and communication infrastructure. Besides, the energy consumed by cloud data centers has an environmental impact associated with using non-clean fuels, which usually release carbon emissions (CO2) to produce electricity. Thus, to tackle these issues, we propose a new integrated edge-fog-cloud architectural paradigm that promises to enhance the energy-efficient of smart agriculture systems and corresponding carbon emissions. This architecture allows data collection from several sensors to process and analyze the agriculture data that require real-time operation (e.g., weather temperature, soil moisture, soil acidity, irrigation, etc.) in several layers (edge, fog, and cloud). Thus, the real-time processing could be held by the edge and fog layers to reduce the load on the cloud layer, which will help to enhance the overall energy consumption and process the agriculture applications/services efficiently. Mathematical modeling is conducted using mixed-integer linear programming (MILP) for a smart agriculture environment, where the proposed architecture is implemented, and results are analyzed and compared to the traditional implementation. According to the results of thousands of agriculture sensors, the proposed architecture outperforms the traditional cloud-based architecture in terms of reducing the overall energy consumption by 36% and the carbon emissions by 43%. In addition to these achievements, the results show that our proposed architecture can reduce network traffic by up to 86%, which can reduce network congestion. Finally, we develop a heuristic algorithm to validate and mimic the presented approach, and it shows comparable results to the MILP model.


I. INTRODUCTION
The Internet of Things (IoT) is one of the emerging technologies that promise to transform the way on how people work and live. The term IoT refers to a network of physical objects ''things'' that contain embedded systems with connectivity and computing power to exchange data with other devices and The associate editor coordinating the review of this manuscript and approving it for publication was Ghufran Ahmed . systems over the Internet. By 2025, the number of IoT devices connected to the Internet is projected to be 100 billion, with an economic impact of more than $11 trillion [1].
The recent development of IoT devices presents a new dimension in the agriculture field, where the IoT has become an ideal choice for smart agriculture due to its highly scalable and ubiquitous architecture. Moreover, the IoT-based smart agriculture value is estimated to reach $18.45 billion in 2022, and 75 million IoT devices are used for the agricultural sector in 2020 [2]. Furthermore, smart farms are projected to have 12 million IoT points by 2023 [3].
Smart agriculture has started incorporating IoT solutions to improve operational efficiency, maximize yield, and minimize wastage through real-time field data collection, data analysis, and deployment of control mechanisms. Also, the diverse of IoT-based applications such as precision farming and smart irrigation is very helpful to the enhancement of agricultural processes. Thus, the IoT is considered as one of the promising solutions for embracing connected farms to address agriculture-based issues and increase the quality and quantity of agricultural production.
IoT solutions are highly associated with cloud computing to process the huge amount of heterogeneous data sent or received by agriculture sensors/actuators [4]. Although cloud computing can handle smart agriculture applications, some of the applications and services produce a large amount of data and need to be processed in a real-time manner, which may cause a heavy load on the network, long response time, and poor quality of service, due to limited bandwidth [5]. Therefore, using the traditional cloud-based architecture may not be efficient to support these applications, which may also result in high energy consumption due to the transfer of agriculture data to and from the cloud. The Information and Communication Technology (ICT) industry is projected to account for 20% of the global electricity demand by 2025 [5]- [8], [9]. Usually, consuming electricity is accompanied by carbon emissions (CO 2 ). fossil fuel usage is the primary source of CO 2 [10]. Consequently, this causes the growth of carbon dioxide emissions. According to [11], ICT uses 730 Million ton (Mt) CO 2 equivalents (CO 2 e) or 1.4% of worldwide carbon emissions.
To overcome the above shortcomings, edge and fog computing architecture are introduced to process the real-time IoT applications and services at the proximity of data sources in an efficient way, which have several benefits (e.g., reduce energy consumption, network traffic and improve quality of service) compared to traditional cloud-based architecture, that does not exploit the latest paradigms such as fog and edge in the agriculture system [4], [6]. However, edge and fog computing are not a replacement for cloud computing, as cloud computing will still be preferable and suitable for analyzing and processing heavy tasks, as well as storing data in a long term. The collaboration between edge, fog, and cloud computing is the best practice to achieve smart agriculture solutions.
Several related works in the literature, (e.g. in [12], [13]), have discussed various architectures, techniques, and methods applied for smart agriculture systems considering different technologies such as IoT, big data analytics, and cloud computing. However, none of the existing works focused on the edge-fog-cloud architecture intending to reduce the energy consumption, CO 2 emission, and network traffic as considering the three computing layers (edge, fog, and cloud). Therefore, this paper presents a new approach for smart agriculture systems to develop an energy-efficient offloading of IoT agriculture applications over an edge-fog-cloud computing architecture, according to the resource requirements of each agriculture task. Also, this approach could help to enhance the solutions of many traditional agriculture issues by taking the advantage of edge and fog computing, which will improve the overall energy efficiency and reduce CO 2 emission, network traffic of smart agriculture systems. The major contributions of this paper are summarized as follows: • Develop an energy-efficient architecture based on mathematical modeling and heuristic algorithm to study the offloading of IoT applications from agriculture sensors to edge, fog, and geo-distributed cloud, while considering minimization of the overall power consumption of networking and processing of the IoT agriculture services.
• Optimize the offloading of IoT agriculture applications over an edge-fog-cloud architecture, which connected to the access network, metro area network, and wide area network, respectively, thus eliminating the associated power consumption and telecommunication network traffic.
• Evaluate the usability and the capability of the proposed architecture and its models, using the mixed-integer linear programming (MILP) model, and compared the results to the traditional approach.
The remainder of this paper is organized as follows: Section II introduces the edge-fog-cloud system architecture and its interaction layers. Section III presents the mixed-integer linear programming (MILP) model for optimizing the offloading of IoT agriculture applications in the edge-fog-cloud architecture. The model's design, scenarios, and the input parameters of the models are presented in Section IV. This is followed by discussing the optimization model results and analysis in Section V. In Section VI, we introduce energy-efficient agriculture IoT applications distribution heuristic over the edge-fog-cloud architecture (EEAIOT-EFC). Finally, Section VII concludes the paper and discusses future work.

II. PROPOSED ARCHITECTURE FOR SMART AGRICULTURE SYSTEM
Today, the traditional cloud-based architecture for agriculture systems is inefficient to satisfy all the requirements of the current scenarios [4], [5], [7], [8], as it lacks the essential efficiency prerequisites such as energy consumption, CO 2 emission, network traffic, and so on [6]. Consequently, there is a need to develop an energy-efficient architecture for a smart agriculture system to fulfill these requirements.
This section provides an outline of the proposed edgefog-cloud architecture and its role in providing dynamicity and efficiency based on different IoT agriculture applications. The proposed architecture of the smart agriculture system is shown in Fig. 1; and it consists of four essential layers, namely, IoT sensor layer, edge layer, fog layer, and cloud layer. The description of each layer of the proposed architecture is presented as follow:

A. IOT SENSOR LAYER
IoT sensors generate massive heterogeneous data to the gateways by using various sensors deployed in different areas of the agriculture field. Also, this layer can receive decisions from to control actuators (e.g., turning on/off irrigation system) [14]. In smart agriculture, there is a range of IoT sensor nodes used to identify several phenomena over the urban areas including but not limited to soil pH, soil temperature, soil moisture, soil electrical conductivity, and ambient temperature [15].
In the IoT agriculture system, low power wide area (LPWA) technologies have paved the way due to their low power consumption and wide area coverage. Long range (LoRa) is proved its efficiency, as a transmission protocol for IoT sensors. Besides its low power consumption, it ensures an extent of 10 kilometers coverage or more. In addition to LoRa, multiple wireless technologies can be used for smart agriculture urban areas such as narrowband (NB)-IoT, WiFi, Zigbee, and the 5G. The Zigbee technology has been successfully used in the field of agriculture at a low power cost. However, the limited distance coverage for wireless data transferring (about 20 meters) is reducing its efficiency. A comprehensive comparison of different IoT wireless network technologies (Zigbee, LoRa, NB-IoT, and 5G), is presented in Table 1.

B. EDGE LAYER
Edge computing refers to a new computing model that implements the computation of sensors/actuators data at the edge of the network. With this concept, some applications and services that do not require a lot of computing resources can be processed in the edge layer (close to the data source) and no longer need to traverse the network to be processed by the fog or the cloud. Thus, edge computing can improve data transmission performance, ensure real-time processing, and reduce the computational load as well as the amount of data transmitted to and from the fog or cloud data centers [8]. However, in case of unavailability/unsuitability of the resources in the edge layer, the sensors will automatically request to process their data in the fog or the cloud, and this will be done hierarchically.

C. FOG LAYER
The fog computing concept was initially proposed by Cisco in 2014 to expand the resources of cloud computing to the edge of the telecommunications network. In this context, the fog layer has the responsibility to process and analyze data sent from IoT sensors, which helps to minimize the latency for agriculture applications and services. Also, the fog layer has the ability to process and analyze complex data more than the edge layer.
Both fog and edge can provide computation, networking, and storage services in between the sensor layer and the cloud layer. It means that instead of executing all processing at the cloud layer, the fog and edge layers can process and analyze agricultural data locally and close to the sensor layer (based on their ability) to reduce latency and cost [5], [7].

D. CLOUD LAYER
At the same level of importance as edge and fog, cloud computing is a vital enabler for the growth of IoT agriculture applications. It offers on-demand computing resources and services (e.g., storage, networking, and processing) in a scalable way. The cloud layer handles the agriculture data received from the sensor layer or the fog layer to process, analyze and store them into the cloud. Cloud computing can process and analyze heavy data, that requires more complex operations (e.g., big data processing and predictive analysis like weather forecasting, fire warning, and soil droughting), which exceeds the fog computing capability [6]. Also, it could provide a large-scale secure platform and cheap data storage services for the IoT agriculture applications [5], [8].

E. TELECOMMUNICATION NETWORKS
The traditional telecommunication network architecture consists of three layers [16]: the core layer, the metro layer, and the access network layer. The wide area network (WAN) is the key network infrastructure that provides interconnection between different regions and cities. The Internet protocol (IP) over wavelength division multiplexing (WDM) is widely implemented in the core network as it can provide high scalability, large capacity, and fast communication network transfer speeds.
Based on the reference hierarchy in Fig. 1, every core network has a direct connection with a metro area network (MAN), which covers a metropolitan area. Metro Ethernet is the technology commonly used in the metro network. It offers connectivity between the core network and users located in the access network. The local area network (LAN) supports Internet access to numerous user premises. We adopted the passive optical networks (PONs) which considered as the leading networking in the LAN network.

III. MILP MODEL
In this section, a new approach is developed based on mathematical mixed-integer linear programming (MILP) optimization model to study the energy-efficiency of offloading IoT agriculture applications over an edge-fog-cloud architecture, considering the three telecom network layers: LAN equipped with an edge layer, MAN equipped with a fog layer and the WAN equipped with a cloud layer.
In the following, we introduce the parameters and variables of our proposed architecture. The architecture consists of the IoT sensor, edge, fog, and cloud layers. Then, we provide the mathematical model to find the optimum distribution of IoT agriculture applications to serve the offloaded requests from the IoT sensor layer based on their energy consumption over an edge-fog-cloud architecture.

A. IOT SENSOR LAYER
The parameters and variables that represent the IoT sensor layer, are shown in Tables 2 and 3.
IoT sensor layer power consumption (IoT) is composed of: Equation (1) calculates the total power consumption of the IoT sensor layer, including IoT sensors and gateway devices.

B. EDGE, FOG, AND CLOUD LAYERS
The following parameters and variables (in Tables 4 and  5) represent the IoT agriculture applications that will be placed in the edge, fog, or cloud layers, as well as the resulted traffic and power consumption.
The power consumption of cloud/fog/edge nodes consist of: 1) Cloud layer power consumption (Cloud): 2) Power consumption of fog layer (Fog): 3) Power consumption of edge layer (Edge): Equations (2, 3, and 4) calculate cloud, fog, and edge computing layers total power consumption, including processing, and networking devices, taking into consideration the power usage effectiveness (PUE) of cloud, fog, and edge layers, respectively.

C. COMMUNICATION NETWORKS
As described in Section II-E, a typical telecom network is considered including WAN, MAN, and LAN networks.  The traffic traverse through these layers as well as the corresponding power consumption are represented by the parameters and variables described below.

1) LOCAL AREA NETWORK (LAN)
The parameters and variables that define the LAN network are shown in Tables 6 and 7.
Local area networks power consumption (LAN) consists of: Equation (5) calculates the total power consumption of the LAN network, including Optical Network Units (ONU) and Optical Line Terminals (OLTs) devices, taking into consideration the network PUE.

2) METRO AREA NETWORK (MAN)
The parameters and variables introduced to define the MAN are shown in Tables 8 and 9.
The metro area network power consumption (MAN) consists of:   Equation (6) calculates the total power consumption of the MAN network, including router ports and switch devices, taking into consideration the network PUE.

3) WIDE AREA NETWORK (WAN)
The parameters and variables introduced to define WAN network are shown in Tables 10 and 11.
The wide area network (WAN ) [17] power consumption consists of:  Equation (7) calculates the total power consumption of the WAN network, including core router ports, transponders, amplifiers, and switch devices, taking into consideration the network PUE.
The MILP model, considering the equations from (1-7), represented by the following: The objective: Minimize total power consumption: (8) Expression (8) Constraint (9) guarantees that all the IoT offloaded traffic is processed at a cloud, fog, or edge destination node.
IoT application in edge/fog/cloud constraints: Constraints (10) and (11) Constraints (12) and (13) ensure that the physical link m, n ∈ c is activated if there is a traffic flow between the nodes s, d ∈ c transmitting through the physical links m, n ∈ c.
Edge, fog, and cloud processing requirements: Constraints (14) gives the processing requirements of IoT application i ∈ I in a cloud, a fog, and an edge layer. Constraint (15) gives the total processing of a cloud, a fog, and an edge layer d ∈ N.
Traffic demand on WAN network: Constraint (16) Constraint (23) gives the total traffic in each node s.

4) CARBON EMISSIONS (CO 2 ) OF IOT-EDGE-FOG-CLOUD LAYERS
Carbon emissions [18] can be defined as the carbon emission intensity per an energy consumption and the unit of carbon emission intensity is kgCO2e / kWh. The research found that using solar, wind or nuclear plants creates a low carbon footprint compared with fossil fuels [19]. However, there are multiple limitations to the usage of low carbon sources including but not limited to the cost of installing these clean plants. Thus, in this work, we assume that only the IoT sensor layer and edge layer are powered by low carbon sources (i.e., solar plants panels) to reduce the power consumption of the proposed architecture. In the following Tables 12 and 13, we define parameters and variables related to carbon emissions.  Total carbon emission (CO) is composed of: (26) Considering that IoT sensors, gateway, and edge processing layers are powered by solar energy sources. While others are powered by oil energy sources.

IV. MILP MODEL DESIGN
In this section we explain the scenarios and the design of the model conducted in order to evaluate the proposed architecture.

A. SCENARIOS
As shown in Fig. 1, different scenarios can be implemented with this proposed architecture to show its effectiveness. In this work, the following scenarios are considered in a hierarchical order based on the edge, fog, and cloud ability. Edge/fog layers can be deployed in the proposed architecture according to the resources required by the agriculture tasks. Essentially, all tasks from heterogeneous IoT devices/sensors in the agriculture field, using different IoT wireless network technologies will be offloaded to the network gateways and then directed to edge/fog or cloud layer. Each layer has pros and cons. For example, processing the tasks within the edge layer will save the power and traffic cost of request transmission from/to the fog or cloud layer. However, handling all types of tasks within the edge layer is not possible, as it has limited capacity. Therefore, fog and cloud layers can be the choice for processing heavy tasks (e.g., resource-intensive applications).
In our model, we assume that a scheduler in the gateway of the IoT layer checks if the edge node has available resources and can handle the request of IoT applications (e.g., CPU capability -the number of million instructions per second (MIPS)), the tasks will then pass to the edge layer to process them. In case of insufficient/unavailability of processing the tasks in the edge layer, the request will be transferred to the fog layer and check if there is enough capacity. Otherwise, the tasks will be forwarded to the cloud layer for processing, which supports resource-intensive applications. Also, we have assumed that the cloud has enough resources and capability to handle all kinds of tasks.

B. INPUT PARAMETERS OF THE MODELS
In the MILP model, we have configured four layers in a smart agriculture system, which is composed of the IoT sensor layer, edge layer, fog layer, and cloud layer. The configuration of edge, fog, and cloud layers depend on the type of tasks (e.g., number of MIPS) requested by each IoT sensor/device at the IoT sensor layer. The model input parameters of different layers (IoT sensor, edge, fog, and cloud layers), in addition to networks and carbon emissions parameters, are shown in Tables 14, 15, 16, 17, and 18, respectively. In our model, we assume that there are 100,000 sensors distributed in each farm The sensors task requirements are divided into three types (sensing 60%, processing 30%, heavy processing 10%). The sensing processing task is usually limited to handling offloaded reading data sent by the sensors (e.g., temperature reading or send control commands for the irrigation system). The processing task is the requirement of light processing (e.g., soil analytics and event detection). The heavy processing task is the requisite of higher processing power and resources (e.g., weather prediction and analysis).

V. RESULTS AND DISCUSSION
In this section, we discuss the proposed energy-efficient edgefog-cloud architecture. In addition to its energy efficiency, we evaluate our model to find the consequence CO 2 emission, VOLUME 9, 2021   [17], [22]. and network traffic compared to the traditional cloud-based architecture.
We have evaluated the proposed architecture and models using MILP optimizer based on the AT&T network topology, as shown in Fig. 2. To solve the MILP model, we use the CPLEX solver over a laptop with an Intel Core i7-7660U CPU, running at 2.50 GHz, with 16 GB RAM. As shown in Table 1, we have categorized all IoT wireless network technologies used in this work based on their data rate, range, number of devices, power consumption of both gateway/base-station, and sensors. This work has identified that the power consumption of different IoT wireless network technologies almost the same, as shown in Fig. 3. The Zigbee technology delivers connectivity with low power consumption compared to other technologies. However, using Zigbee in the urban area is not the best choice as it only covers 20 meters, thus, hundreds or thousands of gateways are required to cover a large area. Since we aim to use a technology that covers a large area with the least amount of energy consumption. Therefore, LoRa has been chosen as an IoT wireless communication technology between the IoT sensors and the gateway, that covers long-distance communication, with low power consumption, and considers one of the most suitable technology for IoT agriculture applications, as shown in Fig. 3. Fig. 4 illustrates the power consumptions of different tasks in the proposed edge-fog-cloud architecture versus the traditional cloud-based architecture. Also, it shows the placement location of each task/application in edge-fog-cloud architecture, as well as the power consumption values of each task individually.

A. ENERGY CONSUMPTION
The results showed that the sensing tasks are offloaded to the edge layer, as it has enough capacity (i.e., sensing requires 500 MIPS, and the edge layer has the capability to process up to 1800 MIPS). The normal processing tasks are offloaded to the fog respectively, as the fog layer has sufficient resources (i.e., 4000 MIPS) to process the tasks (i.e., 2000 MIPS). All remaining requests are offloaded to the cloud layer as there is no capacity in edge neither fog layers to accommodate heavy processing tasks. Fig. 5 shows the power consumption of our proposed architecture compared to the traditional cloud-based architecture, considering different IoT wireless technologies. Also, the figure displays power saving achieved by the proposed architecture. It is clearly shown that our proposed architecture outperforms the traditional cloud-based architecture by up to 36% of the total power consumption. However, the power savings have slightly ranged between 33.6% and 35.6% based   It shows that our proposed architecture can reduce up to 42% of CO 2 emission, for real-time IoT applications in agriculture systems. The results also show a comparable carbon emission using different IoT wireless technologies. The power consumption of these technologies has been eliminated, as all IoT sensors and gateways are power by a solar plant, that emits very low carbon footprints (solar plants emit only 0.048 kgCO 2 /kWh). Fig. 7 shows the total traffic in each network tier in our proposed architecture versus the traditional cloud-based architecture. The results showed that our proposed architecture is capable to reduce the total traffic by 14% and 86% in MAN and WAN tiers, respectively, compared to a cloud-based approach.

C. NETWORK TRAFFIC
In the traditional cloud-based architecture, the process of sending/retrieving the data to/from the cloud in real-time requires high-capacity bandwidth, which may cause a burden on the three network tiers. Thus, employing edge and fog computing has allowed processing most requests locally in edge or fog layers, which significantly decreases the flow of data traverse to the cloud and reduces network traffic, as shown in Fig. 7.

VI. ENERGY EFFICIENT AGRICULTURE IOT EDGE/FOG/CLOUD ARCHITECTURE HEURISTIC
The problem over energy-efficient offloading of IoT applications in edge-fog-cloud architecture for smart agriculture environment is a non-deterministic polynomial (NP)-hard problem. For instance, if i is IoT applications count and n is the count of locations in edge-fog-cloud architecture, then we will have n z=1 n! (n−z)! combinations of possible applications locations to find the optimum locations that result in optimal power consumption. Thus, applying MILP to large-size problems is not feasible. Therefore, heuristic provides a simple and fast real-time implementation. Also, the optimal solution provided by the heuristic can provide validation to results obtained from MILP. To provide that, a heuristic algorithm was developed, referred to as energy-efficient agriculture IoT applications distribution heuristic over the edge-fog-cloud architecture (EEAIOT-EFC).
In the EEAIOT-EFC heuristic, IoT application i is checked based on their total MIPS processing requirements. Firstly, the algorithm tries to place and run the application on the edge layer. If there is not enough MIPS capacity at the edge layer, then, agriculture IoT application is placed in the fog layer, if it has enough capacity. In case of unavailability resources in both edge and fog layers, the cloud layer will host the IoT application, as it has enough processing capability to handle all types IoT applications. After distributing all IoT applications, the power consumption of EEAIOT-EFC is determined. The heuristic flowchart process is shown in Fig. 8.
The heuristic is assessed using a PC with an Intel Core i7-7660U CPU, running at 2.50 GHz, with 16 GB RAM. Similar to MILP, the AT&T network is considered a WAN network example. The heuristic took 5 seconds to evaluate the EEAIOT-EFC, and the MILP and EEAIOT-EFC show a comparable result, as shown in Fig. 9. The gaps between them are limited to 0.7% and 4.7% of the total power consumption under the proposed and the traditional cloud-based, respectively.

VII. CONCLUSION AND FUTURE WORKS
In this paper, the concept of an edge-fog-cloud architecture is introduced in the smart agriculture system, which solved existing real-time processing issues in terms of reducing energy consumption, CO 2 emission, and network traffic, compared to the traditional cloud-based architecture. The proposed architecture employed the edge and fog layers, which are placed close to the agriculture fields to collect heterogeneous data from various kinds of IoT agriculture sensors and process them at these layers. Although the proposed architecture was significantly reduced the computational load and the amount of transmitted data to and from the cloud due to the use of edge and fog layers, however, the cloud layer is inevitably used to process the heavy and complex data/task requested by IoT agriculture devices/sensors. Most of the processing tasks are completed on the edge and fog layers, while few tasks are offloaded to the cloud layer for processing.
In the paper, different metrics have been taken into consideration, including energy consumption, CO 2 emission, and network traffic to study the performance and the outcomes of the proposed architecture. Using mathematical modeling, the proposed architecture is compared with the traditional cloudbased architecture. The model results showed that our proposed architecture can reduce the overall power consumption, carbon footprints, and network traffic by up to 43%, 36%, 86%, respectively.
Moreover, we developed energy-efficient agriculture IoT applications distribution heuristic over the edge-fog-cloud architecture (EEAIOT-EFC) algorithm, which showed comparable results to the MILP model.
Though this proposed solution is based on the idea of smart agriculture, it also can be suitable for other IoT applications and sectors, such as e-healthcare, smart city, and smart home. In the future, we intend to extend the proposed approach in a distributed real agricultural environment, considering machine-learning and decision-making algorithms to further understand the capability of the proposed work.