Energy-efficient routing protocol on public roads using real-time traffic information

Wireless technology has been significantly expanding to perform automotive services related to enhancing road networks and increasing traffic safety. Internet of Vehicles (IoV), as a part of wireless sensor technology, has succeeded in making considerable progress in promoting and protecting human lives from the damage caused by traffic accidents. The road statistical reports demonstrated that utilizing data dissemination techniques in IoV to share timely information about the vehicle’s position with drivers plays a key in avoiding accidents occurrence. This type of technique enables data propagation in a collaboratively and efficient manner to boost real-time performance. However, several limitations have arisen in network bandwidth usage and power consumption, as well as communication reliability with increasing packet loss probability. The main objective of this study is to present a new vehicular architecture that supports the integration of Software-Defined networks and fog computing for enhancing VANET performance. An energy-efficient and QoS-aware routing technique allowing for control of excessive dissemination of data traffic across the networks is also proposed. The simulation results show that the proposed routing protocol introduced an accurately controlling methodology in the transmission rate of data packets and communication reliability of VANET. There is a 50–60% enhancement of the whole power consumption and network throughput, depending on the implementation of the proposed geographical routing methodology.


Introduction
Internet of Vehicles (IoV) has emerged as a promising application allowing intelligent networks for supporting real-time interaction and tremendously in the road traffic journey. It considers a seed of establishing a high travel quality with the reduction of environmental emission, as well as accelerating driver reactions against inconveniences derived caused by the developing countries' decrepit infrastructure [1]. Vehic-ular Ad-Hoc Network (VANET) is a perfect example of a distributed network that can be considered a core of IoV. It allows various vehicular systems to exchange their information through different locations and patterns, such as Vehicles-to-Vehicle (V2V), Vehicle-to-Infrastructure (V2I), and Vehicle-to-Everything (V2X) [2]. Although VANET offers a wide range of automotive services for paying passengers' needs and satisfying Quality of Service (QoS) constraints, it may not guarantee the local traffic databases and timely detection of road conditions as well as lacks transmission reliability among vehicles that have adversely affected the rate of network lifetime and overall performance. Due to its rapid change in their network design, high consumption of transmission power, limitations of communication range, and frequent fragmentation [3].
One heavy task that causes significant damage to network lifetime and bandwidth usage is the excessive data transmission rate among different vehicular units; this was compounded by power constraints on the mobile sensor nodes [4,5]. The energy-efficient routing protocol is designed by providing the most effective path for data gathering taking into consideration energy conservation. According to [6][7][8], the recent research in the routing methodology has been divided this topic into two main directions: (i) the topology-based routing methodology that concerns the nature of network topology, the packet forwarding in this type based on the information collected about the state of path/link (s) such as Ad hoc On-demand Distance Vector routing protocol (AODV), Source-Tree Adaptive Routing (STAR) protocol, Optimized Link-State Routing (OLSR) protocol; and (ii) the position-based routing methodology that concerns the geographic routing protocols, for instance, Fisheye State Routing (FSR) protocol, and the Temporally Ordered Routing Algorithm (TORA). In this method, packet forwarding uses the information collected about the current physical position of the nodes. Consequently, the use of geographical routing protocols can provide an acceptable level of real-time performance when it deals with elevated dynamic change in VANET topology, for various reasons, the most important is each node can trace and figure out the current physical position of the other participated nodes, and there is no need to maintain the up-to-date routing path [9].
During the position-based routing methodology, discovering the optimal route between the source for the destination node has essentially relied on a good knowledge of all neighboring nodes. The effective path selection would be achieved by the node broadcasting a massive amount of its data with other neighbor nodes over the network. This resulted in a negative influence on network bandwidth and overall performance. Otherwise, the Roadside Unit (RSU) and Base Station (BS) are the data management components in VANET, which are concerned with managing the traffic transmission flow on both the vehicles and cloud server sides. This type of process typically exhausts a large part of network bandwidth and sensor battery life. Moreover, the high mobility of vehicles at different densities and speeds will yield continuous breaking of the established communication links between a vehicle to RSU and between the RSU and the cloud server as well. This resulted in a shortage in network stability and response time. Thus attain real-time networking with low power consumption, acceptable data dissemination delay, and less communication overhead, the data transmission rate should be controlled [10,11].
To achieve reliable data traffic with acceptable network lag and bandwidth usage, the Software-Defined-Network controller (SDN-controller) has been introduced. According to [4,12,13], the processes of sensors deployment and data transmission between them consume correspondingly 90% of the total energy of sensors batteries, thus the network lifetime ends rapidly, and the packet loss rate rises growth. Routing tasks capture the optimal paths between source and destination nodes to alleviate the influence of high data transmission rate; hence, providing global and local net-work overviews has become inevitable. The SDN-controller can be used in vehicular networks to give accurate information about the current traffic status; it successfully forged collaboration between different data management units to provide local network overview.
SDN-controller improves overall VANET performance by reducing computational power and managing data transmission. SDN-controller allows the network operations to decouple data exchanges that come from both RSU and BS and logical operations. Such separation not only enhances network performance but also keeps the data transmission rate under control. Moreover, SDN-controller supports the QoS constraints via accelerating internal decision making, maximizing resource provisioning, and simplifying network management operations. One significant control operation enabled by SDN-controller is "OpenFlow." The OpenFlow switch can maintain all flow tables containing a list of flow entries into the network. It also featured by providing a good overview of network status and topology, breaks complexity, is easy to upgrade, replaces traditional traffic system, and it can improve road traffic tremendously. Consequently, the SDN-controller considers a suitable way to trace the current physical traffic status and provide a local network overview of the VANET, but the global network overview is still lacking [2,10].
Fog computing extends locally cloud computing services, where it can provide the global traffic conditions and elastic cloud services closer to the edge of the vehicular network. This concept enables the vehicular networks to control, process, store, and extract sophisticated data locally without any need to be uploaded this unprecedented volume of data to the cloud server. These features not only reduce network bandwidth usage and power consumption but also increase network lifetime and stability [14]. Surely, real-time decision making is the big challenge that faces the majority of real-time applications including the IoV and its services; fog computing can handle this problem by controlling the volume of data traveling to the cloud server as well as reducing data processing time and supporting high mobility, thus emergency responsiveness and network traffic quality will be increased [15,16]. Since fog speeds up location awareness and response to unforeseen traffic events. Meanwhile, it can cope directly with both vehicular units and cloud sides. Therefore, it considers a perfect computing platform for providing a global traffic network with low latency [17].
The main objective of this study is to introduce a dynamic real-time interaction architecture called Software-Defined Network and Fog computing based on Internet of Things (SDNFoG-IoT) for improving the communication of urban vehicular networks. This SDNFoG-IoT architecture is successfully proposed as a vehicle system design methodology that has the potential to achieve energy conservation and effective path estimation as well as satisfying real-time con-straints. Recent research in adjusting data dissemination issues has been focused on three directions: (i) network bandwidth and power consumption, (ii) premature end of network lifetime, and (iii) communication and traffic reliability. To this end, the integration between SDN-controller and fog technology is used in the proposed SDNFoG-IoT to solve the excessive data transmission rate over the network that causes issues in network bandwidth and network power consumption alike. The QoS-aware routing methodology in the SDNFoG-IoT architecture is proposed to establish an effective solution that can reduce the power consumption issue and thus get control of network lifetime and communication reliability. Otherwise, the effeteness of different network parameters on the proposed SDNFoG-IoT architecture is investigated by a collaborative mathematical model to gain QoS assurance. The simulation results prove that the proposed routing protocol achieves accurate control of the data packets dissemination rate of VANET. The whole network performance is measured in terms of energy consumption, throughput, packet delivery ratio, packet loss ratio, end-toend delay time, and routing overhead.
The rest of this paper is structured as follows: In Sect. 2, the recent literature review studies is reviewed. In Sect. 3, the SDNFoG-IoT architecture in proposed. In Sect. 4, the proposed routing and verification methodology are presented. In Sect. 5, the preparing Energy-Efficient Routing Methodology (EERM) via the mathematical model to guarantee link quality and compute network lifetime is demonstrated. In Sect. 6, simulation results and discussion are analyzed. In Sect. 7, the paper is concluded.

Literature review
Over time, academic research has been widespread on developing the urban transportation systems by adjusting the data dissemination rate. Several studies indicate that the combination between SDN and fog computing is a promising solution to keep the data dissemination rate in line. Hence, different aspects of vehicular systems have been enhanced like network bandwidth, power consumption, communication reliability, and delay time.
Fog computing technology has widely used to enable new opportunities can enhance the connection reliability in VANETs. Jorge Pereira et al. [18] proposed a computing vehicular architecture and a proof-of-concept system for supporting fog services and their applications in smart mobility. Such architecture provides local data analytic on the user edge to avoid delay time and latency; this is achieved by redesigning both RSUs and On-Board Units (OBUs) to act as fog nodes. The results were indicated that applying fog technology in smart mobility could achieve reliable information in a shorter period. This architecture is suitable to provide high reliability of message delivery, accelerating response time, and enhancing location-awareness. However, the power consumption and sensor battery lifetime must be considered. A geographically distributed computing architecture based on fog computing was also introduced in [19]. This architecture allows VANETs to adjust the rate of data uploaded to the cloud server; thus the network bandwidth is maintained. Enhancing transmission of power and saving communication range were the main contributions of this proposed architecture. Increasing network scale was a limitation in this proposal.
Enhancing the collaboration among vehicular units through sharing information about the overall network conditions is closely connected with published research in handling data transmission rates. This led us to the idea of installing a control device such as SDN at the edge of network customers to provide local data processing and avoid higher bandwidth usage. Z.H.Ali et al. [20] introduced two mechanisms for improving drone performance are: (i) a service aggregation approach to simplify the amount of data traveling across the drone bandwidth and (ii) a normalized throughput of a channel with controlling the interference ratio that indicates medium access control (MAC)layer overhead. A Kumar et al. [21] offered a Novel Software-Defined Drone Network (SDDN) with collision avoidance strategies for deploying UAV units to monitor road traffic. This architecture attempts to handle large amounts of data dissemination to minimize the use of network bandwidth, extend sensor battery life, extend drone flight time, and reduce communication overhead.
MT Abbas et al. [22] provided a new road-aware routing strategy using SDN. The road networks are divided into a set of segments including RSUs for multi-hop communication. SDN performs as a control unit that manages the rate of messages dissemination in VANET. The delay time reduction was the main contribution in this proposed strategy. However, SDN has a limitation in building global network overview about all road conditions. Routing framework based on SDN for adjusting message dissemination over the vehicular networks was also demonstrated in [23]. The use of SDN in routing shrinks communication overhead; because SDN supports the switching concept in the calculation of optimal path. Several studies on establishing an alliance system between fog computing and SDN have been appeared to see the performance of VANET is constantly holding. Ahmed J.Kadhim [10] investigated a multicast routing approach that includes deadline and bandwidth constraints based on both fog and SDN technologies to reduce transmission power in VANET. Such routing approach ensures the QoS constraints through scheduling and classification algorithms of multicast requests based on priority. The advantages of this proposed model were decreasing power consumption and time complexity; while the scalability feature was still limited. Another rout-ing method based on fog and SDN technology was introduced in [12] to maximize transmission reliability and decrease excessive network bandwidth usage. This developed method can affect the performance of vehicular systems and offer a list of locally services include elastic vehicular cloud services, traffic monitoring services, route planning, traffic alert dissemination, and content transfer. Moreover, it was featured with high stability and low delay time. In [24], routing protocol based on the intersection between fog computing and SDN for controlling information dissemination in V2V manner was suggested. The effectiveness of the proposed algorithm was tested in terms of packet delivery ratio, packet loss, and delay time.
NB Truong et al. [25] presented one system using the fog and SDN technologies that allows vehicular systems to improve their performance in terms of delay time, scalability, reliability, location-awareness, and resource utilization. The use of SDN in the proposed architecture simplifies the VANET management by separating data control and forwarding functions. Therefore, the response time is enhanced. Controlling the rate of power consumption is still needed to be considered. J Pushpa et al. [26] measured the VANET performance by applying fog computing and SDN in terms of connectivity, network bandwidth, and time latency. The superiority of the proposed tool was caused by Network Function Virtualization (NFV). The feature of virtualization helps to improve response time and handle traffic flow. A system of Internet of Things (IoTs) services that can utilize resources and manage transmission flow over the network was proposed in [27]. In this system the integration between fog computing and SDN was used as powerful model for the networks intelligence. However, network scalability was still a big issue.
A novel service architecture based on synthesizing the paradigms of SDN and fog computing in VANETs and a dedicated data scheduling algorithm were designed in [28]. The novelty here was facilitating data scheduling among high dynamic environment through the integration between SDN and VANET. The nature of SDN architecture helps data management units to reschedule requests generated by vehicles, therefore resource utilization is enhanced. Otherwise, the rapid growth in data dissemination rate was treated through fog computing to maintain network bandwidth usage. The complexity of the proposed algorithm was a raised problem. Joseph Khoury [29] studied the effect of SDN and fog computing on the network bandwidth usage and delay in VANET. The combination between these two technologies were highly effect on the data propagation rate over the network this led to enhance the overall network performance. Recently, research on improving real-time performance in vehicular networks has gained extensive attention. The use of fog computing and SDN has provided a successful model in terms of data dissemination, power consumption, and network bandwidth usage. However, the growing demand toward offering developed transport services without compromising QoS constraints is still heavily required.

Proposed software-defined network and fog computing based on IoT architecture
The main objective of the proposed SDNFoG-IoT architecture is to present a dynamic real-time interaction architecture with effective path estimation supporting the integration between SDN and fog computing technology; as well as providing an energy-efficient and QoS-aware routing protocol to get control of fast-frequently fragmentation, premature end of network lifetime, and network bandwidth usage in VANET. It will be resulted in improved overall real-time performance and controlled the data dissemination rate across vehicular networks. The SDNFoG-IoT architecture performs in two levels are control traffic services and data transmission. The control traffic services provided by the SDN-controller to uniform resource utilization of all routing path among the FOG nodes, while the data transmission level afforded by FOG technology to adjust the excessive transmission rate of data acquired from sensors to the cloud server. As seen in Fig. 1, the proposed architecture is designed as a hierarchical structure to support the scale-free topology and therefore it has a degree of distribution networking solution. One whole process is separated into a set of small tasks. Each task is allocated to one of the layer in the proposed architecture that works stalwartly to process the task only. Four proposed layers in SDNFoG-IoT architecture are presented as follows: the inside vehicle, SDN-controller, FOG-controller, and cloud service tiers. The inside vehicle tier is built upon the VANET network and it is composed of smart vehicles are fully equipped with the cache memory, communication unit called OBUs and Global Positioning System (GPS), Geographic Information System (GIS), as well as several stationary infrastructure nodes called RSUs, are deployed throughout the roads to obtain network coverage between vehicles themselves and vehicles and traffic management authorities. With SDNFoG-IoT architecture, SDN-controllers perform resides with the RSU to deliver a network edge that serves as a centralized global monitoring system of the traffic forwarding message. We assume that the RSU nodes placed at junctions reconfigured to work as an SDN-controller node for realizing affordable cost. A single SDN-controller is responsible for proving its services on a certain scale that has been determined by the FOG technology. Each SDN-controller has been labeled with a unique ID to facilitate the information propagation about the road conditions across the vehicular entities. The vehicles able to connect to the nearest SDN-controller via its propagated ID, and every controller sends a periodically request message for the connected vehicles about their information such as the real position, velocity, and movement directions to keep an up-to-date overview of the network. This obtained information has recast by SDN-controller to build routing and flow tables. A routing table is a neighborhood table that contains the information about network topology, vehicle state, and optimal routing path calculated via the proposed routing protocol. Otherwise, a flow table involves information about the status of packet forwarding and dropping over the network. The new routing paths generated by the routing decision are also saved on the flow table. Moreover, SDN-controller is able to provide a primary level of protection for data exchange between FOG tier and vehicular units. The goals of deploying SDN-controllers reside with the RSU can be considered as follows: (i) providing simple real-time networking controller services, (ii) building real traffic database as close as possible to vehicular entities, (iii) offering a global monitoring system for different roads and trajectories, and (iv) reducing network bandwidth usage through controlling the rate of data propagation over the network.
The FOG-controller tier is the second controller tier after SDN-controller in the proposed architecture. It can provide management functionalities by supervising vehicular network data transferring, as well as it offers a place to summarize data traffic as close as possible to the end-user and then store it into the cache memory. This 2 nd tier comprises a set of FOG nodes with high capability to communicate with the lowest layer through FOG-to-SDN connection to obtain traffic-oriented communication. FOG nodes offer an early form of data filtration due to their ability to prevent the passage of the whole data coming from SDN-controller to the cloud; they only push a copy of the most effective data and compute out of the cloud centralization system. Therefore, network bandwidth and response time are enhanced. The data stored in FOG nodes are divided into data sent to get locally processing, and another to build a network overview; this last type of data is stored in a flow table.
With the proposed architecture, each FOG node is assigned to cover a certain scale of the vehicular network called fog relevance zone. Every fog relevance zone has predetermined according to the available FOG communication range. FOG nodes propagate their contact information within each relevance zone to facilitate the communication operation between The FOG nodes themselves and the deployed SDN-controllers in the infrastructure/inside vehicle tier. According to obtained data from the SDN-controller, the FOG nodes automatically build a flow table containing upto-date information about the current network topology and different road conditions. This flow table is beneficial for navigation purposes due to its capability to support nowcasting instead of forecasting technique and therefore, the immediate action across the vehicular network is enhanced. Surely, the timeliness of delivered messages with a high rate of transmission reliability is improved. Assume that every FOG node covers its fog relevance zone by transmitting an identification message contains its unique ID, and it also delivers the list of its service options. The only SDN belong to this zone can receive and deal with this propagation message and then adding extra information such as its SDN-ID and Type of Service (ToS) setting, which allows differentiating in the priority of services. By default, the request from the ambulance is getting a high priority. Surly, this operation is extremely beneficial to the navigation acceleration. The controller in SDN reassembles the identification message as follows FOG-ID, SDN-ID, ServiceOption, Timestamp, and ToS to send it for connected vehicles in the fog relevance zone. The SDN labels the incoming response from FOG and starts to classify them into three main categories: (i) complete service with the highest priority has assigned to the urgent request incoming from ambulances, (ii) supple service with the modest priority has assigned to ordinary vehicles, and (iii) open service with the lowest priority has assigned to other lands transportation such as buses, motorcycles, and vans. This classification guarantees improving response time and reducing latency.
The cloud services tier is the upper tier of the proposed SDNFoG-IoT architecture. The cloud servers offer storageas-a-service as well as their ability to construct historical data about the overall vehicular network. As a result, network coverage is enhanced. Moreover, the cloud servers perform complex computations for a tremendous amount of data transmitted from FOG and they provide analysis optimization tools and on-demand elastic services that are accessed via FOG nodes only. Surly, deploying fog nodes in the two lowest layers helped to diminish the network capacity usage and power consumption due to full control in the data dissemination rate over the network. Hence, the network bandwidth between FOG layer and cloud computing is available to broadcast only the critical traffic events.

Mobility module
This section is going to present the mathematical model to construct the network topology of the VANET. All abbreviations that are used for the proposed routing methodology EERM are listed in the following Table 1.
The SDNFoG-IoT architecture fragments the scale of inside vehicle tier into several F R Z area (see Fig. 2). Every F R Z area holds a number of mobile vehicles, several stationary road units, and a set of SDN-controller installed beside RSU placed at the road junctions. The FOG nodes are scattered randomly in the fog controller tier within two dimensions (3000n × 2000m) area and managed by a single FOG node called FOG Head (FH). An FH is a representative by SDN-controller according to different QoS measurements such as level of power and link quality calculations.
The mobility model is shown in Fig. 3. The VANET topology represents as follows: G = (V , e, w) where V is a finite set of vehicular objects N , N is S ι , the ι symbolizes the ιth vehicle nodes in which ι ∈ {1, 2, 3, ..., n}. The E is a set of edges connecting pairs of vehicular objects V ι and V j , and the w is a set of weights. Assume that twovehicle nodes V ι and V j need to connect to F H 1 . The F H 1 propagates its registration message with a unique ID in the F R Z area of V ι and V j . Every vehicle can receive this message and save it into their cache. The vehicle node exchanges its timely information with the SDN-controller and F H 1 . The SDN-controller employs this information to build a temporal database. This concept not only improving the navigation between vehicles but also removing communication overhead. Only SDN-controller can connect to the FH to transmit the real information about the road conditions and some important data about vehicle nodes.

Basic constructions and assumptions
After establishing the vehicular network, the proposed SDNFoG-IoT architecture starts to randomly deploy FOG nodes at the 2nd tier called the FOG-controller tier. The objective of this layer is to increase the vehicular system's ability to receive and process sensing data in near realtime with low latency constraints. The proposed architecture The curve-metric distance between a single FOG node and SDN-controller The absolute values of the coordinate differences between the source (SDN) and the current position of Fog node is the amount of remaining energy of node i at round r I The total current (in Ampere)

T
The period time that is taken to send and receive the data packet μi The energy rate of FOG node i at the round (r − 1th)

E min
The probable lowest bound energy during the round (r − 1th)

E max
The probable highest bound energy during the round (r − 1th)

B |delay
The available bounded delay value The transmission delay of a FOG node ith l p The length of a packet that is allowed to transfer over the network bandwidth T |rate The data transmission rate g F R The gap areas number or the number of areas out of FOG's communication range

Propagation |speed
The rate of propagation speed (ω) The constant-coefficient values The minimum radius assigned to determine the internal bound of fog relevance zone (d max ) The maximum radius assigned to determine the internal bound of fog relevance zone The probabilities of the packet loss in forward transmission in a certain link i P |rever se The probabilities of the packet loss in reverse transmission in a certain link i (P |success ) The probability of successful delivery packet from SDN to FOG node (P |unsuccess ) The probability of undelivered packet from SDN to FOG node The number of attempts to retransmit packet over certain link i The power consumed in both transmission and receiver data packets ε mp A multi-path propagation loss ε f s A free space propagation loss The multi-path fading (power loss) The free space (power loss)

E dagg
The energy consumed in data aggregation case Fig. 2 The proposed scenario of SDNFoG-IoT architecture Fig. 3 The mobility model for VANET provides a local computation to control the rate of data dissemination over the network. This resulted in minimizing the unnecessary accessing to the cloud server, and therefore the network bandwidth and power consumption are reduced. SDN-controller sends a multi-cast message for all nodes in the FOG-controller tier to collect updated information about the surrounding environment. In the FOG-controller tier, each node has a chance to be selected as an FH based on its level of energy and its location degree. This information sends to the nearest SDN-controller to build its flow table.
According to the stored data in a flow table, FOG nodes are layered based on their distance to the SDN-controller. This layering is beneficial for the multi-hop communication process. We assume that each FOG node has typically equipped with GPS supports Digital Maps to calculate the distance to the SDN-controller and therefore accelerating the navigation process [30]. For the node that does not has GPS, the Euclidean distance in the local computing of FHs can be used. The basic definitions used throughout this study are presented as follows: is a threshold between an SDN-controller and elected FH node into one fog relevance zone.
-Definition 2: The (F H) is the FOG node with a minimal value of location degree and a high capability of power in order to increase the network stability for as long as possible. -Definition 3: The breakdown energy (E br eakdown ) is a critical power value of sensors that refers to the energy depletion rate of FOG nodes, which may affect the network lifetime and cause failure. The E br eakdown can be calculated as: where E f ogNode is the energy of FOG node and r N is the maximum lifetime of each FOG node. -Definition 4: the drain FOG node rate (D f r ) is the energy drain rate of the FOG nodes is recognized based on the staying energy and the draining speed of the FOG nodes in the FOG-controller tier. It can be calculated as: where E P E is the prior assigned energy of a FOG node, E C E is the current energy of a FOG node. T CT is the current time, T PT is the prior time. By default, the selected FH created a Time-Division Multiple Access (TDMA) schedule and earmarks a time slot for every data transmission. After completing the data transmission, the network comes back to the start-up phase to select the new FH. -Definition 5: the link capacity (Link c ) is the maximum throughput of packet transmission of the link between the selected FH and an SDN-controller, which can be represented as: where P si ze is the maximum packet size by bit. The term ΔT r −T s denotes the time interval by sec., which includes the difference between the time taken to successfully received a packet (T r ) and the total time of packet sent.

Routing construction
This section aims to demonstrate the mathematical model used to guarantee link quality and compute network lifetime. The routing algorithm based on LEACH [31,32] performs in a distributed and decentralized manner is proposed in this subsection. The proposed Energy-Efficient Routing Methodology (EERM) utilizes a hybridization of static and dynamic clustering. The layered architecture involves some vehicular nodes as BSs, RSUs, SDN-controller devices are stationary and installed only at the road junctions, and other deployed nodes called FOG nodes whose movement has restricted within the boundaries of the available communication range. As shown in Fig. 4, the process in the proposed EERM involves three phases are the preparation phase, the startup phase, and the data transmission phase. These processes will be discussed in the following sections:

Preparation phase
The preparation phase is handling in a decentralized manner by distributing and installing SDN-controller devices along the road at each junction. These devices communicate with other vehicular units in a bidirectional connection, while the Fig. 4 The operations of FH selection and routing construction connection with the FOG-controller tier via a multi-cast message to build a global vehicular network overview. The FOG nodes transmit real-time information about their status to SDN-controller. This information includes the distance calculation from a single FOG node to a single SDN-controller and its residual energy level, and then the SDN-controller stored this information into its flow table.

Start-up phase
After collecting the information about the surrounded environment of FOG nodes, the proposed EERM launches its operations through two phases the start-up and the data transmission. In the first round (r ), the start-up phase involves three sub-phases: distance calculation, Residual Power Ratio (RPR%), and location degree. These calculations are needed to build a flow table in both the FOG node and SDN-controller. The flow table at FOG nodes is necessary to facilitate the communication among nodes in the FOG-controller tier; while the flow table is created at the SDN-controller devices to construct the best routing path. Thus, achieving reliable packet delivery with low delay time. After these calculations, the start-up phase has entering a new period, which involves four sub-phases: delay time calculation, FHs declaration, bounded fog relevance zone initiation, and route construction.

Local distance
The FOG nodes are deployed randomly in the 2 nd tier, and they have equipped with a fully Digital Mapping System (DMS). According to [30], the DMS has recently developed to introduce widely digital navigation services. In the proposed EERM, the DMS is a key enabler of local distance calculation in FOG nodes using the Euclidean distance. Each FOG node calculates its distance to SDN-controller based on signal strength. The DMS allows FOG nodes to exchange the real-time traffic information with the SDNcontroller as the road ID and curve-metric distance, which is necessary to calculate the distance between the FOG node and SDN-controller. The Euclidean distance between FOG to SDN-controller can express as follows: where Distance(Υ f og , Υ sdn ) are the curve-metric distance between a single FOG node and SDN-controller that is measured as the sum of the absolute values of the coordinate differences between the source and the current position of destination node |(υ f ogi − υ sdn j )|. All data is stored on the FOGs' database and reordered one by one according to their location of SDN-controller device.

Power consumption rate
Another required parameter calculated locally by FOG nodes is to RPR%. The vehicular networks are composed of a large number of dynamic and static sensors. These sensors are needed to react under real-time restrictions; however, most of them are limited storage capacity, limited communication range, and limited power supply. The fog computing technique aids to ensure real-time data delivery. However, the massive amount of data transferred between vehicles and FOG nodes may cause raising the rate of power transmission. Thus, the network has not been stable enough. Since the vehicular networks need to enhance network performance and avoid energy loss. Surly, measuring the RPR% of each participated node is very important to tackle the network lifetime ends prematurely. Ideally, the RPR% can be given by the Eq. 2.
where E rem (i, r − 1) is the amount of remaining energy of node i at round r ; when r is the required time to complete cluster k and packet gathering process among all vehicular units. The E rem can be measured by the following equation: E total − (I × V × T )J oule, where I represents the total current (in Ampere), V represents the voltage (in Volts), and T represents the period time that is taken to send and receive the data packet. The E total (i, r − 1) is the total energy of power supply units. The energy value of the right side must be greater than or equal to the value of the breakdown point in the left side. The amount of energy and the rate of energy for each node i can be calculated by the Eqs. 3 and 4 respectively.
where μi is the energy rate of FOG node i at the round (r − 1th), while Δt denotes the round duration at time (t).
The μi takes the bounds of energy between the probable lowest bound is E min , and the highest bound is E max during the round (r − 1th). Surly, these energy values are adjusted according to the bounds of E |br eakdown . From Eqs. 3 and 4, the bounds of energy are determined for each FOG node i. Hence, the nodes that have R P R% less than the value of E min will be automatically blocked and can not select as an FH. While SDN-controller has still received data about the energy status of other nodes that have R P R% equal to more than the value of E max . These nodes only can participate in the next round (r s ). This approach affects not only decreasing the probability of premature end of network lifetime but also increasing network stability.

Operations of SDN-controller
During this phase, the objective is filtrating the collected data from the related FOG nodes and recasting it to give a perfect selection of an FH. An SDN-controller can filtrate data according to a set of metrics. In this case, three measurable metrics used, namely, delay time, distance, and R P R%. To obtain the optimal flow and therefore providing the batter routing solution, the weights will be calculated. This section figures out the procedure for selecting a suitable FOG node and a way for establishing the high quality of the link between the selected node and SDN-controller.

Delay time estimation
End-to-End (E2E) delay time is one influential QoS metric to measure network performance and validation. It can define as the total estimation time from sending a packet from a source node (mean FOG node) until reaching a destination node (mean SDN-controller). However, when we consider the nature of the VANET network with heavily change topology and fragmentation, the accurate estimation of this time has become not straightforward, and different required factors must be considered such as distance, propagation time, data bit rate, and routing protocol. At VANET, the E2E can be expressed as: where i ∈ {1, 2, 3, 4, ..., n} are the number of FOG nodes, the term oneHop can be calculated as follows: oneH op |delay = t | processing Delay + t | propagation Delay + t |transmission Delay + t |channel Delay + t |queuing Delay + t |reception Delay [33]. The B |delay is the available bounded delay value. Form the Eq. 5, the delay time estimation of FOG nodes can be formulated as: where the F OG |delay determines by a set of factors are: the term (n−1)l p T |rate represents the transmission delay of a FOG node ith, the n is the maximum number of deployed FOG nodes, the l p is the length of a packet that is allowed to transfer over the network bandwidth, and T |rate is the data transmission rate. The term Propagation |speed indicates the propagation delay time, the d o is a threshold of distance, the g F R is the gap areas number or the number of areas out of FOG's communication range, and the Propagation |speed indicants the rate of propagation speed.

FOG selection methodology
The task is to select the most proper FOG node to be an FH. The digital information received from the FOG-controller tier will be saved into a flow table created by the SDNcontroller devices. Initially, the FOG nodes are layered and reordered themselves according to their distance to the nearest SDN-controller. If the distance between the FOG node to SDN-controller less than or equal to the threshold (d o ), the FOG nodes are placed in the nearest layer to SDNcontroller (1 s t layer). Figure 5 represents FOG nodes layered according to the SDN-controller device. Once the SDNcontroller obtains all FOG network information needed, the SDN-controller begins immediately for the conversion of this information to be more meaningful for declaring FH and constructing routing path. To this end, the weights (W ) will be calculated by the SDN-controller. The location degree, RPR%, and E2E delay time are the significant parameters essential for weight calculations. The lower weights indicate the short path between the SDN-controller and FOG, and thus the optimal path is achieved with the shortest distance between the FOG node and controller device, high RPR%, and low latency. Hence, the SDN-controller represents the According to the Eq. numbers 1, 2, and 6, the W between any pairs (FOG, SDN) can be calculated as follows:

Fog relevance zone measurement
According to the mentioned data in Table 2, the S DN 1 declares F H 51 as an FH. Consequently, the S DN 1 will be arranged other FOG nodes within their fog relevance zone in three layers based on their signal strength. The task of F H 51 is to determination of internal and external bounds of these layers for identifying the fog relevance zone. Achieving this task enables the system to ensure some degree of connectivity within avoiding packet loss. As shown in Fig. 6, two radiuses need to measure: (i) the minimum radius (d min ) has assigned to the 1 st layer for determining the internal bound of fog relevance zone, and (ii) the maximum radius (d max ) has assigned to the 3 nd layer for determining the external bound of fog relevance zone. The (d min ) defines as the difference between the FH and SDN-controller, which can be calculated as follows: In our case, the formula d F H − d S DN indicates the difference between F H 51 and S DN 1 that represents the smallest space can be covered by F H 51 . Otherwise, the (d max ) should not exceed the available communication range; it is predefined for each FOG node. The (d max ) has calculated as the difference between FH and the farthest node deployed in the 3 nd layer, and it can be formulated as follows: From the Eqs. 8 and 9, the total area of fog relevance zone can be modeled as: where F R Z areai is the fog relevance zone for each FH, the π is a constant used to find the circumference of a circle by measuring the radius, and the term of 1 − d max d min is used to determine the internal and external bounds of fog relevance zone. Algorithm 2 illustrates the rules of fog relevance zone identification for each SDN-controller devices. Node is layered in 3 nd layer;

Link quality
One significant factor used to attain transmission reliability and network stability is to the link quality. Constructing a robustness channel between sender and receiver is generally improved the network throughput, decreased link failure rate, and raised the overall message delivery ratio. The term Channel State Information (CSI) is a powerful metric for accurate power transmission control, achievable data rate, and faultless link quality via the Signal-to-Interference-Plus-Noise Ratio (SINR) and loss rate [30,34].
According to our numerical network graph, the link (E) can define as a path established between sender and receiver is to allow the network system to successfully packet transmission. In a wireless communication manner, transmission between nodes on a single link may interfere with those on another if they both use the same radio link and are lies within the same interference range. Therefore transmission interference has become crucial in determining the achievable data rate. Otherwise, the communication of VANET supports a variety of interference degrees, causing noises and distortion that may adversely affect the link capacity. Therefore, network bandwidth usage becomes huge and unworkable. The routing methodology is one solution that could be applied heavily to provide low transmission time through finding out the path with the lowest degree of potential interference and network bandwidth [35].
In the proposed EERM, to find a utility path with high link quality and low SINR. Assume that FOG nodes (F N i ) need to send a packet (P) to (S DN j ) on a link ( ). Hence, the sent packet will be successful received at S DN according to the formula 11: (11) where thr put indicates the link throughput, the P |si ze is the size of a packet that needs to transmit from any FN to SDN. Surely, the size of any sent packet should not exceed the total value of Link c . The N noise indicates the noises that occurred in a link. The BW is an estimation network bandwidth of a certain link , and it can be given as follows: where I R is the Interference Ratio of a certain link i . The term I R can be expressed in a link i as:

S I N R ,BW
SN R ,BW . So, the S I N R ,BW = P ,BW 1−N noise, and S N R ,BW = P ,BW N noise, . The S N R ,BW is the Signal-to-Noise Rate of a certain link i and network bandwidth BW , which use to measure the ratio of signal power to the noise power. The D f r indicates the estimated energy drain rate of the FNs. The final term in the Eq. 11 is to (Ψ ), which is a const value that represents data rate Fig. 6 FOG nodes layered in the fog relevance zone. The minimum radius (d min ) is between FH and SDN-controller in the red circle, while the maximum radius (d max ) is between the FH and farthest node in the blue circle and network and path characteristics. The path loss Path |loss is a common way to measure the power gains and expected attenuation of the signal in the telecommunication systems. In the current situation, the Path |loss can be generally formulated by the differences between the packet loss rate in forward and reverse transmission, as well as it can express using the following formula: where P | f orward and P |rever se are the probabilities of the packet loss in forward and reverse transmission in a certain link i respectively. The actual value of P | f orward and P |rever se is usually dependent on the probability of successful delivery packet (P |success ) and undelivered packet (P |unsuccess ) from SDN to FOG node. The (P |unsuccess ) and (P |success ) can express as follows: where P s−1 is the number of attempts to retransmit packet over certain link i .

Estimation of network stability and lifetime
One objective ensured by different routing approaches is to increase network stability and its lifetime. Network stability is typically referred to as the link quality between two nodes, whereas the network lifetime is referred to as keeping the power of sensor batteries up enough to survive a long time [4,13]. Thus, the best scenario to estimate stability period and whole network lifetime indicate how can reduce the consumption of total power during data transmission and how can link endure longer time during the process of the communication. According to Sects. 4 and 5 , all FOG nodes are connected to SDN-controller at the beginning of the network lifetime at least once, the process of data transmission continues until the end of the stability period. The rate of power consumed in the negotiation between FOG and SDNcontroller can express as follows: N,SDN) )+ r s P si ze (ΔE (trans|rece) + ε mp d 4 F N,SDN) )+ r s P si ze (ΔE (trans|rece) + ε f s d 2

(F N,SDN)
+ΔE dagg )otherwise (16) where the Δ is the different values of FOG nodes degrees. The E (trans|rece) is the power consumed in both transmission and receiver data packets. The ε mp is a multi-path propagation loss and ε f s is a free space propagation loss. The d 4 is the multi-path fading (power loss) and d 2 is the free space (power loss). The P si ze is the estimation of data packet size. The r s is the network stability time. The d o is the threshold distance between FOG nodes and SDN. The E dagg is the energy consumed in data aggregation case. Once the network stability is achieved, there is no significant change in the network topology. However, the energy losses are still a bottleneck due to the massive amount of data required to transfer over the internet. Hence, the effectiveness of the proposed routing methodology EERM has appeared.
From the network lifetime point of view, the route stability indicates the link's ability to be endured a long time without failure. Thus, it does not affect network stability period but also lifetime network topology and communication process effectiveness. In this case, we calculate the lifetime period for the FOG node that already selected as FH. The link capac-ity is link c|max when establishing the connection between FH and SDN. Hence, the network lifetime can be calculated according to Eq. 16 as follows: 6 Simulation results and analysis The connection between these roadside sensors occurred based on the configuration in Table 3 and all network setting is shown as in table 2. The behavior of FOG nodes was simulated by the reference guide called Fog Hierarchical Deployment Model from OpenFog Reference Architecture. For evaluating the proposed routing methodology EERM, a variety of average velocities for vehicles (km/h) and traffic rates (Pkt/Sec) were constructed. The 10 random communication connections were set up to build a traffic source called Constant Bit Rate (CBR) between FOG nodes and vehicular network, which generates the packets size of 512 bytes every 2 Sec. and traffic agent Node-UDP. The establishing connection was tested by transmitting a HELLO message between FOG nodes and roadside units. The interval message was set to be 1.5 Sec. The retrieved details from a HELLO sent message are kept for (2.5 × hellointerval) for each neighbor because some HELLO messages might be lost or delayed due to collisions, even though it is within the identified FOG communication range. The setting of the constant-coefficient values in Sect. (5.2.5) is as follows: ω 1 = ω 2 = ω 3 = ω 4 = ω 5 = .... = ω n ≈ 1.

Simulation results and discussion
The experimental results indicated that the proposed routing methodology EERM based on SDN and Fog technologies has successfully surpassed other state-of-the-art algorithms in selecting the most effective path and controlling excessive dissemination of data traffic over the vehicular networks. The impact of the proposed routing methodology EERM on the network performance has also appeared in terms of power consumption rate and network bandwidth usage. The evaluation of EERM was in terms of routing overhead, power consumption, packet delivery ratio, number of packets lost, throughput, and end-to-end delay.

Routing overhead
In this experiment, the impact of routing overhead was used as a network metric to study the performance of EERM by measuring the ratio of network control packets to successfully delivered packets. As indicated in Eq 18, the NRO can be calculated by three terms represented as follows: where the P | f ail indicates the number of packets that failed to reach the destination, T |mesg is the periodic messages, and T rig |mesg is the trigger messages for arriving the data packet to the final destination. Figure 8a shows the impact of EERM on data traffic rate on network performance. The effectiveness of the EERM was tested on the VANET network to prove the trustworthiness of the proposed routing methodology in avoiding routing overhead issues. In Fig. 8a, the comparison was conducted between network systems with applying EERM, and without applying it to demonstrate the superiority of the EERM to introduce less NRO. Figure 8b shows the comparison between the proposed routing methodology EERM and other state-of-the-art routing algorithms called EMHR with BwEst [30], SFSR [12], and enhanced AODV proposed in [38]. There was a significant difference between the proposed methodology EERM and the enhanced AODV protocol proposed in [38]. As it is shown in Fig. 8b, the EERM came first among other compared routing algorithms with a high ability to avoid routing overhead issues. The enhanced AODV came in the last place with a 6% difference less than EERM. This progress achieved in EERM's behavior was referred to its link capacity and its selection methodology, and thus the stable path has always been introduced.
The EMHR with BwEst [30] was reached the second place with a slight decrease from than proposed EERM, while the SFSR [12] was reached the third place in this comparison. Surely, the vehicle speed has a high impact on the performance of routing protocols. Therefore, the ratio of NRO increases based on increasing average vehicle speed.

Power consumption rate
To prove the quality of the proposed routing methodology not only in path optimization but also in power conservation in terms of data transmission, the EERM was used to  Fig. 9b, the highest proportion of energy depletion was recorded by AODV. While the EERM reached the lowest ratio with a 7% enhancement in total power consumption. The enhancement of the rate of power consumption using EERM can be seen clearly in both Fig. 9a and b due to installing the fog server and SDN closer to the vehicle requests. The fog server and SDN can introduce a high-quality computing model with local data processing and a low data transmission rate over the network. The EMHR with BwEst was relatively close to EERM; this referred to that the EMHR with BwEst has the fewest dropped packets in the VANET, compared to SFSR [12] and AODV [38]. Therefore, the EERM is better to provide a data computing system with a low power consumption over EMHR with BwEst [30], SFSR [12], and enhanced AODV [38].

Packet delivery and packet loss ratio
To prove the effectiveness of the proposed routing methodology EERM in terms of transmission reliability, the measurement of successful packet delivery and loss is significant. Figure 10 shows the metrics of packet delivery and packet loss ratio of EERM comparison with exiting algorithms. In both Fig. 10a and c, the x-axis in the figure represents the vehicle speeds vary from 15 to 85 Mph. the y-axis in Fig. 10a represents the average packet delivery ratio (Pkt/s), while in Fig. 10c, the y-axis represents the packet loss ratio (Pkt/s). Figure 10a shows the comparison of applying EERM and without applying it. We observe that the EERM using selection methodology and link quality can outperform the traditional vehicular system in delivering a high rate of data packets and therefore it avoiding packet loss rate.
To further clarify of the impact EERM on vehicular systems, Fig. 10b and d introduce a comparison between EERM and other state-of-the-art algorithms. The x-axis in both Fig.  10b and d indicates the range of vehicles number and the yaxis in Fig. 10b indicates packet delivery ratio (Pkt/s), while in Fig. 10d the y-axis indicates packet loss ratio (Pkt/s). Figure 10b and d show that the proposed routing methodology EERM has a great impact on the vehicular network in terms of data delivery and packet loss compared with EMHR with BwEst [30], SFSR [12], and enhanced AODV [38] because (a) the EERM supports selection methodology can identify service provider, it yields better oriented vehicular services; (b) the routing methodology in EERM has a periodical network overview about all registered nodes in the local area through SDN, it yields enhancing routing decision making; and (c) the EERM provides link quality with low interference, it yields better network bandwidth usage. As a result, we can be deduced that the EERM has the highest rate of data delivery without loss owing to its ability to maintain network bandwidth in comparison with the other state-ofthe-art algorithms. Moreover, it is worth pointing out that the performance of EERM is a stable event if vehicle speeds are changed.

Average network throughput
One important metric to evaluate the proposed methodology in terms of network bandwidth and link quality is to throughput metric. As seen in Fig. 11a, the x-axis indicates the vehicle's speeds vary from 15 to 85 Mph, and the network bandwidth was adjusted at 10 MHz. The y-axis indicates the average network throughput. In this case, the EERM has high throughput than the traditional vehicular systems, and thus it can keep network bandwidth under control. This is due to the capacity of EERM in providing high link quality with a minimum interference rate. Figure 11b shows the average throughput of EERM comparison with EMHR with BwEst [30], SFSR [12], and enhanced AODV [38]. The x-axis indi- cates the scale of the VANET network (ranging from 10 to 100) and the y-axis indicates the average network throughput. In all cases, the throughput of EERM outperforms other compared algorithms. This is due to the operation of data processing being carried out locally, and therefore the probability of bandwidth saving under control is high. We observe that the SFSR was relatively closer to EERM. Whereas the third place was reached by EMHR with BwEst, the reason comes down to that the EMHR with BwEst had successfully exercised bandwidth estimation module that supports the throughput packet normalization to pre-define the size of the packet. The last place was reached by enhanced AODV. Although EERM is not supported the packet normalization technique, it always recorded a higher rate than others due to its ability to introduce high link quality and local control in packet size transmission.

End-to-end delay time
The latency or delay time is a significant metric to assess the proposed routing methodology EERM efficiency. The end-to-end delay time is the average time required for data packet transmission between two nodes over the network. It can be defined as the time taken by sending a data packet from the source node to successfully arrive at the receiver node including delays/latency due to route acquisition, processing, buffering, and reservations [39]. In Fig. 12a, the x-axis represents the vehicle's speeds vary from 15 to 85 Mph, while the y-axis represents the average end-to-end delay time of data packet transmission. This figure shows the comparison between the VANET performance in the case of using EERM and without using it. The EERM has obviously outperformed the traditional system because the EERM can adjust the packet size transmission over the network, as well as enhances the communication channel via providing high link quality.
In Fig. 12b, the x-axis indicates vehicular network scale varies from 10 to 100 nodes, and the y-axis represents the average end-to-end delay. The EERM was compared with EMHR with BwEst [30], SFSR [12], and enhanced AODV [38] to prove the efficiency of the proposed routing methodology. Typically, the calculation of end-to-end delay time is dependent on the mean of delay time for all successful packets arrived at the destination, and thus the process of this metric is relatively linked to both packet delivery and packet loss ratio. This explains the reason why EERM was advanced in terms of delay time more than other compared algorithms. As shown in Fig. 12b, the first place was recorded by the EERM with 8% enhancement in delay time, while the EMHR with BwEst [30] was reached the second place with up to 7% over the SFSR [12], and enhanced AODV [38]. We observe that the performance of EERM is a stable event if the scale of the network is changed. Therefore, the EERM introduces better performance in reducing latency more than EMHR with BwEst, SFSR, and enhanced AODV.

Conclusion
This study presented a dynamic real-time interaction vehicle architecture with effective path estimation supporting the integration between SDN and fog technology as well as providing an energy-efficient and QoS-aware routing technique to get control of fast-frequently fragmentation, premature end of network lifetime, and network bandwidth usage in VANET. It will result in improved overall real-time performance and control of the data dissemination rate across vehicular networks. Recently, modern transportation systems posed new challenges related to employing information and communication technology to improve their services. Although exchanging up-to-date information has provided a successful model of intelligent automotive systems, it may raise a problem in network bandwidth, response time, and power consumption. The proposed SDNFoG-IoT architecture can overcome these mentioned problems using the integration of SDN and fog technology to put data transmission rate under control as well as demonstrating a new routing methodology with a mathematical model called EERM to guarantee link quality satisfactory VANET performance in terms of data packet delivery, power consumption, and network throughput. The superiority of the proposed SDNFoG-IoT architecture was investigated in the experimental results, whereby EERM can control routing overhead. Therefore, the EERM impacts both the data packet delivery and the packet loss rate as well as enhancing the whole power consumption and network throughput with a 50% to 60% more than other state-of-the-art routing algorithms.

Conflicts of interest
The authors declare that there is no conflict of interest and there is no funding received about this work.
Ethical approval This article does not contain any studies with human participants or animals performed by any of the authors.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.