1 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]. Vehicular 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 network 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 constraints. 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-to-end 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.

2 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 routing 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.

3 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.

Fig. 1
figure 1

The proposed SDNFoG-IoT architecture

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 pre-determined 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 up-to-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 storage-as-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.

4 Proposed routing and verification methodology

4.1 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.

Table 1 A list of abbreviations

The SDNFoG-IoT architecture fragments the scale of inside vehicle tier into several \(FRZ_{area}\) (see Fig. 2). Every \(FRZ_{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 \((3000 n \times 2000 m)\) 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.

Fig. 2
figure 2

The proposed scenario of SDNFoG-IoT architecture

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_{\iota }}\), the \(\iota \) symbolizes the \(\iota th\) vehicle nodes in which \( \iota \in \{1,2,3,...,n\}\). The E is a set of edges connecting pairs of vehicular objects \(V_{\iota }\) and \( V_{\j }\), and the w is a set of weights. Assume that two-vehicle nodes \(V_\iota \) and \(V_{\j }\) need to connect to \({FH_{1}}\). The \(FH_1\) propagates its registration message with a unique ID in the \(FRZ_{area}\) of \(V_\iota \) 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 \(FH_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.

4.2 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 real-time with low latency constraints. The proposed architecture 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.

Fig. 3
figure 3

The mobility model for VANET

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:

  • Definition 1: The (\(d_{o}= \sqrt{\frac{\varepsilon _{fs}}{\varepsilon _{mp}}} \)) is a threshold between an SDN-controller and elected FH node into one fog relevance zone.

  • Definition 2: The (FH) 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_{breakdown}\)) 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_{breakdown}\) can be calculated as:

    $$\begin{aligned} E_{|breakdown}= Max(E_{fogNode}|r_{N})=0 \end{aligned}$$

    where \(E_{fogNode}\) 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_{fr}\)) 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:

    $$\begin{aligned} D_{fr}= \frac{E_{PE}-E_{CE}}{T_{CT}-T_{PT}} \end{aligned}$$

    where \(E_{PE}\) is the prior assigned energy of a FOG node, \(E_{CE}\) 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:

    $$\begin{aligned} Link_{c}= \frac{P_{size}}{\varDelta T_{r}-T_{s}} \end{aligned}$$

    where \(P_{size}\) is the maximum packet size by bit. The term \(\varDelta 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.

5 Preparing energy-efficient routing methodology (EERM)

5.1 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 start-up phase, and the data transmission phase. These processes will be discussed in the following sections:

Fig. 4
figure 4

The operations of FH selection and routing construction

5.2 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 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.

5.3 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.

5.3.1 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 SDN-controller 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:

$$\begin{aligned} Distance(\varUpsilon _{fog}, \varUpsilon _{sdn})= \sum _{i,j=1}^{n,m} |\upsilon _{fogi} - \upsilon _{sdnj}| \end{aligned}$$
(1)

where \( Distance(\varUpsilon _{fog}, \varUpsilon _{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 \(|(\upsilon _{fogi}- \upsilon _{sdnj})|\). All data is stored on the FOGs’ database and reordered one by one according to their location of SDN-controller device.

5.3.2 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.

$$\begin{aligned} RPR\%= \frac{E_{rem}(i,r-1)}{E_{total}(i,r-1)} \geqslant E_{|breakdown} \end{aligned}$$
(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 \times V \times T ) Joule\), 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.

$$\begin{aligned}{} & {} E_{total}(i,r-1)= \mu _i \varDelta t \end{aligned}$$
(3)
$$\begin{aligned}{} & {} \mu _i= rand \big (E_{min} (r-1),E_{max} (r-1)\big ) \end{aligned}$$
(4)

where \(\mu {i}\) is the energy rate of FOG node i at the round \((r-1th)\), while \(\varDelta t\) denotes the round duration at time (t). The \(\mu {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_{|breakdown}\). From Eqs. 3 and  4, the bounds of energy are determined for each FOG node i. Hence, the nodes that have \(RPR\%\) 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 \(RPR\%\) 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.

5.3.3 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 \(RPR\%\). 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.

5.3.4 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:

$$\begin{aligned} E2E_{|totalDelay}= \sum _{i=1}^{n}(oneHop_{|delay(i)}+ B_{|delay}) \end{aligned}$$
(5)

where \(i \in \{1,2,3,4,...,n\}\) are the number of FOG nodes, the term oneHop can be calculated as follows: \(oneHop_{|delay}= t_{|processingDelay}+ t_{|propagationDelay}+ t_{|transmissionDelay}+ t_{|channelDelay}+ t_{|queuingDelay}+ t_{|receptionDelay}\) [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:

$$\begin{aligned}{} & {} \scriptstyle FOG_{|delay}= \scriptstyle \frac{(n-1)l_{p}}{T_{|rate}}+ \frac{\sum _{i=1}^{n-gap-1} d_{o}+ g^{FR}}{Propagation_{|speed}} \nonumber \\{} & {} \quad + \scriptstyle \sum _{i=1}^{n-1} t_{|queuingDelay}+ \scriptstyle \sum _{i=1}^{n-1} t_{|processingDelay} \end{aligned}$$
(6)

where the \(FOG_{|delay}\) determines by a set of factors are: the term \(\frac{(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 \(\frac{\sum _{i=1}^{n-gap-1} d_{o}+ g^{FR}}{Propagation_{|speed}}\) indicates the propagation delay time, the \(d_{o}\) is a threshold of distance, the \(g^{FR}\) 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.

Fig. 5
figure 5

FOG nodes layered by the SDN-controller device

5.3.5 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 SDN-controller 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 SDN-controller (\(1^st\) layer). Figure 5 represents FOG nodes layered according to the SDN-controller device. Once the SDN-controller 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 path selection optimization by a general equation, which can mathematically express as follows:

$$\begin{aligned}{} & {} W_{(FOG,SDN)}\\{} & {} \quad = \sum _{i,j=1}^{k,m} \bigg (\omega _{i} \frac{Max (Residual Power ratio)}{Min (Distance(fog,sdn)+ delayTime)} \bigg ) \end{aligned}$$

According to the Eq. numbers 12, and 6, the W between any pairs (FOG, SDN) can be calculated as follows:

$$\begin{aligned}{} & {} W_{|FOGi,SDNi}\nonumber \\{} & {} \quad = \sum _{i,j=1}^{k,m} \bigg (\omega _{1} \frac{RPR_{1}\%}{Distance(\varUpsilon _{fog1}, \varUpsilon _{sdn1})+ FOG_{|delay1}} \nonumber \\{} & {} \qquad + \omega _{2} \frac{RPR_{2}\%}{Distance(\varUpsilon _{fog2}, \varUpsilon _{sdn2})+ FOG_{|delay2}} +... ... ... \nonumber \\{} & {} \qquad + \omega _{n} \frac{RPR_{n}\%}{Distance(\varUpsilon _{fogn}, \varUpsilon _{sdnn})+ FOG_{|delayn}} \bigg ) \end{aligned}$$
(7)

where \(i \in \{1,2,3,4,...,N\}\), the N is number of FOG nodes and \(j\in \{1,2,3,4,...,M\}\), the M is the number of SDN-controller devices. Each connection between pair nodes (means FOG and SDN) has different constant-coefficient values \((\omega _{1}, \omega _{2},......,\omega _{n})\). The sum of them should be not exceeded (1), and they can represent as follows: \(Constant-Coefficient= \begin{bmatrix} \omega _{1} \\ \omega _{2} \\ \vdots \\ \omega _{n} \\ \end{bmatrix} \approx 1\). Otherwise, the total value of W is measured by three parameters: the Euclidean distance from the SDN-controller to each deployed FOG node, the delay time estimation taken from sending one packet from any FOG node until receiving this packet by the SDN-controller, and the real value of energy. The algorithm 1 is shown the steps of selecting an FH.

figure c

5.3.6 Fog relevance zone measurement

According to the mentioned data in Table 2, the \(SDN_{1}\) declares \(FH_{51}\) as an FH. Consequently, the \(SDN_{1}\) will be arranged other FOG nodes within their fog relevance zone in three layers based on their signal strength. The task of \(FH_{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:

Fig. 6
figure 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

$$\begin{aligned} d_{min}= d_{FH} - d_{SDN} \end{aligned}$$
(8)

In our case, the formula \(d_{FH}- d_{SDN}\) indicates the difference between \(FH_{51}\) and \(SDN_1\) that represents the smallest space can be covered by \(FH_{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:

$$\begin{aligned} d_{max}= d_{FH} - d_{farthest} \end{aligned}$$
(9)

From the Eqs. 8 and 9, the total area of fog relevance zone can be modeled as:

$$\begin{aligned} FRZ_{areai}= \pi \bigg [1- \frac{d_{max}}{d_{min}}\bigg ]^{2} \end{aligned}$$
(10)

where \(FRZ_{areai}\) is the fog relevance zone for each FH, the \(\pi \) is a constant used to find the circumference of a circle by measuring the radius, and the term of \(\bigg [1- \frac{d_{max}}{d_{min}}\bigg ]\) 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.

figure d

5.3.7 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 \((FN_i)\) need to send a packet (P) to \((SDN_j)\) on a link \((\ell )\). Hence, the sent packet will be successful received at SDN according to the formula 11:

$$\begin{aligned} \ell _{m}(FN_{i},SDN_j)= \bigg [\ell _{thrput}- \frac{P_{|size}}{N_{noise}+ BW +D_{fr}} \bigg ] \geqslant \varPsi \end{aligned}$$
(11)

where \(\ell _{thrput}\) indicates the link throughput, the \(P_{|size}\) 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 \(\ell \), and it can be given as follows:

$$\begin{aligned} BW= IR_{\ell } \times Link_{c} \end{aligned}$$
(12)

where IR is the Interference Ratio of a certain link \(\ell _i\). The term \(IR_{\ell }\) can be expressed in a link \(\ell _i\) as: \(\frac{SINR_{\ell ,BW}}{SNR_{\ell ,BW}}\). So, the \(SINR_{\ell ,BW}=\frac{P_{\ell ,BW}}{1-N_{noise,\ell }}\) and \(SNR_{\ell ,BW}= \frac{P_{\ell ,BW}}{N_{noise,\ell }}\). The \(SNR_{\ell ,BW}\) is the Signal-to-Noise Rate of a certain link \(\ell _i\) and network bandwidth BW, which use to measure the ratio of signal power to the noise power. The \(D_{fr}\) indicates the estimated energy drain rate of the FNs. The final term in the Eq. 11 is to \((\varPsi )\), which is a const value that represents data rate 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:

$$\begin{aligned} Path_{|loss}= BW \bigg [\frac{1}{P_{|forward} - P_{|reverse}}\bigg ] \end{aligned}$$
(13)

where \(P_{|forward}\) and \(P_{|reverse}\) are the probabilities of the packet loss in forward and reverse transmission in a certain link \(\ell _i\) respectively. The actual value of \(P_{|forward}\) and \(P_{|reverse}\) 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:

$$\begin{aligned} P_{|unsuccess}= 1-(1 - P_{|forward}){(1 - P_{|reverse}),} \end{aligned}$$
(14)
$$\begin{aligned} P_{|success}= P^ {s-1}(1 - P_{|success}) \end{aligned}$$
(15)

where \(P^ {s-1}\) is the number of attempts to retransmit packet over certain link \(\ell _i\).

5.3.8 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 SDN-controller can express as follows:

$$\begin{aligned} E_{|FOG to SDN}= {\left\{ \begin{array}{ll} \ell _{m}(FN_{i},SDN_j)(\varDelta E_{(trans|rece)}+\varepsilon _{mp}d^{4}_{(FN,SDN)})+ \\ r_{s} P_{size}(\varDelta E_{(trans|rece)}+\varepsilon _{mp}d^{4}_{(FN,SDN)}\\ \qquad + \varDelta E_{dagg}){d_{(FN_{i},SDN_j)}\geqslant d_o}\\ \ell _{m}(FN_{i},SDN_j)(\varDelta E_{(trans|rece)}+\varepsilon _{fs}d^{2}_{(FN,SDN)})+ \\ r_{s} P_{size}(\varDelta E_{(trans|rece)}+\varepsilon _{fs}d^{2}_{(FN,SDN)}\\ \qquad + \varDelta E_{dagg})\text {otherwise} \end{array}\right. } \end{aligned}$$
(16)

where the \(\varDelta \) is the different values of FOG nodes degrees. The \(E_{(trans|rece)}\) is the power consumed in both transmission and receiver data packets. The \(\varepsilon _{mp}\) is a multi-path propagation loss and \(\varepsilon _{fs}\) 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_{size}\) 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 capacity 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:

$$\begin{aligned} E_{|init}= {\left\{ \begin{array}{ll} \ell _{m}(FN_{i},SDN_j)(2E_{(trans|rece)}+\varepsilon _{mp}d^{4}_{(FN,SDN)}\\ \qquad + \varepsilon _{mp}d^{4}_{(FN,SDN)}FRZ^{4}_{areai})+ r_{s}P_{size}( E_{(trans|rece)}\\ \qquad +\varepsilon _{mp}d^{4}_{(FN,SDN)}+ E_{dagg}) FRZ,{d_{(FN_{i},SDN_j)}\geqslant d_o}\\ \ell _{m}(FN_{i},SDN_j)(2E_{(trans|rece)}+\varepsilon _{mp}d^{2}_{(FN,SDN)}\\ \qquad + \varepsilon _{mp}d^{4}_{(FN,SDN)} FRZ^{4}_{areai})+ r_{s} P_{size}( E_{(trans|rece)}\\ \qquad +\varepsilon _{mp}d^{2}_{(FN,SDN)}+ E_{dagg}) {d_{(FN_{i},SDN_j)} < d_o \leqslant FRZ}\\ \ell _{m}(FN_{i},SDN_j)(2E_{(trans|rece)}+\varepsilon _{fs}d^{2}_{(FN,SDN)}\\ \qquad + \varepsilon _{fs}d^{2}_{(FN,SDN)} FRZ^{2}_{areai})+ r_{s} P_{size}( E_{(trans|rece)}\\ \qquad +\varepsilon _{fs}d^{2}_{(FN,SDN)}+ E_{dagg}) \text {otherwise} \end{array}\right. } \end{aligned}$$
(17)

6 Simulation results and analysis

6.1 Simulation scenario and setting parameters

Simulation of Urban Mobility (Eclipse SUMO) is an open-source, microscopic, and ongoing simulation package of road traffic built to handle large road networks and trace the speed of vehicle mobility. The average speed of vehicle nodes is between 15 Mph to 85 Mph. As shown in Fig. 7, the simulation environment was conducted with the real urban environment in EGYPT by Openstreetmap and the simulator SUMO. The network simulation NS2.34 [36] was used to model the dynamic vehicles nature and their correlations in a simulation time estimated by 100 sec. The generated range of wireless sensor nodes are: 10,20,30,40,50,60,70,80,90,100 nodes. 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.

Fig. 7
figure 7

The simulation environment

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 \(\times \) 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: \(\omega _{1}=\omega _{2}=\omega _{3}=\omega _{4}=\omega _{5}=....=\omega _{n}\approx 1\).

6.2 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.

6.2.1 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:

$$\begin{aligned} NRO = P_{|fail}+ T_{|mesg}+ Trig_{|mesg} \end{aligned}$$
(18)

where the \(P_{|fail}\) indicates the number of packets that failed to reach the destination, \(T_{|mesg}\) is the periodic messages, and \(Trig_{|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.

Table 2 Network setting and parameters
Table 3 IEEE802.11p setting [37]

6.2.2 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 reduce the total energy consumed by the wireless radio in BS and normalized to the number of roadside sensors in the vehicular network. As shown in 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].

Fig. 8
figure 8

The measurement of EERM performance in term of routing overhead vs. the vehicles speed was tested in figure (a). The performance of EERM comparison with other-state-of-the-art algorithms vs. the vehicles number was tested in figure (b)

Fig. 9
figure 9

The power consumption of EERM vs. the vehicles speed was tested in figure (a). The performance of EERM comparison with other-state-of-the-art algorithms vs. the vehicles number was tested in figure (b)

6.2.3 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.

Fig. 10
figure 10

The packet delivery ratio of EERM vs. the vehicles speed was tested in figure (a). The performance of EERM comparison with other stare-of-the-art algorithms vs. the vehicles number was tested in figure (b)

Fig. 11
figure 11

Throughput of EERM vs. the vehicles speed was tested in figure (a). The performance of EERM comparison with other-state-of-the-art algorithms vs. the vehicles number was tested in figure (b)

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 y-axis 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-of-the-art algorithms. Moreover, it is worth pointing out that the performance of EERM is a stable event if vehicle speeds are changed.

6.2.4 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 indicates 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.

6.2.5 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.

Fig. 12
figure 12

End-to-end delay time of EERM vs. the vehicles speed was tested in figure (a). The performance of EERM comparison with other stare-of-the-art algorithms vs. the vehicles number was tested in figure (b)

7 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.