LSTM-based Traffic Load Balancing and Resource Allocation for an Edge System

The massive deployment of small cell Base Stations (SBSs) empowered with computing capabilities presents one of the most ingenious solutions adopted for 5G cellular networks towards meeting the foreseen data explosion and the ultra-low latency demanded by mobile applications. This empowerment of SBSs with Multi-access Edge Computing (MEC) has emerged as a tentative solution to overcome the latency demands and bandwidth consumption required by mobile applications at the network edge. The MEC paradigm offers a limited amount of resources to support computation, thus mandating the use of intelligence mechanisms for resource allocation. The use of green energy for powering the network apparatuses (e.g., Base Stations (BSs), MEC servers) has attracted attention towards minimizing the carbon footprint and network operational costs. However, due to their high intermittency and unpredictability, the adoption of learning methods is a requisite. Towards intelligent edge system management, this paper proposes a Green-based Edge Network Management (GENM) algorithm, which is a online edge system management algorithm for enabling green-based load balancing in BSs and energy savings within the MEC server. The main goal is to minimize the overall energy consumption and guarantee the Quality of Service (QoS) within the network. To achieve this, the GENM algorithm performs dynamic management of BSs, autoscaling and reconfiguration of the computing resources, and on/off switching of the fast tunable laser drivers coupled with location-aware traffic scheduling in the MEC server. The obtained simulation results validate our analysis and demonstrate the superior performance of GENM compared to a benchmark algorithm.


I. INTRODUCTION
The foreseen dense deployment of Base Stations (BSs) empowered with computing capabilities in order to meet the ultra-low latency demanded by mobile users raises concerns related to energy consumption. Apart from the fact that BS energy costs accounts for a large part of the operating expenses of Mobile Network (MN) operators, there are also increasing concerns regarding their environmental impact in terms of high carbon dioxide (CO 2 ) emissions. In an effort to minimize energy consumption and energy costs in 5G cellular networks within the Multi-access Edge Computing (MEC) paradigm, this paper advocates for the integration of Energy Harvesting (EH) systems into network apparatuses and the use of container-based virtualization within computing platforms (i.e., MEC servers). The use of green energy mitigates the negative environmental impact of MNs and enable cost saving for mobile operators in terms of lowering operational energy costs. The motivation towards green energy is due to the fact that current trends in battery and solar module costs show a reduction in prices. The benefits of container-based virtualization is the reduction in energy drained in the computing platform due to their lower overheads when compared with Virtual Machines (VMs) [1] [2]. For a qualitative comparison of different virtualization technniques, interested readers are referred to [1].
In this paper, a group of EH BSs placed in proximity to a EH-MEC server are considered as an edge system. The EH-MEC server manages the BS system, deciding upon the allocation of transmission resources, and also handling the computing and communication processes. In general, renewable energy systems are dimensioned to guarantee the autonomous operation of the edge system. Thus, it is desirable that the utilization of green energy be made one of the performance metrics when designing load-balancing strategies [3] [4], instead of the network impact [5] [6]. As a result, the green-based load balancing is a promising technique for optimizing MEC performance since it exploits the spatial diversity of the available green energy to reshape the network load among the BSs [4]. In this case, MNs can prioritize the utilization of BSs with sufficient green energy to serve more traffic while reducing the traffic loads for those BSs consuming on-grid power. For instance, in the MEC server, a trade-off between the green energy utilization and the amount of workload that can be computed locally should be carefully evaluated.
In this regard, it is worth noting that the energy consumption within the virtualized computing platform is due to (i) the active computing resources, i.e., VMs or containers [7][8] [9], (ii) the network communications, communication related to transmission drivers [10] [11], and the intra-communications [12]. In order to alleviate this, this paper assumes that the container-based virtualization be deployed in the MEC server as containers are lightweight, i.e., demand less memory space, have shorter start-up time, and offer software portability. At each time instance, the containers are provisioned based on the forecasted server workloads, a technique referred to as autoscaling. In addition, the transmission drivers used for data transfers within the server are tuned by taking into account mobile user's location. The server is also capable of caching the frequently requested contents locally.
In densely-deployed BSs, the energy drained is due to the always-on design approach [5] [6] [13], yet traffic load varies during the day, e.g., the demand is low during the night. Therefore, in order to intelligently manage the BSs towards The use of green energy as a performance metric has been explored within the Radio Acess Network (RAN) [3] [16]. Along the lines of MN softwarization, a distributed user association scheme that makes use of the SoftRAN concept for traffic load balancing via the RAN Controller (RANC) is proposed in [3]. Here, the user association algorithm runs on the RANC and the users report their downlink data rates via the associated BS to the RANC, where the traffic loads from individual users and BSs are measured. The algorithm enhance the network performance by reducing the average traffic delivery latency in BSs as well as to reduce the on-grid power consumption by optimizing the green energy usage. Then, authors in [16] proposed to optimize the utilization of green energy for cellular networks by optimizing the BSs transmission power. The proposed scheme achieves significant on-grid power savings by scheduling the green energy consumption along the time domain for individual BS, and balancing the green energy consumption among the BSs.
Along the lines of MEC, the authors in [4] proposed a framework for jointly performing load balancing, admission control and energy purchase within a network of EH-powered BSs with the goal of minimizing the computation delay and data traffic drops (i.e., increasing the locally computed workloads). This work use green energy as a performance metric. To solve this problem, an online and distributed algorithm is proposed leveraging the Lyapunov optimization with perturbation technique. Here, the algorithm makes the traffic load decisions without forecasting the future traffic load and harvested energy. In contrast, the work presented in this paper consider the short-term future traffic load and the harvested energy for decision making. Then, in our previous work [6], a supervisory online control algorithm that make use of clustering and the network impact metric towards load balancing in MN is proposed. Here, the BSs are empowered with computation capabilities (with VMs as computing resources), the Long Short-Term Memory (LSTM) neural network is used for forecasting and the LLC policy handles foresighted optimization. Even though these works perform load balancing, the problem and scenario considered in this paper is different. Here, a MEC server manage the SBSs powered by green energy. Similar to [11], forecasting and foresighted optimization is used for edge system management.
Load balancing that follows the energy routing, i.e., more computational workload is offloaded to where more energy is available, is presented in [17]. To handle spatial uneven computation workloads experienced by the MEC-enabled BSs, the authors proposed a peer offloading scheme. Here, the BSs share their computing resources and energy costs.

B. Methods for energy saving within computing platforms
Green computing over data centers is an emerging paradigm that aims at performing the dynamic energy-saving management of data center infrastructures. Here, procedures for the dynamic on/off switching of servers have been proposed as a way of minimizing energy consumption in computing platforms. A novel post-decision state based learning algorithm for server provisioning at the network edge is presented in [18]. This work incorporates green energy. At the beginning of the time slot the servers are consolidated, i.e., the number of turned on physical servers are minimized, using the learned optimal policy for dynamic workload offloading and the autoscaling (or right-sizing). Then, in our previous works [6][11] [19], VM soft-scaling (i.e., the reduction of computing resources per time instance) is employed towards energy saving in virtualized platforms either energized by only renewable energy or hybrid supplies (solar and power grid). This is achieved by forecasting the traffic load and harvested energy, and then employing foresighted optimization to obtain the system control inputs. The work of [20] use an iterative algorithm to obtain the number of computing resources (VMs) to be provisioned within a node that transmit to clients wireless. Then, the work of [21] consider a vehicular scenario where vehicles connect wireless to Fog nodes and then develop an adaptive scheduler, which computes on-the-fly the solutions of both the resource reconfiguration and consolidation problems. For this purpose, the primal-dual algorithm is used.
In computing platforms, computation offloading strategies can be jointly exploited together with delay constraints towards energy savings. The authors in [22] proposed an offloading policy to find the optimal place where to offload and the amount of offloaded task data. In this work, the time taken for processing the offloaded task is reduced, at the same time consuming less energy. Then in [23], an efficient scheduling for latency-sensitive applications is proposed towards energy and response time minimization. The achieved results show a reduction in delay and network usage, and the energy consumption. In addition, the works of [24] jointly optimize the computing and communication resources, taking into account the local task execution delay and transmission delay. To meet the task delay requirements, in [25], the heterogeneous clouds, i.e., edge and remote cloud, are coordinated. Here, different policies are employed in the clouds. In this, the edge cloud handles tasks with loose delay bounds and drops drops tasks with stringent delay bounds when the traffic load is heavy.
Towards minimizing energy consumption induced by communication activities within a computing node, the idea of tuning transmission drivers, as one of the energy saving strategies within the MN infrastructure, is first conceived in [10][26] where a computing node (router) is considered. Here, it is observed that having the least number of data transmission drivers (fast tunable lasers) can yield significant amount of energy savings. Motivated by the aforementioned works, within the MEC paradigm, the authors in [11] put forward a traffic engineering-and MEC Location Service (LS)based algorithm that use a location-aware procedure for provisioning the transmission drivers for data transfer towards target BSs. Here, the MEC LS Application Programmable Interfaces (API) is employed for retrieving the User Equipment (UE)'s location and then passing the information to the authorized applications within the MEC platform, for decision making.
Overall, these works numerically analyze and test the energy performance of some state-of-the-art schedulers for computing platforms, but do not attempt to optimize it through the dynamic joint scaling of the available communication-plus-computing resources. The joint analysis of the computing-plus-communication energy consumption within the MEC paradigm is still an open research topic.

C. Methods for guaranteeing quality of service and enabling energy savings (within the MEC paradigm)
The mobile operator's goal is to provide QoS Internet services for large populations of clients, while minimizing the overall computing-plus-communication energy consumption. Hence, a trade-off is required between QoS and energy savings. Future MNs are expected to learn the diverse characteristics of users behavior, as well as renewable energy variations, in order to autonomously determine good system configurations. Towards this goal, online forecasting using Machine Learning (ML) techniques and the LLC method can yield the desired system behavior when taking into account the environmental inputs, i.e., BS traffic load, server workloads and energy to be harvested. Next, the mathematical tools that are used in this research work are reviewed, namely the LLC method [14][27] [28] and LSTM neural networks [29] [30].
The LLC has been used in [27] to address a resource provision problem within virtualized environments. The optimization problem is posed as a profit maximization problem under uncertainty and the LLC formulation models the cost of control. To address the uncertainty over the workload arrival, the Kalman filter is used. Then, in [31], an online supervisory control scheme based on LLC policies is proposed. Here, after the occurrence of an event, the next control action is determined by estimating the system behavior a few steps into the future using the currently available information as inputs. The control actions exploration is performed using a search tree assuming that the controller knows all future possible states of the process over the prediction horizon. An online control framework for resource management in switching hybrid systems is proposed in [14], where the system's control inputs are finite. The relevant parameters of the operating environment, e.g., workload arrival, are estimated and then used by the system to forecast future behavior over a look-ahead horizon. From this, the controller optimizes the predicted system behavior following the specified QoS through the selection of the system controls. In [6] and [19], a LLCbased supervisory algorithm is proposed to obtain the system control actions yielding the desired trade-off between energy consumption and QoS. Here, the traffic load and harvested energy is forecasted and then used as input in the algorithm. The BS are densely-deployed in [6] and each BS is empowered with computation capabilities. Then, in [19], a remote site powered by only green energy is considered.
LSTM can be used for multi-step time series forecasting as it is able to handle the long-term dependencies due to its inherent capability of storing past information and then recalling it. The forecasting method is utilized in [6] [19] within an LLC-based algorithm to obtain the system control actions yielding the desired trade-off between energy consumption and QoS. The application of LSTM network is extended to include Intelligent Transport Systems (ITSs) in [32]. A new ITS edge analytics architecture that makes use of deep learning techniques that either runs on the mobile devices or on the intra-vehicle processors for data analytics is presented. A combination of LSTM networks and deep Convolutional Neural Networks (CNNs) is adopted, i.e., CNN-LSTM network, for path selection in autonomous vehicles, whereby the CNN is used for feature extraction, and then the extracted information is fed into LSTM networks for driving path selection. Forecasting server workloads using LSTM network can be beneficial for dynamic resource scaling and power consumption in cloud computing datacenters. In [33], a forecasting model using the LSTM network for predicting future data center workloads is proposed, and then the results are fed into the resource manager for decision making, which either involves scaling up or down the computing resources (servers in this case).

III. SYSTEM MODEL
In line with ETSI proposed MEC deployment scenarios discussed in [34], the considered network scenario is illustrated in Fig. 1 above where the proposed model is cache-enabled, TCP/IP offload capable (i.e., enables partial offloading in the server's Network Interface Card (NIC) such as checksum computation [35]). The virtualized MEC server is assumed to be hosting C containers deployed at an aggregation point, which is in proximity to a cluster of N BSs from the same MN operator. The BSs are interconnected to the MEC server for computation workload offloading. Each network apparatus (BS, MEC server) is mainly powered by renewable energy harvested from wind and solar radiation, and it is equipped with an Energy Buffer (EB) for energy storage. In this case, energy can only be purchased from the grid supply to supplement the renewable energy supplies. The BSs coverage areas overlaps so that green-based load balancing is possible. The Energy Manager (EM) is an entity responsible Table I. Notation: list of symbols used in the analysis.

Symbol
Description Input Parameters C maximum number of containers hosted by the MEC server, indexed by c N number of BSs, indexed by n ξ(t) aggregate computational workload τ time slot duration L in (t) amount of aggregate workload at the input buffer Lout(t) amount of aggregate workload at the output buffer L max out (t), L max in (t) workload buffers maximum capacity fmax maximum processing rate for container c θ idle,c (t) static energy consumed by container c in the idle state θ max,c(t) maximum energy consumed by container c at maximum processing rate ze per-container reconfiguration cost caused by a unit-size frequency switching λc(t) workload fraction to be computed by the c-th container λmax maximum computation load per-container ∆ maximum per-slot and per-container allowed processing time θ NIC idle (t) energy drained by the NIC when powered, with no data transfer M maximum number of multiple fast tunable lasers βmax maximum energy buffer capacity βup, β low upper and lower energy buffer thresholds Variables θ COMM (t) total BSs energy consumption at time slot t θ MEC (t) server's energy consumption at time slot t θ CNT (t) energy drained due to the active containers, w.r.t CPU utilization, at time slot t θ SC (t) energy drained due to container switching the processing rates at time slot t θ OFF (t) energy induced by the TOE at t θ LNK (t) energy drained due to the virtual-links communication cost at time slot t θ DR (t) energy drained due to the number of active transmission drivers at time slot t θ CC (t) total energy cost incurred by the content caching process C(t) number of containers to be active in time slot t fc(t) instantaneous processing rate ψc(t) load dependent factor rc(t) c-th virtual link communication rate at slot t ζn(t) BS switching status indicator at t θ NIC max (t) maximum energy drained by the TOE at t χc(t) the expected processing time M (t) number of active transmission drivers at t b(t) energy buffer level in slot t H(t) harvested energy profile in slot t E(t) purchased grid energy in slot t for selecting the appropriate energy source to fulfill the EB, and also for monitoring the energy level of the EB. Then, the electromechanical switch (SW) aggregates the energy sources to fulfill the EB level. In the MEC server, there is the presence of a virtualized access control router which acts as an access gateway for admission control, responsible for local and remote routing, and it is locally hosted as an application. Also, the MEC platform is able to track user location via the MEC Location Service Application Programmable Interface (LS API). Lastly, a discrete-time model is considered whereby time is discretized as t = 1, 2, . . . and each time slot t has a fixed duration τ = 30 min. The list of symbols that are used in the paper is reported in Table I.

A. Communication traffic and Energy consumption
From a networking perspective, the understanding and characterization of the energy consumption within the MN can pave the way towards more efficient and user-oriented networking solutions. This can be achieved through the use of historical mobile traffic traces such as Call Detail Records (CDRs) obtained from mobile operators, specifically in the Evolved Packet Core (EPC) network. Due to the difficulties in obtaining relevant open source datasets containing computing requests, real MN traffic load traces obtained from the Telecom Italia Mobile (TIM) network (availed through the Big Data Challenge [36]) are used to emulate the computational load. In order to understand the daily traffic load patterns, the clustering algorithm X-means [37] has been applied to classify the load profiles into several categories. Here, each BS n is assumed to have a related load profile L n (t) which is picked at random as one of the four clusters in Fig. 2. In addition, it is assumed that L n (t) consists of 80% delay sensitive workloads γ n (t) and the remainder is delay tolerant workloads. The total aggregate delay sensitive workload per time instance is The virtualized router in the MEC server of Fig. 1 determines the amount of workload that can be accepted by the input buffer at slot t and the aggregated (or admitted) workload is the maximum input buffer size. In addition, it is assumed that the input/output (I/O) queue of the MEC server are loss-free and they implement the First-In First-Out (FIFO) service discipline, thus L in (t) = L out (t), where L out (t) is the amount of the aggregate computed workload at the output buffer.
The total energy consumption ([J]) for the edge system at time slot t is formulated as follows, inspired by [11] [12]: where θ COMM (t) is the energy consumption term induced by all BS communications and θ MEC (t) is the energy consumption term induced by the MEC server's computing, caching and communication processes.
BS energy cost: the overall energy consumption within the coverage area is defined as the sum of all the BSs components: where δ n (t) ∈ {0, 1} is the BS n switching status indicator (1 for active mode and 0 for power saving mode), θ 0 is a constant value (load independent) representing the operation energy which includes baseband processing, radio frequency power expenditures, etc. θ load,n (t) is the load dependent BS transmission power to the served users that guarantees low latency at the edge. It is obtained by using the transmission model in [38].
MEC energy cost: the energy drained due to the computing, caching and communication processes is defined as:  Figure 2: Normalized BS traffic loads behavior represented as clusters. The data from [39] has been split into four representative clusters.
where θ CNT (t) is the energy drained due to the active containers, w.r.t Central Processing Unit (CPU) utilization, and θ SWT (t) is the energy drained due to containers adapting to new processing rates . The term f 0 is the zero speed of the container, e.g., deep sleep or shutdown, and f max is the maximum available processing rate for container c. It is worth noting that actual containers are generally instantiated atop physical computing cores which offer only a finite set of processing speeds. The term θ OFF (t) is the energy induced by the TCP/IP offload on the NIC and θ LNK (t) is the energy drained due to the virtual-links (toand-from containers) communication cost. Then, θ DR (t) is the amount of energy consumed by the active transmission drivers and θ CC (t) is the total energy cost incurred by the content caching process. In this regard, it is assumed that real-time processing of computation workloads are performed in parallel over the containers interconnected by a rate-adaptive Virtual LAN (VLAN). In addition, it is also assumed that the CPU frequency is fixed at each user and may vary over users. The amount of energy consumed by the CPU is related to the provisioned computing resources, i.e., the CPU share allocated to each container, per time instance t, named C(t) ≤ C, index by c. Thus, θ CNT (t) is defined as [19]: where θ idle,c (t) represents the static energy drained by container c in the idle state, ψ c (t) = (f c (t)/f max ) 2 is the utilization function of container c [28] and θ max,c (t) is the maximum energy that container c can consume. The quantity ψ c (t)(θ max,c (t) − θ idle,c (t)) represents the dynamic energy component of container c.
The intelligent resource manager implements a suitable frequency-scaling policy in real-time, in order to allow the containers to scale up/down their processing rates f c (t) at the minimum cost. At this regard, it should be noted that switching from the processing frequency f c (t − 1) (the processing rate at the (t − 1) time instance) to the next processing frequency f c (t) entails an energy cost, θ SWT (t). This depends on the absolute processing rate gap |f c (t) − f c (t − 1)|, thus θ SWT (t) is defined as: where z e is the the per-container reconfiguration cost caused by a unit-size frequency switching. Typically, z e is limited to a few hundreds of mJ per (MHz) 2 . Before proceeding, it is worth noting the following: at the beginning of time slot t, the online algorithm adaptively allocates the available resources and then determine the containers that are demanded, C(t), the size of the workload allocated to the container c, denoted by λ c (t), and f c (t) for container c that will yield the desired or expected processing time, where ∆ is the maximum per-slot and per-container processing time ([s]). Note that L in (t) = C(t) c=1 λ c (t) is the amount of computational workload admitted in the MEC server, by the router. The amount of the workload to be admitted per-slot shall be decided at the beginning of each time slot depending on the forecasted green energy, grid power to be purchased, and the expected computational workloadsL in (t). Moreover, virtualization technologies specify the minimum and maximum amount of resources that can be allocated per container [40], thus the maximum amount is denoted by λ max . Lastly, the container(s) provisioning and workload allocation is discussed in Section IV-B, Remark 1, and f c (t) ∆ = λ c (t)/∆. By implementing a TCP Offload Engine (TOE) in high-speed computing environments, some TCP/IP processing is offloaded to the network adapter for the purpose of reducing the CPU utilization. To obtain the energy cost incurred, the performance measure for the Broadcom (Fibre) 10 Gbps NIC [35] is considered here as an example of a TCP/IP offload-capable device. Note that θ OFF (t) is data volume dependent and it is obtained as: where θ NIC idle (t) > 0 is the energy drained by the TOE when powered, with all links connected without any data transfer. This provides an opportunity for switching off the network adapter if there is no data transfer, making the energy drained to be zero. For this, ζ(t) = (0, 1) is the switching status indicator (1 for active state and 0 for idle state) and θ NIC max (t) = g(t)·Lin(t) η is the maximum energy drained, where g(t) is a fractional value representing the amount of load computed in the network adapter and η is the NIC best throughput performance, hereby obtained as a fixed value measured in [Gbit/J].
In order to keep the transmission delays from (to) the scheduler to (from) the connected containers at a minimum value, it is assumed that each container c communicates with the resource scheduler through a dedicated reliable link that operates at the transmission rate of r c (t) [(bit/s)]. Thus, the energy needed for sustaining the two-way c th link is defined as, inspired by [41]: where P c (r c (t)) = S c (2 rc(t)/Wc − 1) is the power drained by 0 (W/Hz) is the noise spectral power density, W c is the bandwidth, and g c is the (non-negative) gain of the c th link. In practical application scenarios, the maximum per-slot communication rate within the intra-VLAN is generally limited up to an assigned value r max . Thus, the following hard constraint must hold: In this regard, a two-way per task execution delay is considered. Here, there is a total of c = {1, . . . , C(t)} link connection delays, each denoted by ̺ c (t) = λ c (t)/r c (t), and χ c (t) ≤ ∆ where ∆ is the server's response time, i.e., the maximum time allowed for processing the total computation load and it is fixed in advance regardless of the task size allocated to container c. Since parallel real-time processing is assumed in this work, the overall communication equates to 2 ̺ c (t)+∆. Therefore, the hard per-task delay constraint on the computation time is: max{2 ̺ c (t)} + ∆ = τ max , where τ max is the maximum tolerable delay, which is fixed in advance.
Edge distributed devices utilize low-level signaling for information sharing. Thus, edge computing systems receives information from mobile devices within the local access network to discover their location. In return, for every client who offloaded their task into the MEC server associated with the radio nodes, i.e., BSs, its location and the computation result is known through the LS (which is a service that supports UE's location retrieval mechanism, and then passing the information to the authorized applications within the server), thus enabling the location-aware traffic routing and obtaining the number of transmission drivers to be active for data transfers. The term θ DR (t) depends on the number of active laser (optical) drivers, named M (t) ≤ M , where M is the total number of drivers, that are required for transferring ℓ m (t) ∈ L out (t) in time slot t (ℓ m (t) is the downlink traffic volume ([bits] of the driver at slot t). L out (t) is accumulated over a fixed period of time to form a batch at the output buffer. This means that a large number of drivers yield large transmission speed while at the same time resulting into high energy consumption [26]. Therefore, the energy consumption can be minimized by launching an optimal number of drivers for the data transfer.
The energy drained during the data transmission process consists of the following: a constant energy for utilizing each fast tunable driver denoted by d m (t)([J/s]), the target transmission rate r 0 [bits/s] and L out (t). Thus, the energy is, inspired by [11]: where the parameter M (t) is obtained using the total number of target BSs as M (t) = 1 u · ( ω(t)+1 ω(t) ) 2 , where ω(t) = ρ σNBS(t) . u ∈ (0, 1] is a controllable factor that determines the delay constraint of optical networks, σ ([ms]) is the reconfiguration cost for tuning the transceivers, N BS (t) is an integer value representing the total number of target BSs at time slot t, and ρ is the number of time slots at which the computed workload is accumulated at the output buffer. Thus, the terms u, σ, and ρ are fixed values, and L out (t) is equally distributed over the M (t) drivers.
The MEC server is able to cache contents from the internet and store the contents closer to mobile users. The caching process also contributes to the energy consumption in the server. The caching process is restricted to only viral content. For example, when a video becomes viral, users watching it share and talk about that video, which will be then requested by other users after a response time. Taking into account the internet users response timeλ(t), this epidemic behavior can be modelled by the self-excited Hawkes condition Poisson process described in [42]: where k i (t) is the response time function, Ω i is the number of potential viewers who will be influenced after t i , which is the time when the user i shared the video. The term V (t) is added as a component to the model to capture the views that are not triggered by the epidemic effect. The energy consumption is mainly contributed by content caching and data transmission processes, as such θ CC (t) is defined as: where θ TR (t) is the power consumption due to transmission and θ CACHE (t) is the power consumption contributed by the caching process.

B. Energy Patterns and Storage
The rechargebale energy storage device is characterized by its finite energy storage capacity b max . At each time instance, the energy level reports are pushed from the BS sites to the MEC server. Thus, the EB level b(t) is known, enabling the provisioning of the required computation and communication resources, i.e., the required containers, transmission drivers and BSs to be active. In this paper, the amount of harvested energy H(t), per site BS site, in time slot t is obtained from open-source solar and wind traces from a farm located in Belgium [43] (see Fig. 3 above). The data in the dataset matches our time slot duration (30 min). The dataset is the result of daily environmental records for a place assumed to be free from surrounding obstructions (e.g., buildings, shades).
The harvested energy H(t) is obtained by picking a day at random in the dataset and associating it with one site. Here, the wind energy is selected as a source during the solar energy off-peak periods. The available EB level b(t + 1) located at the BS site (BS n) or computing platform evolves according to the following dynamics: where b(t) is the energy level in the battery at the beginning of time slot t, θ site (t) represent either θ BS,n (t), the BS energy consumption of the communication site, or θ MEC (t), the energy drained at the computing platform, over time slot t, see Eq. (2) and (3). a(t) is leakage energy and E(t) ≥ 0 is the amount of energy purchased from the power grid. Its worth noting that b(t) is updated at the beginning of time slot t whereas H(t), θ BS,n (t) and θ MEC (t), are only known at the end of it. Thus, the energy constraint at the computing site must be satisfied for every time slot: θ MEC (t) ≤ b(t).
For decision making in the GENM application, the received EB level reports are compared with the following b up corresponds to the desired energy buffer level at the BS site or computing site and b low is the lowest EB level that any site should ever reach. If b(t) < b low , then BS n or the computing site is said to be energy deficient. The suitable energy source at each time slot t is selected based on the forecast expectations, i.e., the expected harvested energŷ H(t). IfĤ(t) is enough to reach b up , no energy purchase is needed. Otherwise, the remaining amount up to b up , i.e., , is purchased from the electrical grid. Our optimization framework in Section IV-A makes sure that b(t), never falls below b low and guarantees that b up is reached at every time slot.

IV. PROBLEM FORMULATION
In this section, the optimization problem is formulated to obtain reduced energy consumption through short-term traffic load and harvested solar energy forecasting along with energy management procedures. The optimization problem is defined in Section IV-A, and the edge system management procedures are presented in Section IV-B.

A. Optimization Problem
Our objective is to improve the overall energy savings of the edge system through BS power saving modes (i.e., green-based traffic load balancing), autoscaling of containers, contents caching and tuning of the transmission drivers, and also to guarantee the QoS within the network. Note that at the end of each time slot, the EB states are updated depending on the harvested energy and the consumed energy, thereby linking per-time slot problems across time.
To achieve our objective, two cost functions are defined, one captures the edge system energy consumption and the other, handles the QoS. This is defined as: F1) θ EDGE (t), weighs the energy consumption due to transmission in the BSs and the computing-plus-communication activities in the MEC server. F2) a quadratic term (ξ(t) − L in (t)) 2 , which accounts for the QoS. At this regard, it is worth noting that F1 tends to push the system towards self-sustainability solutions and F2 favors solutions where the delay sensitive load is entirely admitted in the MEC server by the router application, taking into account the expected energy to be harvested in the computing site. A weight Γ = [0, 1] is utilized to balance the two objectives F1 and F2. The corresponding (weighted) cost function is defined as: where Γ ∆ = 1 − Γ. Hence, starting from t = 1 (i.e., t = 1, 2, . . . , T ) as the current time slot and the finite horizon T , the following optimization problem is formulated as: subject to: : where the set of objective variables to be configured at slot t in the BS system and MEC server is defined as The setting handles the transmission and computing-pluscommunication activities. Constraint A1 specifies the BS operation status (either power saving or active), A2 forces the required number of containers, C(t), to be always greater than or equal to a minimum number β ≥ 1: the purpose of this is to be always able to handle mission critical communications. A3 makes sure that the EB level is always above or equal to a preset threshold β low , to guarantee energy self-sustainability over time. Furthermore, A4 and A5, bound the maximum processing rate and workloads of each running container c, with c = 1, . . . , C(t), respectively. Constraint A6 represents a hard-limit on the corresponding per-slot and per-VM processing time. A7 bounds the aggregate communication rate sustainable by the VLAN to r max and A8 ensures that the energy consumption at the computing site (due to the admitted computational workload) is bounded by the available energy in the EB. A9 forces the server to process the offloaded tasks within the set value τ max .
From the optimization problem P1, it could be noted that J(ζ, ψ, M, t) consists of a non-convex component defined in Eq. (7), while the others are convex and non-decreasing. In this case, Eq. (7) can be converted into a convex function using Geometric Programming (GP) concept [44], by introducing alternative variables and approximations. In this case, fixed parameters and approximations are introduced, i.e., µ c , ν c . In the sequel, the index t is dropped to improve readability. Thus, letting r c = 2 λ c /(τ max − ∆) and then obtaining P c (r c ) in terms of λ c by rearranging the Shannon-Hartley expression and substituting the value of r c :P c (r c ) = ((2 λc/(τmax−∆))−νc Wc) ln 2 µcWc + ln(N (c) 0 ) − ln g c . From the Shannon-Hartley expression, the presence of the log-sum-exp function is observed as it has been proven to be convex in [45] and recall that P c (r c ) = exp(P c (r c )).

B. Edge System Management
In this subsection, a traffic load and energy harvesting prediction method and an online management algorithm are proposed to solve the previously stated problem P1.
1) Traffic load and energy prediction: Given a time slot duration of τ = 30 min, the time series prediction is performed, i.e., the T = 3 estimates ofL n (t) andĤ(t) are obtained by using an LSTM developed in Python using Keras deep learning libraries (Sequential, Dense) where the network has a one-dimensional (1D) subsequence of data, single feature, and multi-step for an output. The dataset is split as 70% for training and 30% for testing. The efficient Adam implementation of stochastic gradient descent and fit the model for 20 epochs with a batch size of 4 is used. As for the performance measure of the model, the Root Mean Square Error (RMSE) is used.
2) Edge system dynamics: The system state vector at time t is denoted by q(t) = (δ(t), C(t), M (t), b(t)), which contains the number of active BSs, δ(t), number of active containers, C(t), transmission drivers for data transfers, M (t), and the EB level, b(t). The input vector ϕ(t) = ({δ n (t)}, C(t), {ψ c (t)}, {P c (t)}, {λ c (t)}, ζ(t), M (t)) drives the MEC server behavior (handles the joint switching on/off of BSs, autoscaling and reconfiguration of containers, and the tuning of transmission drivers) at time t. In this work, {P * c (t)} is obtained with CVXOPT toolbox 1 , and {λ * c (t)} is obtained by following the prodecure outlined in remark 1.
The system behavior is described by the discrete-time state-space equation, adopting the LLC principles [14][28]: where φ(·) is a behavioral model that captures the relationship between (q(t), ϕ(t)), and the next state q(t + 1). Note that this relationship accounts for the amount of energy drained θ COMM (t), θ MEC (t), that harvested H(t) and that purchased from the electrical grid E(t), which together lead to the next buffer level β(t + 1) through Eq. (10). The Greenbased Edge Network Management (GENM) algorithm, finds the best control action vector that yields the desired energy savings within the edge network. Specifically, for each time slot t, problem (12) is solved, obtaining control actions for the prediction horizon T . The control action that is applied at time t is ϕ * (t), which is the first one in the retrieved control sequence. This control amounts to setting the number of active BSs, {δ * n (t)}, number of instantiated containers, C * (t) (along with their obtained {ψ * c (t)}, {P * c (t)}, {λ * c (t)} values), NIC status to either active or not, ζ * (t) ∈ (0, 1), and the optimal transmission drivers, M * (t). The entire process is repeated every time slot t when the controller can adjust the behavior given the new state information.
State q(t) and ϕ(t) are respectively measured and applied at the beginning of the time slot t, whereas the offered load L(t) and the harvested energy H(t) are accumulated during the time slot and their value becomes known only by the end of it. This means that, being at the beginning of time slot t, the system state at the next time slot t + 1 can only be estimated, which is formally written as: Remark 1 (Container provisioning and load distribution) for a fair provisioning of the computing resources, C(t), and the expected workload allocation,ξ(t + 1), a remark is presented. Firstly, each container can only compute an amount of up to λ max and to meet the latency requirements, C(t) is obtained as: C(t) = (ξ(t + 1)/λ max ) , where · returns the nearest upper integer. Secondly, to distribute the workload among the C(t) containers, a heuristic process splits the computational workload λ c (t) = λ max to the first C(t) − 1 containers, and the remaining workload λ c (t) = ξ(t + 1) − (C(t) − 1)λ max to the last one. 3) Edge system management framework: in order to perform traffic load balancing using the green energy as a performance metric, a framework is defined that will identify the BS to be dynamically switched off and then steer the traffic load towards those BSs with sufficient green energy. To do this, the available operating interval is defined as the ratio of the next time slot available green energy and the expected total power consumption (recall that the BS load is forecasted), per BS site, as If I n (t) < 1, the BS site will not have sufficient energy to handle the expected traffic and it becomes a potential BS to be switched off. In the case where I n (t) ≥ 1, the site energy will be sufficient to handle the expected traffic. The potential BS to be switched off, denoted by BS n, will offload its traffic load to a neighboring BS, denoted by BS nn ′ . For BS nn ′ to be able to handle the offloaded traffic, the energy must be sufficient, thus the green-based operating interval is defined as where θ BS,nn ′ (t+1) is the total energy consumption of the BS site when the traffic load from the neighboring BS is combined with the expected load of the BS, and b nn ′ (t + 1) is the next time slot energy. Next, the BS wake-up procedure is discussed.

Algorithm 1: GENM Algorithm Pseudocode
Input: q(t) (current state) Output: ϕ * (t) (control input vector) 01: Parameter initialization S(t) = {q(t)} 02: for (k within the prediction horizon of depth T ) do -L in (t + k):= forecast the workload -Ĥ n (t + k):= forecast the energy -I n (t + k):= operating interval of each BS x nn ′ (t + k):= green-based operating interval -S(t + k) = ∅ 03: for (each q(t) in S(t + k)) do -generate all reachable statesq(t + k) for (eachq(t + k) in S(t + k)) do -calculate the corresponding θ EDGE (q(t + k)) taking into account of κ n from L out (t) end for end for end for 05: -obtain a sequence of reachable states yielding minimum energy cost 06: ϕ * (t) := control leading from q(t) toq min 07: Return ϕ * (t) BS wake-up procedure: to support BS re-activation commands, the UE location fingerprints that are obtained from the LS API are considered. The UE trajectory is assumed to be sequential, i.e., from BS-to-BS along same direction (while still associated with the MEC server) and this is represented as i 1 (t) → i 2 (t) → · · · → i n (t), where i n (t) refers to the serving/target BS node n in association with user i, at time slot t. When a BS node is switched off it goes into discontinuous reception cycle and configure a timer to awake and listen. Here, the MEC server, as BSs manager, send wake-up control information as wake-up signaling (the information is a single bit). The wake-up information is only sent during the listening period. A BS n can be woken up only if it meets the following conditions: (i) b n (t + 1) > b low and (ii) a group of UEs that are associated with the MEC server are expected to receive the computed results via BS n (their trajectory is towards BS n as reported by the LS in the MEC).

4) Green-based Edge Network Management (GENM)
Algorithm: in order for the algorithm to manage the BS system, deciding upon the allocation of their transmission resources, and also handling the computing and communication process, the best control action, , that will yield the expected system behavior shall be obtained.
The edge network management algorithm pseudocode is outlined in Algorithm 1 above and it is based on the LLC principles from [14] [28]. Starting from the initial state, the controller constructs, in a breadth-first fashion, a tree comprising all possible future states up to the prediction depth T . The algorithm proceeds as follows: A search set S consisting of the current system state is initialized (line 01), and it is accumulated as the algorithm traverse through the tree (line 03), accounting for predictions, accumulated workloads at the output buffer, mobile devices trajectory i n (t), past outputs and controls, operating intervals. The set of states reached at every prediction depth t + k is referred to as S(t + k) (line 02). Given q(t), the workloadL in (t + k) and harvested energyĤ(t + k) is estimated first, then obtain the operating intervals I n (t + k), x nn ′ (t + k) (line 02), and generate the next set of reachable control actions by applying the accepted workload ξ(t+k), energy harvested and green-based operating interval (line 03). The energy cost function corresponding to each generated stateq(t + k) is then computed (line 04), whereq(t + k) take into account of η n as observed from L out (t). Once the prediction horizon is explored, a sequence of reachable states yielding minimum energy consumption is obtained (line 05). The control action ϕ * (t) corresponding tô q(t+k) (the first state in this sequence) is provided as input to the system while the rest are discarded (line 06). The process is repeated at the beginning of each time slot t. Algorithm Complexity: The algorithm is executed at each time instance and the corresponding time complexity is obtained as follows. The time complexity associated with the computation of the I n (t) and x nn ′ is linear with the size of the BS group |N | interconnected to the MEC server. Next, the complexity associated with updating the load allocation for the active BSs is |N | − 1, which leads to O(|N | 2 ). In the worst case scenario (no BS has been switched off), the total complexity is |N |q(t)ϕ(t)T , which is linear in all variables, namely, number of BSs interconnected to the MEC server, number of system states, number of control actions, and time horizon T .

V. PERFORMANCE EVALUATION
In this section, some selected numerical results for the scenario of Section III are shown. The parameters that were used in the simulations are listed in Table II.

A. Simulation Setup
A virtualized MEC server in proximity to a group of BSs is considered. The BS coverage areas overlaps to enable load

B. Numerical Results
Data preparation: The information from the used mobile and energy traces is aggregated to the set time slot duration. The mobile traces are aggregated from 10 min observation time to τ . As for the wind and solar traces, they were aggregated from 15 min observation time to τ . The used datasets are readily available in a public repository (see [39]).
In Fig. 4, the real and predicted values for BS traffic load and harvested energy is shown. Here, the forecasting routing tracks each value and predict it over one-step. The shown selected prediction results are for Cluster 3, Solar 3, and Wind 3. Then, Table III shows the the average RMSE of the normalized harvested energy and traffic load processes, for different time horizon values, T ∈ {1, 2, 3}. In the table, the term H wind (t) represent the forecasted values for energy harvested from wind turbines and H solar (t) is for the harvested energy from solar panels. From the obtained results, the prediction variations are observed between H(t) and L(t) when comparing the average RMSE. The measured accuracy is deemed good enough for the proposed optimization.
The GENM algorithm is benchmarked with another one, named Iterative-based Resource Manager with network impact Capability (IRMC), which is inspired by the iterative approach for computing platforms from [20] and the use of the network impact towards load balancing from [5]. Both algorithms make use of the learned information. Figs. 5a    Fig. 5a, the average results for GENM (z e = 0.005, |N | = 24, Γ = 0.5, λ max = 10 MB) show energy savings of 59%, while IRMC achieves 34% on average. As expected, the highest energy savings gain is observed in the early hours of the day (1 h − 8 h) as the aggregated computational workload was at its lowest. In Fig. 5b, the average energy savings obtained by GENM is 68% (z e = 0.005, |N | = 12, Γ = 0.5, λ max = 10 MB) and for IRMC is 49%. Again, here the highest peaks for energy savings are obtained from 1 h−8 h. The results are obtained with respect to the case where no energy management procedures are applied; i.e., the MEC server provisions the computing resources for maximum expected computation workload (maximum value of θ MEC (t), C = 20, ∀t). Comparing the results of Fig. 5a and 5b, we observed that when the BSs being manage by the MEC server are reduced (i.e., 12 < 24), the aggregated delay sensitive workload is also reduced and this translates to reduced computation process demands, which in turn results into high energy savings. Fig. 6 shows the average energy savings obtained when green energy is used as a performance metric towards load balancing within a group of BSs. Here, the group size is  increased from |N | = 5 to 50, using incremental step size of 5. The obtained energy savings are with respect to the case where all BSs are dimensioned for maximum expected capacity (maximum value of θ COMM (t)). From the results, it is observed that the energy savings increase as the BS cluster grows, thanks to the load balancing among active BSs.
Then, Fig. 7 shows the average energy savings for the edge system. Here, the BS group size is set to |N | = 40 and the obtained energy savings results are with respect to the case where no energy management procedures are applied, i.e., the BSs are dimensioned for maximum expected capacity (maximum value of θ COMM (t), ∀t) and the MEC server provisions the computing resources for maximum expected computation workload (maximum value of θ MEC (t), with C = 20 containers, ∀t). The average results of GENM (z e = 0.05, λ max = 10 MB, Γ = 0.5) show energy savings of 51%, while IRMC achieves 44% on average. The effectiveness of the joint dynamic BSs management, autoscaling and reconfiguration of the computing resources, and on/off switching of the fast tunable laser drivers, coupled with foresighted optimization is observed in the obtained numerical results.

VI. CONCLUSIONS
This paper envisioned an edge system where a group of BSs is placed in proximity to a MEC server for ease of handling the offloaded computational workload and BSs management, and also the edge apparatuses are power by hybrid supplies, i.e., green energy is used in order to promote energy self-sustainability within the network and as a performance metric for traffic load balancing. The extra energy can only be purchased from the grid supply to supplement the renewable energy supplies. The considered energy cost model takes into account the computing, caching and communication processes within the MEC server, and transmission-related energy consumption in BSs. To intelligently manage the edge system, an online algorithm based on forecasting, control theory and heuristics, is proposed with the goal of minimizing the overall energy consumption and guarantee the quality of service within the network. The algorithm jointly performs (i) dynamic BS management using green energy as a performance metric, (ii) autoscaling and reconfiguration of the computing resources, workload and processing rate allocation, and lastly, (iii) switching on/off of fast tunable drivers. Numerical results, obtained with real-world energy and traffic load traces, demonstrate that the proposed algorithm achieves energy savings of above 50% with respect to the allocated maximum per-container loads of 10 MB. The computing platform is able to achieve energy savings from 59% to 68%, depending on the size of the BS cluster. The energy saving results are obtained with respect to the case where no energy management techniques are applied in the BS system and the MEC server.

DATA AVAILABILITY
In this paper, open source datasets for the mobile network (MN) traffic load, solar and wind energy have been used. The details are as follows: (1) the real MN traffic load traces used to support the findings of this study were obtained from the Big Data Challenge organized by Telecom Italia Mobile (TIM) and the data repository has been cited in this article. (2) The real solar and wind traces used to support the findings of this study have also been cited in this article.