Keywords: Informatique dans les nuages, Réseaux électriques intelligent, Internet des objets, Réseau défini par logiciel, Réseaux ad hoc de véhicules, Cyber-Sécurité, 5G Cloud computing, Smart power grids, Internet of things, Vehicular ad hoc Networks, Cyber-Security, 5G

Les technologies du Cloud computing ont attiré l'attention des gouvernements, industriels et chercheures, car elles offrent un potentiel énorme en termes d'efficacité de traitement, de capacité de stockage et de disponibilité. Cependant, elles présentent des défis particuliers qui entravent l'intégration du Cloud dans des nouvelles technologies émergentes. L'objectif principal de ce projet de recherche est de concevoir et d'évaluer les performances des nouvelles architectures et modèles Cloud pour : la gestion de l'énergie des réseaux électriques intelligents, l'Internet des objets industriel et les réseaux véhiculaires basés sur SDN et 5G. Pour atteindre cet objectif, cette thèse propose des architectures et modèles efficaces et sécurisés basés sur les technologies de Cloud computing.

Ce travail présente trois applications principales du cloud computing. La première application concerne la gestion de l'énergie des réseaux électrique intelligents. On propose trois contributions principales: 1) en considérant le traitement des demandes de chargement des véhicules électriques (EV) comme étude de cas, nous proposons un nouveau modèle pour la planification de plug-in des EVs basé sur une architecture cloud, 2) afin de réduire les coûts de la production d'énergie et les pics de consommation, nous proposons un modèle de tarification dynamique en temps réel, 3) pour sécuriser l'infrastructure de comptage intelligent de la consommation d'électricité contre les attaques d'injection de fausse informations, nous proposons un nouveau système de sécurité, appelé SecMetering. La deuxième application est conçue pour le traitement des données de l'Internet des objets industriels ; nous proposons une nouvelle architecture décentralisée basée sur un fog hiérarchique. La troisième application concerne les réseaux véhiculaires. Nous proposons deux nouvelles architectures : 1) une architecture fog hiérarchique basée sur SDN, appelé HSVF, 2) une architecture qui utilise le réseau sans fil 5G basé sur SDN pour améliorer les performances de la conduite autonome.

Special thanks go to my friends Hocine and Amine for their guidance and encouragements during my first year as a Ph.D student. Their explanations were easy to grasp and their feedback was highly appreciated. I am very glad to have worked with them.

I would like also to thank all my colleagues at ERA Research Laboratory for the beneficial discussions, research collaboration, and continuous exchange of knowledge. No doubt all ERA members are great people.

In addition, I would sincerely like to thank all my friends in Troyes, France, for their continuous support and encouragements. Special thanks for my brother Karim Mekkouci, who made my stay in Troyes comfortable and very enjoyable.

Last but not least, I would like to thank my mother, my two brothers and my sister Yasmine for all their love and encouragements. In particular, I am grateful to my mother who raised me with a love of science and supported me in all my career, and for all of the sacrifices that she has made on my behalf. And most of all for my loving, supportive, encouraging, and patient wife Manel; she was always my support in the moments when there was no one to answer my queries.

1 CHAPTER 1

INTRODUCTION

In this chapter, we start by presenting some basic definitions, concepts and applications related to our thesis (Cloud, smart grid, IoT and vehicular networks, and 5G). Then, we present our contributions and objectives, and finally we conclude the chapter by illustrating our thesis organization.

Research Context

Cloud Computing Architecture

Cloud computing is an emerging computation model that provides on-demand facilities, and shared resources over the Internet. Cloud computing, based on large storage and computational devices, acts as a utility provider [1]. Implementation and maintenance costs, and system complexity of cloud computing are reduced with the utilization of information technology. With cloud computing, computations are achieved over the Internet. Resources such as software and information are shared through the network and retrieved by computers and devices on demand.

Cloud computing provides three distinct types of services: Platform as a Service (PaaS), Software as a Service (SaaS), and Infrastructure as a Service (IaaS) [2].

 Infrastructure as a service: IaaS is the infrastructure service model that includes storage and virtual machines. Load balancing in cloud computing is performed using IaaS. Users can install access to required software through virtual machines. These virtual devices provide on-demand facility to the customers [3]. The IaaS service offers hardware platform to the users on-demand basis. Therefore, users can access the online hardware platform as on-demand basis to fulfill their requirements. Additionally, the IaaS service also supports virtualization of resources on which a guest user can run his/her own operating system.

 Platform as a service: PaaS is responsible for the development and delivery of programming models to IaaS. Users can access such programming models through cloud and execute their programs. PaaS is responsible for the runtime execution of users' given task. Therefore, the PaaS service completes the requirements of building and delivering of Web-applications without downloading and installing required software as well.

 Software as a service: SaaS supports all the applications in the cloud environment. This feature of cloud computing is accessible through Web-browsers. The SaaS service provides the modeling of software deployment where users can run their applications without installing it on his/her own computer. However, this service is limited to the users, i.e., only existing set of services is available to the customers.

On the other hand, Cloud can also be categorized, depending on the deployment models, as:

private, public, community, and hybrid [3].

 Private cloud: The cloud is owned by a private organization, and information is shared only within the organization. The purpose of this type of cloud application is to serve its own business applications.

 Public cloud: On the other hand, public cloud is owned by a service provider, and used by public for their purposes.

 Community cloud: Community cloud is similar to the private cloud with some additional features to provide services to a group of organizations who have similar type of requirements.

 Hybrid cloud: Hybrid cloud is the extension of cloud computing with private, public, and community cloud computing techniques. The private, public, and community clouds are integrated together to perform several tasks which are capable of handling the requirements of private, public, and community organizations.

In Figure 1.1, cloud services and properties are shown. The advantages of using a cloud computing model are as follows [4]:

 Elastic nature: Cloud computing supports elastic nature of storage and memory devices. It can expand and reduce itself according to the demand from the users, as needed.  Shared architecture: Cloud computing also supports shared architecture. Information can be shared among the users after meeting the privacy issues, and, thereby, reducing service costs [5].

 Metering architecture: Cloud computing offers metering infrastructure to customers [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF].

In the metering system, cost optimization mechanisms are offered to users, enabling them to provision and pay for their consumed resources only.

 Internet services: Cloud computing can be implemented in the existing Internet service system. Thus, it supports the existing network infrastructure.

Smart Grid Architecture

A smart grid (SG) can be conceptualized as an integration of electric power grid with the bidirectional communication network system [6]. With the integration of information and communication technology, modern smart grid is capable of providing electricity to the end users in an increasingly efficient manner. A smart grid architecture spans primarily three different technical domains generation system, transmission side, and distribution side. The generation side consists of traditional power plant generation. The transmission side is responsible for delivering electricity to the distribution side (customers). An important characteristic of a smart grid is controlling electricity consumption at the customers' ends by establishing different optimization methods [7]. To achieve this goal, smart metering and microgrid are the most important components that have been incorporated in the smart grid architecture.

Smart metering: Smart metering is one of the most emerging technologies used in smart grid to obtain information about customers' real-time energy consumption. It is also capable of controlling the advanced metering infrastructure (AMI) systems. AMI is supported with bidirectional communication mechanism to obtain real-time energy consumption at the customers' ends remotely. A smart meter is a device deployed at the distribution-end, and capable of recording the energy consumption by the customers. Customers and utilities are benefited with smart metering infrastructure. For example, a customer can estimate his/her energy consumption during the whole day for cost-optimization, and utility is able to maintain real-time monitoring for the supply-demand curve.

Micro-grid: In the concept of the smart grid architecture, the power distribution side is divided into subgroups similar to the step-down transformers. These subgroups have selfgeneration capacity such as combined heat power, wind generation, and solar generation.

Additionally, they can control and distribute electricity to the end-users. These subgroups are known as micro-grids. A micro-grid is the integration of low-voltage electricity systems with self-generating facilities. A subgroup has an independent power supply and control system to provide electricity to the end users [8]. In the presence of an intrusion in the entire system, a micro-grid acts in the islanding mode. In such a situation, a micro-grid is able to control the power flow autonomously. Due to the fluctuation in renewable energy sources, the primary distributed energy resources are converted into distributed generation using the micro-grid operation. Some of the advantages of a micro-grid are listed as follows:

 Electricity distribution facility is converted to decentralized from centralized.

 A micro-grid increases the local reliability, and energy management mechanisms.

 Improved real-time monitoring system can be achieved.  In the presence of any kind of intrusion, it acts in the islanding mode, and supplies electricity in secure and efficient ways to the end users.

 All the micro-grids can interact with one another and exchange energy, when there is an excess or deficit of it.

The smart grid conceptual model, identified by the National Institute of Standards and Technology (NIST) [9], gives the characteristics, requirements, operations and services that should be provided by a SG. It also specifies communication ways from top level to lower levels for SG applications. The conceptual model includes seven domains such as bulk generation, transmission, distribution, customer, service provider, operations and markets.

The conceptual model begins with bulk generation. In this domain, electricity generation and protection procedures are realized. The second domain is the markets which perform load balancing by analyzing and optimizing energy pricing to help control energy consumption of The last SG domain is the customers who let their energy usage be managed. All of these domains makeup the SG architecture and result in many benefits including efficiency, low cost, fault tolerance and renew-able energy generation. Figure 1.2 illustrates a smart grid architecture with the generation, transmission, and distribution components. The traditional power plants, and renewable energy sources are treated as generation side of a smart grid. Electricity is transmitted to the distribution side from the generation side using transmission lines. Finally, the distribution side is responsible for distributing it to the end users.

Cloud Computing Application for Smart Grid Energy Management

Energy management is a major concern in smart grid environments. In the past several years, researchers addressed this issue by incorporating the implementation of different components such as Home Energy Management System (HEMS), building energy management system, dynamic pricing, and load shifting [10]. Therefore, the objective of the smart grid is to support cost-effective and reliable energy management in real-time. On the other hand, The SG offers many features and applications to consumers, however it needs to be improved to handle more secure, efficient and scalable systems. This can be carried out by using of Cloud computing capacities. Operations can be done at low cost with cloud computing because sharing and automation are widespread within these systems. Also, real time response is very important for SG applications for giving immediate demand response. In cloud platforms, when a client request comes to the cloud operation system, a response is sent to the client in real time. In addition, cloud computing provides a power efficient self-healing system which is crucial for SG applications to recover from faults and give instant response to customers. Communication in the SG is achieved via the Internet, therefore there should be no Internet outages to provide consistent transmission. Cloud computing has many characteristics that can yield improved SG applications. These cloud characteristics are listed below:  Reconstruction of SG technological infrastructure is provided with the agility characteristic of cloud computing [11].

 Communication between the machine and cloud software is done via cloud computing application programming interface (API).

 Public cloud delivery model provides lower cost for SG customers.

 Any device by a consumer/customer that needs to access the systems can do this from anywhere via the Internet. This is the device and location independence feature of cloud computing.

 Maintenance and virtualization are other properties of cloud computing. Installation is not required for running applications and performing computations. This provides easy access to cloud computing services from anywhere and at any time. Servers and storage devices can be shared and carried easily from one server to another using the virtualization property of cloud computing data centers.

 Large number of users use shared resources, which are located in a pool. This is enabled by the cloud computing multitenancy characteristic. In this way, infrastructure is centralized with lower cost, without needing extra device load capacity and utilization increase.

 Cloud computing provides disaster recovery capability and this assures reliability.

 Some architectures are constructed for increasing system performance in cloud computing platform by using web services.

 Reliability is improved by using private cloud platforms which prevents connection losses.

Cloud Computing Application for Smart Grid Security

A smart grid can be conceptualized as a cyber-physical system that connects physical electricity systems and cyber-infrastructure, with the integration of the Internet. This service can communicate with the consumer appliances and also provide the backbone for service providers to absorb contents and control operations. With the presence of online connectivity, it is a big challenge to prevent cyber-attacks in the smart grid that can potentially disrupt the power supply [12]. One of the important issues is power theft by consumers. This can be done by hacking a smart meter or modifying the real-time information through accessing communication channel to change the reported electricity usage. Additionally, data manipulation is also one of the most security concerns in the smart grid. To overcome these issues, we need to implement proper security for secure and reliable smart grid architecture.

Security can be implemented on the consumer side, transmission side, and generation side. The main security aspects of smart grid are as follows:

 With the increase of the grid system complexity and their integration, it is difficult to track interactions among business systems securely.

 The smart grid architecture is more complex than the one for the traditional power grid. The implementation of a smart sensor network, wireless communication, and smart meters increases the complexity in the protection of the information security system.

 With the implementation of millions of smart meters, the network is distributed to the enduser systems. So, the capacity of the protection at the end-users needs further enhancement.

 The denial-of-service (DoS) attack to affect the stability of the applications for the SG.

 Utility and third-party can access the user data as well as private information, thereby affecting the privacy of the users.

False Data Injection Attacks in Smart Grid

In smart grid, enormous amount of real-time energy information is collected and reported to operations control center (OCC) for appropriate monitoring and analyzing the state of power grid. To achieve this, real-time energy consumption is measured from the electric appliances in residential users' home. The appliances are connected to a central element called smart meter; this latter measures and reports the electricity consumption of appliances to the OCC via an advanced metering infrastructure (AMI) for further analysis and scheduling (e.g., for real-time energy pricing, detecting energy fraud, predict the energy supply, etc.). However, AMI is confronted with various cyber security threats [13]. The costs of security events may be benign disruptions or deliberate acts of sabotage. The latter can menace lives of citizens and even national security. For example, in December 2015, more than 225,000 people in Ukraine suffered from a blackout due to a devastating cyber-attack (i.e., mainly false data injection attack (FDIA)) on a power station [14]. In power grid system, the metered data has an important economic value (e.g., when the data is used for dynamic pricing calculation). For instance, a malicious attacker who gets access to the crypto key may remotely disconnect massive smart meters, which causes a heavy financial loss of smart grid utility [15]. Moreover, users' privacy is of supreme importance to ensure correct operation and protection of users personal data: it has been shown that users electricity measurements can be used to outline their behavior and even to determine which household appliances are being used [16]. Therefore, from the perspective of users, protecting its data is of a primary concern. For example, a relative low and static daily consumption of a household may indicate that no one is at home (this may facilitate robbing actions, etc.). Thus, there is a critical need to secure the information exchanged within AMI environment.

Different security fears in smart grid energy metering using smart meters may come from several attackers that can use different techniques (e.g., physical attacks, cyber-attacks, etc.).

The attackers may be external and/or local. Local attackers may be the users, the gateways or the operation center. Generally, these attackers are honest-but-curious [16]; they attempt various techniques to seek and deduce knowledge about victims, using for example their energy consumption measurements. It is stated that the determination of users' behavior figures in the second most serious attacks consequences on smart grid environment in 14 fears types defined by Electronic Privacy Information Center [16].

On the other hand, an external attacker may compromise a smart meter by injecting false data or spying on the communication channel to violate user's privacy. The false data injection attack (FDIA), first proposed by Liu et al. [17], is a cyber-attack where power system state estimation outputs are corrupted by injecting false data into meter measurements in a carefully coordinated fashion. The defining feature of a successful FDIA is that the state estimation residual falls below a hypothesis test threshold despite the presence of corrupted measurements; the attack thereby may evade detection.

Yet, smart meters, even they have protection against physical damage using sophisticated microcontrollers, they are still vulnerable to electricity theft and false data injection attacks. Furthermore, as a fully trusted party, a trusted authority should be implemented in the AMI system model; it is responsible to insure random secret keys to household users and operation center through a secure communication channels. Hence, some issues like how to design an effective privacy preserving, secure and fault tolerant smart metering scheme, and AMI architecture resisting to power theft and detecting false data injections in smart grid, still merit more investigations and effort by the both academia and industry.

Cloud Computing Application for Industrial IoT

Internet of Things (IoT) has been gaining attraction in many industry areas, such as logistics, manufacturing, retailing, and pharmaceutics [START_REF] Al-Fuqaha | Internet of things: A survey on enabling technologies, protocols, and applications[END_REF]. On the other hand, with the advances in wireless communication and sensor network technologies, more and more networked things or smart objects are being involved in industrial IoT (IIoT). As a result, IIoT-related technologies have also made a large impact on information and communication technology (ICT) and industrial systems technologies [START_REF] Qiu | An efficient tree-based self-organizing protocol for Internet of Things[END_REF].

Recently, the manufacturing industry has gained another transformation sparked by smart connectivity and advanced analytics. This is referred to as advanced manufacturing in North America and Industry 4.0 in Europe [START_REF] Lade | Manufacturing Analytics and Industrial Internet of Things[END_REF]. Because of its highly adapted properties and reduced delivery time, this smart connectivity and analytics based on IIoT are seen as key enablers to future industry. On the one hand, this transformation facilitates flexibility and scalability, particularly with respect to the high generation of data and information. On the other hand, it also permits the delivery of products with improved quality at the same or lower cost by leveraging the data collected by various elements of a connected assembly line.

Consequently, a large amount of data is generated from IIoT devices installed over different physical factory components as assembly lines, human machine interface, and logistic structures. Besides, the data collected brings transparency about the machines' operations, the materials utilized, the facility logistics, and even about the human operators. However, much of the data collected are used for direct real-time feedback control and for forensic purposes.

As presented in a case study from Bosch group in [START_REF] Lade | Manufacturing Analytics and Industrial Internet of Things[END_REF], during the manufacturing process, information about the status of the process, the states of machines, tools, and parts produced are uninterruptedly relayed, scheduled and stored in a real-time manner. The capacity, scale, and regularity of production in this traditional case study (i.e., Bosch group case) is so high that it requires the use of a big data tools scheduling to store, reprocess, and join the data. In these regards, an efficient service management for IIoT needs to be implemented, and the traditional industrial network should be enhanced and adapted in order to ensure real time analytic process, to minimize the end-to-end delay and to increase the data storage capacity.

In recent research works, cloud computing has acted as a key approach for big data processing with its ample computing, storage capacity and distributed aspects [START_REF] Alippi | A Cloud to the Ground: The New Frontier of Intelligent and Autonomous Networks of Things[END_REF], [START_REF] Chekired | Smart Grid Solution for Charging and Discharging Services Based on Cloud Computing Scheduling[END_REF].

However, most interaction between IIoT devices and back-end servers in the traditional system is done through large scale cloud data centers. Nevertheless, because of the delays induced on Wide Area Networks (WANs), and being far from IIoT devices, cloud-based IIoT systems face several challenges, including especially a high response time due to the high cost of communication bandwidth, and heavy loads on cloud servers due to the high redundancy of data.

The Need of Fog Computing for Scheduling IIoT Data

In order to overcome the weaknesses of cloud computing, a local cloud computing architecture, called fog computing, has been introduced recently. According to Cisco [START_REF]Fog Computing and the Internet of Things: Extend the Cloud to Where the Things Are[END_REF], fog computing extends the cloud computing away from the cloud computing data centers and towards the edge of the network. Fog computing, considered as a new decentralized computing aspect of cloud architecture, is one of challenging industry topics for IoT. Fog computing is a newly introduced concept that aims to put the cloud services closer to the end users (things) for better quality of service (QoS). Fog is an intelligent server's layer sitting between cloud and IIoT that brings low latency, location awareness, and widespread geographical distribution for IoT [START_REF] Mubeen | Delay Mitigation in Offloaded Cloud Controllers in Industrial IoT[END_REF]. Getting main concepts of cloud computing, fog provides computation and storage capacities to end users, but at the edge of the network. An open issue consists of exploring the enhancement of an optimal end-to-end delay network by having an intelligent layer of fog servers between IIoT devices and cloud data centers.

SDN and 5G for Vehicular Networks

Recent advances in wireless technologies have enabled vehicles to share information between each other. Such information could significantly improve the user's driving practice in terms of both safety and efficiency. Nowadays, a vehicle can exchange information with other vehicles (V2V), surrounding infrastructure (V2I), and a back-end cloud server, enabling the vehicle to everything communication (V2X). According to Cisco internet business solutions group report [START_REF] Mai | Connected Vehicles: Service Providers at a Crossroads, accessed on Octo[END_REF], there will be 400 million gigabytes of data generated by 300 million passenger vehicles, interconnected via various wireless technologies. This data is generated by various types of applications, including route planning, traffic statistics, road conditions as well as media streaming and online gaming. These applications have different QoS requirements, which impose significant challenges to the existing networking infrastructure.

To mitigate these inconveniences, car manufacturers and research institutions have been working jointly to develop V2X communication technologies to capture future commercial opportunities. A key technology enabler of V2X is vehicular ad hoc network (VANET), which is based on the dedicated short-range communication (DSRC). Apart from VANET, cellular networks, particularly 4G/5G, are also considered as a promising technology to enable V2X communication as it can provide real-time, highly reliable, and actionable information flows [START_REF]The Case for Cellular V2X for Safety and[END_REF]. For instance, the 5G cellular network can achieve a data rate of up to 7.5 Gb/s in a stationary environment and 1.2 Gb/s when a vehicle is moving at a speed of 100 km/h based on 28 GHz spectrum [START_REF]Cooperative Driving[END_REF]. Although these technologies can ensure reliable and universal mobile coverage, several salient features of VANETs introduce new challenges, such as unbalanced traffic flows in a multi-path topology, high response delay and inefficient network resources utilization [START_REF] Nekovee | Radio Technologies for Spectrum above 6 GHz -A Key Component of 5G[END_REF]. Thus, flexible and programmable architectures are key requirements for wireless vehicular networks.

SDN for VANET

Software Defined Networking (SDN) is an emerging network paradigm that has been increasingly incorporated into different types of network systems. In SDN, the control plane and data plane are decoupled, and network resources are managed by a logically centralized controller. Furthermore, devices from various vendors can communicate with each other via a standardized interface, which significantly simplifies the network management and offers a programmable and flexible network architecture. Originally, SDN was designed and deployed in wired network environments with high-speed switches, such as data centers and campus networks. Yet, recently, researchers have started using SDN enhancing many forms of wireless distributed networks (WDNs), including mobile ad hoc networks, wireless sensor networks, device-to-device networks, Wi-Fi networks, and vehicular networks [START_REF] Nekovee | Radio Technologies for Spectrum above 6 GHz -A Key Component of 5G[END_REF]. Indeed, SDN brings new intuitions and high potential to improve the flexibility, programmability and efficiency of wireless networks [START_REF] Yaqoob | Overcoming the Key Challenges to Establishing Vehicular Communication: Is SDN the Answer?[END_REF] despite the new challenges that it may introduce.

Fog Computing for VANET

Other technologies can also be considered to enhance VANET's performance. For instance, recent research studies have shown that interconnecting VANET with cloud services can improve the network's performance [START_REF] He | SDVN: Enabling Rapid Network Innovation for Heterogeneous Vehicular Communication[END_REF]. In addition, fog computing can also be considered as a fundamental solution for accommodating the flow of mobile traffic and reducing latency, both known to be pivotal problems of cloud computing. Fog services, including computation, storage, and distributed networking, are deployed near end users (i.e., the edge of the network); thus, timely and reliable access is provisioned to delay-sensitive mobile applications. Still, these fog services can get overwhelmed, in some cases, due to the growing number of demands from customers. This can be observed particularly during peak hours, subsequently resulting in a critical performance degradation.

5G Technology and Service Slicing for VANET

The emerging 5G technology is foreseen as the promising solution to improve network performance and management while ensuring high data rate and enhanced QoS. It is expected to support a variety of vertical industries such as manufacturing, automotive, healthcare, energy, media and entertainment [START_REF] Ertico | 5G Empowering Vertical Industries[END_REF]. Such verticals will spark different use cases, imposing new set of requirements (e.g., scalability, latency, reliability and availability) that the currently deployed networks, which are based on the "one-fit-all" conceptual paradigm, are not able to meet [START_REF] Ordonez-Lucena | Network Slicing for 5G with SDN/NFV: Concepts, Architectures, and Challenges[END_REF][START_REF] Afolabi | Network Slicing and Softwarization: A Survey on Principles, Enabling Technologies, and Solutions[END_REF]. Accommodating the new applications while supporting existing services imply having a programmable and flexible network infrastructure that can be shared by different network technologies (e.g., IoT, cellular and vehicular). This shared infrastructure should endorse a software-based architecture that uses open interfaces to allow access to different users (e.g., individuals or businesses) while matching their service requirements.

One way to achieve such a design is a concept called network slicing. It consists of splitting the physical network infrastructure into multiple logical networks, referred to as slices. These slices are controlled and managed independently by the slice owners, which can be of two types: Over-The-Top (OTT) service providers and Virtual Mobile Network Operators (VMNO) [START_REF]Next Generation Mobile Networks Alliance, "5G white paper[END_REF].

Each slice is allocated a set of network functionalities that are selected from the shared network infrastructure. These functionalities can be virtualized using technologies such as SDN and NFV. Indeed, an SDN-based architecture was proposed in [START_REF] Onf Tr- | Applying SDN Architecture to 5G Slicing[END_REF] to enable efficient and scalable network slicing. It deploys a controller between slice owners and the shared network infrastructure that provides an abstract view of the network resources to the slice owners while enabling them to transmit their service requirements to the network infrastructure using northbound interfaces.

Thesis Objectives

In a time where data traffic and energy consumption is constantly booming in smart cities, Cloud computing is becoming the most plausible solution to cope with the conventional smart city networks' shortcomings. Most of these conventional networks have rigid performances requirements (i.e., energy saving, delay, scalability, bandwidth and throughput). Yet, meeting these requirements is not straightforward, given the particular characteristics of smart cities networks (e.g., high energy consumption, high mobility, sporadic connectivity, high data traffic, and security threats). Thus, the objective of this dissertation is to contribute to the design and the evaluation of new solutions that ensure smart city networks requirements. This work was carried out on the medium access control (MAC) sublayer, the network layer and the application layer. On the one hand, it proposes a new efficient and safe models and architectures based on cloud and SDN technologies for: 1) smart grid energy managements, 2) industrial IoT data scheduling, and 3) connected vehicles. The proposed solutions take performance evaluation parameters, such as energy saving, response time, and latencies into account. On the other hand, it specifies, evaluates, and implements mechanisms for managing networks resources, in order to offer differentiated services to further enhance the performance of different smart city networks (i.e., smart grid network, IoT network, and VANET).

The first part of this thesis addresses the problem of smart grid energy saving considering three principals issues: 1) EVs energy plug-in management for batteries charging and discharging, 2) Dynamic and real-time pricing for energy saving and cost optimization, 3) Secure energy smart metering against false data injection attacks. Several approaches have been proposed in the literature to deal with the previous issues (e.g., [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF], [START_REF] Jian | Regulated Charging of Plug-in Hybrid Electric Vehicles for Minimizing Load Variance in Household Smart Microgrid[END_REF], [START_REF] Luo | Cloud-Based Information Infrastructure for Next-Generation Power Grid: Conception, Architecture, and Applications[END_REF], [START_REF] Liang | UDP: Usage-Based Dynamic Pricing With Privacy Preservation for Smart Grid[END_REF], [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF], [START_REF] Liu | A Collaborative Intrusion Detection Mechanism Against False Data Injection Attack in Advanced Metering Infrastructure[END_REF]).

Despite their good performance, exiting schemes sustain major shortcomings. These models are based on conventional centralized architectures that only acquire local and centralized network topology in smart grid environment, making them prone to local maximum, data congestion problems, and high response delay which affects drastically the energy saving in smart grid especially for scalable smart city networks.

The second part of this dissertation focuses on the problem of Industrial IoT data scheduling.

To efficiently integrate IoT technology into industry, the collected and sensed data from IIoT need to be scheduled in real time constraints with an optimal end-to-end delay; especially for big factories. In the literature, several schemes [START_REF] Xu | Internet of Things in Industries: A Survey[END_REF][START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF][START_REF] Sahni | Edge Mesh: A New Paradigm to Enable Distributed Intelligence in Internet of Things[END_REF][START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] have been proposed to help smart factories to schedule data and requests in real-time constraints. They can be of two types: centralized schemes based on Cloud computing, and decentralized schemes that consider distributed computation feature. Although they assure certain level of performance, the existing schemes experience various limitations. For the centralized schemes, on the one hand, most of the existing works focus on centralized computation architectures for the purpose of monitoring data and managing control processes in the industrial automation and focus only on higher levels than the field-level. On the other hand, decentralized based schemes are cost-inefficient (i.e., due to the use of multiple servers); in addition they ignore data transmission delay and synchronization time especially when using distributed computing manner over decentralized data centers.

The final part of this thesis addresses the problem of the development of an efficient VANET architecture that requires considerable efforts in information gathering and data processing to allow quick decision-making and fast feedback to all users. Thus, several novel and promising VANET network applications have been developed lately. Examples include trip planning, media sharing and Internet access. However, sufficient network resources (e.g., equipped vehicles, base stations (BSs), Road Side Units (RSUs) and other infrastructures) to support these applications are not yet available or are deployed at a slow pace. On the other hand, 5G networks are anticipated to support a plethora of innovative and promising VANET services.

These services have heterogeneous performance requirements (e.g., high-rate traffic, low latency and high reliability). To meet them, 5G networks are entailed to endorse flexibility that can be fulfilled through the deployment of new emerging technologies, mainly SDN, NFV, and network slicing. Although applying SDN in a heterogeneous vehicular network is challenging, several architectures (e.g., [START_REF] Ku | Towards software-defined VANET: Architecture and services[END_REF], [START_REF] Azizian | Vehicle Software Updates Distribution with SDN and Cloud Computing[END_REF], [START_REF] Correia | An Architecture for Hierarchical Software-Defined Vehicular Networks[END_REF], [START_REF] Ge | 5G Software Defined Vehicular Networks[END_REF], [START_REF] Liu | A Scalable and Quick-Response Software Defined Vehicular Network Assisted by Mobile Edge Computing[END_REF]) have been proposed in the literature to address the aforementioned issues. These studies describe network architectures that can be arranged in two categories: centralized and distributed. Despite their adequate performance, schemes in both categories have limitations. On the one hand, the use of only one SDN controller could be the bottleneck of the entire system, leading to resiliency and scalability issues. In addition, adopting the conventional ad hoc mode of vehicular networks whenever connections to the SDN controller are lost may escalate the end-to-end delay. On the other hand, deploying multiple SDN controllers increases the system complexity and introduces new challenges (i.e., handover) that need to be dealt with. This may lead to higher control overhead [START_REF] Correia | An Architecture for Hierarchical Software-Defined Vehicular Networks[END_REF][START_REF] Ge | 5G Software Defined Vehicular Networks[END_REF] and longer end-to-end delay [START_REF] Liu | A Scalable and Quick-Response Software Defined Vehicular Network Assisted by Mobile Edge Computing[END_REF]. Yet, to the best of our knowledge, none of the proposed models have considered all the aforementioned factors.

Thesis Contributions

The aforementioned research topics have yielded several results that we have published as articles in international refereed journals and conferences. The thesis consists of six contributions made from six scientific articles (4 published journals and 8 conferences). Technologies with Industry Perspective [START_REF] Chekired | Smart Grid Solution for Charging and Discharging Services Based on Cloud Computing Scheduling[END_REF]. 2) We propose a real-time dynamic pricing model for EVs charging and discharging service and building energy management, in order to reduce the peak loads, and then optimize energy saving. Our proposed approach uses a decentralized cloud computing architecture. This work was published in IEEE Transactions on Industrial Informatics Journal: Special Section on Cloud Computing in Smart Grid Operation and Management [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF]. To address the issue of using cloud computing for industrial IoT, we propose a hierarchical fog servers' deployment at the network service layer across different tiers. Using probabilistic analysis models, we prove the efficiency of the proposed hierarchical fog computing compared with the flat architecture. We use two-priority queuing model in order to schedule and analyze IIoT data. We further introduce a workload assignment algorithm to offload peak loads over higher tiers of the fog hierarchy. This work was published in IEEE Transactions on Industrial Informatics Journal: Special Section on Fog Computing for Industrial Applications [START_REF] Chekired | Industrial IoT Data Scheduling Based on Hierarchical Fog Computing: A Key for Enabling Smart Factory[END_REF].

To address the issues of integrating cloud computing in

To address the issue of application cloud computing for vehicular networks, we propose two new architectures as follows: 1) we propose a new hierarchical SDN-based wireless vehicular fog architecture, called HSVF (i.e., Hierarchical SDN for Vehicular Fog architecture).

HSVF is based on a hybrid SDN control plane that reinforces centralized and distributed management. This work was published in IEEE Vehicular Magazine Special Issue on Next-Generation Softwarized Networks. 2) we design a framework that uses 5G networks, SDN, NFV, and network slicing technologies to enhance the quality of service of the autonomous driving application. The framework is made of i) a distributed and scalable SDN core network architecture that deploys fog, edge and cloud computing technologies; ii) a network slicing function that maps autonomous driving functionalities into service slices; and iii) a network and service slicing system model that promotes a four-layer logical architecture to improve the transmission efficiency and satisfy the low latency constraint. This work is submitted to IEEE Journal on Selected Area on Communications (the paper is under minor revision).

Thesis Organization

The remaining of this thesis is structured as follows. In Chapter 2, we describe the existing approaches in the literature that address the aforementioned issues. In Chapter 3, we address the application of cloud computing for scheduling EVs energy demands in smart grid. We then present the dynamic pricing model proposed for energy saving in smart grid based distributed Fog architecture in Chapter 4. In Chapter 5, we present the SecMetering scheme proposed to secure smart metering against false data injection attacks in smart grid. In Chapter 6, we present the hierarchical Fog architecture for scheduling industrial IoT data. Finally, we present the issue of decentralized cloud computing integration for vehicular networks where we propose a hierarchical SDN-based wireless vehicular fog architecture, then we present the application of 5G slicing technology for autonomous driving services based on a new SDN core network architecture.

CHAPTER 2 RELATED WORK

Following the thesis contributions, we present in this Chapter recent and relevant related work of cloud computing integration on smart grid energy management, Industrial IoT and vehicular networks, and 5G. For smart grid energy management, we study the state of the art of three relevant topics, a) the management of EVs plug-in for energy charging and discharging in smart, b) recent pricing models proposed to save smart grid energy, and 3) relevant secure smart metering solution in smart grid. Next, we present the recent proposed works on the literature about the application of cloud computing for scheduling industrial IoT data. Then, we present recent studies in the literature that demonstrate the high potential of SDN to improve data forwarding and to ensure better QoS in vehicular networks. These studies describing network architectures are arranged in two categories: centralized and distributed. Finally, we present the various 5G slicing approaches proposed in the literature for the automotive vertical.

Cloud Computing Application for Smart Grid Energy Management

For several years, researchers proposed several solution concepts for demand response and smart grid energy management. In this part, we study the state of the art of three relevant energy management issues in smart grid: a) the management of EVs charging and discharging energy demands according to the used architecture, b) pricing models for energy saving in smart grid, and c) smart metering security.

EV plug-in Energy Management

To deal with the impact of EVs charging on the power grid (in terms of energy overflow and real-time management), several scheduling models have been proposed. Existing works can be classified into two classes according to the used architecture:

1) Non cloud based architecture: In this class (e.g. [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF], [START_REF] Jian | Regulated Charging of Plug-in Hybrid Electric Vehicles for Minimizing Load Variance in Household Smart Microgrid[END_REF], [START_REF] Tushar | Smart Microgrids: Optimal Joint Scheduling for Electric Vehicles and Home Appliances[END_REF], [START_REF] Sharma | A Smart Scheduling Strategy for Charging and Discharging of Electric Vehicles[END_REF], [START_REF] Bayram | Capacity Planning Frameworks for Electric Vehicle Charging Stations With Multiclass Customers[END_REF]), the management of plug-in EVs at public supply stations is centralized in the micro grids, and EVs scheduling is executed by smart grid providers. The authors in [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF] present an approach for scheduling EVs charging and discharging. They introduce global and local scheduling schemes where the charging power is optimized to minimize the total cost of EVs charging and discharging during the day. The authors prove by simulation that the local scheduling schema can achieve a close performance to the global one; however, they did not show how the future base loads information are managed especially when using a centralized architecture. In [START_REF] Jian | Regulated Charging of Plug-in Hybrid Electric Vehicles for Minimizing Load Variance in Household Smart Microgrid[END_REF], the authors propose a scheduling model in order to regulate the charging of EVs for minimizing load variance in household micro grid. Their model is formulated using an optimization problem and is slacked into a quadratic programming by ignoring the non-linear factors existing in the constraints and solved using in polynomial time. However, some factors have been assumed to be known in advance, such as the load-power curve of home appliances and the time periods when EVs are connected to the micro grid. In [START_REF] Tushar | Smart Microgrids: Optimal Joint Scheduling for Electric Vehicles and Home Appliances[END_REF], the authors propose an optimal centralized scheduling method to jointly control the electricity consumption of home appliances and plug-in EVs; they mathematically formulate the scheduling method as a mixed integer linear programming (MILP) problem. However, [START_REF] Tushar | Smart Microgrids: Optimal Joint Scheduling for Electric Vehicles and Home Appliances[END_REF] assumes just a local scheduling for micro grids. In [START_REF] Sharma | A Smart Scheduling Strategy for Charging and Discharging of Electric Vehicles[END_REF], the authors formulate a multi-objective scheduling problem for the maximization of aggregator's profit, minimization of EV charging cost and maximization of EVs departing with target SOC as the multiple objectives. However, the authors did not extend their work to support the future large scale adoption of EVs into the electrical grid.

2) Cloud based architecture: Only few works (e.g. [START_REF] Luo | Cloud-Based Information Infrastructure for Next-Generation Power Grid: Conception, Architecture, and Applications[END_REF], [START_REF] Xing | Decentralized Optimal Scheduling for Charging and Discharging of Plug-In Electric Vehicles in Smart Grids[END_REF], [START_REF] Gan | Optimal Decentralized Protocol for Electric Vehicle Charging[END_REF]) have proposed to integrate cloud computing in the smart grid environment. In [START_REF] Luo | Cloud-Based Information Infrastructure for Next-Generation Power Grid: Conception, Architecture, and Applications[END_REF] the authors propose cloudbased information infrastructure for next-generation power grid. The work introduces three specific cloud-enabled power services. The first two services validate how to develop practical compute-intensive and data-intensive power applications by utilizing different layered services provided by the state-of-the-art public cloud platforms. For the third service, the authors propose a cloud-based collaborative direct load control framework in a smart grid and show the merits of the cloud-based information infrastructure. The authors in [START_REF] Xing | Decentralized Optimal Scheduling for Charging and Discharging of Plug-In Electric Vehicles in Smart Grids[END_REF] focus on the procurement of load shifting service by optimally scheduling the charging and discharging of EVs in a decentralized fashion. The optimal scheduling problem is then formulated as a mixed discrete programming (MDP) problem. However, the authors did not use cloud platforms to manage the demands of EVs users. The authors in [START_REF] Gan | Optimal Decentralized Protocol for Electric Vehicle Charging[END_REF] propose a decentralized algorithm to optimally schedule EV charging. The algorithm exploits the elasticity of electric vehicle loads to fill the valleys in electric load profiles. They formulate the EV charging scheduling problem as an optimal control problem. As in [START_REF] Sharma | A Smart Scheduling Strategy for Charging and Discharging of Electric Vehicles[END_REF], the algorithm requires each EV to solve its local problem. Besides, this work doesn't use V2G technology.

Dynamic Pricing

Several models have been proposed in the context of EVs charging/discharging and pricing scheduling (e.g., [START_REF] Erol-Kantarci | Prediction-based charging of PHEVs from the smart grid with dynamic pricing[END_REF], [START_REF] Misra | D2P: Distributed Dynamic Pricing Policyin Smart Grid for PHEVs Management[END_REF], [START_REF] Liang | UDP: Usage-Based Dynamic Pricing With Privacy Preservation for Smart Grid[END_REF], [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF], [START_REF] Fan | A distributed demand response algorithm and its applicationto PHEV charging in smart grids[END_REF], [START_REF] Ruiz | A direct load control model forvirtual power plant management[END_REF], [52], [53], [START_REF] Guo | Optimal power management of residential customers in the smart grid[END_REF]). A prediction-based charging strategy for EVs management is discussed in [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF]. In this approach, EVs receive price information using wireless communication, and predict the market price during the charging period, in such a way that the time of charging (TOC) price is low. Different dynamic pricing policies are proposed in smart grid usage (D2P) [START_REF] Misra | D2P: Distributed Dynamic Pricing Policyin Smart Grid for PHEVs Management[END_REF], (UDP) [START_REF] Liang | UDP: Usage-Based Dynamic Pricing With Privacy Preservation for Smart Grid[END_REF], quadratic cost function (QCF) [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF], and distributed demand response (D2R) [START_REF] Fan | A distributed demand response algorithm and its applicationto PHEV charging in smart grids[END_REF]. In a recent work [START_REF] Erol-Kantarci | Prediction-based charging of PHEVs from the smart grid with dynamic pricing[END_REF], the authors propose an intelligent distributed dynamic pricing (D2P) mechanism for EVs charging management.

Two pricing models are proposed: home-price and roaming-price; consequently, two types of energy services are considered: home micro grids and foreign micro grids. In this work, the real-time price is decided by micro grids using standard communication architecture for SG, where the scheduling is centralized, in such a case the management of all EVs demands become very difficult especially in peak hours. The authors in [START_REF] Liang | UDP: Usage-Based Dynamic Pricing With Privacy Preservation for Smart Grid[END_REF] propose a usage-based dynamic pricing (UDP) scheme for smart grid. In this work, distributed gateways are used as proxies of the utility company to timely respond the price from customers; nevertheless, the scheduling of EVs demands is performed in a centralized way inside the utility company. In [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF], the authors use neural network for piecewise quadratic cost function. In such a pricing model, the grid decides the price depending on the supply power. As a result, customers may have to pay more cost, even though the total demand is low. A distributed demand response algorithm for PHEV charging in smart grids is proposed in [START_REF] Fan | A distributed demand response algorithm and its applicationto PHEV charging in smart grids[END_REF]. In such pricing models, the costs acquired by the customers directly depend on the demanded energy even though micro grids have excess energy to serve. Thus, clients may not be interested to consume more energy, and, thus, excess energy may be useless.

To schedule the electricity load, the utility company adopts the conventional direct load control (DLC) strategy [START_REF] Ruiz | A direct load control model forvirtual power plant management[END_REF] where smart switches are installed inside of houses such that the house appliances can be turned off during a high-demand period. The DLC enforces the customers to abandon the control of their appliances at certain conditions. Recently, in Ontario, Canada, a time-of-use (TOU) pricing strategy has been widely adopted by utility companies, e.g., Hydro One [52], Waterloo North Hydro [53]. TOU means that the electricity unit price changes according to the time of the day. The Ontario Energy Board (OEB) divides daily and seasonal TOU periods into three categories: off-peak, mid-peak, and on-peak. TOU enables the customers to view the electricity usage online and potentially influences electricity usage encryption, authorization, authentication, firewall, etc). IDS is a monitoring system that can dynamically detect any unwanted entity into a targeted system and trigger alerts for the administrator to take appropriate measures to mitigate the risks and prevent the escalation of malicious activities. The work in [START_REF] Liu | A Collaborative Intrusion Detection Mechanism Against False Data Injection Attack in Advanced Metering Infrastructure[END_REF] proposes a threat model for smart meters based on Petri networks. The authors consider the constrained computation and storage resources of a smart meter, and present a collaborative intrusion detection mechanism against false data injection attack. However, the authors did not take in consideration the users behavior. In [START_REF] Jokar | Intrusion Detection and Prevention for ZigBee-Based Home Area Networks in Smart Grids[END_REF], the authors present novel intrusion detection and prevention system for ZigBee-based home area networks in smart grid based on machine learning model. The detection module excerpts network features and analyzes them to decide whether the network is in a normal state.

Nevertheless, the proposed IDS operates only in the home area network level, and the false data can be injected at different levels of the network; AMI may be not well secured when IDS is implemented only at the home area network.

Cloud Computing Application for IoT Data Scheduling

According to Xu et al. [START_REF] Xu | Internet of Things in Industries: A Survey[END_REF], the application of IoT in the industrial automation address to a very small extent. IoT solutions for the industrial automation are still evolving. As explained earlier, the fog-based approaches can meet the requirements of modern industrial systems. However, most of the existing works focus on centralized computation architectures that utilize cloud computing for the purpose of monitoring data and managing control processes in the industrial automation [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF], [START_REF] Sahni | Edge Mesh: A New Paradigm to Enable Distributed Intelligence in Internet of Things[END_REF]. The majority of existing approaches and solutions in the context of cloud computing in the industrial automation focus on the higher levels than the field-level. In [START_REF] Mubeen | Delay Mitigation in Offloaded Cloud Controllers in Industrial IoT[END_REF], the authors investigate a prototype to explore the use of IoT devices to communicate with a cloud-based controller targeting the automation industry. Nevertheless, this work applies mitigation mechanisms to deal only with the communication delays that are caused by the networks and ignored the computation delays and capacities of cloud servers; also the mitigation model was not validated using a concrete mathematical model.

In a recent work [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF], the authors derive an exact expression for the performance of IIoT by combining computation with intelligence. They design an efficient way to obtain a threshold by approximating the performance of different computing manners, and show how to apply it to practical IIoT applications. The proposed work is interesting and gives good results (i.e., we will compare the computing efficiency of our work with this work [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF] in the performance evaluation section). However, the authors ignore data transmission delay and synchronization time especially when using distributed computing manner.

Only few works (e.g., [START_REF] Sahni | Edge Mesh: A New Paradigm to Enable Distributed Intelligence in Internet of Things[END_REF], [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]) consider the distributed computation feature. In [START_REF] Sahni | Edge Mesh: A New Paradigm to Enable Distributed Intelligence in Internet of Things[END_REF], the authors proposed a computing paradigm, named Edge Mesh, which distributes the decisionmaking tasks among edge devices within the network instead of sending all the data to a centralized server. Edge Mesh provides many benefits, including distributed processing, low latency and fault tolerance. However, the authors ignore the tasks allocation problem in such distributed architecture. A vision of distributed IIoT data processing using fog and cloud computing has also been discussed in a recent work [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]. The authors discuss the emerging challenges in the aspects of data processing in IIoT. They design a flexible framework by integrating the fog computing and cloud computing. Based on the time latency requirements, the collected data are processed and stored by the edge server or the cloud server.

Cloud-Based SDN Architectures for Vehicular Networks

Although applying SDN in a heterogeneous vehicular network is challenging, several studies in the literature have demonstrated the high potential of SDN to improve data forwarding and to ensure better QoS for vehicular network applications. These studies describe network architectures that can be arranged in two categories: centralized and distributed.

Centralized approaches deploy one SDN controller that is responsible for maintaining the status of all nodes in the network and making packet forwarding decisions. For instance, Ku et al. [START_REF] Ku | Towards software-defined VANET: Architecture and services[END_REF] proposed an SDN-based architecture to select routing paths with high connectivity. Two operational modes were deployed, depending on the control level reinforced by the SDN controller (i.e., total or hybrid). Similarly, He et al. [START_REF] He | SDVN: Enabling Rapid Network Innovation for Heterogeneous Vehicular Communication[END_REF] introduced SDVN, another SDN-based architecture that uses traffic information, collected through RSUs, as well as a trajectory prediction module to make forwarding decisions. SDVN also adopts a network slicing mechanism to prevent the broadcast storm problem and supports control flexibility via allowing nodes to deploy routing protocols that exquisitely fit the current context. Azizian et al. [START_REF] Azizian | Vehicle Software Updates Distribution with SDN and Cloud Computing[END_REF] proposed an architecture that is based on SDN and cloud computing to tackle the issue of vehicles' software updates dissemination. Indeed, the SDN controller, in collaboration with several cloud elements, uses beacon messages to compute relative mobility between vehicles and to construct connectivity graphs. These graphs serve two purposes: 1) computing routes and updating flow tables; and 2) assigning frequency bands to vehicles to mitigate hidden terminal and interference problems. Abolhasan et al. [START_REF] Abolhasan | Software-defined wireless networking: centralized, distributed, or hybrid?[END_REF] proposed a hybrid SDN-based architecture that uses two distinct frequency bands to transmit control and data packets. It splits the complexity of route discovery between the SDN controller and the forwarding nodes to reduce significantly the signaling overhead. Finally, Yang et al. [START_REF] Yang | An Architecture of Cloud-Assisted Information Dissemination in Vehicular Networks[END_REF] proposed a cloud-assisted architecture, inspired by SDN, to facilitate information dissemination among vehicles. It uses driving histories to build virtual social networks (VSNs) between vehicles. Within each VSN, the closeness between any two vehicles is computed, based on a voting system, and stored in the cloud. Therefore, instead of flooding the network, vehicles only get information that may be of interest to them.

Distributed schemes, on the other hand, use multiple SDN controllers along with cloud/fog services to maintain network state information and to make forwarding decisions. For example, Correia et al. [START_REF] Correia | An Architecture for Hierarchical Software-Defined Vehicular Networks[END_REF] proposed a hierarchical SDN-based vehicular architecture that ensures data dissemination in situations where connection to the SDN controller is lost. Indeed, local SDN domains are built using vehicles clustering. Each cluster head acts as a local controller, retaining some of the network intelligence that is employed to select a set of gateways to forward data packets.

Likewise, Ge et al. [START_REF] Ge | 5G Software Defined Vehicular Networks[END_REF] proposed a new vehicular network architecture to enhance QoS requirements (i.e., delay, throughput) by integrating 5G mobile communication technologies, SDN, cloud computing and fog computing. Vehicles and RSUs are responsible for collecting traffic information (e.g., speed, density, and road condition). This information is processed by fog computing clusters and transmitted to the SDN controllers, which will forward it to the cloud computing centers. This information is used to: 1) build the global information map; and 2) generate control information based on rules and strategies from the application plane. These rules are then forwarded to RSUs. Finally, Lui et al. [START_REF] Liu | A Scalable and Quick-Response Software Defined Vehicular Network Assisted by Mobile Edge Computing[END_REF] proposed another SDN-enabled network architecture assisted by Mobile Edge Computing (MEC) to provide low-latency and high reliability communications. Instead of requesting services from remote data centers, these services can be deployed in cloud computing resources that can be placed near the vehicular network. This way, local data forwarding decisions can be quickly executed, decreasing therefore the round-trip time of data packets.

Despite their adequate performance, schemes in both categories have limitations. On the one hand, the use of only one SDN controller could be the bottleneck of the entire system, leading to resiliency and scalability issues. In addition, adopting the conventional ad hoc mode of vehicular networks whenever connections to the SDN controller are lost may escalate the endto-end delay. On the other hand, deploying multiple SDN controllers increases the system complexity and introduces new challenges (i.e., handover) that need to be dealt with. This may lead to higher control overhead [START_REF] Correia | An Architecture for Hierarchical Software-Defined Vehicular Networks[END_REF][START_REF] Ge | 5G Software Defined Vehicular Networks[END_REF] and longer end-to-end delay [START_REF] Liu | A Scalable and Quick-Response Software Defined Vehicular Network Assisted by Mobile Edge Computing[END_REF]. Table 2.1 illustrates a comparison summary between HSVF and the various existing schemes, including recent ones using different metrics as the architecture of the control plane, the number of controllers, the deployment of a controller failover system, and the ability to manage storage and computational resources considering techniques such as data offloading and resource allocations. Table 1 also shows that while HSVF supports all V2X communications (i.e., V2V, V2I, and I2I). the remaining schemes do not support I2I communications. HSVF deploys a decentralized and hierarchical Fog and Cloud architecture for resource management, and makes use of a computational capacity allocation mechanism using NFVM, which will be described in Section 3.

5G-based SDN architectures for Vehicular Networks

Network Slice Architetures based SDN

There exists various network slicing approaches that have been proposed in the literature.

For example, Costanzo et al. [START_REF] Costanzo | A network slicing prototype for a flexible cloud radio access network[END_REF] proposed a network slicing solution that makes use of an efficient scheduling algorithm, based on the centralized SDN architecture presented in [START_REF] Onf Tr- | Applying SDN Architecture to 5G Slicing[END_REF], to ensure a real-time allocation of bandwidth to the different slices considering their requirements in cloud radio access network. Velasco et al. [START_REF] Velasco | An architecture to support autonomic slice networking[END_REF] proposed an architecture to enable autonomic slice networking. It has two domains: metro and core, each of which includes: i) a provisioning and reconfiguration module based on SDN; ii) a data analytics module that collects data records from nodes and analyze them; and iii) a slice manager that exports virtualized network resources in the form of network slices through a northbound interface. The approaches proposed in [START_REF] Costanzo | A network slicing prototype for a flexible cloud radio access network[END_REF]

5G network slice architetures for automative

Few schemes have been proposed to support 5G network slicing for the automotive vertical.

For instance, Soenen et al. [START_REF] Soenen | Demystifying network slicing: From theory to practice[END_REF] proposed an SDN-based slicing architecture that addresses the issue of reliability when broadcasting safety messages in vehicular ad hoc networks (VANET).

Instead of rebroadcasting a received safety message, a vehicle forwards it to its respective base station. Once received, the centralized SDN controller uses the dedicated slice, based on edge computing, to instruct that particular base station along with all its neighboring base stations to forward the safety message to all the vehicles in their vicinity. Nevertheless, the use of one authorization and subscription management. Moreover, it deploys an application server at the network edge to help vehicles in processing 3D maps and building an augmented vision beyond their visual perception. Nevertheless, the works in [83, 84, and 85] didn't provide a mathematical framework to investigate the principal autonomous driving requirements as reliability and ultra-low latency. Moreover, the authors in [START_REF] Campolo | 5G Network Slicing for Vehicle-to-Everything Services[END_REF] propose to use only one slice to handle autonomous driving services, which is insufficient due to the important modules of the autonomous driving services (localization, perception, planning, and global system management). These modules need to be virtualized and scheduled using different service slices.

From the reviewed papers, supporting the autonomous driving application in 5G given its inherent requirements (i.e., end-to-end reliability and ultra-low latency) needs further investigation in terms of core network management and orchestration, resource allocation and service differentiation. In order to fulfill the gap in the literature, we propose a framework that contains four components: i) a distributed and scalable SDN core network architecture based on vertical and horizontal partitioning of the network, where each domain is managed by a single or multiple controllers (i.e., Fog, Edge and Core); ii) a network slicing function that maps autonomous driving functionalities into service slices; and iii) a network and service slicing system model with four logical layers. iv) an ultra-low latency mathematical framework where we used a GI/M/1 queuing system to define the handling, and the tail latencies.

Chapter Summary

In this chapter, we started by reviewing the different architectures and models proposed to addressee the issues of energy saving in smart grid environment considering the management of EVs energy plug-in as a case study, pricing models for energy cost optimization, and smart metering security against FDIA. Most of these proposed architectures and models rely on central and local topology information based on the traditional smart grid architecture.

However, almost all of them endure the local maximum and/or data congestion problems, increasing therefore the end-to-end delay and the response time for scheduling data and users' energy requests (e.g., EVs energy demands for charging). We then described the various

CHAPTER 3 CLOUD-BASED EVs PLUG-IN MODEL IN SMART GRID

Smart Grid (SG) technology represents an unprecedented opportunity to transfer the energy industry into a new era of reliability, availability, and efficiency that will contribute to our economic and environmental health. On the other hand, the emergence of electric vehicles (EVs) promises to yield multiple benefits to both power and transportation industry sectors, but it is also likely to affect the SG reliability, by consuming massive energy. Nevertheless, the plug-in of EVs at public supply stations must be controlled and scheduled in order to reduce the peak load. In order to reduce the impact of charging electrified vehicles (EVs) on smart grid and optimize energy saving; in this chapter, we propose a coordinated model for planning the plug-in of electrified vehicles for charging and discharging energy.

Our contributions are summarized as follows: a) we propose a new plug-in system of EVs based on calendar planning using distributed Fog computing capacities, b) we use a multipriority queueing system to manage the plug-in of EVs at each electric public supply station (EPSS), the proposed queuing system uses a cut-off discipline in order to enhance to plug-in process, c) in order to improve our planning scheme and maintain the energy curve stability, we propose three optimization algorithms as follows: i) two priority attribution algorithms for both the calendar's plug-in and random plug-in according to different energy constraints, ii) and an algorithm to select the optimal EPSS for each EVs to plug-in, d) we perform extensive simulations using realistic energy loads in order to improve the effectiveness of our solution; also we compare our algorithms with two recent works.

The rest of this chapter is organized as follows. Section 3.1 presents the EVs plug-in system model. Section 3.2 describes the smart grid based decentralized Fog architecture while section 3.3 presents the calendars planning of EVs plug-in based on the proposed Fog architecture.

Section 3.4 describes the multi-priority queuing model for EVs plug-in while section 3.5

presents the optimal priority and EPSS attribution strategy. Section 3.6 portrays the simulations results. Finally, Section 3.7 concludes the chapter.

System Model of EVs Plug-in

In this section, we present the energy consumption system for EVs in a smart city. Primary, we express the EV plug-in problem by defining diverse parameters that contribute in this process (e.g., EVs, EPSS, users, and energy). Next, we define the energy flow between EVs and each micro grid (i.e., G2V, V2G) in order to characterize the demand-supply energy curve for each micro grid.

EVs Plug-in Problem Definition

We consider a geographical area that contains a number of EVs, and a number of charging and discharging stations. Each station has a number of plug-in sockets. The stations are equipped with a bidirectional charge and discharge controller to insure bidirectional G2V-V2G energy flows.

The set of electric vehicle , which performs charging and discharging, is represented as

follows: = { 1 , 2 , … , , … , }, ∀ = 1, … , (3.1)
The set involves two sets: i) the charging-only set (i.e., G2V) denoted by 2 , ii) the discharging-only (V2G) set denoted by 2 . So we have:

2 = { 1 2 , … , 2 , … , ′ 2 }, ∀ = 1, … , ′ , ∀ 2 ⊂ (3.2) 2 = { 1 2 , … , 2 , … , ′′ 2 }, ∀ = 1, … , ′′ , ∀ 2 ⊂ (3.3) = 2 + 2 (3.4)
The set of electric public supply stations is represented as follows:

= { 1 , … , , … , }, ∀ = 1, … , , ∀ ⊂ (3.5)
The charging and discharging time of an EV (i.e., service time) is superior to that of a regular vehicle. As illustrated in Figure 3.1, the charging and discharging time is composed of the waiting time to plug-in and the service time. Moreover, the waiting time at public supply stations is more important than the waiting time at home and work stations. In this regard, we study the problem of pug-in EVs at each electric public supply stations, aiming to optimize the waiting time to plug-in at public supply stations.

Energy Model

We study the battery charging and discharging of EVs during the day, including peak hours, mid-peak hours and no-peak hours, at public supply stations. The day is evenly divided into a set of periods. The period set is denoted by . The length of a period is denoted by . We divide the day into 288 periods, so the period length is given by = minutes.

Let us consider a smart grid system, with a micro grid that covers a geographical area. The micro grid provides energy and controls the power consumption of all users, including EVs.

The energy demand of charging of an denoted by 2 , depends on its available energy state of charge at time slot denoted by , and the predetermined target charging level denoted by . Thus, we have:

2 = - (3.6)
The total charged energy by EVs at time slot is given by:

2 = ∑ 2 ′ =1 .7
Also, the energy discharging of an denoted by 2 depends on its state of charge at time slot , and the discharging target level denoted by . Thus, we have:

2 = - (3.8)
The total energy discharged form EVs at time slot is given by:

2 = ∑ 2 ′′ =1
.9

Let denotes the total energy supply at time slot , which includes the energy production by the micro grid denoted by , and the total discharging energy form EVs calculated by Equation (3.9). Thus, we have:

= + 2 (3.10)

EVs Mobility Model

To design the mobility pattern of EVs in a geographical area, we use the Gauss-Markov mobility model proposed in [START_REF] Bai | A survey of mobility models[END_REF][START_REF] Liang | Predictive Distance-Based Mobility Management for PCS Networks[END_REF]. According to [START_REF] Liang | Predictive Distance-Based Mobility Management for PCS Networks[END_REF], a mobile agent checks its position periodically, and updates the location whenever it reaches a threshold distance. In our case study, EVs are considered as mobile agent; consequently, we use the Gauss-Markov model to implement EVs mobility patterns. The velocity of an EV is considered to be correlated over time, i.e., the location of an EV at time depends on its location and velocity at time -1).

In the proposed scenario, the movement of each is considered to be in two-dimensional plan , . Thus, based on the birth-death stochastic process, the Gaussian-Markov model is represented as in :

= -1 + 1 -+ √1 -2 -1 ∀ ∈ (3.14) = [ ,
] denotes the velocity of at time slot .

= [ , ] denotes the variance of memory level.

= [ , ]

denotes the standard deviation.

-1 = [ -1 , -1
] is the uncorrelated Gaussian process.

From Equation (3.14), we evaluate the mobility model in two-dimensional plan , , respectively as follows:

= -1 + 1 -+ √1 -2 -1 ∀ ∈ (3.15) = -1 + 1 -+ √1 -2 -1 ∀ ∈ (3.16)
In the proposed model, we assume different locations of an (e.g., home, office, roadside, parking deck, and shopping mall) with three different values of : 0, 1, and < < 1. Where is a parameter which can reflect the randomness of Gauss-Markov process.

Smart Grid Based Decentralized Fog Architecture

We believe that the centralized scheduling of EVs requests with their heterogeneous battery characteristics, and the management of charging and discharging stations including base load consumption, in a geographical area, is challenging. In the centralized architecture, all information and operations are scheduled inside the micro grid. With the limited storage and computing capacity of the smart grid, also with the increasing number of EVs, the real-time demand response and energy monitoring become very problematic.

Traditional Smart Grid Architecture

Fundamentally, the traditional architecture of SG is designed in a centralized way where the data generated from various data sources (e.g., smart meters, EVs, EVPS) are typically examined at a centralized control center (i.e., smart grid controller) [START_REF] Yuan | Competitive Charging Station Pricing for Plug-In Electric Vehicles[END_REF]. Taking EVs and EVPSSs as an example (Figure 3.2), EPPS acquires metering data and requests from EVs, and delivers them to an operation center where a meter data management system (MDMS) and scheduling applications are used to process the data and response to EVs request [START_REF] Ye | Reliable Energy-Efficient Uplink Transmission for Neighborhood Area Networks In Smart Grid[END_REF]. Using such centralized architecture, smart grid management systems receive and process big datasets and demands from all customers, which seems an easy way of managing data only in some simple situations (e.g., small-scale and non-mobile systems).

Why using decentralized cloud for smart grid

With the growing number of EVs fleet and electric de-vices, it is highly likely that the traditional centralized architecture reaches its physical limit of handling these big data. Such architecture can cause data congestion, serious latency, or even data loss, which may seriously damage SG services [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF]. Hence, it is very critical for electric companies to define new communications standards and find the best computing infrastructure to control and manage all costumers. To address these problems, we propose a new concept of distributed computing architecture for SG, where the case study is the scheduling of EVs charging/discharging requests (see Figure 3.3). We strongly trust that a decentralized aspect of cloud computing (i.e., fog) is an encouraging solution thanks to the following advantages:

 Cloud technology provides high computing capacity to smart grid utilities. In addition, with its enormous data storage, cloud can help smart grid to improve demand side management services.

 The decentralized aspect of cloud networking, using the so-called Fog-computing, can be used to manage and control each micro grid in a distributed manner.

Fog-assisted vehicles demands management

We propose a decentralized fog computing architecture for an intelligent transportation system by scheduling EVs charging/discharging requests in SG environment. In the proposed scheme, multiple fog data centers are deployed in a smart city and connected to each micro grid controller; each distributed fog data center plays the role of serving one local area (i.e., one micro grid) and reporting to a centralized cloud data centers. In addition, the distributed operation center is capable of collecting and analyzing data locally, and making decisions (with localized goal settings) rather than backhauling all data to the central operation center. Such Indeed, each fog data center and cloud data center can communicate respectively with the micro grid controller and the smart grid controller in order to update periodically energy parameters, such as price, total energy supply, etc. Figure 3.5 shows the proposed packet format of EVs, EVPSS and smart grid controller interactions.

Calendars Planning of EVs Plug-in based on Decentralized Fog

In order to schedule the plug-in process of EVs, we use in our proposed solution the proposed architecture based on decentralized Fog (Figure 3.3), where each micro-grid has its appropriate Fog data centers. We use Fog computing capabilities (i.e., storage and processing capacities) to schedule all EVs requests. To give back this usage more efficiency and proficiency in our model, EVs users are solicited to create and save their EVs energy profiles . An includes information about EVs users as represented below:

{ , , , , , }

Where is the unique identifier of an electric vehicle, is used for session authentication to ensure privacy and security, and are used to calculate the charging and discharging time.

EV users may create several calendars to express several charging and/or discharging requests.

EV calendars for charging and discharging are represented, respectively, as follows:

2 [ , , , , ] 2 [ , , , , ]
Each EV can update several charging and discharging calendars, once accessing its profile in the cloud, by indicating its location , state of charge , and the estimated time to plug-in . Moreover, it can indicate its requested energy for charging ( ) and for discharging ( ). Once scheduling of EVs calendars, inside each Fog computing data center, the suitable and the optimal calendars with the best waiting time to plug-in, and the best energy utilities, in order to update and collect information in a real-time way; consequently, the best decision can be outlined.

 Once the scheduling process is performed, the optimal calendars are selected for each EV user. The user receives a notification message of the suitable calendar on his profile, where he can confirm or decline the proposed calendar. If the user confirms the charging and/or discharging calendar, he sends a notification message to the cloud in order to update information (e.g. calendars data base, demand-supply curve and price). Otherwise, the user selects his appropriate calendar.

In order to make our model more realistic, we suppose that we may have some EVs users that cannot create profiles or haven't sent calendars to plane their plug-in, we called this EVs as EVs with random plug-in. In summary, we will have four types of EVs how's perform the charging and/or discharging process. We divided the EVs into four sets as follows: 1) The set of EVs with calendar plug-in who request charging, 2) The set of EVs with calendars plug-in who request discharging, 3) The set of EVs with random plug-in who request charging, and 4)

The set of EVs with random plug-in who request discharging.

Multi-Priority Queuing Model for EVs Plug-in

In this section, we study the plug-in process of EVs at each public supply station (EPSS).

We use a multi-priority queueing concept with cut-off discipline. As seen earlier, we have four sets of EVs that can be in the same public EPSS at time instance to perform charging or discharging process, thus we consider four priority levels. Each EV calendar receives its priority level to plug-in according to different metrics and condition (we will see this in the next section).

However, in order to control and manage all EVs sets, we assume that EVs with random plug-in receive their priority levels when they arrive at the EPSS. The Fog services can communicate with each ESS controller to attribute the appropriate priority levels to EVs with random plug-in according to the scheduling state.

Taking into consideration the four sets of EVs, our priority queuing theory with four priority levels is seen as a multi-priority M/M/S queuing model for each EPSS where each EPSS has a number of plug-in sockets. In this regard, our stochastic process is presented as a Markov chain with four priorities in each state transition. We noted the priority levels ℒ as follows:

ℒ = {1, , , 4} where, ℒ = 1 > ℒ = > ℒ = > ℒ = 4 (3.17)
By convention, ℒ = 1 designates highest priority.

Cut-off Discipline for M/M/S Queuing Model

In order to organize the charging and discharging process of each EV user, we use a server cut-off discipline for each EPSS. Under this discipline, we anticipate EVs with highest priorities relative to EVs with lowest priorities; in order to serve EVs arrivals with highest priorities. The cut-off discipline is shown in Figure 3.7.

Associated with each priority level ℒ, there is a server cut-off number ℒ , where ℒ = 1, , , 4. If a priority ℒ customer finds upon arrival fewer than ℒ servers busy, then he enter service immediately. Otherwise (i.e., if ℒ or more servers are busy upon arrival), the customer joins an first-in-first-out (FIFO) queue of his priority class. In order to describe the relative thresholds (cut-off) of the respective priority levels, we assume that ℒ are ordered as follows:

≤ ≤ 2 ≤ 1 (3.18)
Where the indexes 4, 3, 2 and 1 are the priority levels.

However, if two or more priority classes have the same server cut-off number (i.e., ℒ+1 = ℒ ), then all the higher priority customers are saved in a head-of-line manner before any of lower priority customers. In this work, EVs with lowest priority receive service (i.e., to plugin) only when the number of EVs with highest priority are waiting is null. Nevertheless, an EV with low priority that is receiving service is not interrupted, if an EV with higher priority arrives and all sockets are occupied; thus the queue discipline is no-preemptive. Let us consider a number of busy plug-in sockets in each EPSS. As shown in Figure 3.7, the admission of each EVs category is scheduled according to the following conditions:

 For EVs with priority level 4 (ℒ = 4): (i) serve an arriving EV if and only the number of occupied plug-in sockets is fewer then , (i.e., < ), otherwise, place it in the appropriate queue. (ii) Serve an EV from the queue whenever one of busy plug-in sockets (< becomes free.  For EVs with priority level 3 (ℒ = ): (i) serve an arriving EV if and only the number of occupied plug-in sockets is fewer then , (i.e., < ), otherwise, place it in the appropriate queue. (ii) Serve an EV from the queue whenever one of busy plug-in sockets (< becomes free.

 For EVs with priority level 2 (ℒ = ): (i) serve an arriving EV if and only the number of occupied plug-In sockets is fewer then 2 , (i.e., < 2 ), otherwise, place it in the according priority queue. (ii) Serve an EV from the queue whenever one of busy plug-in sockets (< 2 becomes free.

 For EVs with priority level 1 (ℒ = 1): an EV enters service immediately unless all plug-in sockets are busy = 1 = , in which case it can be queued.

The multi-priority queuing model with cut-off discipline is motivated by the concept of charging and discharging system at public EPSS, in which it is desirable to retrain a strategic reserve of plug-in sockets for higher priority customers.

Workload Parameters and Steady-State Probabilities

We define the workload parameters as follows:

{ = 1 + 2 + + µ = µ 1 = µ 2 = µ = µ 1 = µ , 2 = µ , = µ , = µ = 1 + 2 + + (3.19)
We define also the steady-state probabilities as follows:

( 1 , 2 , , , ) = { r [ 1 , 2 , , , ] (3.20)
Where, 1 , 2 , , .

Otherwise,

1 , 2 , , , = (3.21)
And , , , , =

The steady-state equations for our model are given by the following:

 For > (Figure 3.8 (a)) 1) If ≤ + µ , , , , = 1 + 2 + , , , , -1 + , , , -1, + µ + 1 , , , , + 1 + µ , , , + 1, (3.23) 2) If + 1 ≤ ≤ -1 + µ , , , , = 1 + 2 + , , , , -1 + , , , -1, + µ + 1 , , , , + 1 + µ , , , + 1, + µ , , 1, , (3.24)
3

) If + 1 ≤ ≤ 2 -1 1 + 2 + + µ 2 , , , , 2 = 1 + 2 , , , , 2 -1 + , , , -1, 2 + µ 2 + 1 , , , , 2 + 1 +µ 2 , 1, , , 2 + µ 2 , , 1, , 2 + µ 2 , , , + 1, 2 (3.25) 4) If 2 + 1 ≤ ≤ 1 -1 1 + + µ 1 , , , , 1 = 1 , , , , 1 -1 + , , , -1, 1 +µ 1 1, , , , 1 +µ 1 , 1, , , 1 + µ 1 , , 1, , 1 + µ 1 , , , + 1, 1 (3.26)
 For N > (Figure 3.8 (b)) 1) If ≤ + µ , , , , = 1 + 2 , , , , -1 + , , -1, , + , , , -1, + µ + 1 , , , , + 1 +µ , , + 1, , + µ , , , + 1, (3.27) 2) If + 1 ≤ ≤ 2 -1 1 + + + µ 2 , , , , 2 = 1 , , , , 2 -1 + , , -1, , 2 + , , , -1, 2 + µ 2 + 1 , , , , 2 + 1 +µ 2 , 1, , , 2 +µ 2 , , + 1, , 2 + µ 2 , , , + 1, 2 (3.28) 3) If 2 + 1 ≤ ≤ 1 -1 1 + + + µ 1 , , , , 1 = 1 , , , , 1 -1 + , , -1, , 1 + , , , -1, 1 +µ 1 1, , , , 1 +µ 1 , 1, , , 1 + µ 1 , , + 1, , 1 + µ 1 , , , + 1, 1 (3.29)  For 2 > (Figure 3.8 (c)) 1) If ≤ 2 + 4µ 2 , 2 , , , 2 = 1 , 2 , , , 2 -1 + 2 , 2 -1, , , 2 + , 2 , -1, , 2 + , 2 , , -1, 2 +µ 2 + 1 , 2 , , , 2 + 1 + µ 2 , 2 + 1, , , 2 +µ 2 , 2 , + 1, , 2 + µ 2 , 2 , , + 1, 2 (3.30) 2) If 2 + 1 ≤ ≤ 1 -1 + 4µ 1 , 2 , , , 1 = 1 , 2 , , , 1 -1 + 2 , 2 -1, , , 1 + , 2 , -1, , 1 + , 2 , , -1, 1 +µ 1 1, 2 , , , 1 + µ 1 , 2 + 1, , , 1 +µ 1 , 2 , + 1, , 1 + µ 1 , 2 , , + 1, 1 (3.31)
 For 1 > (Figure 3.8 (d)) 1) If ≤ 1 (Fig. 2. (d)) + 4µ 1 1 , 2 , , , 1 = 1 1 -1, 2 , , , 1 + 2 1 , 2 -1, , , 1 + 1 , 2 , -1, , 1 + 1 , 2 , , -1, 1 +µ 1 1 + 1, 2 , , , 1 + µ 1 1 , 2 + 1, , , 1 +µ 1 1 , 2 , + 1, , 1 + µ 1 1 , 2 , , + 1, 1 (3.32)
Figure 3.8 shows that , the probabilities that there are servers busy, represent the total probability of being in a hyperplane orthogonal to the -axis and passing through , , , , . Indeed, the state transition diagrams represented in Figure 3.8 is (ℒ +1)-dimensional (i.e., Five-dimensional diagram in our case with 4 priority levels). For the 4priority problem, and using "balance-of-flow" results from M/M/S queues, it is easy to see that:

For < < = -1 (3.33) Where = ∑ ℒ µ ℒ=1 .
Similarly, it is easy to see by summing the global balance equations over ℒ that: (3.34) show that, to obtain the steady state probabilities , it is necessary to determine the relationship between ℒ -1 and ℒ , for ℒ = 1, … , 4. By normalizing the sum of to 1 then obtaining . In order to derive the probability distribution for number of busy sockets, we need to introduce some additional concepts and notations.

For ℒ+1 < < ℒ and 1 ≤ ℒ < 4 = -1 ℒ (3.34) Where ℒ = ∑ µ ℒ =1 .

Let

ℒ denotes the first passage time from state to -1 = 1, , … , with arrival streams of priority ℒ. Figure 3.9, illustrates the definitions of the random variable ℒ , for 1 ≤ ℒ ≤ 4 and ℒ+1 ≤ ≤ ℒ for our model with four priority levels where ≤ ≤ 2 ≤ 1 =

. The continued arcs show the first passage time ℒ from one state to another. The discontinued arcs show the conditional upward transition rates for a given number of busy sockets as follow:

ℒ = ∑ ℒ =1 .

Mean Waiting Time for Each Priority Queues

Now, let ℒ for each priority level of a customer) denotes the queue move-up time. Due to the Markovian nature of the entire system, it is clear that the ℒ 's are independent. The move up time is equivalent to a first passage time from one state to another. The steady state probabilities of our model with four priority levels are given by [START_REF] Schaack | An N server cutoff priority queue[END_REF][START_REF] Xia | On the Large Deviations of Resequencing Queue Size: 2-M/M/1 Case[END_REF]. Using the recursive method and the derivation of the that requires the knowledge of the mean first time passage time [ ℒ ] for a certain combination of indices and ℒ, we derive these quantities recursively as seen in Figure 3.10.

We can now write down the by inspection, in terms of the expected service times seen by the various queues. For a four priority system with arrival rates 1 , 2 , , , individual service rate µ, and cut-offs ≤ ≤ 2 ≤ 1 = the steady state probabilities are as follows:

 If ≤ β < C = ! (3.36)  If C ≤ β < C = ! 1 1-[ ] (3.37)  If C ≤ β < C 2 = ! 1 1-[ ] 1 1-[ ] (3.38)  If C 2 ≤ β < C 1 = ! 1 1-[ ] 1 1-[ ] 1 1-[ ] (3.39)  If β = C 1 = ! 1 1-[ ] 1 1-[ ] 1 1-[ ] 1 1-[ ] (3.40)
Thus, the mean waiting time for each priority queues ℒ for our four-priority M/M/S system is given by:

ℒ ] = ⁄ 1- ∑ ℒ- = 1- ∑ ℒ = (3.41)
In order to allow a good saving of computation effort. We use for a number of EPSS a form of block matrix notation to highlight the waiting time and the cut-off threshold vectors for all ESS, which are given as follows:

_[ ℒ ] = {[ ℒ ] 1 , … , [ ℒ ] , … , [ ℒ ] } (3.42) = 1 = For = … (3.43) _ 2… = { 2… 1 , … , 2… 2 , … , 2… ] (3.44)

Optimal Priority and EPSS Attribution Strategy

Optimal Priority Algorithms

In this section, we study the priority assignment strategy implemented in our approach. Each priority level is attributed to an EV according to: 1) the EV type (i.e., with calendar plug-in or random plug-in), 2) the type of requests (i.e., charging or discharging), 3) the demand supplycurve state, 4) the waiting time at each EVPSS, and 5) the mobility model and EV location.

We consider four priority levels; in our priorities attribution strategy, we use the supply-demand curve characterized by Equation (3.12) as a principal constraint. Thus, the priorities attribution is given as follows:

 If ≤ (i.e., the value of Equation (3.12) is positive): EVs which request to charge their battery receive the first and the second priority levels ℒ = 1, ℒ = as follows:

EPSS Selection Strategy Algorithm

Finally, we propose a strategy to select the best EPSS for each EV with calendar plug-in using the output information from EV_CPA algorithm and some constraints related to EPSS state, the , the time and the distance to joint each EPSS. To this end, we propose a scheduling algorithm (Algorithm 3) for selecting the best station called (BSS); the algorithm is implemented and executed inside the Fog data centers. However, for each EV calendar, the algorithm selects the optimal EVPSS that has the minimum waiting time to plug-in for each priority queue taking into consideration the mobility scenario for each EV. We note that BSS algorithm is dedicated only for EVs with calendar plug-in process. For EVs with random plugin, we assumed earlier that they arrive randomly to EVPSS, consequently they cannot benefit of this service until they create their charging/discharging profile and calendars.

Performance Evaluation

We perform extensive simulations to evaluate and highlight the proposed scheduling approach for EV charging and discharging services. We use MATLAB to perform our simulations and SUMO-Veins [START_REF]Veins Vehicle in Network Simulations: The open source vehicular network simulation framework[END_REF] to implement our mobility model.

Simulation settings

We consider the electric load in a city, provided by a micro grid and controlled using smart grid utilities. We examine EV charging and discharging during a day (24 h) starting from 12:00 AM. The day is evenly divided into 288 intervals [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF]. Each interval has a length of 5 minutes (min). According to our proposed model we have two EVs categories: a) EVs with calendar plugin, b) EVs with random plug-in. The arrival times of the EVs are uniformly distributed across the day, and the charging load is estimated to be high during evening peak hours (5:00 am to 22:00 am). The charging and discharging periods of EVs are uniformly distributed according to the requested energy for charging and for discharging . For mobility modeling, we consider a scenario of 10 roads that allow access to a city having area of 10 km x 10 km where the EPSSs are placed randomly. All vehicles are traveling with speeds that cannot exceed 60 km/h. Table 3.1 shows the various parameters used for simulation.

Performance Metrics

In order to evaluate our proposed schemes, we use different metric as follows:

 Demand supply curve: is the principal metric used to inspect the performance of the proposed approach, especially during peak hours. The demand supply curve is evaluated from Equation 3.12.

 Priority levels attribution: we use four priority levels and compare the number of EVs categories (charging or discharging) for each priority level across the day in different case studies.

 Time to plug-in: we define the time to plug-in for any EV as the sum of the waiting time to join EPSS and the cloud provider response time.

Results and Discussion

Three scenarios of simulations were performed as follows: 1) we perform simulations considering four priority levels for EVs where we suppose that the demand supply curve is not stable, and 2) we run simulation without considering cloud computing platforms and priority strategy, we called this scenario the standard case.

In order to keep our simulation scenarios more realistic, we use a real base load consumption, shows the real time charging and discharging energy during a day selected randomly where the charging energy is estimated to be high compared with the discharging energy. shows the total energy demand, the total energy supply and the demand supply curve after adding the charging and the discharging load. We can see that the demand supply curve is not ). In order to stabilize the curve during a day, we run simulations with EV_CPA and EV_RPA scheduling. Figure 3.12(a) shows the number of charging EVs and discharging EVs with different priority levels during a day. We can see that the number of discharging EVs is higher with priority levels (1 and 2) then the lowest priority levels (3 and 4). This is due mainly to the performance of the proposed priority attribution strategy implemented by EV_CPA for EVs with calendar plug-in, and EV_RPA for EVs with random plug-in. In this regard, the algorithms aim to maximize the waiting time to plug-in for EVs need to charge and minimize the waiting time to plug-in for EVs need to discharge. As represented in Figure 3.12(b) we can observe that from 03:00 am to 09:00 am, the waiting time for discharging EVs is higher than the waiting time for charging EVs, this is because the demand supply curve is stable ( > ) during this period. However, from 12:00 pm when the demand supply curve becomes not stable ( ≤ ), the curves are inversed, and the waiting time to plug-in for charging EVs become very high, especially for EVs with random plug-in. This is why EVs users are solicited to create charging and discharging calendars in order to relieve the smart grid system and select a best charging/discharging planning during a day, and especially during peak hours.

As results, we can see in Figure 3.12(c) a significant stabilization of the demand supply curve compared with the standard case; we have an important energy saving (500 kwh) during evening peak hours. Now, we examine the efficiency of the queueing model with four priority levels and cut-off process under implementation of the proposed planning algorithms (i.e., PAC, PAR, BSS). We show in Figure 3.13 the impact of EV arrival rate, cut-off values and number of busy sockets on the waiting time for each priority level, results are performed during evening peak hours

Comparison with Existing Works

Figure 3.14 illustrates the performance of the proposed scheduling approach compared with existing works, such as optimal scheduling for charging and discharging of EVs [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF], and decentralized changing and discharging scheduling of plug-in EVs in smart grid (i.e., DOS_A) [START_REF] Xing | Decentralized Optimal Scheduling for Charging and Discharging of Plug-In Electric Vehicles in Smart Grids[END_REF]. To do this, first we consider the same simulation parameters used in each work. In [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF],

the authors used 400 EVs and the battery capacity is 9 KWh, we adjust our simulation scenario with the same parameters and we run simulations. using our scheduling algorithms (i.e., EV_CPA and EV_RPA) compared with the globally optimal scheme proposed in [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF]. We can see that from 01:00 am to 06:00 am the total energy demand using our scheduling is higher than the total energy using the globally optimal scheme, this is because our algorithms solicit EVs users to charge their batteries during this period (i.e., no peak hours where the demand supply curve is stable) by attributing the high priority levels;

in that way we reduce the waiting time in EPSS. However, during peak hours, from 12:00 pm to 21:00 pm, we can see that our algorithms are more efficient than the globally optimal scheme. Moreover, they reduce significantly the energy base load (-100 KW), because a high number of EVs with calendars discharge during this peak period with the lowest waiting time allows a quick deliverance of energy to the grid. Next, we examine the scheduling of charging and discharging power for randomly chosen EVs during evening peak hours, for our case we select EVs with calendar plug-in. As shown in Figure 3.14(b), our algorithms discharge the energy in peak hour intervals 16:00 pm -21 pm with a different energy load (varied according to the demand supply curve). However, the locally optimal and the globally optimal schemes discharge only during intervals 17:00 pm -19:00 pm with a constant energy load. For the charging load, we can see that our algorithms charge energy during non-peak hour intervals 22:00 pm -24:00 pm with a high amount of energy compared with the other schemes.

Finally, we compare our results with the work proposed in [START_REF] Xing | Decentralized Optimal Scheduling for Charging and Discharging of Plug-In Electric Vehicles in Smart Grids[END_REF]. The authors in [START_REF] Xing | Decentralized Optimal Scheduling for Charging and Discharging of Plug-In Electric Vehicles in Smart Grids[END_REF] use 10 heterogonous EVs and the base load curve of 100 households in the service area of Southern California Edison from 20:00 to 8:00 [START_REF] Xing | Decentralized Optimal Scheduling for Charging and Discharging of Plug-In Electric Vehicles in Smart Grids[END_REF] as shown in Figure 3.14(c). We use the same parameters, and we run simulation during the same period. We observe that our proposed scheduling is more capable to regulate the total demand curve compared with DOS_A especially during peak hours 20:00 pm -22:00 pm.

Chapter Summary

Smart charging can assist EVs to act as flexible loads and distributed storage resources that can benefit the energy system. This chapter proposes an efficient smart grid approach for EVs charging and discharging services at electric public supply stations (EPSS), based on cloud computing scheduling. The proposed approach ensures the communication between smart grid and cloud platforms, and manages the smart grid entities and operations. In order to optimize the waiting time to plug-in at EPSS, we introduced priority assignment algorithms. The simulation results proved that the proposed approach can be useful in a variety of cases, especially in peak hours when the number of EVs charging requests is high, and can also improve the grid stability.

CHAPTER 4 DYNAMIC PRICING MODEL FOR ENERGY SAVING IN SMART GRID

In this chapter, we propose a real-time dynamic pricing model for EVs charging and discharging service and building energy management, in order to reduce the peak loads. Our proposed approach uses a decentralized cloud computing architecture based on software define networking (SDN) technology and network function virtualization (NFV). We aim to schedule user's requests in a real-time way and to supervise communications between microgrids controllers, SG and user entities (i.e., EVs, electric vehicles public supply stations, advance metering infrastructure, smart meters, etc.). We formulate the problem as a linear optimization problem for EV and a global optimization problem for all microgrids. We solve the problems by using different decentralized decision algorithms. The extensive simulations and comparisons with related works proved that our proposed pricing model optimizes the energy load during peak hours, maximizes EVs utility, and maintains the microgrid stability. The simulation is based on real electric load of the city of Toronto.

The rest of the chapter is organized as follows. Finally, Section 4.6 concludes the chapter.

Motivation

To improve the grid stability and make profit from the price variation, it is well known that the EVs charging process [grid-to-vehicle (G2V)] should be on off-peak demand period while the discharging process (V2G) would be on-peak load period. Nevertheless, it is expected that EVs will be deployed in large-scale environments; consequently, EVs need a real-time scheduling and monitoring. In this regard, a new distributed architecture based on flexible networks needs to be implemented to maintain the adequate balance between demand and supply in SG.

On the one hand, SG environment is suitable to accommodate several utilities, which can require huge data storage and processing [START_REF] Ma | Decentralized charging control for large populations of plug-in electric vehicles[END_REF]. For instance, it has been estimated that SG will generate 22 GB of data each day from its 2 million customers [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF]. Also, the existing power grid in the U.S. is going through a massive transformation to make it more reliable and connected with the ability to transfer data and power in two ways [START_REF] Saputro | A survey of routing protocols for smart grid communications[END_REF]. Moreover, the microgrids will support an exponential growth in terms of energy demands from many devices [e.g., advance metering infrastructure (AMI), smart meters, EVs, electric vehicles public supply stations (EVPSS), etc.], located at home area networks (HANs), EV area networks (EVANs), and wide area networks. Each of these networks deploys thousands of devices that need to be managed and controlled incessantly [START_REF] Gungor | Smart grid technologies: Communication technologies and standards[END_REF]. Thus, the scheduling of all microgrid entities and minimizing the network management cost becomes very problematic. On the other hand, the emerging software define networking (SDN) technology can provide good opportunities for reducing the network management cost by integrating a flexible software network controller and virtualization functions (NFV). Some of existing works in the SDN area focus on data centers virtualization and cloud computing [START_REF] Yan | Software-defined networking (SDN) and distributed denial of service (DDoS) attacks in cloud computing environments: A survey, some research issues, and challenges[END_REF]. This later, with its distributed aspect and memory capacity, can offer huge computing, storage, and networks capabilities. So, there is a need to adapt cloud-based SDN technology for various SG applications.

In this work, we introduce a new SG architecture based on a decentralized cloud computing architecture for each microgrid, and a centralized SG controller located at cloud data centers.

This architecture exploits SDN paradigm in order to offer to SG new options and opportunities for dealing with networks faults and communications problems even in the case of overall outages. Also, we believe that the cloud computing with its enormous data storage, computing capacity, and its distribution aspect, can help the SG to manage efficiently users' requests and solve the proposed optimization problems in a real-time manner.

The contributions of this chapter can be summarized as follows.

1) A new dynamic pricing model, where the price is varied according to the variations of the demand-supply curve. The objective is to optimize the energy costs in the SG using V2G energy flow and renewable energy sources.

2) Renewable energy management algorithm to manage energy inside the buildings by switching the energy usage between microgrid and local renewable sources.

Distributed SG Architecture based Cloud SDN

In this section, we first describe the communication infrastructure for SG and then detail our proposed network model based on a decentralized architecture using Fog-SDN for microgrid controllers and Cloud-SDN for SG controller.

SG Networking Architectures

Basically, the traditional electric grid infrastructure can be divided into three major components in SG communication architecture [START_REF] Saputro | A survey of routing protocols for smart grid communications[END_REF]:

1) Customers layer: contains different area network as HANs, building area network (BANs), industrial area network (IAN), and EVAN. Each local network connects home, building, and industrial devices to smart meters.

2) Microgrid layer: collects the smart meters and EVPSS data from the customer layer.

3) SG layer: provides long-haul communication with the utility control centers using various communication technologies and standards.

SG Motivation for Cloud-SDN Enabled SG

A communication network is the important component of SG infrastructure. With the integration of advanced technologies and applications for achieving a smarter metering of energy consumption, a huge amount of data from different building appliances and EV infrastructures will be generated for analysis, update, control, and real-time pricing methods.

Thus, the management of these networks is a big challenge due to the scale. Moreover, due to heterogeneity of devices and applications from different vendors, the equipment may not be interoperable. Hence, it is very critical for electric companies to define the communications standards and find the best communication infrastructure to control and manage all customers throughout the total system considering the real-time constraint. Cloud computing based SDN is an encouraging solution for the aforementioned problems, thanks to the following advantages.

1) Cloud technology provides high computing capacity to SG utilities. In addition, with its enormous data storage, cloud can help SG to improve demand side management services and customers' participation for efficient electricity usage.

2) The decentralized aspect of cloud networking using the so-called Fog-computing can be used to manage and control each microgrid in a distributed manner.

3) The SDN technology adopts standards and introduces abstraction, which provides a centralized control and management of various types of network devices and multiple vendors that are common in SG.

4) The hardware NFV through SDN solves the problem of managing different networks and reduces the energy consumption of the network equipment.

5) Programmability by operators, enterprises, independent software vendors, and users using common programming environments.

Proposed Network Model

As seen earlier, the traditional SG architecture contains three major components. In this regard, we need to describe the communication standards and network topologies required for information flow in a SG system for each layer.

A. Customers' Area Networks (i.e., HAN, BAN, IAN): The basic metering data flow is from sensors and electrical devices to smart meters. To do this, we use ZigBee wireless communication technology that is relatively low in power usage, data rate, complexity, and cost of deployment; it is an ideal technology for smart energy monitoring and automatic meter reading [START_REF] Gungor | Smart grid technologies: Communication technologies and standards[END_REF]. Also, ZigBee integrated SG meters can communicate with the ZigBee integrated devices and control them.

B. Smart Meters Network:

In order to collect the metering data from the smart meters, we use radio frequency mesh network, where we suppose that every smart meter is equipped with a radio module and each of them routes the metering data through nearby meters as presented in Fig. 1 For each microgrid, we associate a decentralized data center (i.e., fog). A data center comprises different servers, such as database server, management server, real-time communication server, application server, and NFV and VM servers; each server provides various services for customers. Also, the data center can communicate with the microgrid control center in order to update and deliver real-time information to the company utilities (about prices for example). Hence, all communications and networks are managed and controlled using the SDN technology. Finally, the management of the fog datacenters is provided by cloud services in a centralized manner (see Fig. 1). A centralized SDN controller is implemented inside the cloud in order to manage the backhaul network.

Energy Management Model

Energy Demand Profiling

We consider two types of demands:

A. Building demands: represented as including customer's devices demands, ℎ , , , arriving at time interval at each HAN, BAN, and IAN respectively., Thus, we have:

= ∑ ∑ ℎ =1 + ∑ ∑ =1 + =1 ∑ ∑ =1 4. =1 ℎ=1
Where, , , are the numbers of HANs, BANs and IANs at each micro grid , and is the number of devices. In our proposed model, each device has a minimum and maximum energy demand as follows:

ℎ, , ≤ ℎ, , ≤ ℎ, , , ∀ ℎ,, ∈ , , (4.6
Where, is the predetermined target charging level of an 2 , ∀ 2 ∈ , and is the available energy state of charge of at time interval . However, the condition in Equation (4.8), must be respected to perform charging of an EV, where is the battery capacity of an .

Thus, the total energy demands 2 of a number ′ of 2 at the micro grid is given by:

2 = ∑ , ∀ 2 ∈ 4.9 ′ =1
Finally, the total energy demand of a micro grid including all customers' devices and EVs is represented as follows: = + 2 (4.10)

And for the total smart grid demand :

= ∑ =1 (4.11)
Remark 1: If an EV perform the charging operation at home or at building areas, its energy demand for charging will be metered by the home smart meter and the EV is considered as a device, so the energy consumption will be calculated as in Equation (4.5).

Energy Supply Profiling

We consider that each micro grid has renewable and non-renewable energy sources with self-generation capacity, and provides electricity in a certain region. The energy supply sources are presented as follows:

A. Building renewable energy supply: we suppose that we have a number of building areas (HAN, BAN and IAN) equipped with renewable energy sources as solar energy equipment, so we define a new set of building energy consumption called buildings with renewable energy denoted by , thus we have:

= {1, , … , , … , }, ∀ ∈ (4.12)
Where:

< + + (4.13)
The renewable energy supply for each building ℎ, is denoted by ; this energy is used to fulfill the self-energy consumption in the same building. We suppose that the generated energy is stored used a domestic battery as Tesla wall battery [START_REF] Powerwall | The Tesla Home Battery[END_REF]; this battery can be charged by the energy discharged from EVs that perform the discharging process at home denoted by , so we have:

= -1 + + , ∀ ∈ (4.14) And, 0 ≤ -1 ≤ ≤ (4.15)
Where, and are respectively the charged level and the capacity of the wall battery at time interval . However, the wall battery cannot be necessary sufficient to provide the total energy needed to fulfill all power demands from building devices. In this regard, we have two cases as follows:

a) If > ∑ =1
, then devices of building use the stored energy in the wall battery. The charged level of the battery will be reduced at time interval + 1, also the requested energy from the micro grid denoted by is null, so we have:

+1 = -∑ =1 (4.16) and, +1 ∑ =1 > ℎ (4.17)
= (4.18) b) If < ∑ =1
, in this case user devices of building can use the wall battery if only it's charged level is superior to the predetermined minimum threshold ℎ .

The condition in Equation (4.17) must be respected.

Therefore, the requested energy from the micro grid denoted for one building by +1 is not null and becomes:

+1 = ∑ +1 =1 - +1 4.19
Remark 2: Taking into consideration buildings characterized by a self-renewable energy generation, the total demands of all buildings inside the micro grid represented in Eq. ( 5) becomes:

= ∑ ∑ ℎ =1 + ∑ ∑ =1 + -′′ =1 ∑ ∑ =1 + ∑ ∑ =1 =1 -′′′ =1 4.
-′ ℎ=1 = ′ + ′′ + ′′′ (4.21)

Where < + + . ′ , ′′ and ′′′ are respectively the numbers of homes, buildings and industrials area networks that have a self-renewable energy generation.

Assumption 1: Buildings with self-renewable energy generation are equipped with smart meters that can switch between the wall battery and micro grid energy usage according to conditions presented in Equation (4.15) and Equation (4.17).

B. EVs discharging energy supply:

In our proposed model, we use new industrial innovations used by cars and battery companies such as the energy flow from EVs batteries to grid or so-called V2G, where EVs located at micro grid provide energy by discharging its

batteries. An EV can perform the charging and discharging process at buildings in order to charge the domestic battery as seen in Equation (4.14) or at public supply stations EVPSS in order to provide energy to micro grid storage system. Therefore, we consider the discharging energy of one electric vehicle 2 as follows:

= -

Where,

is the predetermined target discharging level of an 2 , ∀ 2 ∈ , and is the available energy state of charge of 2 at time interval . The total discharging energy from ′′ of 2 at public supply stations at time interval is given by: The total energy supply of one micro grid is given by:

2 = ∑ ′′ =1 , ∀ 2 ∈ , (4.23
= _ + + 2 + - (4.25)
Where 2 is the energy provided from discharging EVs batteries, and -is the energy received from another micro grid.

Real-time Pricing Optimization

Pricing Model based Demand-Supply Curve Balancing

In the proposed distributed dynamic pricing model, we aim to ensure the energy management by balancing the demand supply curve for each micro grid . Therefore, real-time price is subject to different constraints such as total supply, demand, and time.

Assumption 3:

We assume that the real-time price of a micro grid is not affected by the pricing policy of the other micro grids. Each micro grid has its unique price according to the local demand supply curve.

In order to characterize the demand-supply curve, we calculate the difference and the ratio between the total energy demand calculated in Equation (4.10) and the total energy supply calculated in Equation (4.25) for a particular micro grid , as follows:

= - (4.26) = (4.27)
Each micro grid evaluates its real time price depending on the real time difference and ratio presented in Equation (4.26) and Equation (4.24).

Theorem:

The dynamic real time price for consuming one unit of electricity is represented as follows:

= { tan -1 ( ) + tan -1 1 } + (4.28)
Where, is a fixed base price. In Eq. ( 28), the part between brackets is the dynamic portion that changes the price according to the variation in and .

Proof:

We know that lim Corollary: With an increase in the supply , the real time price decreases while demand from the customers is either fixed or decreased. On the other hand, the real-time price increases with an increase in the demand, while supply is either fixed or decreased. In this regard, we aim to vary the price value in a bounded interval in order to respect the conventional prices given by electrical companies, this is why we use exponential and arctangent functions.

Pricing Optimization based Fog Management

A. For micro grid services: The objective of micro grid is to maximize its own utility, depending on real time demand and supply. In this regard, we formulate the real time price optimization, decided by each micro grid controller, as a maximization problem as follows:

∑ ∈ Subject to ∑ ∈ ≤ ∑ ∈ (4.29)
Where, = + 2 Equation (4.29) shows that the total demand to a micro grid should always be less than or equal to the total supply for that micro grid. In the proposed model, is considered as the combination of grid self-generation energy (i.e., renewable and no renewable energy), the energy from other micro grids and EVs energy which discharge their batteries at time .

B. For buildings with renewable energy:

As seen earlier, buildings with renewable energy sources have the opportunity to supply local energy. Thus, their objective is to maximize the use of stored energy in the wall battery when the price is high and the demand supply curve is not stable, so we have:

∑ =1 Subject to = (4.30)
Where,

∑ =1 = - -1 66 -1 ∑ =1 > ℎ (4.31)
Equation (4.30) shows that the total demand from buildings with renewable energy sources to micro grid should be null when the demand supply curve of that micro grid is not stable at time , and the constraint in Equation (4.31) must be respected.

C. For EVs charging and discharging service: Based on the proposed network architecture (see Figure 4.1), we assume that EVs can communicate with their micro grid fog platforms, in order to collect information about EVPSS state, price, etc., In our model, we assume that each EV creates own profile. The EV profile is represented as follows:

[ , , , , , , , ]
An EV may create several calendars to express several charging/discharging requests. We believe that the storage capacity inside the fog can be very beneficial, especially when the number of users increases. The EV calendars are scheduled inside the fog server for each micro grid ; then, the suitable calendar, in terms of price and scheduled time, will be sent to all EVs.

We consider two types of pricing optimizations for EVs users in the micro grid ; the sale price for charging , and the buying price for discharging . These prices are calculated as in Equation (4.28), but the base price for charging is not equal to the base price for discharging, and it is decided according to different constraints like production cost, so we have:

= { tan -1 ( ) + tan -1 1 } + 2 (4.32) = { tan -1 ( ) + tan -1 1 } + 2 (4.33)
As we can see in Equation (4.9) and Equation (4.23), EVs contribute on the supply-demand curve. In the one hand, EVs users aim to consume more energy when the sale price is low and discharge more energy when the buying price is high. Thus, the micro grid controller looks for maximizing the gain as in Equation (4.29) and this by supporting more EVs that need to be charged by selecting charging calendars when the demand supply curve is stable (i.e., ≤ , and minimizing the number of EVs requiring the discharging, at the same time slot interval. On the second hand, when the demand-supply curve is not-stable (i.e., >

, users prefer to discharge their EVs because the buying price is automatically high, and the micro grid wants to maximize the number of discharging EVs by selecting discharging calendars in order to keep the demand-supply curve more stable. Our proposed model uses EVs charging and discharging calendars in order to predict the demand supply energy curve.

In this regard, we define our linear optimization problems for EVs charging and discharging process in different situations; a) the demand-supply curve is stable, and b) when they are notstable, as follows:

a) If the supply demand curve is stable, ≤ :

∑ ′ =1
Where, Where, ℎ is the predetermined minimum threshold that cannot be surpassed. We use this constraint to save the reserved energy in EV battery for an emergency usage.

=

Optimization Decision Algorithms for Energy Management

In this section, we define the utility for micro grid energy management with the consumed energy from buildings and EVs, supply energy from renewable sources and discharging EVs batteries and real time price. We discuss the decision making process for building energy

Algorithm for Buildings with Renewable Energy Sources

Algorithm 1 shows the energy management inside buildings, and the switching process of energy usage between micro grid energy and the wall battery energy. The algorithm is executed inside the smart meter. The time complexity of the algorithm is Select discharging calendars = ℎ ;

5.

Calculate utility function for discharging; 6.

Calculate the total cost to discharge; 7.

Choose the optimal cost to maximize the utility; 8.

Requests EVs to discharge their battery; 9. else 10.

Select charging calendars = ℎ ;

11.

Calculate utility function for charging; 12.

Calculate the total cost to charge; 13.

Choose the optimal cost, to maximize the utility; 14.

Requests EVs to charge their battery; 15. end 16.

Update the energy supply ; 17.

Update the energy demand ; 18.

Calculate prices; 19.

Broadcast optimal calendars and prices to EVs users; end

The proposed algorithm (i.e., EV_OCM) aims to solve the optimization problems in Equation (4.34) and Equation (4.35), by taking decisions according to the available energy, distance to the charging-discharging station, and real-time price. In this regards, we define the utility function of each EV depending on various parameters as follows:

, , , , , , (4.36)
Where, , , , , , and are the demand supply curve, price, calendar types (charging or discharging), distance to EVPSS, state of charge of battery, total cost to charge the battery and the available energy to join the EVPSS, respectively.

Therefore, the decision making process of EV charging and discharging calendars considers the global information presented in the utility function . We use a multi attribute decision making methodology to take the optimal decision, as explained below.

Let us consider micro grids in particular EVs vicinity. Then, the proposed decision matrix, which is based on several decision parameters, is represented as follows:

( 1 ⋯ 1 ⋯ 1 ⋯ 1 ⋯ 1 ⋯ ) (4.37)
Assumption 4: Due to the EVs mobility, an EV can charge and discharge its battery in any micro grid m, even if its calendar is not saved in the according micro grid fog. In this regard, communications between micro grids fog servers are authorized in order to ensure the roaming of EVs.

So, the decision instruction ѱ ⍵ with full information can be written as:

ѱ ⍵ = ⍵, (4.38)
Where, is the selected micro grid from which charge or discharge energy, ∈ and ∈ , and ⍵ is the set of full information parameters, i.e.,

⍵ = { , , , , } (4.39)
We show in Algorithm 2 (i.e., EV_OCM), an optimal management of charging and discharging calendars based on the decision matrix represented in Equation (4.37). The algorithm is decentralized and executed inside each micro grid fog controller. The time complexity of the algorithm is ; where is the number of .

Algorithm for Micro Grid Energy Management

The objective of each micro grid m is to maintain the stability of the demand supply curve, and determine a real time price of energy. Remove m from list of non-stable micro grids; 13.

Add m to list of stable micro grids; 14. end 15.

until list of non -stable micro grids = null ; 16.

Calculate prices 17.

Broadcast list of stable micro grids; 18.

Broadcast list of non-stable micro grids; 19.

Broadcast real time prices of each micro grid; end

Performance Evaluation

Simulation Settings

We implement extensive simulations to evaluate the performance of the proposed dynamic pricing model based on a decentralized Cloud-SDN architecture. We use SUMO to implement EVs mobility and MATLAB Simulink to execute the proposed energy management algorithms.

We consider a real electric load in the city of Toronto, divided into 05 micro grids and managed using smart grid controller. We examine the energy load (i.e., EV charging and discharging, renewable energy supply, building consumption) during a day (24 h) starting from 12:00 AM.

The day is evenly divided into 288 intervals. Each interval has a length of 5 minutes (min). For EVs mobility modeling, we consider a scenario of 10 roads that allow access to a city having Where 2 2 , and denote the real time prices obtained using D2P, D2R, UDP and QFC pricing policy, respectively.

Results and Comparison with Exiting Works

In order to keep our simulation scenarios more realistic, we use a real load consumption, To evaluate the impact of the proposed dynamic pricing policy, we compare the price over different micro grids situations in Figure 4.3(a). For micro grid 1, the curve is not stable; we can observe different energy peaks during a day, consequently the price is varied according to the variations in the energy load. For micro grid 3, we have two peaks, mid-peak period [12:00 pm to 14:00 pm] and evening-peak period [17:00 pm to 20:00 pm]. We can see that the price is QFC and static pricing policy from Ontario Energy Board [START_REF]Ontario Energy Board, Time-of-use (TOU) Prices[END_REF].

In simulation, we assume that each micro grid calculates the real time price every 3 seconds interval. We can see that with the implementation of DP-DEM, the cost to consume energy is less than that with the other pricing policies; the proposed distributed pricing policy gives better result than the centralized one. In the proposed scenario, we see that a reasonable pricing policy, using the proposed pricing equations, is also maintained compared with D2R price policy for example.

Figure 4.4, shows the charge that is held at 10 house batteries (we selected 10 house of a no stable micro grid). We run simulations using Renewable Building Energy Management (RB_EM) algorithm. We can observe that the charge energy in house batteries' (represented by the green plot) decrease during morning peak hours and evening peak hours, this is due because the total demand supply curve is not stable so, and according to our proposed pricing policy the price of one unit of energy increase, as results house devices use the house battery energy.

However, we can see that from 12:30 pm and from 20:30 pm the charge level of the house batteries increases, this is because the demand supply curve is stable so the price decrease, so the proposed scheme make profit of this situation and start charging the house batteries.

In order to specify why it is useful to use Cloud-SDN architecture in the smart grid environment, we present in Figure 4.5 the implementation of decentralized Fog-SDN architecture for micro grids, where we use response time as a performance metric (This is the time it takes for the first response to come after processing of a dataset). We implement two scenarios as follows: i) Centralized standard scenario without using SDN technology. ii) Decentralized scenario using Fog-SDN technology.

For all simulation tests, the topology shown in Figure 4.1 was used where a finite number (1000) of EVs submit their requests for charging. We have 03 data centers (i.e., each micro grid has its data center); the data centers contain different scheduling servers (i.e., represented as virtual machines VMs with 2 GO capacity in our simulation parameters). In order to evaluate to effectiveness of the proposed scheduling scheme based on a decentralized Fog-SDN architecture, we evaluate the proposed architecture using ns-2. Figure 4.5 shows the response time of end users (EVs requests) waiting for scheduling charging/discharging demands from the grid. When the number of EVs requests is increased, the proposed Fog-SDN approach yields a lower response time compared to the approach making use of the traditional centralized core is used, services need to be accessed far away from remote sites that reduce the overload on the core. In the proposed decentralized scheme, the services are immediately available from the fog computing resources, thereby minimizing the response time.

The performances of our proposed algorithms (i.e., DP-DEM, EV-OCM and RB-EM) are shown in Figure 4.6. In Figure 4.6(a), we evaluate the execution of the optimal EVs calendars management algorithm during peak hours. We can observe that the number of discharging EVs is higher than the charging EVs; this is because the demand supply curve is not stable and the EV-OCM selects discharging calendars in order to maximize the utility function for discharging by choosing the optimal cost. Also, the price in that period is high and EVs users profit to maximize their gain by discharging the EV battery. In Figure 4.6(c), we evaluate the price variation during a day, and compare the DP-DEM scheduling policy with the D2P scheduling. First, we can see that our price is less than that of D2P price during all the day including peak hours and non-peak hours. Second, we see that with the proposed DP-DEM, we have two peaks during a day at 02:00 pm (mid-peak hours) and at 08:00 pm (evening peak hours); however, the price is reduced from (11.4 cents) to (10.05 cents)

when the DP-DEM send notifications to all micro grids controllers located at the data centers to execute the EV-OCM algorithm (at 02:00 pm). Thus, the utility for discharging EVs is maximized as seen in and decides when sending notifications to each micro grid to execute EV-OCM, in order to maximize the EV charging and discharging utility and minimize the cost. Finally, we evaluate in Figure 4.7(c) the demand supply curve state during a day over the proposed scheduling. We can observe a significant stabilization of the demand supply curve compared to the standard case; an important energy saving (600 kWh) is obtained during evening peak hours. Thus, our proposed model is capable to regulate the total demand curve.

Chapter Summary

In this chapter, we proposed a distributed dynamic pricing model for EVs charging and discharging scheduling and building energy management in smart grid, which considers realtime and energy demand constraints. The model is based on a decentralized cloud-SDN communication architecture. We used a linear optimization approach to achieve the price decision process, maintain the demand-supply curve stable, and insure more grid efficiency.

Also, we use a multi attribute decision making methodology to take optimal decisions aiming to maximize the utility for smart grid users. We solved the optimization problems using two distributed algorithms; one for EV charging and discharging calendar, and the second for managing building renewable energy. We implemented a centralized algorithm in order to manage all micro grids. Our algorithms aim to ensure the balance between the charging and discharging requests of EVs and balancing energy usage between grid energy and renewable energy. We used dynamic pricing equations to incite users to consume their energy when the price is optimal for the smart grid and for users. As proved in simulations and comparisons with four other works, using real electric load in the city of Toronto, the proposed decentralized architecture can be useful for smart grid applications. Furthermore, the proposed pricing policy can also improve the grid stability, especially in peak hours.

3)

To define the states of our embedded Markov chain, we use a range-based sifting policy.

Where, the operation center predicts the range of electricity consumption according to historical power data, load of appliances and users profile. To classify each smart meter into the appropriate state, we use several thresholds; the thresholds can be updated periodically according to the user's energy profile.

4)

We propose three algorithms to analyze the intrusions behaviors. First, for each state, we define: suspicious behavior control algorithm (SuspBehCon) for detecting suspicious smart meter, malicious behavior control algorithm (MalBehCon) for detecting malicious smart meter, and observation control algorithm (ObsCon) for smart meter placed under observation.

The remainder of this chapter is organized as follows. In Section 5.2, we describe the proposed HD-IDS architecture. Section 5.3 presents the stochastic modeling of false data injections. Section 5.4 presents the intrusion behaviors analysis algorithms. The performance evaluation of the proposed HD-IDS solution is discussed in Section 5.5. Finally, Section 5.6 concludes the paper.

HD-IDS Fog-Based Smart Metering

The proposed distributed fog architecture for smart grid electricity consumption metering has three layers as follows (Figure 5.1):

1) Cloud layer: It includes a centralized operation center. This latter interacts directly with the smart grid central operation center. 2) Fog layer: As seen in Figure 5.1, for each micro grid, we associate a decentralized fog data center. This latter contains different servers (e.g., database server, management server, application server); each server provides various services for customers. In addition, a data center can communicate with the micro grid control center in order to update and deliver real-time information to the company utilities (for instance about prices and real-time energy consumption). 3) AMI layer: The AMI layer for one fog (i.e., micro grid) contains different smart grid users' types (e.g., households, community residents, factories, electric vehicles …). The daily energy consumption measurements from all these users are counted periodically using smart meters according to a predefined time slots defined by the fog operation center. At the beginning of each slot, each smart meter submits real-time measurements of electricity consumption to the home gateway (i.e., HGW) via a local area network using wireless communication technologies (e.g., ZigBee which is relatively low in power usage, data rate, and cost implementation). Next, each home gateway sends the metering result (as a report) to the residential gateway (i.e., RGW) via residential area network (see Fig.

Stochastic Modeling of False Data Metering Detection

To address the aforementioned problems and enhance the AMI system architecture, we propose a stochastic modeling based on Semi-Markov processes to study the behavior of each smart meter.

Range-based measurements sifting policy

As seen earlier, we have three detection levels according to the proposed architecture; the input data into each IDS is the measurements of electricity consumption counted by each smart meter. We aim to study the behavior of each smart meter, and then classify it into five classes as shown in Figure 5.2 authentic, suspicious-min, malicious-min, suspicious-max, and malicious-max. The main idea of this process is to introduce five ranges with four thresholds , , , and as shown in Figure 5.3; and then, we can identify the class of each smart meter measurement. The thresholds values are determined and retrieved from the historical energy profile of each user. In our work, the thresholds are determined from real households' energy consumption datasets from the U.S. electricity system operating data [START_REF]Electric System Operating Data[END_REF].

Thus, we analyze the daily energy consumption of 1000 households in California during winter period (i.e., November 1 -April 30) including weekdays, weekends and statutory holidays.

Stochastic Modeling of Smart Meters' Behavior

The tracking of data metering behaviors of smart meter can alleviate the uncertainty caused by false data injections attacks. Therefore, we propose in this section a stochastic model to identify the stationary state of smart meter based on its previous evolution. We use the rangebased measurements sifting policy defined in the previous sub-section to represent the space of possible states of each smart meter. We assume that we have, for each smart meter, seven states according to the reported measurement at a reporting time denoted by where is the identifier of the smart meter. The states are listed as follows:

 Authentic state (i.e., A): the smart meters having a measurement between and , ( ≤ ≤ .

 Suspicious_max state (i.e., : the smart meters having a measurement between and , ( < ≤ .

 Suspicious_min state (i.e., : the smart meters having a measurement between and , ( < ≤ . In order to explain the different states transitions and behaviors, we present in Figure 5.3 a state transition diagram of smart meter with the predefined seven states. As shown in Figure 5.3, the state space is given by = { , , , , , , }

From Figure 5.3, it is easy to verify that the chain is irreducible and aperiodic with a semi-Markov process.

Let , be the state of a smart meter , and be the state of the smart meters of one residential area at a reporting time . We give the stochastic process modeling of a smart meters of a residential area as follows:

= ⋃ , =1 .
Where is the number of smart meters in the residential area network. The evolution of the network is represented by a Semi-Markov process, where, the process ( , is memoryless (i.e., the present, the past and the future are independent for all smart meters ). In our case study, the memoryless property of the Markov chain means that the state of a smart meter at future time + relies on the smart meter state at the current time , and does not depend on the state at earlier time instance -.

Semi-Markov Process-based Embedded Markov Chain

In this subsection, we consider a generalization of our proposed Markov chain, termed Semi-Markov process. In such process, we augment its specification by including a state holding time parameter.

Thus, our main interest is to define the holding time of a smart meter at each state. The holding time of state , denoted by is the amount of time that passes before making a state transition from . The value of depends on the next state transition. Thus, let , be the holding time of state given that the next state transition is the state . According to the law of total probability, we have

= ∑ , , ∞ = .
Where , is an indicator random variable that equals 1 with the probability , . As we know, Markov chains have state holding times that are equal to a unit time (i.e., a step) and that are independent of the next state transition (i.e., = , = 1 . However, in Semi-Markov process, holding times do not have to be one-time unit nor do they have to be independent of the next state transition. A Semi-Markov process operates in the following way:

 After entering state , the process randomly selects its next state according to a probability transition matrix.

 Given that state is selected, the time spent in state before jumping to state is given by random variable , .

A Semi-Markov process selects its next state and then selects a value for its holding time.

On the other hand, the sample paths for Semi-Markov processes are timed sequences of state transitions. Where, we can write a sample path by a sequence of pairs as follows:

, , 1 , 1 , 2 , 2 , … , ( -1, -1 ), , , …

This formulation denotes a sample path where the process is in state over the time period , +1 . However, if we view the process only at the times of state transition then the sample paths are identical to Markov chain, with transition Matrix that have entries as follows:

, = { , = , 1 -; , ≠ ⁄ .
Now, our main interest is to define the stationary probabilities of the embedded Markov chain.

Let be the stationary probability of our embedded chain then, = ∑ , ≠ .7

the probability that, at the embedded points, the process is found in state . We give the following proposition.

The state holding time is independent of , and is geometrically distributed with an average given by

[ ] = 1 1 -, , = , 1, … .
Proposition 1: the probability of finding the Semi-Markov process of smart meter in state at a randomly selected time is not given by .

Proof: to proof Proposition 1, we use a counterexample, supposing that the holding time of state is extremely large with respect to the holding times of other states. Formerly, with a high probability, a random point in time finds the process in state regardless of the value of .

Thus, we should define the stationary distribution of the Semi-Markov chain process with the embedded chain. Let denotes the stationary probability of the Semi-Markov chain. It is clear that the value of depends on the stationary probabilities of the embedded chain as well as on the holding time of each state.

Theorem 1: let us consider a Semi-Markov process of a smart meter with state holding time H i and the embedded state transition probabilities . We assume that the embedded Markov chain is positive recurrent and that π i e are its stationary probabilities. The stationary distribution of smart meter Semi-Markov process is proportional to the product π i e [H i ] and it is given by

= [ ] ∑ [ ] ∞ =
.9

Proof: to proof Theorem 1, it is sufficient to show that the portion of time spent in state is given by . For this, let be the portion of time spent in state over the first steps of the embedded chain process and let be the number of times that state is visited during these steps. For = 1, , , …, let be the random variable that denotes the length of time the process spends in its ℎ visit to state . From these definitions we have

= ∑ =1 ∑ ∑ =1 ∞ = .1
As shown earlier, our Markov chain is positive recurrent, so → ∞ as → ∞, and the strong law of large numbers implies that

∑ → ], → ∞ .11 =1
From the Markov chain property, we can see successive visits to state as a renewal sequence (i.e., in our case study, successive visits to state A (authentic state) represent a renewal sequence). Thus, the expected number of steps between visits is given by

1 ∑ , ∞ =1 = .1
On the other hand, and according to the properties of the recurrent states renewal process of Markov chains, if is recurrent and if ↔ then

→ → ∞ .1
Where,

= [ ∑ , ∞ =1 ] -1 = 1 ∑ , ∞ =1
.14

Finally, by substituting Equation (5.11), Equation (5.12), and Equation (5.14) into Equation (5.9), we obtain

= [ ] ∑ [ ] ∞ =
Therefore, theorem 1 is proved. Now, by combining the notion of a state holding in the description of semi-Markov process, we can study the operation of the embedded chain without self-loops.

Definition 1: a self-loop is a transition from a state immediately back to itself (with probability

, for state ).

Intrusion Behaviors Analysis Algorithms

In this section, we analyze the behavior of each smart meter measurements according to the proposed Markov chain. For this end, we propose several algorithms as follows:

Suspicious Behavior Control Algorithm

In this algorithm, we aim to control the behavior of smart meters placed in suspicious lists (i.e., suspicious_min , suspicious_max ). Thus, for each element (i.e., smart meter) of the both lists, we calculate the holding times and , and compare them respectively with the predefined thresholds denoted by ℎ and ℎ . If the thresholds are exceeded, we place the smart meter in the observation list, otherwise, the smart meter stays in the suspicious states waiting for the next measurement to efficiently analyze its behavior. On the other hand, we should report a valid measurement / to the micro grid. For this end, we suppose to calculate the average between the reported data (i.e., , )

and the historical data (calculated according to the pervious authentic measurement and user energy profile).

Malicious Behavior Control Algorithm

In this algorithm, we control the malicious behavior of smart meters, where we confirm the intrusion and place all smart meters in (the stop list) and then update the lists. Regarding the reported valid measurement, it is calculated using the last historical authentic measurement.

Observation Algorithm

We analyze in this algorithm the behavior of smart meters placed in the observation list (i.e., observation state). If the observation list is not empty, we calculate the holding time of each smart meter placed in the observation state, and define a holding time threshold ℎ for each smart meter. Note that the observation list contains both elements transited from suspicious_min and suspicious_max. Thus, for both type of elements while the thresholds are not exceeded, we compare the reported measurements with the historical ones based on the user energy profile. If the measurement is reasonable, we confirm it with the micro grid operation center, and place the concerned smart meter in the authentic list. Rationally, we should update the thresholds , , , according to the new energy profile of the user. However, if the measurement is not confirmed, while the holding time threshold is not exceeded, the smart meter stays in the observation state waiting for next measurements. Nevertheless, when the threshold time is exceeded, the smart meter is placed immediately in the stop list, and the historical measurements are reported to the micro grid operation center.

Simulation Scenarios and Metrics

In our simulations, we used MATLAB Simulink to implement the proposed mathematical model, and to evaluate the three proposed algorithms. We use NS3 to implement the proposed AMI architecture, and VMs to represent fog servers. Each VM contains a storage capacity to store the historical energy consumption data of each household located in the appropriate fog. The thresholds are calculated from real households' energy consumption datasets from the U.S. electricity system operating data [START_REF]Electric System Operating Data[END_REF]. We implement two fog topologies. In the first topology, we implement our securing solution (SecMetering). The second topology is the traditional smart grid environment without security functions (called Trad). Moreover, in order to compare the effectiveness of the implemented IDSs at different levels (i.e., HAN-IDS, RAN-IDS, and Fog-IDS), we implement several topologies: a topology only with HAN-IDSs, a topology only with RAN-IDSs, and a topology only with Fog-IDS.

We evaluate our solution over different metrics as follows:

 Intrusion detection rate: It is the detection rate of intrusions at each level of the hierarchy.  Price: It is the electricity price proposed in [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF].

 Time cost: It is the time needed to report a valid energy measurement to the micro grid operation center [START_REF] Yaghmaee Moghaddam | A Fog-Based Internet of Energy Architecture for Transactive Energy Management Systems[END_REF].

SecMetering performance evaluation

Figure 5.5 shows the performance evaluation of SecMetering. Figure 5.5(a) presents the number of attacks generated randomly at each reporting time slot (i.e., at each time slot of 10 minutes, smart meters' report measurements of electricity consumption) [START_REF] Yaghmaee Moghaddam | A Fog-Based Internet of Energy Architecture for Transactive Energy Management Systems[END_REF][START_REF] Tripathi | An Efficient Data Characterization and Reduction Scheme for Smart Metering Infrastructure[END_REF]. In order to efficiently evaluate the performance of our proposed HD-IDS implemented in SecMetering, we generate false data injection attacks at different levels of the hierarchy (i.e., HAN, RAN, and FAN). In Figure 5.6(b), we compare the intrusion detection rate of the four implemented topologies (HD-IDS, HAN-IDS, RAN-IDS, Fog-IDS). We can observe that HD-IDS topology outperforms other topologies in terms of detections rates. This is because our HD-IDS includes three detection levels (i.e., in the home area network, in the residential area network, and in the fog operation center), where false data injection attacks are detected efficiently at each network gateway. We compare in Figure 5.5(c) the computation time (time needed to detect an intrusion by our proposed algorithms) for each topology. We observe that HD-IDS topology outperforms other topologies by offering a smaller computation time (by around 50% for HAN-IDS, 40% for RAN-IDS, and 25% for Fog-IDS). This is because HD-IDS topology can detect intrusions in a parallel and hierarchical way. Now we evaluate the impact of false metering data injection on smart grid energy curve. In has proximately the same values as the topology without attacks (i.e., SecMetering without attacks). This is explained by the efficiency of the proposed intrusions behavior analysis algorithms, where each behavior is analyzed distinctly tacking into account both historical behavior and user energy profile. In addition, the algorithms report the authentic historical data to replace immediately the false data injected when the intrusion is detected. Figure 5.5(e)

shows the impact of false data metering injection on the smart rid energy curve (the difference between the energy demand and the energy supply). As we can observe, compared with the traditional architecture without any security protocol, SecMetering solution lets the curve more stable especially during evening peak hours. In Figure 5.5(f), we evaluate the impact of false measurement on electricity price; we use the dynamic pricing policy proposed in [START_REF] Zhang | Distributed Intrusion Detection System in a Multi-Layer Network Architecture of Smart Grids[END_REF], where the price is calculated on real time according to the energy demand-supply curve. We observe that false data metering can affect seriously the price during the day; however, SecMetering

Probabilistic Analysis Model of Fog Hierarchy

In this section, we formally prove the advantage of the hierarchical fog computing on improving the efficiency of cloud resource utilization when serving the peak load of IIoT.

Without loss of generality, we first develop an analytical model for a two tier hierarchical fog.

Then, the analysis results based on this two tier model are generalized to more complicated topology of the fog hierarchy.

As shown in Figure 6.2, a two tier fog hierarchy consists of servers in tier-1, and one server in tier-2. Let denotes the computational capacity of the -th tier-1 servers, and be the amount of received IIoT workload of the -th tier-1 servers; and are measured in units of CPU cycles. However, in tier-2 we have only one server which has a capacity of .

Probabilistic Model of Tier-1 Fog Hierarchy

We assume that 1 , … , , … , are independent and identically distributed random variables. We denote by ℙ ≤ the probability that the -th tier-1 server can successfully serve its received workload when is its computational capacity. The probability that all tier-1 servers can schedule their received requests from different IIoT devices and sensors is:

ℙ 1 ≤ 1 , 2 ≤ 2 , … , ≤ = ∏ ℙ ≤ =1 (6.1)
According to the capacity of each server, we consider two cases as follows: 1) If > , the workload amount denoted by will be offloaded on the tier-2 server (see Fig. 2). The offloaded amount of one server is given by: = -(6.2)

2) If ≤ , the offloaded workload is null (i.e. = ).

As results, we define the Cumulative Distribution Function (CDF) of the offloaded workloads as follows:

= ℙ ≤ = { ℙ ≤ + ℎ (6.3)

Probabilistic Model of Tier-2 Fog Hierarchy

For now, we calculate the probabilistic model for tier-2 server, systematically, the probabilistic model of tier-2 server is related to tier-1 servers. As shown in Figure 6.2, we define the total workload that the tier-2 server has revived from tier-1 servers as follows:

= ∑ =1 .4
To calculate the probability that one server in tier-2 can serve the received data from different tier-1 servers, we divide the tier-1 servers into two groups 1 and 2 where the group 1 includes servers from 1 to -1, and 2 has server (i.e., only one server).

1) We suppose that there is no workload offloaded by 2 , so all the workloads come from 1 , then the probability that tier-2 servers can handle their received workload is: Where, ℙ = = -1 .

ℙ = ℙ ∑ ≤ ℙ = -1 =1 .
2) Now, we suppose that there is a workload of amount ( > ) offloaded by 2 . The workloads offloaded by 1 cannot exceed -, because is the computational capacity of the tier-2 server. When is fixed, the probability that the tier-2 server can serve its offloaded workload is given as follows:

ℙ = ℙ ∑ ≤ -ℙ = .7 -1 =1
Then, when < < , this probability is:

ℙ = ∫ ℙ ∑ ≤ -ℙ ≤ .
-1 =1 + From (6.5), (6.6), (6.7) and (6.8), we define the formula of the Cumulative Distribution Function for tier-2 workload probabilistic model as follows:

Let = ℙ ≤ , and = ℙ ≤ , so we have:

= -1 + ∫ -1 - + . 9
Thus, = ℙ + ℙ (6.10) Equation (6.9) and Equation (6.10) show how to analytically derive the characteristics of ,

given the knowledge about workloads received by all tier-1 servers.

Analytic Comparison Model

From the above workload models, we further analyze the advantage of hierarchical fog on improving the efficiency of servers' resource utilization. As shown in Figure 2, the amount of capacity is provisioned to the tier-2 server. Similarly, when we provision the flat fog architecture using the same amount of capacity, will be provisioned to tier-1 servers. Moreover, we define the difference between flat (i.e., one tier) and hierarchical (i.e., multi-tier) architectures of fog servers' deployment.

To analyze the difference between flat and hierarchical designs of fog, we first have the following lemma: Theorem 1: For any computation capacities 1 * , 2 * ∈ [ , ], 1 * + 2 * = , we have:

ℙ 1 + 2 ≤ ℙ 1 ≤ 1 * ℙ 2 ≤ 2 *
.11

Proof: We use algebra of sets to proof this lemma. We define two sets of offloading workloads as follows:

{ 1 = { 1 , 2 | 1 + 2 ≤ } 2 = { 1 , 2 | 1 ≤ 1 * , 2 ≤ 2 * }
It is evident that for any element { 1 , 2 } ∈ 2 , we have also { 1 , 2 } ∈ 1 , so 2 ⊆ 1 , and then we have:

ℙ 1 + 2 ≤ ℙ 1 ≤ 1 * ℙ 2 ≤ 2 * (6.12)
Now, we generalize the concept for all fog servers. To this, end, we extend Theorem 1 to lemma 1 as follows:

Lemma 1: For any * ∈ [ , ] ∀ = 1, , … , and ∑ * =1

= we have:

ℙ ∑ ≤ =1 ∏ ℙ ≤ * =1 . 1
Proof: Lemma 1 can be proved recursively using Theorem 1:

ℙ (∑ ≤ =1 ) ℙ (∑ ≤ ∑ * -1 =1 -1 =1 ) ℙ ≤ * ℙ (∑ ≤ ∑ * -1 =1 -2 =1 ) ℙ -1 ≤ -1 * ℙ ≤ * ⋯ ∏ ℙ ≤ * =1 .14
From Lemma 1, we can deduct that when using a fixed amount of processing capacity, the hierarchical fog computing always has a higher chance to successfully schedule the workloads. , we have:

ℙ (∑ ≤ =1 ) ∏ ℙ ∑ ∈ ≤ * =1 .1
Equation (6.15) indicates that the efficiency of resource utilization in the 2-tier fog hierarchy will be maximized when there is only one tier-2 server. When = in Eq. ( 15), the number of tier-1 and tier-2 servers are the same; as results, the flat and hierarchical designs of fog computing will be equivalent to each other. Clearly, we can also extend the results for hierarchical fog computing with more than 2-tier by repeating the above analysis recursively.

For example, to construct a 3-tier fog hierarchy, we can simply use ∑ =1

as the workload of a tier-2 server.

Priority Queuing Model for Scheduling IIoT Data

As seen earlier, we consider a number of fog cells or data centers, where each data center contain servers deployed hierarchically. These servers handle the scheduling process and analysis data coming from different things installed inside the industrial factory. Incoming data, requests and information from different industrial things and sensors have different degrees of importance, e.g., emergency requests. The requests with high priority need to be scheduled and analyzed quickly.

We describe the queuing system with two priorities by making the following assumptions [START_REF] Prabhu | Fondations of Queuing Theory[END_REF]:

Assumption 1(The input): the interval times of data of each class are mutually independent and identically distributed random variables. Thus, the input consists of a superposition of two independent renewal processes corresponding to these classes. However, it must be noted that the total input of IIoT data regardless of their class is not in general a renewal process.

Assumption 2 (The service mechanism): there are s servers in each fog tier. The services times of scheduling requests from IIoT are mutually independent random variables. their distribution being the same for requests in the same class, but they are different from that of other classes.

Assumption 3 (Queue discipline): the two classes are numbered 0 for low priority and 1 for high priority. Thus, a request of class 1 is always served prior to a customer of class 0. Within each class, the queue discipline is first come, first served (FIFO) with pre-emptive discipline.

In the pre-emptive case, the request of class 0 (low priority) returns to the head of the queue of his class and waits until the newly arrived request of class 1 are served.

First, we describe the queuing system with two priorities [START_REF] Prabhu | Fondations of Queuing Theory[END_REF]. The workload parameters are defined as follows:

= 1 + (6.16) µ = µ 1 = µ (6.17 As a stochastic model, the queuing process theory is represented using Markov chains by incorporating information in the state description. We consider that each state in the Markov chain corresponds to the number of IIoT requests in the two queues, and the state transitions occur when a new IIoT requests arrives or an IIoT requests is served. We use the birth-death process as a stochastic model to describe the evolution of our system.

The model considers two cases: the first is when the number of waiting requests, denoted by , in the two queues is < , where is the number of servers in each fog tier; the overall completion rate is then µ. The second case is when the number of waiting requests is ;

this means that the entire servers are occupied, and the completion rate is µ.

We can obtain the general stationary distribution state using recursive demonstration to distinguish two cases according whether µ depends on or not, as follow:

 if < : = ∏ + 1 + 1 µ -1 = = ( + 1 µ ) 1 ! . 19
 if : = ∏ + 1 + 1 µ -1 = ∏ + 1 µ -1 = = ( + 1 µ ) 1 ! - .
The total probability condition is as follows:

= (∑ + ! -1 =1 + + ! 1 ! -) -1 . 1
Finally, from Eq. ( 19), ( 20) and ( 21) we define the mean waiting time (low ) and (high 1 )) as follows [START_REF] Prabhu | Fondations of Queuing Theory[END_REF]:

= µ + µ 1-1-- (6.22) 1 =
1-µ (6.23)

IIoT Data Assignment

In this section, we focus on determining which fog server's workloads are placed on to be scheduled. In addition, we define how much the computation capacity is provisioned to execute each request, so as to optimize the performance of executing all IIoT workloads and to take an optimal decision in a real time way to minimize the response delay.

Assignment Problem Formulation

We first study a scenario which considers only one server at each tier of the fog. Then, we aggregate the decisions of workload offloading at different tiers. We formulate the workload placement problem as a mixed nonlinear integer programming (MNIP) problem of fog tier which has only one server, considering integers variables to indicate the locations of things requests being placed and non-integer variables to indicate the capacity allocated to execute each request. We assume that there are computing tasks with amounts of computations { 1 , , … , }, the data size of program states { 1 , 2 , … , }, and servers at the fog layer with capacities { 1 , 2 , … , } (i.e., CPU cycles per second).

The MNIP problem is given as follows:

min = ∑ -1 + . + ( ,1 ) =1 . 4 Subject to ∑ ∊ = 1, = 1, , … ,
Where indicates the server where task is placed on, is the percentage of server 's computational capacity being allocated for task , and denotes the set of computing tasks placed at server . The rate -1 measures the communication delay of transmitting task states to server , which is determined by the network bandwidth allocated to . The rate .

measures the computational delay of task 's execution. Finally, ( ,1 ) measures the waiting time of task in each server's queue. (i.e., the waiting time is calculated in Equation (6.22) or Equation (6.23) according to the priority class of each task).

Theorem 2: To solve the MNIP problem in Equation ( 6.24), we first study the optimization problem when is known to each task . When each server is fixed, the optimization problem in Eq. ( 24) becomes a convex optimization problem.

Proof: According to [START_REF] Boyd | Convex optimization[END_REF], function in Equation (6.24) is strictly convex if its Hessian matrix H is positive definite for all the variables. So, we can prove that the Hessian matrix of function is a positive definite matrix. To do this, we use to substitute , thus in Equation (6.24) becomes a function of variables { 1 , 2 , … , }. For each pair of , , we have:

= { 1 2 -1 -, = ℎ (6.25)
According to [START_REF] Boyd | Convex optimization[END_REF], the Hessian matrix H = * of is symmetric and positive definite. Therefore, since the constraint in Eq. ( 24) is linear, the optimization problem in Equation (6.24) is a linear convex optimization problem.

107

From Theorem 2, we further extend the MNIP problem as follows:

When each is fixed, the optimal value of is as follows:

= ∑ [∑ -1 ∊ + ∑ √ ∊ 2 + ∑ ( ,1 ) ∊ ] =1 .
Hence, the corresponding optimal solution to the MNIP problem in Eq. ( 29) is:

* = √ ∑ √ ∊ (6.27)
Corollary 2: when the placement for each demand is fixed, the corresponding capacity provisioning problem for scheduling these demands is deterministic and can become a combinatorial optimization problem using the transformation lemma. Hence, for each possible assignment, we can solve the problem from theorem 2 and Equation (6.26).

Branch and Bound Approach to Design Workload Assignment Algorithm

To determine the optimal value of { } and based on the above problem formulation (i.e., Equation (6.26)), we develop in this subsection IIoT workload and data assignment algorithm.

As seen earlier, we have computing tasks and servers, so the time complexity to exhaustively search the solution space is . As we can see, the time complexity is very important. However, to further decrease the searching complexity and obtain the optimal solution space, we propose to use a branch and bound approach [START_REF] Bazin | A Branch-and-Bound Approach to Correspondence and Grouping Problems[END_REF], as shown in Figure 6.3.

In our work, the research space corresponds to the definition space of the optimal value of { }.

To this end, and without loss of generality, we assume that the IIoT workloads { 1 , 2 , … , } are successively determined to be assigned. The sub-problems of the workload assignment problem is denoted by . Based on this sub-problem definition, we have the following lemma:

Lemma 2: Let indicates the total delays for the sub-problems having been branched, the lower bound on the total delays for the remainingtasks is:

= + ∑ [ min 1≤ ≤ { + -1 + ( ,1 )}] .
=+1 Proof: In Equation (6.28), all the remaining tasks (tasks) are provisioned with 100% capacity of a server, consequently provides a lower bound on the total amount of delays for the remainingtasks.

Based on Lemma 2, the branching process is a depth-first search over subproblems placing subsets of workloads, with the ones of the smallest lower bounds being searched first. Each time when a leaf node in the search tree is reached, all other branches with larger values of lower bounds are pruned. The optimal solution will be found until all the leaf nodes have been either searched or pruned.

Example:

In order to explain more the branching process using BnB algorithm, we further illustrate an example in Figure 6.3. To this end, we define the values of each variable as follows:

the number of tasks = , the number of servers = , and the amounts of computations for each task is { 1 , 2 , } = { , , 4} where tasks 1 and 2 are high priority tasks while tasks 3 is a low priority one. The capacity of each server is { 1 , 2 } = {1, }, and the communication delays between tier-1 and tier-2 servers (e.g., the rate -1 ) for the three tasks are { , , }.

Finally, the waiting times in high and low priority queues of the two servers are:

{ 1 2 , 2 }
for server number one, and { 1 , } for server number two.

The number indicated by the side of each node represents the lower bound of this sub-problem computed and the number on each edge indicates the decision of workload placement. For example, when task 1 is placed on tier-1, the lower bound of total delay on node 2 is

{ 2 1 + 1 2 + 1 + 1 2 + 1 + 2 = 11.
, however, when it is placed on we further branch the next sub-problem until we reach a leave node being colored as green in Figure 6.3. Formerly, the leftmost and rightmost branches are automatically pruned because their lower bound is larger than 15.0. Therefore, the optimal solution of this example is { , 1, }, with the total delay of 15.0.

Aggregation of Optimization Results Over High Tiers

In order to ensure a global optimality of IIoT requests assignment, we aggregate the solutions over different high-tier servers. The idea is to allocate the computational capacity of high-tier fog server on demand, when it receives offloading requests from multiple low-tier servers.

Since there is one and only one optimal solution for a branch and bound searching process, the optimal allocation at a server that minimizes the cumulative delay of executing IIoT workloads is also unique.

The key challenge of aggregating the optimization results is how to allocate computational capacity of a higher-tier server to each branch of the fog hierarchy. To do this, let denotes the capacity allocation vector of a higher-tier server to its children; a direct solution is a numerical iteration. As in [START_REF] Bazin | A Branch-and-Bound Approach to Correspondence and Grouping Problems[END_REF], we adopt the Simulated Annealing Algorithm (SA) to find out the optimal allocation using numerical iterations. We describe SA in Algorithm 1. The idea is to generate a new iteration state from the previous state . is the simulated temperature; at the beginning, equals to and decreases at each iteration by a cooling parameter < < 1 .

Then, we calculate the difference of total delay, denoted as ∆, by solving the optimization problem in Equation (6.26). If ∆ < , is accepted; otherwise, we calculate the probability = -∆ to accept . The SA algorithm iterations terminate when = .

The simulated annealing algorithm is given as follows:

IIoT Offloading Algorithm Over k Tiers of Fog Hierarchy

Finally, we implement the offloading algorithm considering tiers in the fog hierarchy.

Where each tier servers have two workload queues (high priority queue and low priority queue).

When a task arrives from different factory devises to the first tier level, the server invokes functions _ _ or _ _ to put the workload into the appropriate queue according to its priority level.

If the queue is not empty and there is a spare computing capacity on the tier-k server, one task will be popped out from the queue and processed. Otherwise, if the tier-1 server is fully loaded, it will call & to check the availability of the -+ 1 server. Only after having received the reply from the -+ 1 server which invokes the & function and confirmed that the -+ 1 server has a spare computing capacity available and the optimal solution was founded, the -+ 1 server will aggregate the optimal solution based on Algorithm 1 (i.e., SA Algorithm), and allocate the computational capacity of -+ 1 . & from Tier-( + 1);

11.

& to Tier-servers;

12. Calculate optimal assignment using BnB; 13.

if (optimal solution founded in Tier-( + 1)) then 14.

Aggregate the optimal solution using SA Algorithm; 15.

Allocate the computational capacity of Tier-( + 1); Finally, -+ 1 receives the offloaded tasks from the lower tier servers which the _ _ function invokes and the tasks will be queued in the appropriate queue according to its priority levels. However, if the optimal solution was not founded, the branch and bound research is executed for higher tiers = + 1 until finding the optimal offloading solution with an optimal response delay for each task. The process of offloading tasks is presented in Algorithm 2 called IIoT_Off. Figure 6.4 illustrates an example execution, considering the implementation of two fog hierarchies with three servers, two of which are used as tier-1 servers and another is used as the tier-2 server.

System Performance Evaluation

In this section, we implement extensive simulations to evaluate the performance of the proposed fog architecture, and compare it (i.e., hierarchical architecture) with the flat fog architecture and relevant recent works [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF], [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]. We measure the proposed architecture performance using realistic industrial data from Bosch group case study presented in [START_REF] Lade | Manufacturing Analytics and Industrial Internet of Things[END_REF].

System Settings and Performance Metrics

We use multiple virtual machines VM as fog servers, and each VM has a CPU capacity of 1.45 GHz and 2GB RAM. We use NS-2 to implement our network topologies [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF]. In our experiments, industrial IoT tasks and datasets are received by 4 tier-1 fog servers. Our experiments are conducted over different settings of the hierarchical fog with different topologies and computational capacity being provisioned. Every two fog servers are connected via a 100Mbps network link. A total amount of 20 GHz computational capacity (in terms of the amount of CPU cycles per second) is provisioned. Each VM of the network topologies is running MATLAB to execute all the proposed algorithms. We evaluate the performance of each topology using the following metrics:

 Workload rate: The number of tasks, which indicates the workload rate, is determined every time following the same Poisson distribution.

 Provisioned capacity: The computational capacity provisioned to a fog server is measured by the number of computing threads running concurrently on the server.

 Waiting time: It is the waiting time at each priority queue.

 End-to-end delay: This is the time it takes for the first response to come after processing of IIoT dataset.

 Completion time: It indicates the amount of computational capacity being provided by fog servers.

 Synchronization Time: The time interval between the time point that the IIoT devices get the readings and that of the fog servers receive these readings.

Experiment Results

In order to study the performance of the proposed fog architecture, we conduct simulations experiments over the three topologies of fog architecture, i.e., 3-tiers fog hierarchy, 2-tiers fog hierarchy and flat architecture. First, we evaluate the completion time performance of each topology by fixing the provisioned capacity and change the workload rate from 1 to 5 tasks per 10 seconds. The results are shown in Figure 6.5. As we observe in Figure 6.5(a), when the provisioned capacity is 2, there is large difference between the performance of flat and hierarchical designs (e.g., 3-tier fog hierarchy and 2-tiers fog hierarchy); the 3-tiers hierarchy performs better and gives an optimal completion time. Rationally, when the provisioned capacity is 4, the completion time is more optimal as we can see in Figure 6.5(b). The major reason for this difference is that the tier-3 server is able to efficiently aggregate the peak loads from all tier-2 servers, and tier-2 servers are able to efficiently offload the IIoT peak loads from tier-1 servers. Hence, each hierarchical tier (e.g., 3-tiers and 2-tiers) utilizes the provisioned capacity to process the tasks at a much higher efficiency by executing the proposed IIoT Offloading Algorithm (IIoT_Off). Now, we evaluate the proposed priority queuing mechanism implemented over each tier server. To do this, we examine the waiting time at each queue; the results are shown in Figure 6.6 over 3-tier hierarchy topology. Figure 6.6(a) shows the comparison of waiting time at high priority queue (i.e., dedicated for high priority tasks) over the three tier servers of the fog > (i.e., the sum of queued workloads computation becomes superior to the capacity of each tier 1 server). As results, the next received workloads will be offloaded to tier 2 servers which leads to a decrease in the waiting time for tier 1 servers and an increase in the waiting time in tier 2 servers. In the same way, we can explain the increase/decrease relationship of waiting time between tier 2 servers and tier 3 servers. In this experimentation, we suppose that the time frames from 60 to 90 contain a high amount of IIoT computation tasks where 80% of them are high priority tasks and 20% are low priority ones. We can see an increase in the waiting time for both high and low priority tasks from frames 60 to 90. However, the waiting time for high priority workloads is more stable than for This is because there are around 80% of high priority tasks in this frames interval (i.e., 60 and 90), and the proposed queue discipline is pre-emptive (the low priority tasks returns to the head of the queue of its class and waits until the newly arrived high priority tasks is served). As results, from Figure 6.6 we can conclude that the proposed priority queuing mechanism helps the IIoT_Off algorithm to balance the high workloads over all tier servers in order to minimize the waiting time at each queue.

Now, we study why the end-to-end delay is an important parameter to consider in Industry 4.0 and smart factories based IoT. We propose a comparison study between each tier topology over various computation tasks (e.g., Figure 6.7(a)), different IIoT data size (e.g., Figure 6.7(b)), and several priority levels of tasks (e.g., Figure 6.7(c)). As shown in Figure 6.7(a), the 3-tier fog architecture can reduce the end-to-end delay by about 40% compared to that of the flat architecture. In addition, the 2-tier hierarchy reduction is around 20%, this is due to its incapability of aggregating enough peak loads from lower tiers. Indeed, the 3-tier fog hierarchy provides more computational capacity on the higher tiers servers and less capacity on the first tier, leading to a more iterative aggregation of devices demands. In Figure 6.7(b), we evaluate the end-to-end delay of the proposed architecture over different IIoT data sets sizes. As known, larger data sizes increase the communication delay for transmitting workloads to high tiers; however, our proposed scheduling scheme can still optimize the offloading of industrial things requests by reducing the total delay by 30% with different data sizes. Mainly, the 3-tier fog hierarchy can also outperform other topologies, because of its efficient iterative aggregations of the peak loads using IIoT_Off algorithm. Figure 6.7(c) shows the average endto-end delay for high and low priority tasks. As explained earlier, the end-to-end delay for high priority requests is better than that of low priority requests; this is because the waiting in high priority queues is smaller compared to that in low priority ones (see Figure 6.6(b)). shown in the figure, with the increase in the number of interconnected industrial devices, the end-to-end delay increases for the two topologies, however it is smaller when we offload workloads over 4-tiers than over 2-tiers. This is mainly because the 4-tier fog hierarchy provides more computational capacity on the higher tiers servers and less capacity on the first and second tiers.

Finally, we study the impact of the SA algorithm cooling parameter () on the performance and time complexity in Figure 6.9. The experiment results are shown in Figure 6.9(a). Since a larger value of helps the SA algorithm process to converge, it further reduces the total delay of task completion time. On the other hand, when the value of is too small (< 0.6), the iterations may not be enough for the SA algorithm to converge, incurring higher delay of task completion. Figure 6.9(b) shows that the 3-tier fog has the lowest delay compared to other 2tier fog under different cooling parameters values, even though the result has not reached the convergent value. The reason is that although the cooling process accelerates, the 3-tier fog hierarchy can still aggregate more peak loads from lower tiers compared to the 2-tier hierarchy.

Comparison with exiting works

Now, we compare the proposed hierarchical fog computing and the scheduling approach of IIoT requests with two recent works (i.e., [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF] and [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]), based on three principal metrics (i.e., synchronization time, accuracy, computing time, and end-to-end delay). First, we consider the same simulation parameters used in each work. Then, we adjust our simulation scenario with the same parameters and we run simulations. Figure 6.10 illustrates the performance of the proposed hierarchical fog architecture compared with two schemes (i.e., fog-cloud scheduling scheme and cloud scheme) proposed in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] (see related work section). As in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF], in our proposed model, there is an interesting tradeoff between the data preprocessing time and data transmission time (due to the hierarchical deployment of the servers). We employ the synchronization time to measure the time efficiency of our model and compare it with the two schemes in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] (i.e., traditional scheme which uses only cloud computing, and the framework that uses edge servers and cloud). We can observe that our two schemes (3-tier fog and 2-tier fog) are much more time-efficient than the traditional scheme (only cloud [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]) and the edge framework scheme [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]. This is reasonable considering that multiple links between the fog servers' hierarchy are built in our architecture, while only one link is built in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] scheme which can provide an important overhead. Our proposed model ensures both offloading IIoT requests based on priority queuing discipline and optimal capacity allocation and aggregation over different fog tiers; this make it consumes very little time compared to [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF].

Finally, we compare in Figure 6.11 the performance of our proposed scheduling scheme (i.e., IIoT_Off algorithm) with a recent work [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF] (see related work section). In [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF], the authors design an efficient and simple content-aware data processing rule, in order to define how to As we can see in Figure 6.11(a), the priority-based analysis using IIoT_Off algorithm can achieve at least 6% on the analysis accuracy compared to content-aware method and more than 15% compared to the conventional one. The priority curve is remarkably stable during all time slots; this is due to the optimal offloading of IIoT requests over different fog tiers using the proposed queuing system at each server. Similarly, the computing time when using the proposed scheduling scheme is more optimal, reduced to 20 (ms) compared with the content analysis scheme, and to 30 (ms) compared with the packet analysis scheme. We observe also that the computing time curve of priority analysis is stable, and is decreased over highest time slots. We can explain this by the optimal resource allocation and workloads assignment over different fog tiers using the brand and branch method to solve the assignment problem in Equation (6.26). Figure 6.12 illustrates the performance of the proposed hierarchical fog architecture with two topologies (i.e., 3-tier hierarchy and 2-tier hierarchy) compared with two schemes (i.e., fogcloud scheduling scheme and cloud scheme) proposed in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] (see related work section). We aim to examine the average end-to-end delay over different amounts of IIoT traffic loads (we increase the number of tasks at each 10 seconds). As we can see in Figure 6.12, the two topologies of our proposed scheme (i.e., 3-tier, and 2-tier) outperforms the other schemes where the average end-to-end delay is stable between 0.5 and 0.7 second for 3-tier topology, and between 1.8 and 2.0 second for 2-tier topology. However, the average end-to-end delay increases significantly for fog-cloud scheme (it can reach 5 seconds) and cloud scheme (it can reach 8 seconds) when we increase the number of tasks. it is well-known that the end-to-end delay includes the computing time, the transmission time of each requests, and the synchronization time (in the case of offloading of requests). As we have seen earlier, our proposed scheme proposes an appropriate mechanism to allocate the computation capacities for each server located at different tiers of the fog hierarchy; however, the work in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] did not propose a mechanism to reduce the computing time. On the other hand, as we compared in Figure 6.10, our two schemes are much more time-efficient (in terms of synchronization time)

than the traditional scheme (only cloud [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]) and the edge framework scheme [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF]. This is reasonable considering that multiple links between the fog servers' hierarchy are built in our architecture, while only one link is built in [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] scheme which can provide an important overhead, which may increase significantly the end-to-end delay.

Given these results from the comparison with relevant existing works, we find that the proposed scheduling scheme based on hierarchical fog servers' deployment and priority queuing outperforms the works [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF] and [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF] in terms of synchronization time (i.e., data transmission over different servers), computing time, processing accuracy, and average end-toend delay.

Performances when Servers' Crashes at Different Tiers of the Hierarchy:

Finally, we examine the performance of our scheme when one of servers at different tiers of the hierarchy crashes. For this end, we study the percentage of scheduled IIoT requests during a simulation time of 12 minutes. We implement the three topologies (3-tier, 2-tier, and flat fog), and we generate the same load of IIoT traffic for each topology. Indeed, we simulate two crashes of servers; the first is caused at a server at tier-1 of each topology at 3 min, and the second is at a server located at tier-2 of each topology. The results are shown in Fig. 13; we investigate the results as follows:

compared to the conventional industrial system and two relevant recent works are proved over different performance metrics and through extensive simulations using realistic industrial data from Bosch group.

CHAPTER 7 5G SLICING BASED ON SDN HIERARCHICAL VEHICULAR FOG

Several novel and promising wireless vehicular network applications have been developed

lately. Examples include trip planning, media sharing and Internet access. However, sufficient network resources (e.g., equipped vehicles, base stations (BS), Road Side Units (RSUs) and other infrastructure) to support these applications are not yet available or are deployed at a slow pace. Moreover, these applications require considerable efforts in information gathering and data processing to allow quick decision-making and fast feedback to all users. This imposes significant challenges on the development of an efficient wireless vehicular communication platform.

On the other hand, 5G networks are anticipated to support a plethora of innovative and promising network services. These services have heterogeneous performance requirements (e.g., high-rate traffic, low latency and high reliability). To meet them, 5G networks are entailed to endorse flexibility that can be fulfilled through the deployment of new emerging technologies, mainly Software-Defined Networking (SDN), Network Functions Virtualization (NFV) and Network Slicing.

In this chapter, we propose two vehicular architectures a follows:

1) A hierarchical SDN-based wireless vehicular fog architecture, called HSVF (i.e., Hierarchical SDN for Vehicular Fog architecture). HSVF is based on a hybrid SDN control plane that reinforces centralized and distributed management. The proposed SDN control plane includes a trajectory prediction module to mitigate the drawbacks of the frequent handover problem between RSUs and vehicles. The proposed architecture is then evaluated using a relevant case study that addresses the scheduling of electric vehicles (EVs) energy demands.

2) A distributed and scalable SDN core network architecture that support 5G slicing functions that maps autonomous driving functionalities into service slices, the proposed architecture is called SliceScal. SliceScal deploys fog, edge and cloud computing technologies and propose a network and service slicing system model that promotes a four-layer logical architecture to improve the transmission efficiency and satisfy the low latency constraint. To address this problem, HSVF deploys a distributed control plane over different fog cells, each of which is composed of vehicles, RSUs and LTE base stations.

To support the functions of the control plane, SDN-F has four modules:

 Information gathering module: collects information from vehicles, RSUs and BSs as well as servers within the fog cell. This information is used to construct the vehicles' connectivity network model and to allocate frequency bands. In addition, this module generates control instructions based on the SDN-C directives and forwards them to the forward and control instructions module.

 Wireless vehicles network manager module: ensures the management of different wireless networks (i.e., WAVE, LTE and Wi-Fi).  Forward and control instructions module: based on the data received from the information gathering module, the forward and control instructions module generates control directives and forwards them to all devices in the fog cell.

 Management links status module: manages the links status communications (V2V, V2I, and I2I. It is responsible for maintaining service continuity while considering network topological changes.

Control plane of SDN-C: SDN-C is responsible for constructing the global network connectivity by aggregating information received from all SDN-Fs and generating control information based on rules and strategies from the application plane. SDN-C has four modules:

 Information gathering module: collects topological information from each SDN-F to maintain the network's global topology and controls cooperation within each fog cell (e.g., data offloading, vehicles mobility management and data migration).

 Wired fog cells network manager module: manages the wired network connecting fog cells data centers (i.e., servers). It is responsible for routing the data and analyzing the network topology of each fog data center.

 Hierarchy of fog servers control module: controls the hierarchy deployment of fog servers and draws the global information of all fog cells based on the data information received from SDN-Fs data plane; it then generates the control information of offloading demands over different tiers of the hierarchy.

 NFVM computing capacity allocation module: uses NFVM to allocate sufficient computational resources for each server in the fog tiers. The NFVM creates and configures different VMs according to the quantity of data offloaded from each server. This module provides good computation opportunities for scheduling different requests in a timely manner.

Communication interfaces:

The control and data planes in HSVF communicate with each other via an integrated interface (i.e., southbound application programming interface, South-API), which includes some predefined control and statement messages. This technique maintains the data transmission and control instructions to be used when the central SDN-C controller is not accessible. In addition, by distributing the control over different fog cells, HSVF aims to reduce network congestion and message control overhead. Indeed, SDN-Fs are the key component of HSVF. Each fog cell can have one, two or three layers' hierarchy of servers, as illustrated in Figure 1. These servers report periodically the network state (e.g., overhead, flow table changes) and the state of the scheduling requests (e.g., the quantity of offloading workloads, the capacity allocated) to their respective SDN-F. This later aggregates the information and generates the control instructions based on the SDN-C control directives.

Case Study: Scheduling of Electric Vehicles Energy Demands

EV fleets are expected to grow considerably as the EV technology is being adopted for public transportation in many countries to reduce CO2 emissions. With the development of high energy and power density batteries, EV market penetration is expected to flourish. Therefore, in this case study, we focus on scheduling EV charging and discharging demands using HSVF.

As EVs become more popular, numerous charging/discharging public stations (EVPSS) are made available at many public areas. However, this situation raises multiple concerns. One of the most challenging issues is how to adequately manage all EV demands considering EVPSS states in different grid situations. To address this problem, several questions are to be answered, including: how difficult will it be for an EV driver to find a public charging station when away from home? Can the charging demands be scheduled in real-time? Can the communication architecture support the mobility of EVs by collecting information, maintaining vehicles connectivity and ensuring reliability? Designing an optimal scheduling of charging-discharging for EVs using an adequate communication architecture is the answer to all these questions.

Planning of EVs Demands Using Calendars Policy

We adopt the main idea proposed in our previous work (i.e., [START_REF] Chekired | Smart Grid Solution for Charging and Discharging Services Based on Cloud Computing Scheduling[END_REF], [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF]) where EV users may create several calendars to express several charging-discharging requests. While the scheduling of calendars in [START_REF] Chekired | Smart Grid Solution for Charging and Discharging Services Based on Cloud Computing Scheduling[END_REF] is done using a centralized cloud computing architecture without the use of SDN, [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF] proposes a decentralized scheduling using Fog architecture with a single SDN controller that manages only the wired network (i.e., the network that connects servers of each Fog). Unlike [START_REF] Chekired | Smart Grid Solution for Charging and Discharging Services Based on Cloud Computing Scheduling[END_REF] and [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF], HSVF proposes a novel hierarchical control plane for wireless vehicular network. In order to organize the demands of users based on the storage capacity of Fog data centers, users may create numerous calendars to express several charging-discharging requests.

The calendars are scheduled by the appropriate Fog data center based on vehicles location. The optimal calendar is then selected for each vehicle considering parameters like waiting time to plug-in, price at time , distance to EVPSS and demand-supply energy curve.

Provisioning Computational Capacity in HSVF

The main goals of the case study are: 1) scheduling all EV demands in real time; 2) reducing the response time of scheduling all calendars; and 3) reducing the transmission delay of data (i.e., calendars, EVPSS state, traffic statistics) from vehicles-to-servers and from servers-tovehicles. We implemented the SDN-F controller in a tier-3 server in order to centralize the control of Fog cell servers in one server. Also, all Fog servers (tier-1, tier-2, and tier-3) in HSVF are in charge of scheduling EV calendars using VMs. To this end, as shown in Figures 2, the three-tier hierarchical Fog-SDN architecture of one cell consists of servers in tier-1, -1 servers in tier-2, and one server in tier-3. This latter represents the SDN-F controller. is the computational capacity while is the amount of received EVs calendars of tier-i servers.

Optimal offloading process based on SDN-F controller

As shown in Figure 7.2, the offloading process is related to the capacity of tier-1 servers to handle EV requests. In case they cannot, some tasks will be offloaded to the higher tiers of the hierarchy. Figure 7.2 depicts the offloading process along with the synchronization between scheduling EV requests (selecting the optimal calendars) and the SDN-F controller (i.e., allocating the computing capacity for the offloading and updating flow tables).

7.3 SliceScal: 5G-Slicing-Enabled Distributed Scalable SDN Architecture

Features of 5G-Enabled SDN Architecture

Reliable and ultra-low latency of autonomous driving service functions and requests over wireless networks alone is not sufficient to guarantee the required end-to-end reliability. The core network has also to be considered for service slice management to support these requirements. Indeed, both autonomous driving and best-effort traffics will have to travel through a complex network while competing for resources during transmission, buffering, and computing. In order meet the desired requirements of autonomous driving systems, traffic generated by autonomous vehicles has to be properly marked, identified, and prioritized at all the network elements (both wireless and core network). In Addition, a central cloud orchestrator generates a complete isolation between different flows and service slices, and applies the necessary forwarding rules to ensure that the QoS of autonomous driving is maintained throughout the network. In a network with multiple flows requiring different levels of QoS, a distributed SDN can allow dynamical control of their Key Performance Indicators (KPIs) based on the effective demands generated by each of these flows.

Core Network Design

The 5G core vehicular network architecture defined in this work considers a distributed scalable SDN, it uses a stable clustering technique based on the deployment of fog cells. This technique maintains the data transmission and control instructions to be used when the central cloud orchestrator is not accessible. In addition, by distributing the control over different fog cells, we can reduce network congestion and message-control overhead.

We use 3GPP's 5G system for our vehicular network [START_REF]System Architecture for the 5G System[END_REF]; however, we introduce it as part of the global architecture for NFV virtualization. In particular, all vehicular network functions are considered to be slices that can run over standard hardware. The slices may be moved across different locations subject to the requirements of the service providers. Using this architecture, our goal is to describe the role of softwarization and service slicing from the autonomousdrving perspective. This includes software-defined traffic routing decisions in the 5G radio access and defining SDN controllers' duties in the core network. In general, service slicing rules have to be enforced in the physical infrastructure to satisfy a satisfactory level of QoS for autonomous driving systems, starting from the selection of most suitable radio access nodes and up to managing traffic and service requests in the transport vehicular network.

We believe that autonomous drivingthe use of 5G slicing based on a distributed and scalable SDN core network is crucial for autonomous driving function services to ensure appropriate traffic isolation while guaranteeing ultra-low latency and reliability. denoted by assumed to be deployed randomly in the street. We denote by the length of one manually driven vehicle , its PDF is given by . The manually driven vehicles are traveling at a random speed that follows the PDF of .

The vehicles are positioned on lane following a Poisson process with intensity denoted by .

denotes the inter-vehicle distance in line , designates the PDF of . All vehicles are assumed to have a constant width given by and drive along the center of their lanes. microwave network (Wi-Fi). DSRC is used to provide V2V and V2F communications. Cellular mmWave base stations (BSs) are assumed to be deployed alternately on the left and the right sides of the buildings on a street at a constant height of ℎ with a distance of between one another. For microwave access, we assume that both LTE and Wi-Fi connectivity is always available via road side units (RSUs). Principally, the LTE network covers the entire city and maintains a constant SNR level via adequate power control. We also assume that there is always at least one Wi-Fi access point within the coverage area around the autonomous vehicle and we consider fixed-power transmissions, where the effective spectral efficiency is determined by true distance between the vehicles and the access point [START_REF] Galinina | 5G multi-RAT LTE-WiFi ultradense small cells: Performance dynamics, architecture, and trends[END_REF]. chose which wireless access network to use (i.e., LTE or Wi-Fi). Therefore, our SliceScal network architecture is always configured to grant high reliability and ultra-low latency for the requested data rates of autonomous driving service slice traffic even if it leads to declining the QoS of the best-effort for other vehicle (manually driven vehicles).

BSs Logical Layers for Function Slicing

To improve the transmission efficiency and satisfy the ultra-low latency constraint, the functions at BSs can be sliced and restricted to support the autonomous driving service slicing and resource slicing in future 5G vehicular networks. In this paper, the function slicing is realized by a new logical layers implemented at each BS. As we shown in Figure 7.4, the BS is consisted by four principal logical layers: control layer, resource management layer, virtualization layer and interface layer. This is to improve the efficiency of resource utilization in 5G slicing vehicular network.

2) Virtualization layer: the main function of the virtualization layer is to organize different autonomous driving service slices and optimize the handling process for prompt response from the service slices. In addition, the virtualization layer allocates resource blocks at the location of each BS to satisfy the requirements of critical autonomous driving service slices.

3) Resource management layer: manages the resource blocks at the location of BSs.

Originally, BSs resource blocks are allocated to a specific autonomous driving service slice.

Thus, when the BSs resource management layer cannot satisfy the location requirement of service slices, the virtualization layer can provide more resource blocks from the associated control layer by sharing unoccupied resource blocks from adjacent BSs. It is the resource management layer duty to allocate these shared blocks in order to meet the requirements of different service slices.

4)

Interface layer: provides the interface for different types of the predefined autonomous driving functions. The interface layer covers the human-machine interface (HMI) of the global system management service slice (GMSS). The main function of BS interface layer is to separate the BS resources with different types of autonomous driving service slices.

Based on the BS interface layer, the relationship of different types of autonomous driving service slices is declining by separating the resource requirements with the type of service slice.

HSVF Performance Evaluation

To verify the effectiveness of HSVF, we used NS-2 and SUMO to simulate our VANET.

We also used Mininet 2.1.0 with OpenFlow 1.3 for the SDN data plane, as it is more scalable and provides realistic environment for testing. We implemented a distributed controller based on POX. Briefly, POX catches link change event using Link Layer Discovery Protocol (LLDP) via OpenFlow. Discover module, and sends it to the path view module. This latter sends an event to all SDN-F controllers to inform them about the changes in the network topology. It also offloads EVs workload in order to compute the optimal path using parallel computing.

Once done, we get the optimal route and modify the flow tables in OpenFlow switches using Forwarding.12_multi module. Like NS-2, POX is implemented in C++. So, the messages between the SDN network and the EVs network can be synchronized.

To make the evaluation realistic, we ran the simulations using a map of a region of the city of Paris, France. The road topology was obtained using OpenStreetMap and was filtered, formatted, and converted into a SUMO network file. Using SUMO, vehicular mobility traces were generated and used to populate the chosen area. We also deployed some RSUs along with some LTE base stations within that region following a uniform distribution. We varied the average number of vehicles between 50 and 200 per kilometer. Each car is equipped with a DSRC transceiver to enable V2V and V2I communications.

During the simulation, each vehicle sends calendars as one packet using UDP protocol. We implement two hierarchical topologies (i.e., two tiers and three tiers) where we alter the number of servers at each tier between one and four according to the topology (Figure 7.2 represent an example of three tiers topology). Other simulation parameters are listed in Table 7.1.

We seek to evaluate two things: 1) the performance of HSVF when using SDN-F (HSVF-F);

and 2) the offloading process of EV calendars when using the hierarchical deployment of fog cell servers. We compare HSVF-F to HSVF-W 2) (HSVF without SDN implementation) and the flat architecture of Fog cells servers. This latter can be considered as a traditional architecture of Fog servers' deployment and consists of using one tier of Fog servers (i.e., the offloading process is not supported). of the workload rate. We observe that 3-tiers hierarchy outperforms 2-tier hierarchy in all the workload rates. This is 3-tiers hierarchy can efficiently offload the peak loads of calendars from lower tier servers to higher tier servers based on the offloading process depicted in Figure 3.

Delay Optimization Results

After selecting the optimal calendars for each EV, the SDN-F selects the optimal routes according to the EV trajectory prediction. Software-Defined VANET) [START_REF] Correia | An Architecture for Hierarchical Software-Defined Vehicular Networks[END_REF], in terms of average end-to-end delay and control overhead.

HSVF Comparison with Related Work

SliceScal Performance Evaluation

In this section, we present a simulation-based evaluation of the proposed system. We examine the effectiveness of SliceScal and the 5G slicing model for autonomous driving. We an evaluation platform using network simulator NS-3, vehicles traffic simulator Veins-SUMO, and OpenFlow SDN controller. We employ a realistic urban scenario that may serve as a representative setup for a variety of possible deployment configurations. The road topology was obtained from OpenStreetMap, filtered, formatted, and converted into a SUMO network file.

queues. We distinguish the critical autonomous driving traffic and the best-effort traffic using the destination IP address in the packets. The minimum (guaranteed) and maximum service rates need to be maintained in each of the queues to avoid disturbance from the best-effort traffic toward the critical autonomous driving traffic since the sum of both data flows represent the full capacity of the link.

Performance Results

To evaluate the average end-to-end delay, we make vehicles generate traffic at different data rates. Figure 7.6(a) illustrates the average end-to-end delay of over SlcieScal against a benchmark scheme that does not use the SDN approach. As vehicle's data traffic increases, we observe that SlcieScal outperforms the benchmark topology by (30% to 45%) in term of average end-to-end delay. We also evaluate the average end-to-end delay with repsect to generated traffic flows when scaling the SliceScal by using different number of distributed fog controllers (FCs) (i.e., One FC, two FC, three FC). an SDN controller, we endorse the load balancing capability. In fact, fog controllers are responsible for only managing the vehicles located in their corresponding geographical area.

In Figure 7.6(c), we compare the average end-to-end delay of autonomous driving traffic and best-effort traffic in the core network. We can observe that autonomous driving traffic incurs is shorter end-to-end delay compared to best-effort traffic. This is because FC maintains the priority of the critical autonomous driving flows with respect to other flows (e.g., best-effort traffic) by mapping them into a priority queue. Results presented in Figure 7.6 demonstrate that the SlcieScal core network is suitable for scheduling and transmitting critical traffic (i.e., autonomous driving traffic) especially when using 5G wireless network and service slicing.

Chapter Summary

In this Chapter, we propose two architectures for vehicular network. HSVF, a hierarchical architecture for wireless vehicular networks based on a new hybrid SDN architecture. HSVF consists of decentralized SDN controllers deployed over distributed fog cells and a centralized SDN controller implemented within the cloud data centers. Simulation results show that HSVF incurs shorter end-to-end delay and completion time compared to existing approaches. Second, we introduced a distributed and scalable SDN core network architecture called SliceScal designed specifically for autonomous driving service slicing use case. We then presented the essential autonomous driving functions that need to be sliced. The simulation results have demonstrated that the SlcieScal core network is suitable for scheduling and transmitting critical autonomous driving traffic especially when using 5G wireless network and service slicing.

To secure smart metering infrastructure against false data injection attacks in smart grid environment, we proposed SecMetering; a new security scheme based on hierarchical and distributed intrusion detection system (HD-IDS). The proposed HD-IDS is based on distributed fog architecture considering three hierarchical network layers. The problem is formulated using stochastic modeling. Based on a Semi-Markov process, we implemented an embedded Markov chain to observe the behavior of each smart meter using range-based behavior sifting policy. In addition, we proposed four algorithms to analyze efficiently the behavior of smart meters and detect false data attacks in real-time way at different layers of the proposed HD-IDS architecture. We validated the effectiveness of SecMetering via extensive simulations.

For Industrial IoT data scheduling, we designed a decentralized multi-tiers fog architecture for IIoT requests scheduling and data analytics. The architecture is based on hierarchical deployment of servers in the fog layer. We proposed a probabilistic model to compare the efficiency of fog resources utilization between flat and hierarchical fog architectures. We show, using an analytical model that the hierarchical fog architecture has better efficiency requests handling in terms of minimizing computation and communication delay. Moreover, we formulated the IIoT workload assignment problem as a mixed nonlinear integer programming (MNIP) problem, and proposed a branch and bound approach to solve the problem. Then, the optimal results will be aggregated for high tiers using Simulated Annealing Algorithm in order to ensure a global optimality of IIoT workload assignment. Finally, we developed an IIoT offloading algorithm which offloads the workloads over different tiers of the hierarchy. in the smart grid. Otherwise, it will be cost-expensive rather than the cost-effective one. Finally, an interactive cooperation using cloud services to support not only multiple customers, but also multiple energy sources should be considered in future works especially for large-scale development of smart grid energy management.

As we presented in Chapter 5, with the presence of online connectivity, a smart grid can be conceptualized as a cyber-physical system that connects physical electricity systems and cyberinfrastructure. However, it is a big challenge to prevent cyber-attacks in the smart grid that can potentially disrupt the power supply. One of the important issues is power theft by consumers.

This can be done by hacking a smart meter or modifying the real-time information through accessing communication channel to change the reported electricity usage. Additionally, data manipulation is also one of the most security concerns in the smart grid. We have proposed in this work a mechanism (i.e., SecMetering) to secure smart metering against FDIA in smart grid. entire networks. Therefore, scalability is one of the major challenges faced by the logically centralized SDN architecture. In SDNs, as the network size and diameter grows, the amount of control traffic destined towards the centralized controller increases and as a result the flow setup time grows. Moreover, it is known that the capability and operation set of an OpenFlow controller is most likely limited. Yet, this design has proven to be unsalable and unreliable.

Le réseau électrique intelligent

Un réseau électrique intelligent peut être conceptualisé comme une intégration du réseau électrique avec le système de réseau de communication [6]. Grâce à l'intégration des nouvelles technologies de l'information et de la communication, le réseau électrique intelligent est en mesure de fournir de l'électricité aux utilisateurs finaux de manière efficace. L'architecture de réseau intelligent couvre principalement trois domaines techniques différents : système de génération, côté transmission et côté distribution.

Cloud computing pour la gestion d'énergie

La gestion de l'énergie est une préoccupation majeure pour le réseau électrique intelligent.

Au cours des dernières années, les chercheurs ont abordé cette question en intégrant la mise en oeuvre de différents composants tels que le système de gestion de l'énergie domestique, le système de gestion de l'énergie du bâtiment, la tarification dynamique et le transfert de la charge [10]

La gestion de l'énergie dans les réseaux électriques intelligents

La première partie de cette thèse aborde le problème des économies d'énergie dans les réseaux intelligents en considérant trois problèmes principaux : 1) la gestion du plug-in des véhicules électriques pour le chargement et le déchargement des batteries, 2) la tarification dynamique et en temps réel et l'optimisation des coûts, 3) la sécurisation de comptage intelligent de la consommation d'énergie contre les attaques d'injection de fausses données. Plusieurs approches ont été proposées dans la littérature pour traiter les problèmes précédents (par exemple [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF], [START_REF] Jian | Regulated Charging of Plug-in Hybrid Electric Vehicles for Minimizing Load Variance in Household Smart Microgrid[END_REF], [START_REF] Luo | Cloud-Based Information Infrastructure for Next-Generation Power Grid: Conception, Architecture, and Applications[END_REF], [START_REF] Liang | UDP: Usage-Based Dynamic Pricing With Privacy Preservation for Smart Grid[END_REF], [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF], [START_REF] Liu | A Collaborative Intrusion Detection Mechanism Against False Data Injection Attack in Advanced Metering Infrastructure[END_REF]). En dépit de leurs bonnes performances, les systèmes existants entretiennent des lacunes majeures. Ces modèles sont basés sur des architectures centralisées conventionnelles qui n'acquièrent qu'une topologie de réseau local et centralisé dans un environnement de réseau intelligent, ce qui les expose au risque de saturation maximale des données locales et à un délai de réponse élevé qui affecte considérablement les économies d'énergie dans le réseau électrique intelligent, en particulier pour les villes intelligentes.

Une architecture Fog computing décentralisée pour les réseaux électriques

La planification centralisée des demandes de EV avec leurs caractéristiques de batterie hétérogènes et la gestion des EPSS, y compris la consommation de base, dans une zone géographique, est un défi. Dans l'architecture centralisée, toutes les informations et les opérations sont planifiées à l'intérieur du micro-grid. Avec la capacité de stockage et de calcul limitée du réseau électrique intelligent, ainsi que le nombre croissant de véhicules électriques, la réponse à la demande en temps réel devient très problématiques.

Pourquoi une architecture décentralisée ?

Avec le nombre croissant de parcs d'automobile, il est fort probable que l'architecture centralisée traditionnelle atteigne sa limite physique de traitement de ces données volumineuses. Une telle architecture peut entraîner une congestion des données, une latence importante, voire une perte de données, ce qui peut sérieusement endommager les services de réseau électrique [START_REF] Venkatesh | Optimal Scheduling for Charging and Discharging of Electric Vehicles[END_REF]. Il est donc essentiel pour les fournisseurs d'électricité de définir de nouvelles normes de communication et de trouver la meilleure infrastructure informatique pour contrôler et gérer tous les clients. Pour résoudre ces problèmes, nous proposons un nouveau concept de calcul basé sur une architecture décentraliser, dans lequel l'étude de cas est la planification des demandes de chargement/déchargement de véhicules électriques (voir Figure 9.1). Nous sommes convaincus qu'un aspect décentralisé de cloud computing (c'est-à-dire le Fog) constitue une solution encourageante grâce aux avantages suivants :  La technologie cloud offre une capacité de calcule élevée aux utilitaires de réseau électrique intelligent. En outre, grâce à son énorme stockage de données, le cloud peut aider le réseau électrique à améliorer les services de gestion des demandes.

 L'aspect décentralisé des réseaux cloud, qui utilise ce que l'on appelle le Fog-computing, peut être utilisé pour gérer et contrôler chaque micro-grid de manière distribuée. En effet, chaque centre de données dans le fog et chaque centre de données dans le cloud peuvent communiquer respectivement avec le contrôleur de micro-grid et le contrôleur de réseau électrique intelligent afin de mettre à jour périodiquement des paramètres énergétiques, tels que le prix, la production d'énergie, etc. La figure 9.3 illustre le format de paquet échangé entre les véhicules électriques, les stations EPSS et les contrôleurs de réseau électrique intelligents.

Une planification basée sur les calendriers pour le plug-in des EVs

Afin de planifier le processus de plug-in des véhicules électriques, nous avons proposé une architecture basée sur le Fog décentralisé (Figure 9.1), dans laquelle chaque micro-grid est relié à un fog. Nous utilisons les capacités de calcul dans le fog pour planifier toutes les demandes des EVs. Pour rendre cette utilisation plus efficace dans notre modèle, les utilisateurs des EVs sont invités à créer et sauvegarder leurs profils énergétiques . Un fichier contient des informations sur les utilisateurs de EVs, telles que représentées ci-dessous: Afin de rendre notre modèle plus réaliste, nous supposons que certains utilisateurs de véhicules électriques ne peuvent pas créer de profils ou n'ont pas envoyé de calendrier pour planifier leur plug-in. Nous avons appelé ces véhicules les véhicules électriques avec un plugin aléatoire. En résumé, nous aurons quatre types de véhicules électriques pour exécuter le processus de charge et/ou de décharge. Nous avons divisé les véhicules électriques en quatre ensembles, de la manière suivante : 1) EVs qui plug-in avec calendrier pour le chargement, 2) EVs qui plug-in avec calendrier pour le déchargement, 3) EVs qui plug-in aléatoirement pour le chargement, et 4) EVs qui plug-in aléatoirement pour le déchargement.

Évaluation des performances

Nous effectuons des simulations approfondies pour évaluer et mettre en évidence la méthode de planification proposée. Nous utilisons MATLAB pour effectuer nos simulations et SUMO-Veins [START_REF]Veins Vehicle in Network Simulations: The open source vehicular network simulation framework[END_REF] pour mettre en oeuvre le modèle de mobilité.

Affectation des demandes IIoT

Nous nous concentrons sur la détermination des charges de travail pour chaque serveur dans le fog. En outre, nous définissons la capacité de calcul fournie pour exécuter chaque demande, de manière à optimiser les performances d'exécution de toutes les charges de travail et à prendre une décision optimale en temps réel pour minimiser le délai de réponse.

Nous étudions d'abord un scénario qui prend en compte un seul serveur à chaque niveau dans le fog. Ensuite, nous agrégions les décisions de déchargement de la charge de travail à différents niveaux. Nous formulons le problème de placement de charge de travail comme un problème de programmation mixte non linéaire (MNIP) d'un niveau dans le fog qui n'a qu'un serveur.

Évaluation des performances

Nous mettons en oeuvre de nombreuses simulations pour évaluer les performances de l'architecture proposée et nous les comparons (architecture hiérarchique, par exemple) à une architecture fog plat et aux travaux récents [START_REF] Zhou | When Computation Hugs Intelligence: Content-Aware Data Processing for Industrial IoT[END_REF], [START_REF] Fu | Secure Data Storage and Searching for Industrial IoT by Integrating Fog Computing and Cloud Computing[END_REF].

Paramètres des simulations

Nous utilisons plusieurs machines virtuels en tant que serveurs de fog, et chaque machine virtuel a une capacité de processeur de 1,45 GHz et 2 Go de RAM. Nous utilisons NS-2 pour implémenter nos topologies de réseau [START_REF] Chekired | Decentralized Cloud-SDN Architecture in Smart Grid: A Dynamic Pricing Model[END_REF]. Nos expériences sont menées sur différents topologies et capacités de calcul. Chaque deux serveurs de fog sont connectés via un lien réseau à 100 Mbps. Une quantité totale de capacité de calcul de 20 GHz (exprimée en nombre de cycles de processeur par seconde) est fournie.

Conclusion et perspectives

Le Cloud computing a attiré l'attention de différents gouvernements, industriels et institutions universitaires, car il offre un potentiel énorme de nouvelles opportunités commerciales en termes d'efficacité du traitement, de capacité de stockage et de disponibilité.

ix 7 . 6 CHAPTER 8 : 49 Table 4 . 1 - 72 Table 7 . 1 -Figure 1 . 1 - 2 Figure 1 . 2 - 4 Figure 3 . 1 - 30 Figure 3 . 2 - 32 Figure 3 . 3 - 33 Figure 3 . 4 - 34 Figure 3 . 5 - 35 Figure 3 . 6 - 36 Figure 3 . 7 - 38 Figure 3 . 8 - 42 Figure 3 . 9 44 Figure 3 . 10 Flow 44 Figure 3 . 11 - 50 Figure 3 . 12 - 51 Figure 3 . 13 -Figure 3 . 14 -Figure 4 . 1 - 59 Figure 4 . 2 - 73 Figure 4 . 3 - 74 Figure 4 . 4 - 75 Figure 4 . 5 - 75 Figure 4 . 6 - 76 xiiFigure 4 . 7 - 77 Figure 5 . 1 - 82 Figure 5 . 2 - 83 Figure 5 . 3 - 85 Figure 5 . 4 - 94 Figure 5 . 5 - 95 Figure 6 . 1 - 99 Figure 6 . 2 - 100 Figure 6 . 3 - 105 Figure 6 . 4 - 108 Figure 6 . 5 - 113 Figure 6 . 6 - 113 Figure 6 . 7 - 114 Figure 6 . 8 -Figure 6 . 9 -Figure 6 . 10 -Figure 6 . 11 -Figure 6 . 12 -Figure 6 . 13 -Figure 7 . 1 -Figure 7 . 2 -Figure 7 . 3 -Figure 7 . 4 -Figure 7 . 5 -Figure 7 . 6 -

 7684941727111212431303232333334343535363637383842394431044311503125131331441594273437444754575467647775182528353855494559561996210063105641086511366113671146869610611612613717273747576 Figure 1.1-Cloud computing infrastructure ............................................................................................2

Figure 1 . 1 -

 11 Figure 1.1-Cloud computing infrastructure

Figure 1 . 2 -

 12 Figure 1.2-Smart Grid architecture with centralized and decentralized generation

  the context of smart grid for energy management and smart metering security, we propose three principal contributions: 1) we propose a new energy scheduling model for smart grid based on cloud computing; we consider the scheduling of EVs energy demands for charging and discharging as a case study. This work was published in IEEE Transactions on Industrial Informatics Journal: Special Section on Smart Grid and Renewable Energy Resources: Information and Communication

3 )

 3 In order to secure smart metering infrastructure against false data injection attacks in smart grid environment, we propose a new security scheme (called SecMetering) based on hierarchical and distributed intrusion detection system (HD-IDS). The proposed HD-IDS is based on distributed fog architecture considering three hierarchical network layers. A part of this work is accepted for publication in IEEE International Conference on Communication, the other part is submitted to IEEE Transactions on Industrial Informatics Journal: Special Section on New Trends in Residential Energy Management (the paper is under Major revisions).

  mechanisms proposed in the literature to enhance IIoT data scheduling based on cloud computing architectures. Finally, we presented the different proposed Cloud-Based SDN architectures for VANET, also we described recent and new works that propose to integrate 5G slicing technology into vehicular networks.We will devote the rest of this thesis to our contributions that aim to contribute to the design and the evaluation of new efficient and safe cloud computing architectures that ensure smart city networks requirements (i.e., smart grid, IoT, and VANET). In Chapter 3, we address the application of cloud computing for scheduling EVs energy demands in smart grid. We then present the dynamic pricing model proposed for energy saving in smart grid based distributed Fog architecture in Chapter 4. In Chapter 5, we present the SecMetering scheme proposed to secure smart metering against FDIA. In Chapter 6, we present the proposed hierarchical Fog architecture and model for scheduling industrial IoT data. Finally, Chapter 7 outlines the proposed hierarchical SDN-based wireless vehicular fog architecture, then we present the application of 5G slicing technology for autonomous driving services based on a new SDN core network architecture.

Figure 3 . 1 - 2 ( 3 . 11 )

 312311 Figure 3.1-Time to plug-in diagram for an EV

Figure 3 . 2 -

 32 Figure 3.2-Conventional (Centralized) smart grid architecture

Figure 3 . 3 -

 33 Figure 3.3-Decentralized Fog for smart grid communications

Figure 3 . 4 -

 34 Figure 3.4-Fog architecture for EVs charging/discharging service

Figure 3 . 5 -

 35 Figure 3.5-Packet format of EVs, EVPSS and smart grid communications

Figure 3 . 6 -

 36 Figure 3.6-Sequence diagram of scheduling calendars

Figure 3 . 7 -

 37 Figure 3.7-Cut-off priority mechanism for one public EPSS

1 Figure 3 . 8 -

 138 Figure 3.8-The State transition diagram for four priority levels with cut-off thresholds

Figure 3 . 9

 39 Figure 3.9 Illustration of the random variable ℒ , for 1 ≤ ℒ ≤ 4 and ℒ+1 ≤ ≤ ℒ with four priorities

[

2 = 1 2 = 2 = 2 = 4 2 = 1 2 = 2 = 4

 21222421224 for EVs with calendar plug-in, and for EVs with random plug-in. However, EVs which request to discharge their battery receive the low priority level ℒ = , ℒ = 4 as follows: for EVs with calendar plugin and for EVs with random plug-in.  If > (i.e., the value of Equation (3.12) is negative): EVs which request to discharge their battery receive the first and the second priority levels ℒ = 1, ℒ = as follows: for EVs with calendar plug-in, and 2 = for EVs with random plug-in. However, EVs which request to charge their battery receive the low priority level ℒ = , ℒ = 4 as follows: for EVs with calendar plugin, and for EVs with random plug-in.

Figure 3 .

 3 Figure 3.11(a) shows the base load consumption and the energy supply simulated by scaling the real base load and the real supply energy in Toronto by a factor of 1/1500.Figure 3.11(b)

Figure 3 .

 3 11(b)

Figure 3 .

 3 11(c)

  Figure 3.11-Real-time impact of EVs integration in the smart grid supply demand curve

  Figure 3.12-Priority attribution strategy using EV_CPA and EV_RPA scheduling and demand supply curve stabilization

[ 06 :

 06 00 pm to 10:00 pm].

Figure 3 .

 3 13(a) shows the number of EVs arrivals into each EPSS with different priority levels, we can see that the average number of EVs with high priority level is higher than other priority levels for the most of EPSS, we can explain this by the comportment of the two algorithms PAC and PAR in order to adjust the energy curve during peak hours by maximizing the number of EVs looking for discharging energy.

  Figure 3.13-Comparison of the impact of EV arrival rate, cut-off values and number of busy sockets on waiting time for each priority

Figure 3 .

 3 Figure 3.13(b) and Figure 3.13(c) show respectively the update of cut-off thresholds and the waiting time in each EPSS according to the arriving rate represented in Figure3.13(a). We see clearly the impact of the cut-off values for each priority on the waiting time for the according queue, for example EVPSS number 4, 7 and 10, C < β this is why the waiting time in the queue with priority levels ℒ = 4 is very high. Consequently, the arrival rate of EVs, the cutoff values and the number of busy sockets in each EVPSS have an important impact on the waiting time, the time the plug-in, and so the energy loads (i.e., demand and supply) during the charging and the discharging time period.

Figure 3 .

 3 Figure 3.14-Comparison of EV-CPA & EV-RPA performance with existing works. Total energy demand, charging/discharging and load shifting

  Section 4.1 presents the motivation behind the dynamic pricing model. Section 4.2 presents the proposed architecture and motivation for Cloud-SDN enabled SG while Section 4.3 presents the energy management model. In Section 4.4 we formulate the real-time pricing optimization model. Section 4.4 presents the optimal decision algorithms for energy management while Section 4.5 portrays the simulations results.

3 )

 3 EVs charging and discharging scheduling algorithms based on two principal metrics: a) dynamic pricing and b) demand-supply curve. The objective is to ensure a well energy balancing especially on peaks hours and solve the optimization problem for EVs. 4) Centralized microgrid management algorithm. The objective is to manage and control all microgrids in different situations and solve the global optimization problem. 5) Exploration of cloud and fog computing capacities based on SDN technology. The objective is to offer EV users the best calendar (i.e., optimal reservation time) and manage all microgrid communications networks considering real-time and energy constraints.

  (b). Each device acts as a signal repeater until the collected data reaches the AMI (electric network access point). The mesh network technology is used by many companies for SG metering applications due to the redundancy and high availability features of this technology.C. EVs Mobile Network:Current cellular networks can be a good option for connecting EVs and public supply stations. The existing communications infrastructure avoids electrical companies from spending operational costs and additional time for building a dedicated communication network. Also, the cellular network technologies (e.g., 3G, 4G) enable the mobility of EVs and the deployment of EVPSS. We suppose that an embedded mobile SIM within a cellular radio module is integrated at each EV and EVPSS to enable the communication. Many telecom operators and vendors have also agreed to put their cellular network into service of electrical companies, this can be a big challenge in terms of interoperability and privacy; we believe that the use of the SDN technology can manage and control different networks.D. Microgrid-BasedDecentralized Fog-SDN Architecture: In our proposed network architecture, we suppose that we have a number of micro grids , where: = {1, , … , , … , }, ∀ ∈ (4.1) Each micro grid contains a number of smart meters , a number of EV , and a number of EVPSS , where: = {1, , … , , … , }, ∀ ∈ (4.2) (a) Cloud-SDN architecture for Micro Grids communication (b) Decentralized Fog-SDN architecture for one micro grid

Figure 4 . 1 -

 41 Figure 4.1-Proposed Cloud-SDN and Decentralized Fog-SDN architectures for smart grid communications

  )B. Electric Vehicles demand: represented as , the energy demand from mobile EVs, at public supply stations inside the micro grid , depends on their available energy and battery capacity. Therefore, we consider the charging energy of one electric vehicle

2 ] 1 .

 21 , so the portion e D m t is always bounded between [ , +∞[ , ∀ D m . On the other hand, we have: tan -1 e D m t is always bounded between [ , п , but the variance of this portion is not very important. Thus, in order to keep the balance between demand and supply effects more the real time price, we add the second portion, tan -1 R m 1 , varied according to the variations in the ration R m Consequently, the proposed real time price p m is varied between [p a e ,

-

  management and EVs charging and discharging service by implementing algorithms to solve the optimization problems in Equation (4.29), Equation (4.30), Equation (4.34) and Equation (4.35). In order to solve the optimization problem in Equation (4.29), we start by solving the problems in Equation (4.30), Equation (4.34) and Equation (4.35).

Figure 4 .

 4 Figure 4.2(a) and Figure 4.2(b) show the energy consumption and the energy supply, respectively, for each micro grid, simulated by scaling the real energy load in Toronto city by a factor of 1/1500 and divided into 05 micro grids.Figure 4.2(c) shows the total energy demand,

Figure 4 .

 4 2(c) shows the total energy demand, the total energy supply for all micro grids and the demand supply curve including the charging and the discharging load of EVs. We can see that the demand supply curve is not stable from [12:00 pm to 08:00 pm].

Figure 4 . 2 -

 42 Figure 4.2-Real time supply and demand for micro grids and total supply demand curve

Figure 4 .

 4 Figure 4.3(b), we compare our proposed price policy DP-DEM with existing works, UDP, D2R,

  (a) Energy load impact on price (b) Comparison with related works

Figure 4 . 3 -

 43 Figure 4.3-Impact of energy load on the proposed pricing policy and price comparaison

Figure 4 . 4 -Figure 4 . 5 -

 4445 Figure 4.4-Charge of house batteries and EVs batteries

Figure 4 .

 4 6(b) shows the utility function for the discharging delay for the same number of EVs in Figure4.6(a). We can see that the delay with EV-OCM algorithm is less than that with the utility function that uses D2P pricing policy, especially during peak hours. This is because the calendars scheduling helps micro grid controller to predict the energy load and the EVPSS state at time . On the other hand, the proposed decentralized architecture based on SDN networking and fog computing, reduces the response time by controlling all network entities (i.e., EVs, EVPSS, AMI …).

( a )

 a EVs number in peak hours over EV-OCM (b) Delay for discharging the EVs battery (c) Price variation and comparison during a day

Figure 4 . 6 -

 46 Figure 4.6-EVs prices optimization and comparison

Figure 4 .Figure 4 . 7 -

 447 Figure 4.7-EVs charging cost and utility comparison, and demand supply curve comparaison

1 )

 1 using long-range wireless technologies (e.g., LoRa). Upon receiving the electricity consumption reports from different smart meters, RGW aggregates the reports to a compressed report (aiming to reduce the communication overhead) and forwards it to the appropriate for operation center.To efficiently secure the metering system based on the proposed distributed fog architecture, we implement a new Hierarchical Distributed Intrusion Detection System (HD-IDS) over a layered network. In order to insure a secure electricity metering and data forwarding and aggregation, we implement three control levels, hierarchically, between the fog operation center and smart meters. To do this, we deploy three IDS agents over AMI layers as follows: a) a Home area network IDS (i.e., H-IDS) implemented inside the home gateway (HGW) b) a Residential area network IDS (i.e., R-IDS) implemented inside the residential gateway (RGW), and c) a fog network IDS (i.e., F-IDS) implemented inside the fog operation center. Each IDS agent can communicate with the operation center and other IDSs according to the hierarchy (Figure1).

Figure 5 . 1 -

 51 Figure 5.1-Secure AMI system architecture based on HD-IDS

Figure 5 . 2 -

 52 Figure 5.2-Smart meter measurements ranges with thresholds



  Communication overhead: It is the time needed for each smart meter to report the measurement data between the HGW and the fog operation center.  Computation time: It is the time needed for each topology to detect an intrusion.  Energy metering: It is the energy consumption measured by smart meters and received by the fog operation center. This data includes also false data injected by an attacker.

Figure 5 .Figure 5 . 5 -

 555 Figure 5.5(d), we observe the values of energy consumption measurements during a day, and

Figure 5 . 6 -

 56 Figure 5.6-SecMetering comparison with related works. (a) Energy metering with DRAFT. (b) Energy metering with Jongho et al's scheme. (c) Time cost comparison. (d) Communication overhead.

Figure 6 . 1 -

 61 Figure 6.1-Hierarchical fog architecture for Industrial internet of things

Figure 6 . 2 -

 62 Figure 6.2-Notation in two-tier fog hierarchy for IIoT workloads

Corollary 1 :

 1 From Theorem 1 and Lemma 1, we can generate our analytic comparison model of fog hierarchy between multi-tier and flat fog architectures. To this end, we partition the offloaded workloads , = 1, , , … , into mutually groups { 1 , 2 , … , }. Thus, for any * ∈ [ , ] = 1, , … , and ∑ * = =1

Where 1

 1 and µ 1 are respectively the arrival rate and the service rate of demands with high priority. and µ are the arrival and the service rate of demands with low priority, respectively. Definitely, when arriving, IIoT requests are placed in different queues of each server; each of which has two services priority, high and low.

Figure 6 . 3 -

 63 Figure 6.3-The branch and bound process based on BnB algorithm

Figure 6 . 4 - 1 .

 641 Figure 6.4-Implementation of IIoT_OFF for two tiers fog hierarchy

Figure 6 . 5 -Figure 6 . 6 -

 6566 Figure 6.5-Average completion time over different amounts of workloads

Figure 6 .

 6 Figure 6.6(b) shows the average waiting time comparison between high and low priority tasks over different time frames (e.g., 50% of high priority tasks and 50% of low priority tasks).

Figure 6 . 7 -

 67 Figure 6.7-Average end-to-end delay over different topologies

Figure 6 . 8 -Figure 6 . 9 -

 6869 Figure 6.8-Average end-to-end delay over IIoT-OFF Algorithm for 4-tiers and 2-tiers

Figure 6 .

 6 Figure 6.8 evaluates the performance of the offloading algorithm over 2-tiers and 4-tiers hierarchy, where = and = 4 in IIoT_Off algorithm. We increase the number of IIoT devices from 200 to 600 where each device sends the same amount of data size (2 MB). As

Figure 6 . 10 -Figure 6 . 11 -

 610611 Figure 6.10-Synchronization time comparison

Figure 6 . 13 -Figure 6 . 12 -

 613612 Figure 6.13-Performances of our scheme when servers' crashes at different tiers of the hierarchy

123 7 . 1 Figure 7 . 1 .

 7171 Figure 7.1. From the bottom up, HSVF is divided into three planes: data plane, control plane, and application and service plane.

Figure 7 . 1 -

 71 Figure 7.1-HSVF system architecture. Hybrid SDN controls management planes and hierarchical fog cell servers' deployment.

Figure 7 . 2 -

 72 Figure 7.2-Offloading process diagram based on SDN-F controller

Figure 7 .

 7 3 illustrates the SliceScal core network. From bottom up, our architecture includes one data access plane and three control levels: fog control plane, edge control plane, and cloud control plane. The southbound API between the control plane and data plane is implemented by extending OpenFlow while the northbound API is provided to the applications as a high-level abstraction to communicate with the different controllers.Data plane (RSUs, 5G BSs, and Vehicles):The data plane includes all data transmission network devices. The main functions of the data plane are data collection, data quantization and data forwarding to the control plane through the southbound API. The data plane supports Vehicle-to-Vehicle (V2V), Vehicle-to-Infrastructure (V2I) and Infrastructure-to-Infrastructure (I2I) communications using different networking technologies (e.g., DSRC, 5G, Wifi, and IEEE 802.11p). The data plane is built as a hierarchical overlay fog network to eliminate the heterogeneity of existing vehicular networks. All vehicles, Road Side Units (RSUs), and 5G Base Stations (BSs) are abstracted as SDN devices and equipped with OpenFlow software switches. These software switches can be further categorized into the mobile data plane (i.e., vehicles) and stationary data plane (RSUs, 5G BSs). RSUs, BSs, and other edge equipment can communicate with micro-data centers located in the fog to deliver different services. We

Figure 7 . 3 -

 73 Figure 7.3-5G-Slicing-Enabled Scalable SDN Core Network architecture (i.e., SliceScal)

2 )

 2 Heterogeneous wireless access network: in SliceScal, we propose to use the concept of heterogeneous vehicular access network. This concept is proposed to satisfy the communication requirements of not only autonomous driving service slices (i.e., safety message) but also besteffort traffic (i.e., non-safety message) for both autonomous driving vehicles and manually driven vehicles. Thus, due to high mobility and the dynamic change of vehicular network topology, it is difficult to provide satisfactory services through only a single wireless access network, such as dedicated short range communication (DSRC) or third generation 4G Long Term Evolution (LTE) networks or Wi-Fi [109]. In particular:  DSRC networks are mainly designed for short-range communication without considering the pervasive communication infrastructure. The end-to-end delay in LTE networks can considerably fail with a large number of vehicles, while ultra-low latency for delivering real-time information for autonomous driving is required. The huge volume of data generated by sensors in autonomous driving system is beyond the capacity of the current vehicular networks. Therefore, SliceScal architecture uses a heterogeneous wireless access networks which integrate four wireless technologies: (a) dedicated short range communication (DSRC), (b) cellular mmWave network, (c) cellular microwave network (LTE), and (d) non-3GPP

Finally, in

  order to ensure high reliability and ultra-low latency when transmitting critical autonomous driving data and action-triggered messages, the autonomous vehicle should always keep a number of transmission data sessions to the nearest mmWave base station. Hence, the autonomous vehicle is in outage on the mmWave network only when it has outage on all the currently serving mmWave BSs. In this situation, the current autonomous driving service requests transmission falls back from the mmWave to the microwave segment (i.e., LTE or Wi-Fi). Based on our proposed SliceScal network configurations, the service slice controller (SSC)

1 )

 1 Control layer: includes two function modules, monitoring and allocation. The monitoring module takes charge of monitoring the number of occupied resource blocks at each BS

Figure 7 . 4 -

 74 Figure 7.4-Logical layers for autonomous driving function slicing

Figure 7 .

 7 Figure 7.5(a) shows the average end-to-end delay as a function of vehicles' density. We observe that HSVF-F outperforms both HSVF-W and the flat architecture. Indeed, HSVF-F generates an average end-to-end delay that is 25% and 40% lower than the end-to-end delay incurred by HSVF-W and the flat architecture, respectively. The reason is threefold:

Figure 7 Figure 7 . 5 (

 775 Figure 7.5-Simulation results comparisons

Figures 7 .

 7 Figures 7.5(c) and (d) depict performance results of HSVF and HSDV (i.e., Hierarchical

Figure 7 .

 7 Figure 7.5(c) shows the average end-to-end delay with respect to vehicle density. We observe that HSVF outperforms HSDV in all densities. The reason is twofold: a) HSVF reduces the number of control messages in the network using a hierarchical server deployment at each fog cell along with a hybrid control plane; b) HSVF adapts the offloading mechanism of EV requests according to the capacity allocated at each tier's servers.

Figure 7 .

 7 Figure 7.5(d) portrays the routing overhead in the wired fog cells network as a function of vehicle density. We observe that HSVF generates far less control messages compared to HSDV (i.e., on average, HSVF generates 30 % less control messages than HDSV). This is because HSVF makes use of the wired fog cells network manager module to: 1) ensure the proper management of the wired network connecting fog cells data centers; and 2) control the forwarding of flow table over different fog cells. HSVF also relies on SDN-C to route data packets and analyze the network topology of each fog data center. This reduces significantly the number of control messages.

Figure 7 .Figure 7 . 6 -

 776 Figure 7.6-Performances of SliceScal core network

9. 3 . 1

 31 Gestion du plug-in des véhicules électriques L'émergence des véhicules électriques (EV) promet d'apporter de nombreux avantages aux secteurs de l'énergie verte et des transports, mais elles risquent également d'affecter la fiabilité du réseau électrique en consommant une quantité d'énergie considérable pour charger les batteries des voitures. Néanmoins, le branchement (plug-in) des véhicules électriques dans les stations d'approvisionnement publiques (EPSS) doit être contrôlé et planifié afin de réduire la charge. Afin de réduire l'impact de la recharge des véhicules électriques sur le réseau électrique intelligent et d'optimiser les économies d'énergie ; nous proposons un modèle coordonné pour planifier le plug-in des véhicules électriques pour charger et/ou décharger de l'énergie. Nos contributions sont résumées comme suit : a) nous proposons un nouveau système pour le plug-in des EVs basé sur la planification du calendrier en utilisant les capacités de calcul réparties dans les serveurs de Fog computing, b) nous utilisons un système de file d'attente à plusieurs priorités pour gérer le plug-in des EV. Le système de file d'attente proposé utilise une discipline de coupure (cut-off) afin d'améliorer le processus de plug-in, c) afin d'améliorer notre modèle et de maintenir la stabilité de la courbe d'énergie, nous proposons trois algorithmes d'optimisation comme suit: : i) deux algorithmes d'attribution de priorité pour le plug-in avec calendrier et le plug-in aléatoire en fonction de différentes contraintes d'énergie, ii) et un algorithme pour sélectionner l'EPSS optimal pour chaque EV à plug-in, d) nous effectuons des simulations approfondies afin d'améliorer l'efficacité de notre solution; Nous comparons également nos algorithmes avec deux travaux récents.

Figure 9 . 1 -Figure 9 . 2 -

 9192 Figure 9.1-Decentralized Fog for smart grid communications

Figure 9 . 3 - 2 [

 932 Figure 9.3-Packet format of EVs, EVPSS and smart grid communications

Figure 9 . 4 -

 94 Figure 9.4-Sequence diagram of scheduling calendars

9. 3 . 4

 34 Un modèle de file d'attente multi-priorités pour le plug-in des véhicules électriques En prenant en considération les quatre ensembles de véhicules électriques, notre file d'attente avec quatre niveaux de priorité est considérée comme un modèle M/M/s à plusieurs priorités pour chaque EPSS où chaque EPSS possède un certain nombre de prises. À cet égard, notre processus stochastique est présenté comme une chaîne de Markov avec quatre priorités dans chaque transition d'état. Les niveaux de priorité ℒ est donné comme suit: ℒ = {1, , , 4}. ℒ = 1 > ℒ = > ℒ = > ℒ = 4 . Par convention ℒ = 1 désigne la priorité la plus élevée.

Figure 9 . 5 - 9 . 4 . 1

 95941 Figure 9.5-Cut-off priority mechanism for one public EPSS

Figure 9 . 6 - 9 . 4

 9694 Figure 9.6-Real-time impact of EVs integration in the smart grid supply demand curve

( a )Figure 9 . 6 - 9 . 4 . 1 9 . 4 . 2

 a96941942 Figure 9.6-Priority attribution strategy and demand supply curve stabilization

Figure 9 . 7 -

 97 Figure 9.7-Hierarchical fog architecture for Industrial internet of things

9. 4 . 6

 46 Résultats des simulationsAfin d'étudier les performances de l'architecture et du modèle proposés, nous réalisons des expériences de simulation sur les trois topologies de l'architecture de fog : une hiérarchie de à 3 niveaux, une hiérarchie à 2 niveaux et une architecture plate. Tout d'abord, nous évaluons la performance de chaque topologie en termes de temps d'exécution en fixant la capacité fournie et en modifiant le taux de charge de travail de 1 à 5 tâches chaque 10 secondes. Les résultats sont présentés par la figure 9.8. Comme nous observons dans la figure 9.8(a), lorsque la capacité fournie est égale à 2, il existe une grande différence entre les performances de l'architecture plate et l'architecture hiérarchique ; la hiérarchie à 3 niveaux fonctionne mieux et donne un temps d'exécution optimal. Rationnellement, lorsque la capacité fournie est de 4, le temps d'exécution est plus optimal, comme le montre la figure 9.8(b). La principale raison de cette différence est que le serveur de niveau 3 est capable d'agréger efficacement les pics de charge de tous les serveurs de niveau 2. Par conséquent, chaque niveau hiérarchique utilise la capacité fournie pour traiter les tâches avec une efficacité bien supérieure.

Figure 9 . 8 -Figure 9 . 9 -

 9899 Figure 9.8-Average completion time over different amounts of workloads

Figure 9 .

 9 Figure 9.10-HSVF system architecture.

Figure 9 . 11 - 9 . 5 . 5 Figure 9 . 12 -

 911955912 Figure 9.11-Offloading process diagram based on SDN-F controller

  to thank all people who have encouraged me, in various ways, to pursue my goal. This dissertation would not have been possible without them.My deep appreciation goes to Prof. Lyes Khoukhi and Prof. Hussein Mouftah for giving me the opportunity to work with them on one of the promising technologies that can make our world better. Their exemplary supervision, great support, valuable advices and constructive criticism have helped me become the researcher I am today.

			xiv xv xvi
		LIST OF ABBREVIATIONS (dedication) To my late FATHER. ACKNOWLEDGMENTS
			"He taught me to persevere and
	PaaS I would like Platform as a Service	prepared me to face the
	SaaS	Software as a Service	challenges with faith and humility".
	IaaS	Infrastructure as a Service
	SG	Smart Grid
	AMI	Advanced Metering Infrastructure
	HEMS	Home Energy Management System
	DoS	Denial-of-Service
	OCC	Operations Control Center
	FDIA	False Data Injection Attack
	IoT	Internet of Things
	IIoT	Industrial Internet of Things
	ICT	Information and Communication Technology
	VANET	Vehicular Ad hoc Network
	DSRC	Dedicated Short-Range Communication
	SDN	Software Defined Networking
	NFV	Network Function Virtualization
	WDN	Wireless Distributed Networks
	MAC	Medium Access Control
	HD-IDS	Hierarchical and Distributed Intrusion Detection System
	HSVF	Hierarchical SDN for Vehicular Fog
	EV	Electric Vehicle
	EPSS	Electric Public Supply Station
	EV_CPA	EV Calendar Priority Attribution algorithm
	EV_RPA	EV Random Priority Attribution algorithm
	BSS	Best Station Selection algorithm
			.....140
	RB_EM	Renewable Building Energy Management algorithm
	EV_OCM	EV Optimal Calendar Management algorithm

  We introduce two priority attribution algorithms: First, for EVs with calendars plug-in (i.e., EVs that have already created their charging/discharging profiles inside cloud data centers), we propose the EV Calendar Priority Attribution algorithm (EV_CPA) which is executed inside cloud platforms. All information about EVs users, EPSS and demand-supply curve are centralized in the Fog data centers. The priority levels are attributed considering the two cases Second, for EVs with random plug-in (i.e., EVs that have not yet created their charging/discharging profiles inside cloud data centers); we propose the EV Random Priority Attribution (EV_RPA) algorithm which is executed inside the station. EVs with random plugin receive their priority levels when they arrive at EVPSS. Where, cloud services can communicate with EPSSs and attribute for each EV with random plug-in for charging and for discharging the appropriate priority according to the scheduling state. This algorithm is executed for each EPSS when an EV with random plug-in is arriving.

	of demand-supply curve (i.e., 2  charging and	≤ and	> ), and EVs calendars types (i.e.,
	Algorithm 1: EV Calendar Priority Attribution (EV_CPA) Algorithm 2: EV Random Priority Attribution (EV_RPA)
	Input: , Input: , 2	2 ,	, 2	2 ,	,	, ; , ;
	Output: calendars plug-in with priority levels attribution; Output: random plug-in with priority levels attribution;
	1. for (each ) do 1. for (each SS) do
	2. 2. Read Read ( 2	2	at time slot t; at time slot t;
	3. 3. Read Read ( 2	2	at time slot t; at time slot t;
	4.	4.	if ( if ( ≤	≤ ) then then
	5.	5.	for (each for (each	2	2	) do	do
	6. 7. 8. 9.	6. 7. 8. 9.	2 Save and confirm the 2 = ; ℒ = 1; end end for (each 2 ) do for (each 2 ) do 2 = 4;	2	;
	10. 10. 11. 11. else end 12. 12. for (each 2 Save and confirm the ℒ = ; 2 ) do end 13. else 13. 2 = 4;	2	;
	14. 14. 15. 15. 16. 16. 17. 17. 18. 18. end end for (each 2 for (each Save and confirm the 2 ) do 2 ) do ℒ = ; 2 = ; end end for (each 2 ) do 19. 2 19. Update the ESS state; ℒ = 1; 20. Save and confirm the 20. Send to EVPSS state information to the Cloud services; 2 ; 2 ; end
		21.	end
		22. end
		23. Update,		, ;
			end

2

 discharging).

Table 3 .

 3

	1-Simulation Parameters
	Parameters	Value
	Simulation area	10 km x 10 km
	Number of charging EVs	3000
	Number of discharging EVs	2000
	(Charging energy)	[10 kW -45 kW]
	(Discharging energy)	[10 kW -40kW]
	EVPSS number	20
	Number of plug-in socket	10
	Battery capacity	50 kW [93]
	Charging and discharging rate	20 kW/h [93]

  All micro grids can communicate with the other micro grids, and can exchange energy with one another. If a micro grid has excess energy, it can provide another micro grid that has energy deficiency.

			)
	and	= ′ + ′′ , ′ > ′′	(4.24)

C. Micro grid energy supply:

We consider that each micro grid has renewable and non-renewable energy _ sources with self-generation capacity, and provides electricity in its covered region.

Assumption 2:

end 4.5.2 Algorithm for EVs Charging and Discharging Management As

  1 ; seen earlier, EVs may create several calendars to express several charging and discharging requests. We discuss the decision making process of EVs calendars for charging and discharging process.

	Algorithm 2: EV Optimal Calendar Management (EV_OCM)
	Input:	Total	supply ,		Total	demand ,	EVs
	charging/discharging calendars.
	Output: Optimal calendar, Optimal EVPSS, Total cost	.
	1. for (each ) do
	Algorithm 1: Renewable Building Energy Management (RB_EM) 2. Read ( ) at time slot t;
	Input: Total supply , Total demand , , 3. if > then Output: Energy demand from the micro grid . 4.	ℎ	.
	1. Calculate	as in Eq.(4.14) until	= ;
	2. if (		then
	3.	if	> ∑ =1	then
	4.	Switch to the wall battery energy usage;
	5.	Calculate	as in Eq.(4.16);
	6.	else
	7.	while		>	ℎ	repeat
	8.	Switch to the wall battery energy usage;
	9. 10.	+1 = -∑ =1 until +1 = ℎ	;	;
	11. 12.	+1 = ∑ =1 Request	+1 +1 energy from the micro grid; -+1 ;
	13. end
	14. else
	15. Switch to the micro grid energy usage;

  Therefore, we have a global maximization problem represented in Equation(4.29), where each micro grid always looks to maximize its utility. In this regards, we propose a centralized algorithm (DP_DEM) to manage and control all micro grids in different situations. Also, it uses SDN and NFV technologies to supervise the communication networks between micro grids, and control the data flow in order to maintain the total smart grid demand supply curve, by maximizing the number of stable micro grids. The algorithm is executed inside the smart grid cloud controller, as a centralized master algorithm based on the proposed architecture. The time complexity of the algorithm is ; where is the number of micro grids.

	Algorithm 3: Micro Grids Energy Management (DP_DEM)
	Input: ,	and of each micro grid ;
	Output: list of stable micro grids, list of non-stable micro
	grids, real time price of each micro grid m;
	1. for ( = 1	) do
	2.	Receive S m , S m , p m at time t;
	3.	Update list of stable micro grids;
	4.	Update list of non-stable micro grids;
	5.	while list of non -stable micro grids ≠ null repeat
	6.	Execute (RB_EM) and (EV_OCM) for micro grid ;
	7.	Create virtual communications based SDN-Controller
	8.	Request exceeded energy from stable micro grids;
	9.	Receive Exceeded energy;
	10.	Calculate energy difference	for ;
	11.	if	then
	12.

  The northbound API, on the other hand, enables application and control planes to communicate. It provides applications with a high-level abstraction to communicate with SDN-Fs and SDN-C. switches, allowing for a better load balancing. Moreover, per-connection event filtering is introduced in OpenFlow 1.3. This enables controllers to only subscribe to types of message in which they are interested. For example, a controller responsible for collecting statistics about the network can be attached as an auxiliary controller and will subscribe only to statistics events that are generated by the switches. Based on application requirements, rules and strategies of HSVF are generated by SDN-C for the SDN-Fs and by SDN-Fs for wireless vehicular network. The application plane contains a set of applications and services like resource organization, demands management, delay optimization, trajectory prediction module. The application plane interacts with each SDN-F to forward required information to the control plane. Additionally, in our proposed architecture, we consider content fragmentation module as a service that is provided at the application plane. It requires the help of the trajectory prediction module to enhance data dissemination of many infotainment applications (e.g., media streaming) in VANET.HSVF uses a stable clustering technique based on the proposed deployment of Fog cells.

	Application plane:

The southbound API is implemented by extending OpenFlow 1.2 to OpenFlow 1.3 to support multiple controllers. With OpenFlow 1.2, only fault management is targeted by a master/slave scheme. With OpenFlow 1.3, auxiliary connections can be used to connect the master controller and the

Table 7 .

 7 1-Simulation parameters

	Parameter	Value
	Data rate Packet generation rate	2Mbps (UDP) 5 -20 packets/second
	Packet size	512 byte
	Transmission power	20 mW
	Sensitivity Duration of a time slot	-89 dBm 13 μs
	Transmission range	200 m
	Beacon rate	1 Hz
	Speeds	30 and 80 km/h
	Number of RSUs	10
	Number of LTE BSs	5
	Computation capacity	1.45 GHz and 2GB RAM
	EV Calendars per second	2-5

  Beyond the previously proposed architectures and models based on cloud for smart cities networks (e.g., smart grid, IoT, VANET), various future opportunities are provided hereafter with some research challenges. As we presented in Chapter 3 and Chapter 4, the heterogeneous architecture of smart grid can lead to huge amount of data generation from smart meters, and thus, cloud computing applications and decentralized fog architectures are useful for managing these data. However, there are some research challenges in smart grid, while incorporating the cloud computing applications. First, due to failures in one of the protocol used for communication, the entire system is affected in the smart grid technologies. Thus, cloud computing can be used as a solution to recover network failures. In addition, data warehousebased cloud can be implemented in order to optimize, control, and secure smart grid communications. Second, the integration of public cloud with the private cloud infrastructure

	8.2 Future Work
	Smart grid management:
	Finally, in order to enhance the QoS of vehicular network, we proposed two new vehicular
	architecture based on decentralized SDN and 5G technologies. First, we proposed a hierarchical
	SDN-based wireless vehicular fog architecture, called HSVF (i.e., Hierarchical SDN for
	Vehicular Fog architecture). HSVF is based on a hybrid SDN control plane that reinforces
	centralized and distributed management. The proposed architecture is then evaluated using a
	relevant case study that addresses the scheduling of electric vehicles (EVs) energy demands.
	Second, we proposed a distributed and scalable SDN core network architecture (SliceScal) that
	supports 5G slicing functions, which map autonomous driving functionalities into service
	slices. SliceScal deploys fog, edge and cloud computing technologies and proposes a network
	and service slicing system model that promotes a four-layer logical architecture to improve the
	transmission efficiency and satisfy the low latency constraint.

for cost-effective communication in smart grid is indispensable for new scalable smart cities networks. Public cloud can be integrated with the private cloud for large-scale development in smart grid in a cost-effective manner. However, security and privacy are two of the important issues, while allowing information exchange between private and public cloud. Third, due to heterogeneous communication architecture of smart grid when integrating cloud computing, multi-mobile agent can be used to communicate with different layers. Therefore, defining an adequate mobile strategy for the agent is required for cost-effective information management

  Though, distributed control plane architectures have gained ground lately, they bring new concerns. A paramount question that should be investigated thoroughly is how to efficiently perform path computation and flow table updates in very large SDNs. In our future works we aim to address this inquiry by proposing new path computation models for distributed and scalable SDN networks and describes a mechanism to update path views in case of topology changes along with a failover mechanism to address the problem of isolated fog cells.Finally, SDN-based VANET can enhance network security due to global visibility of the network state, centralized intelligence and network programmability. As such, a common distribution layer gathering information about security requirements of different services, resources and hosts, and disseminating the security establishing commands to the network elements to enforce security policies can result in robust and scalable security enforcement. In addition, availability is a security aspect that strongly correlates scalability with security. Most of the security threats in SDN target to compromise availability of the control plane. Thus, multiple controllers are suggested, but, simply adding multiple controllers might result in cascading failures of controllers as demonstrated. Therefore, it is necessary to correlate security and scalability in SDN to design secure SDN architectures that ensure high availability of the control plane. Thus, there is a clear need to perform more research on Le cloud computing est un modèle de calcul émergeant qui fournit des services à la demande et des ressources partagées sur Internet. Le cloud computing, basé sur de grands dispositifs de stockage et de calcul, agit en tant que fournisseur d'utilité[1]. Les coûts de mise en oeuvre et de maintenance, ainsi que la complexité du système informatique dans le Cloud, sont réduits grâce à l'utilisation des nouvelles technologies de l'information. Les ressources sont partagées sur le réseau et récupérées par des périphériques à la demande. Le cloud computing fournit trois types de services distincts : la plate-forme en tant que service (PaaS), le logiciel en tant que service (SaaS) et l'infrastructure en tant que service (IaaS)[2].

	RÉSUMÉ EN FRANÇAIS
	9.1 Introduction
	9.1.1 Le Cloud Computing

However, the same key attributes of SDN (i.e., centralized intelligence and programmable network elements), make security in SDN a more challenging task. Indeed, to our understanding, there are still some security features which need to be addressed for our proposed SDN-based architectures for VANET. First, controllers should be protected all the time against DDoS attacks, particularly the centralized controller. Hence, the lack of scalability in SDN can enable targeted DDoS attacks by inundating communication between the controller and the switch to cause control plane saturation. Besides saturation of the control plane, it is demonstrated that a network can be compromised by exhausting resources of OpenFlowenabled switches.

securing SDN-based VANET architectures because attacks not only have the potential for devastating effects to both smart cities networks and to individuals associated with them but also are expected to become even more critical in the future.

5 Cloud computing basé sur SDN pour le réseau véhiculaire

  . Par conséquent, l'objectif du réseau électrique intelligent est de prendre en charge une gestion de l'énergie rentable et fiable en temps réel. D'autre part, le réseau électrique intelligent offre de nombreuses fonctionnalités et applications aux consommateurs, mais il doit être amélioré pour gérer des systèmes plus évolutifs. Ceci peut être réalisé en utilisant des capacités de calcul dans le Cloud. Les opérations peuvent être effectuées à moindre coût avec le Cloud computing car le partage et l'automatisation sont répandus au sein de ces systèmes. En outre, la réponse en temps réel est très importante pour les applications du réseau électrique intelligent à grande échelle. Néanmoins, en raison des retards induits sur les réseaux étendus (WAN) et éloignés des dispositifs IIoT, les systèmes IIoT basés sur le cloud rencontrent de nombreux défis, notamment un temps de réponse élevé en raison du coût élevé de la bande passante de communication et des lourdes charges de travail. Le réseau défini par logiciel (SDN) est un nouveau paradigme des réseaux qui est de plus en plus intégré dans différents types de réseau de communication. Dans un réseau SDN, le plan de contrôle et le plan de données sont découplés et les ressources du réseau sont gérées par un contrôleur centralisé de manière logique. De plus, les appareils de différents fournisseurs peuvent communiquer entre eux via une interface standardisée, ce qui simplifie considérablement la gestion du réseau et offre une architecture réseau programmable et flexible. la bande passante et le débit). Cependant, il n'est pas simple de répondre à ces exigences, compte tenu des caractéristiques particulières des réseaux de villes intelligentes (forte consommation d'énergie, forte mobilité, connectivité intermittent, trafic de données important et menaces à la sécurité). L'objectif de cette thèse est donc de contribuer à la conception et à l'évaluation de nouvelles solutions répondant aux besoins des réseaux de villes intelligentes. Ce travail a été effectué sur la sous-couche de contrôle d'accès au support (MAC), la couche réseau et la couche application. D'une part, il propose de nouveaux modèles et architectures efficaces et sûrs basés sur les technologies cloud et SDN pour : 1) la gestion de l'énergie dans les réseaux électriques intelligents, 2) la gestion et le traitement des données IIoT, et 3) les véhicules connectés. Les solutions proposées prennent en compte des paramètres d'évaluation des performances, tels que l'économie d'énergie, le temps de réponse et les latences. D'autre part, elles définissent, évaluent et implémentent des mécanismes de gestion des ressources du réseau, afin de proposer des services différenciés afin d'améliorer encore les performances de différents réseaux de ville intelligente (réseau électrique intelligent, réseau IoT et VANET).

	9.1.Néanmoins, ces services de fog peuvent être dépassés, dans certains cas, en raison du nombre
	croissant de demandes des clients. Ceci peut être observé en particulier aux heures de pointe,
	entraînant par la suite une dégradation critique des performances.
	9.2 Les objectifs de la thèse
	Quand le trafic de données et la consommation d'énergie sont en plein essor dans les villes

À l'origine, SDN était conçu et déployé dans des environnements de réseau filaire avec des commutateurs à haute vitesse. Pourtant, les chercheurs ont récemment commencé à utiliser le SDN pour améliorer de nombreuses formes de réseaux distribués sans fil, y compris les réseaux ad hoc mobiles, les réseaux de capteurs sans fil, les réseaux Wi-Fi et les réseaux de véhicules

[START_REF] Nekovee | Radio Technologies for Spectrum above 6 GHz -A Key Component of 5G[END_REF]

. En effet, le SDN apporte de nouvelles intuitions et un potentiel élevé d'améliorer l'efficacité des réseaux sans fil

[START_REF] Yaqoob | Overcoming the Key Challenges to Establishing Vehicular Communication: Is SDN the Answer?[END_REF]

. D'autres technologies peuvent également être envisagées pour améliorer les performances de VANET. Par exemple, des études récentes ont montré que l'interconnexion de VANET avec des services de fog computing peut améliorer les performances du réseau

[START_REF] He | SDVN: Enabling Rapid Network Innovation for Heterogeneous Vehicular Communication[END_REF]

. De plus, le cloud peut également être considérée comme une solution fondamentale pour prendre en charge l'écoulement du trafic mobile et pour réduire le temps de latence. Les services de fog computing, y compris le calcul, le stockage et les réseaux distribués, sont déployés près des utilisateurs finaux ; ainsi, un accès rapide et fiable est fourni aux applications mobiles. intelligentes, le cloud computing devient la solution la plus plausible pour faire face aux faiblesses des réseaux de villes intelligentes classiques. La plupart de ces réseaux classiques ont des exigences de performances strictes (c'est-à-dire, l'économie d'énergie, le délai, le passage à l'échelle,

des architectures cloud efficaces et sécurisées : application aux réseaux électriques intelligent, IoT et SDN VANET Les technologies du Cloud computing ont attiré l'attention des gouvernements, industriels et cher- cheures, car elles offrent un potentiel énorme en termes d'efficacité de traitement, de capacité de stockage et de disponibilité. Cependant, elles pré- sentent des défis particuliers qui entravent l'intégra- tion du Cloud dans des nouvelles technologies émergentes. Ce travail présente trois applications principales du cloud computing. La première appli- cation concerne la gestion de l'énergie des réseaux électrique intelligents. Nous proposons trois contri- butions principals : 1) un nouveau modèle pour la planification de plug-in des véhicules électriques EVs basé sur une architecture cloud, 2) afin de ré- duire les coûts de la production d'énergie, nous proposons un modèle de tarification dynamique en temps réel, 3) pour sécuriser l'infrastructure de comptage intelligent de la consommation d'électricité contre les attaques d'injection de fausse informations, nous proposons un nouveau système de sécurité, appelé SecMetering. La deuxième application est conçue pour le traitement des données de l'Internet des objets industriels ; nous proposons une nouvelle architecture décen- tralisée basée sur un fog hiérarchique. La troisième application concerne les réseaux véhiculaires. Nous proposons deux nouvelles architectures : 1) une architecture fog hiérarchique basée sur SDN, appelé HSVF, 2) une architecture qui utilise le réseau sans fil 5G basé sur SDN pour améliorer les performances de la conduite autonome. Mots clés : informatique dans les nuages -réseaux électriques intelligents -internet des objets - réseau défini par logiciel -réseaux ad hoc de véhi- cules -cyber -sécurité -5G. Djabir Abdeldjalil CHEKIRED Doctorat : Ingénierie Sociotechnique des Connaissances, des Réseaux et du Développement Durable Année 2019 Towards Efficient and Secure Cloud Architectures and Models: Application on Smart Grid, IoT and SDN Vehicular Networks Cloud computing technologies have seized the at- tention of different governments, industries, and academic institutions as they offer tremendous potential for new business opportunities in terms of scheduling efficiency, storage capacity, and availa- bility. Yet, they have particular challenges that hin- der cloud integration in new emerging technologies and systems. This work presents three principals applications of Cloud computing. The first applica- tion issue is for smart grid energy management. It proposes three principal contributions: 1) conside- ring the scheduling of electric vehicles (EVs) energy demands for charging and discharging as a case study, we propose a new energy scheduling model for smart grid based on Cloud computing, 2) in order to reduce the energy cost and energy peak loads, we propose a real-time dynamic pricing policy, 3) to secure energy smart metering infrastructure against false data injection attacks in smart grid environ- ment, we propose a new security scheme, labeled SecMetering. SecMetering is based on hierarchical and distributed intrusion detection system. The second application is designed for scheduling indus- trial internet of things data; we propose a new hie- rarchical and decentralized Fog architecture. The third application concerns vehicular networks. We propose two new architectures based on distributed SDN: 1) a hierarchical SDN-based wireless vehicular Fog, labeled HSVF, 2) a framework that uses 5G networks based SDN to enhance the performance of autonomous driving applications. Keywords: cloud computing -smart power grids - internet of things -vehicular ad hoc networks -SDN -cyber-security -5G.

  Cependant, il présent des défis particuliers qui entravent son application pour des nouvelles technologies et systèmes émergents. L'objectif principal de ce projet de recherche est de concevoir de nouvelles architectures et modèles du cloud computing pour : 1) la gestion de l'énergie d'un réseau électrique intelligent, 2) l'internet industriel des objets, et 3) et les réseaux véhiculaires basés sur les technologies SDN et 5G. Pour atteindre ces objectifs, cette thèse a présenté des architectures et des modèles efficaces et sûrs basés sur les technologies Cloud. Au-delà des architectures et des modèles proposés dans ce projet de recherche, diverses opportunités futures sont présentées, avec quelques défis en matière de recherche. La mise en place d'un réseaux électrique intelligent pose plusieurs problèmes de recherche tout en intégrant les applications du cloud computing. Premièrement, en raison de défaillances des protocoles utilisés pour la communication, l'ensemble du système peut être affecter. Ainsi, le Cloud peut être utilisé comme solution. En outre, un cloud basé sur un entrepôt de données peut être mis en oeuvre afin d'optimiser, de contrôler et de sécuriser les communications de réseau intelligent. Deuxièmement, l'intégration du cloud public à l'infrastructure du cloud privé pour une communication rentable dans un réseau électrique intelligent est indispensable pour les nouveaux réseaux de villes intelligentes évolutives. Le Cloud public peut être intégré au Cloud privé pour un développement à grande échelle dans un réseau électrique intelligent, de manière rentable. Cependant, la sécurité et la confidentialité sont deux des problèmes importants, tout en permettant l'échange d'informations entre les Clouds privés et publics. Troisièmement, en raison de la nature hétérogène du réseau électrique intelligent lors de l'intégration du cloud computing, des agents mobiles peuvent être utilisés pour communiquer avec différents éléments de l'architecture. Par conséquent, il serait nécessaire de définir une stratégie de communication adéquate pour l'agent afin de gérer les informations de manière rentable dans le réseau électrique intelligent.

	Vers

area of 10 km x 10 km where EVPSSs are placed randomly. All vehicles are traveling with speeds that cannot exceed 60 km/h. Table 4.1 shows the parameters used for simulation.

Performance Metrics

In order to evaluate our proposed model, we use different metric as follows:

 Dynamic real time price: the price is calculated as in Equation (4.28) for buildings energy consumption and as in Equation (4.32) and Equation (4.33) for EVs charging and discharging respectively.

 Demand supply curve: is the principal metric used to inspect the performance of the proposed model, especially during peak hours. The demand supply curve is evaluated from Equation (4.26) and Equation (4.27).

 Charging delay: is the sum of the fog provider response time, time to travel to the selected EVPSS, the waiting time in the queue and the service time.

 EV charging cost: is consistently related to the real time price and distance to the charging station of the selected micro grid. It is calculated as in Equation (4.38).

 Utility for EV charging: EV_OCM algorithm takes decisions based on the decision matrix proposed in Equation (4.37). We calculate the utility for EV as charging cost using D2P [START_REF] Misra | D2P: Distributed Dynamic Pricing Policyin Smart Grid for PHEVs Management[END_REF], D2R [START_REF] Fan | A distributed demand response algorithm and its applicationto PHEV charging in smart grids[END_REF], UDP [START_REF] Liang | UDP: Usage-Based Dynamic Pricing With Privacy Preservation for Smart Grid[END_REF], QFC [START_REF] Park | Economic load dis-patch for piecewise quadratic cost function using Hopfield neuralnetwork[END_REF] and the proposed pricing model DP-DEM. Thus, we denote the utility function as follows:

FOG-BASED SECURE SMART METERING ARCHITECTURE IN SMAT GRID

In order to secure smart metering infrastructure against false data injection attacks in smart grid environment, we propose in this chapter a new security scheme (called SecMetering) based on hierarchical and distributed intrusion detection system (HD-IDS). The proposed HD-IDS is based on distributed fog architecture considering three hierarchical network layers. The problem is formulated using stochastic modeling. Based on a Semi-Markov process, we implement an embedded Markov chain to observe the behavior of each smart meter using rangebased behavior sifting policy. In addition, we propose four algorithms to analyze efficiently the behavior of smart meters and detect false data intrusion attacks in real-time way at different layers of the proposed HD-IDS architecture. We validate the effectiveness of SecMetering via extensive simulations. We evaluate the impact of SecMetering on the smart grid energy curve by illustrating real-word traces of households' electricity consumption (from the U.S. electricity system operating data-city of California). Finally, SecMetering is compared with three recent and relevant related works.

Motivation

Different security fears in smart grid energy metering using smart meters may come from several attackers that can use different techniques (e.g., physical attacks, cyber-attacks, etc.).

The attackers may be external and/or local. Local attackers may be the users, the gateways or the operation center. Generally, these attackers are honest-but-curious [16]; they attempt various techniques to seek and deduce knowledge about victims, using for example their energy consumption measurements. It is stated that the determination of users' behavior figures in the second most serious attacks consequences on smart grid environment in 14 fears types defined by Electronic Privacy Information Center [16].

On the other hand, an external attacker may compromise a smart meter by injecting false data or spying on the communication channel to violate user's privacy. The false data injection attack (FDIA), first proposed by Liu et al. [17], is a cyber-attack where power system state estimation outputs are corrupted by injecting false data into meter measurements in a carefully coordinated fashion. The defining feature of a successful FDIA is that the state estimation residual falls below a hypothesis test threshold despite the presence of corrupted measurements; the attack thereby may evade detection.

Yet, smart meters, even they have protection against physical damage using sophisticated microcontrollers, they are still vulnerable to electricity theft and false data injection attacks. Furthermore, as a fully trusted party, a trusted authority should be implemented in the AMI system model; it is responsible to insure random secret keys to household users and operation center through a secure communication channels. Hence, some issues like how to design an effective privacy preserving, secure and fault tolerant smart metering scheme, and AMI architecture resisting to power theft and detecting false data injections in smart grid, still merit more investigations and effort by the both academia and industry.

Motivated by the aforementioned issues, we propose SecMetering, a novel security scheme for electricity smart metering against false data injections with range-based sifting. The proposed scheme includes a hierarchical and distributed intrusion detection system (i.e., HD-IDS) based on new distributed fog architecture for AMI. By ensuring accurate false data detection, SecMetering aims to deal with real-time consumption report failures in smart grid environment. We believe that the distributed monitoring based on fog architecture allows early detection of planned and coordinated attacks in AMI. Moreover, it allows the network administrators to localize intrusions and to take preventive measures rapidly.

To the best of our knowledge, our work is one of the first attempts to design a hierarchical and distributed intrusion detection system based on Fog architecture to secure smart metering against false data injection in smart grid energy environment. We validate our solution using real-word traces of households' electricity consumption of California city. The main contributions of this paper are as follows:

1)

We propose SecMetering scheme, with the desirable features of false metering data injection detection, under hierarchical and distributed IDS (i.e., HD-IDS). The HD-IDS is designed on smart grid environment based on distributed fog architecture. The objective is to implement three protection levels over the fog layers (home area network gateway, residential area network gateway, and fog operation center).

2)

We use a mathematical process based on stochastic modeling to formalize the false data metering detection problem, where we study the behavior of each smart meter. To do this, we prove that our stochastic process is a Semi-Markov process. Then, the behavior study of smart meters is represented by an embedded Markov chain under seven possible smart meter states (e.g. authentic, suspicious, malicious, etc.). Then, we define the parameters of the chain (e.g., state transition diagram, states holding times, and transit probabilities). The objective is to efficiently analyze the behavior of each smart meter and then detect the intrusion immediately.

We define the probability transition of a smart meter from state to state for all , 2

as follows:

After defining the states of our Markovian process and their different properties, we use a stochastic state transition matrix denoted by to represent the evolution of a measurement of a smart meter over the time. The matrix contains the probabilities of transition between two states (i.e., classes according to the range-based measurements sifting policy) of , where = , , ∈ .

We give the probability of each matrix entry by the following:

Where is the number of transitions of smart meter from current state to another state , and is the expected number of visits to state .

Each entry ,→ denotes the conditional probability that smart meter moves from state to state . As we can see in Fig. 3, we have not transitions from states STOP to any other states. Thus, this is called an absorbing state, once entered the system stays in this state; this means that the attack is happened and an intrusion alert should be signaled to the corresponding smart meter. However, all other states . . , , , , , are transient states, because starting from them, there is a positive probability that the chain will never return. Besides, they are positive recurrent where we can have a sequence of states starting and ending at . To model the operation of embedded Markov chains without self-loops, we distingue two equivalent cases as follows:

 Self-loops and unit holding times: as shown in Equation (5.3), the Markov chain changes state at each step and has self-loops. The holding time in this case is one unite of time.

 No self-loops and geometric holding times: in this case, we see the chain only at epochs where the chain makes transition that are not self-loops. The Markov chain operates as a Semi-Markov process. When entering state , the chain remains there until it jump to another state according to the transition matrix of the embedded Markov chain.

On the one hand, for the No self-loops states, the stationary probability of the Semi-Markov process denoted by ~, = , 1, …, from Equation (5.8), ~ can be written as follows:

On the second hand, for the self-loop states, as proved later these states represent an irreducible Markov chain with one ergodic set, then the stationary probabilities are unique and given as follows:

Yet, it is clear that the two cases of the Markov chain given above have the same stationary distribution. Consequently, we can rewrite the global balance equation of Equation (5.16) for as follows:

.17

Likewise, Equation (5.7) can be rewritten a follows:

Finally, Equation (5.15) involves that

Algorithm 3: Observation control Algorithm (ObsCon)

Performance Evaluation

In this section, we evaluate the performance of our proposed solution via extensive simulations using real-word traces of households' electricity consumption of California city.

We consider the following criteria, intrusion detection rates, time cost, communication overhead, energy curve, and energy price under various system topologies. In addition, we study the impact of false measurement injection attack on smart grid environment. Finally, we compare our solution with three other relevant and recent works (i.e., [START_REF] Ni | Differentially Private Smart Metering With Fault Tolerance and Range-Based Filtering[END_REF], [START_REF] Bao | A New Differentially Private Data Aggregation With Fault Tolerance for Smart Grid Communications[END_REF] and [START_REF] Won | Privacy-Assured Aggregation Protocol for Smart Metering: A Proactive Fault-Tolerant Approach[END_REF]).

gives normal prices according to the real energy consumption from real and secure measurements.

SecMetering Comparison with Related Works

In Figure 5.6, we compare SecMetering with three recent works DiPrism [START_REF] Ni | Differentially Private Smart Metering With Fault Tolerance and Range-Based Filtering[END_REF], DPAFT [START_REF] Bao | A New Differentially Private Data Aggregation With Fault Tolerance for Smart Grid Communications[END_REF],

Jongho et al [START_REF] Won | Privacy-Assured Aggregation Protocol for Smart Metering: A Proactive Fault-Tolerant Approach[END_REF]. In Figure 5.6(a) and Figure 5.6(b), we compare our SecMetering scheme with DPAFT and Jongho schemes respectively. The simulations are done using the same parameters used in [START_REF] Ni | Differentially Private Smart Metering With Fault Tolerance and Range-Based Filtering[END_REF], [START_REF] Bao | A New Differentially Private Data Aggregation With Fault Tolerance for Smart Grid Communications[END_REF] and [START_REF] Won | Privacy-Assured Aggregation Protocol for Smart Metering: A Proactive Fault-Tolerant Approach[END_REF], by generating realistic consumption traces during evening peak hours for 2000 households. We generate false data injection attacks at different levels and at each reporting time. As it can be seen from the figure, SecMetering, compared to DPAFT and Jongho schemes, gives approximatively the same energy metering reports as given in the historical authentic metering data (i.e., the real consumption data saved without attacks). This is because SecMetering improves the accuracy of a large scale of failures reports (caused by the data injection attack), by tacking in consideration all states of the smart meter, where the attack is confirmed after an efficient analysis of the behavior of each smart meter using the proposed algorithms. Moreover, the failure reports are replaced by the authentic historical data, thus the micro grid receives a confirmed measurement from the fog operation center.

Chapter Summary

In this Chapter, we proposed a new scheme for securing smart meters called SecMetering.

SecMetering The remainder of this chapter is organized as follows. In section 6.1 we present a probabilistic model for hierarchical fog servers. Section 6.2 describes the priority queuing model for IIoT data scheduling. In Section 6.3, we introduce the IIoT data assignment and offloading algorithms. The evaluation of the proposed architecture and algorithms is discussed in Section 6.4. Finally, Section 6.5 concludes the paper.

 Before the first crash (from 1 to 3 min): we observe that the percentage of scheduled requests is stable for all topologies, and the 3-tier fog hierarchy topology outperforms the author topologies where it can reach 99% of scheduled requests, 91% for 2-tier hierarchy, and 72% for flat topology.

 After the first crash (from 3 to 7 min): we observe that the percentage decreases for the tier topologies from 3 to 4 min (i.e., to 80% for 3-tier, and to 70% for 2-tier). After 4 min, we observe that the percentage increases for the two topologies quickly to reach 98% for 3-tier and 90% for 2-tier. To loss of these requests can be explained by the crash of the server, where the requests scheduled in this server are not handled. However, we see that the problem is rapidly solved by offloading the incoming request to other servers of the hierarchy using IIoT_Off algorithm, and reallocating the computation capacities according to the new situation of the fog hierarchy (the proposed algorithms can be adapted rapidly to any situation change in the architecture by modifying the initial parameters as the number of servers at each tier). However, for flat architecture, we can see the percentage still increase until 35% at 7 min, because we have only one tier (we can offload the requests to other tiers).

 After the second crash (from 7 to 12 min): we observe that the percentage of the scheduled IIoT requests for 3-tier topology decreases to reach 70% at 8 min, and it increases to be stable between 90% and 95%. However, for 2-tier topology, the percentage decreases significantly to reach 50% at 12 min. This is because we have only one sever at tier-2 for 2-tier topology, and by crashing the server at tier-2, the topology becomes flat where we cannot offload the IIoT requests, also, we cannot aggregate the optimal results, this is way the percentage did not increase. Nevertheless, for 3-tier hierarchy, even a server is crashed at tier-2, we still have a hierarchical topology with three tiers. Hence, we can adapt and execute our algorithms according to this situation.

Chapter Summary

In this Chapter, we propose an efficient fog architecture for industrial internet of things applications, and introduce a new scheduling model for IIoT data processing. The proposed architecture is based on multi-tier servers' deployment at the fog layer. To efficiently schedule different industrial devices requests in a real time way, we developed an optimal workload assignment algorithm named IIoT-OFF by solving a mixed nonlinear integer programming (MNIP). Then, the optimal solution is aggregated over different tiers using a new Simulated Annealing Algorithm (SA). The advantages of the proposed hierarchical fog architecture required information to the control plane. Additionally, in order to improve service access efficiency of autonomous vehicles, we consider the content fragmentation module as a service that is provided at the application plane. It requires the help of the autonomous-driving trajectory predection module to enhance data dissemination while offering real time information about nearby services.

Network and Service Slicing System Model

Ensuring and end-to-end service is among the main goals of 5G networks. We investigate the end-to-end performance of multi-service slicing in networks based on a distributed and scalable SDN architecture. We begin by outlining the corresponding system model, then detail our function slicing model.

System Model

We analyze an interesting use case in vehicular networks where end-to-end communications delay is a critical metric. Indeed, we focus on autonomous driving vehicles with intensive computing tasks for real-time traffic detection and driving decision making. In this specific scenario, a softwarized 5G infrastructure enables large data transfer from various sensors on autonomous vehicles (e.g., cameras, sensors, ultrasonic radar…) to an operation center. Since the requirements for serving autonomous driving vehicles in terms of data rate and delay are hardly supported by microwave systems, the use of 5G mmWave cellular is considered here as a primary option for the autonomous vehicle. Other radio technologies are used as backup [107].

1)

Environment and mobility model: We assume a typical urban setting similar to Central

Paris. An urban outdoor environment is projected on a plane ℝ 2 where the roads are modeled using the Manhattan Poisson line process (MPLP) [START_REF] Maurice | Stochastic geometry and architecture of communication networks[END_REF]. The road distribution model is featured by two unit-density homogeneous Poisson processes , ⊂ ℝ 2 along the -axis and theaxis, respectively. At each point of these processes, an avenue (West-East direction) or a street (North-South direction) grows infinitely along the -axis and -axis. The total street width is and there are lanes in each direction, each having the width of . We model a straight segment of a street with left-side traffic.

We assume a test scenario with a number of autonomous vehicles denoted by are traveling at a random speed that follows the probability density function (PDF) of .

The height of the vehicles is denoted by ℎ and all antennas are placed on their roofs for better channel conditions. Also, we assume that we have a number ′ of manually driven vehicles

Parametrization of Experimentation Scenario

We model a 4-lane bidirectional street of 20 m width in the city of Paris. Each lane has a width of 3.65 m. We assume the Tesla Model S form factor with the dimensions of 4.979 m, 1.964 m, and 1.445 m as the autonomous vehicle. The number of AVs follow a uniform distribution from 2 to 10 vehicles. Following the data from [115], we allow the length of other vehicles, to follow a Gamma distribution with a mean of 4.5 m and a variance of 0.5 m 2 . As for the height, we assume that it adheres to a Gamma distribution with a mean of 1.7 m and a variance of 0.3 m 2 . The speed of vehicles (including autonomous vehicles) is uniformly distributed between 20 km/h and 80 km/h, which is representative of dense urban setting.

The mmWave radio propagation follows the default 3GPP protocol, where the case of blockage is modeled as NLoS conditions. According to 3GPP release 14, in case of blockage, the mmWave radio access is capable of establishing an alternative NLoS path that is currently nonblocked. We also adopt the typical parameters of mmWave cellular. Specifically, we set the transmission power to 25 dBm and the center frequency to 73 GHz with 2 GHz of bandwidth.

Antennas' gain for BS and autonomous vehicles is assumed to be 15 dB and 10 dB, respectively.

The noise floor is set to -80 dB.

SliceScal Implementation

To demonstrate the ultra-low latency approach for autonomous driving advocated in this paper, we construct a simple but representative proof-of-concept implementation of SliceScal core network. In our test implementation, we use two Linux servers implemented on two DELL OptiPlex 7050 with 32GO of RAM and Intel core i7-7500T CPU 3.75GHz. Each Linux machine acts as the SDN edge controller (EC) In each Linux machine, we implement five VMs, three of them act as SDN fog controllers (FC). We use Mininet 2.1.0 with OpenFlow 1.3 for the SDN FC data plane as it is more scalable and provides a realistic environment. The two remaining VMs are used as hosts to either generate or receive data traffic. The generated UDPflows are created with iperf [START_REF] Iperf | The ultimate speed test tool for TCP, UDP and SCTP[END_REF] and represent either autonomous driving traffic or best effort traffic (other vehicles traffic.

Further, we employ the OpenDaylight (ODL) SDN controller to manage FC switches. The communication between the ODL controller and the switches is based on the OpenFlow protocol. In order to have a distributed control plane, the topology of our core network has been implemented using POX [117]. To maintain the priority of the critical autonomous driving flows with respect to other flows (e.g., best-effort traffic), FC maps a flow onto a priority queue.

Relying on each FC controller, we assign the data flows initiated by the VMs hosts to the For smart grid energy management, we proposed three contributions (i.e., an EV energy plug-in model, a dynamic pricing model, and a secure architecture for smart grid energy metering against false data injection attacks). We proposed an energy saving solution in smart grid by proposing optimal scheduling models for plug-in EVs charging. The plug-in system model of EVs is based on calendar planning using distributed Fog computing capacities. We used a multi-priority queueing system to manage the plug-in of EVs at each electric public supply station; the proposed queuing system used a cut-off discipline in order to enhance to plug-in process. To improve our planning scheme and maintain the energy curve stability, we proposed three optimization algorithms as follows: 1) two priority attribution algorithms for both the calendar's plug-in and random plug-in according to different energy constraints, and

2) an algorithm to select the optimal EPSS for each EVs to plug-in.

In addition, we proposed a real-time dynamic pricing model for EVs charging and discharging service and building energy management, in order to reduce the peak loads. The proposed approach used a decentralized cloud computing architecture based on software define networking (SDN) technology and network function virtualization (NFV). We formulated the problem as a linear optimization problem for EV and a global optimization problem for all micro grids. We solved the problems by using different decentralized decision algorithms. The extensive simulations and comparisons with related works proved that our proposed pricing model optimizes the energy load during peak hours, maximizes EVs utility, and maintains the micro grid stability.

As an extension to SecMetering, would be to implement a coordinated fault protection mechanism with the help of decentralized fog infrastructure in each micro grid. In this mechanism, different equipment are able to perform together efficiently. In addition, we aim to add a state estimation and perception method based on Machin learning for proactive and adaptive management for micro grid. Therefore, adequate strategy can be taken by service providers in order to provide reliable energy services to the end-users. Récemment, le Cloud computing, avec ses vastes capacités de calcul, la capacité de stockage et ses aspects distribués, a été considéré comme une approche clé pour le traitement de données volumineuses [START_REF] Alippi | A Cloud to the Ground: The New Frontier of Intelligent and Autonomous Networks of Things[END_REF], [START_REF] Chekired | Smart Grid Solution for Charging and Discharging Services Based on Cloud Computing Scheduling[END_REF]. Toutefois, dans les systèmes traditionnels, la plupart des interactions entre les périphériques IIoT et les serveurs principaux se font via des centres de données cloud

Industrial