1 Introduction

Cities are becoming overcrowded with more people using the roads. This contributed to increasing traffic congestion, dangerous circumstances, and road accidents. Accordingly, governments’ road improvement programs are vigorously pursuing to enhance inland transport system using cutting-edge technologies. Thus, improving roadway safety and reducing traffic congestion.

Intelligent Transportation Systems (ITS) combine avant-garde information and leading-edge communication technologies employed in traffic management systems to enhance safety, operational efficiency, sustainability of transportation networks, improve traffic flow and increase drivers’ experiences [1,2,3]. Vehicular Ad Hoc Networks (VANETs) are considered the heart of the ITS [4, 5]. VANET provides a wide range of advanced automotive solutions to meet the needs of road passengers without compromising the Quality of Service (QoS) requirements [6]. The overall QoS objective is to allow the system to introduce high-quality transport services at an acceptable cost [7]. However, VANET suffers from the lack of data transmission reliability which has a negative impact on the overall network performance due to the quick changes in network design and frequent fragmentation.

Geographical routing protocol is used to address the reliability of data delivery, especially with the networks that are characterized by frequent changes in their topology where there is no need to maintain a static route. The vehicles in geographical routing communicate with each other based on their location. Therefore, each vehicle is keen to share information about its location periodically for keeping the transport system up-to-date. Several challenges appear due to continuous data interchange making the network more susceptible to communication overhead and congestion that affect network bandwidth and power consumption [8, 9].Otherwise, based on [10,11,12], data transmission among vehicles consume 90% of the entire energy of sensor batteries. Thus, resulting in a short network lifetime and high packet loss rate. Moreover, VANET environment faces inherent wireless network issues such as unpredictable wireless signal, limited bandwidth and unacceptable power consumption in the data transmission process due to its specific characteristics.

Locally data storing and processing help the system to create a local overview of the network. Thus, accelerating the geographical routing performance decision making. Fog computing is a decentralized computing model where the location is nearer to the end-user and where data is analyzed and stored without being transferred to a cloud server. Therefore, it provides a proper computing environment in real time with low time latency and without high bandwidth usage. Therefore, fog computing is used to maintain all information about the VANET and rearrange the nodes based on their location [13, 14].

Thus, informing the proposed routing protocol about the node status

To improve geographic routing and reduce the huge amount of data transmission across VANET, a geographical architecture based on the integration of Software-Defined Network (SDN) and Fog platform is proposed. This integration offers better-informed solution to support local computing and processing as close as possible to vehicular units. As a result, the consumption of bandwidth and power is reduced by alleviating unnecessary traffic for cloud computing. Recent research in VANET has been concerned with the concept of increasing road safety via broadcasting messages among all vehicles. This entails building knowledge about the best paths among all vehicles and selecting the optimal forwarding nodes for the next hop to avoid low network connectivity and high packet loss. Accordingly, Dynamic Urban Evaluation Routing (DUEvR) protocol is introduced. The main contributions of this work are listed as follows:

  • Providing a new geographical architecture called Software-Defined Road Network based on Fog Computing (SDN-FoG). This SDN-FoG architecture proposes a vehicle system design methodology that can accomplish low power consumption and high network connectivity;

  • Establishing geographic routing protocol called Dynamic Urban Evaluation Routing (DUEvR) for selecting the optimal next hop that achieves high reliability and low energy consumption;

  • Improving the overall performance of geographical routing by a 50–60% in the terms of power consumption and packet delivery.

The remainder of this paper is organized as follows: in Sect. 2, the related work is presented. In Sect. 3, the SDN-FoG is introduced and its functions are illustrated. In Sect. 4, the DUEvR mathematical model is proposed while Sect. 5 presents the numerical results. The paper is concluded in Sect. 6.

2 Related work

The literature discussing various techniques for enhancing VANET routing performance is briefly reviewed in this section. The routing problem is one of selecting an optimal path for the traffic vectors. It affects a wide range of networks and it is not exclusive to vehicular networking.

One of the most well-known geographic routing protocols is Greedy perimeter stateless routing. It consists of perimeter forwarding and greedy forwarding modes [15]. The greedy forwarding selects the next hop based on the lowest Euclidean distance to the destination. In case the greedy forwarding can not find the node nearest to the destination, the problem of the local maximum will occur. Thus, the network suffers from a lack of connectivity. To this end, perimeter forwarding can be applied to avoid the local maximum issue. Although the greedy perimeter stateless routing reaches scalability in VANET, it may suffer from a lower throughput as to ad hoc on demand distance vector routing [16].

There are several attempts trying to adapt geographic routing to VANET environments such as [17, 18]. For instance, the routing protocol “street centric” attempts to adapt geographic routing according to the anticipated data transmission rate for enhancing Urban VANET [19]. Additionally, many researchers introduced new traffic-aware protocols for enhancing greedy routing protocol [20] such as perimeter coordinator [21], connectivity aware [22], and partial backward protocol [23] which uses vehicles located at specific points or junctions on the road to select the most proper street segment for forwarding the data packet. Two forwarding modes were proposed in [24]. One forwarding mode selects the next hop depending on the distance between the node and the destination. The second mode selects the next road based a weight calculated using traffic density, direction, and distance.

Adjusting data transmission-based routing is among the best methods for enhancing routing approach in urban VANET. Ali et. al. [25] proposed two techniques through an End-To-End Oriented Management Architecture (EEOMA) to govern the massive VANET data transfer and accommodate for the constraints. The first technique simplifies the data traffic using the bandwidth of the network. The second technique adjusts the ratio of interference that signals overhead in the medium access control (MAC) layer. The technology of fog computing was used to open up new possibilities for improving VANET connection stability. Pereira et. al. [26] suggested an architecture for the VANET and a system that proved the concept of fog services in the smart mobility applications. They redesigned both RSUs and onboard devices to operate as fog nodes. This architecture delivered user edge data analytic, and eliminated latency and time delay. The findings suggested that smart mobility fog computing could provide more trustworthy information in less time. The design was well suited to ensure high message transmission reliability, shorter reaction times, and improved location awareness. Nevertheless, sensor battery life and power consumption should have been taken into account.

A fog computing-based globally distributed computing architecture was introduced by Y Chen et. al. [27]. The architecture enabled VANETs to modify data transfer rate to the cloud server. Therefore, preserving network bandwidth. Khalid A. Darabkh et. al. [28] introduced three techniques: (i) a novel clustering algorithm that aims to avoid falling into a local maximum issue, (ii) an efficient control overhead reduction mechanism to decrease network bandwidth, and (iii) a dual-phase approach to maximize the rate of delivering packets across the VANET. An advanced routing methodology for improving packet transfer utilizing the capacities of vehicle communication was proposed in [29]. This routing technique targeted packets transmission that alternated between the road infrastructure and the Internet. In case the VANET infrastructure failed to transmit the data, fog computing and SDN determined the optimal path to complete the transmission operation.

To minimize transmission power consumption in VANET, Kadhim [30] studied a multicast routing approach which included bandwidth and time limits. It was based on both SDN and fog technologies. Both algorithms of scheduling and classification, used multicast requests based on priority, ensured QoS requirements. The proposed model’s benefits were reduced power usage and temporal complexity while scalability was still limited. In [11], a new routing strategy based on SDN and fog technologies was implemented to improve reliability while reducing bandwidth utilization. The method affected the performance of vehicular systems and provided a list of locally available services such as traffic monitoring, traffic alert distribution, elastic vehicular cloud services, route planning, and content transfer.

In [31], a new service architecture was built based on SDN and fog computing paradigms in VANETs. It also had a dedicated algorithm for data scheduling. Through the integration of SDN and VANET, the uniqueness here was simplifying data scheduling in a high-dynamic context. Data management units were able to reschedule requests issued by vehicles based on the SDN architecture Thus, resulting in better resource efficiency. Conversely, to sustain network bandwidth use, fog computing was used to treat the rapid rate of data dissemination. The proposed algorithm’s complexity was a point of contention. In a VANET, Khoury [32] investigated the impact of fog computing and SDN on network delay and bandwidth. The combination of fog and SDN had a significant impact on the data propagation rate across the network. Thus, it improved the network performance. All mentioned studies will be summarized in Table 1.

Table 1 Related Work Summary

3 Fog computing software-defined road network

The main objective of the Software-Defined Road Network based on Fog Computing (SDN-FoG) is to introduce a dynamic architecture for vehicular networks that can accomplish low energy consumption and effective path estimation. The suggested architecture supports the scale-free topology as it is based on hierarchical structure. Hence, there is a distribution networking degree solution as shown in Fig. 1. A large procedure is broken down into several smaller ones. Each task in the proposed SDN-FoG is assigned to one of the layers which works tirelessly to complete the mission. The vehicle sensor network, SDN-FoG, and cloud service layer are the proposed three layers of this architecture.

Fig. 1
figure 1

The proposed SDN-FoG conceptual design architecture

3.1 Vehicle sensor network layer

This layer consists of smart vehicles that are fitted with onboard units (OBUs), GPS, Geographic Information System (GIS), cache memory, communication, and several roadside stationary units (RSUs). The RSUs are fixed infrastructure nodes on the road network to serve as communication links between the vehicles and traffic authorities. SDN together with the RSUs form a globally centralized monitoring structure of the traffic forwarding message in the SDN-FoG architecture on the network edge. The RSU nodes at the junctions will be altered to work as SDN nodes for a cost-effective solution. A single SDN is in charge of delivering services on a scale dictated by the FOG technology. Each SDN is assigned a unique ID to enable the dissemination of information on the roads across vehicular entities.

3.2 SDN-FOG layer

To keep an up-to-date picture of the network, smart vehicles connect to the nearest SDN by propagating their IDs. Every SDN circulates a periodic request message inquiring about the connected vehicles information. Information such as directions and real-time position. Then, SDN recasts the information it gathered into tables. Those are:

  • Routing tables: The routing table is a neighborhood table that holds information about the proposed routing protocol optimal routing path, vehicle state and the network topology.

  • Flow table: a table that contains information regarding packet forwarding and packet dropping over the network. It saves the new paths produced by the routing decisions.

Furthermore, SDN provides an initial level of security for data transfer between the FOG tier and the vehicular units. The RSUs’ objectives for installing SDN can be summarized as follows:

  • Delivering easy real-time networking controller services.

  • Providing a cosmic monitoring system for various roads and paths.

  • Lowering bandwidth utilization by controlling data propagation rates across the network.

An SDN in the proposed SDN-FoG architecture provides administration functions by overseeing vehicular network data transfer. It provides a location to summarize data flow as close to the user as possible. It stores the data in the cache memory. This second layer consists of a group of high-capability FOG nodes (\(F_N\)). They connect to the lowest layer via a “FOG-to-SDN” connection to achieve traffic-oriented communication. FOG nodes \(F_N\) work as filters as they have a capacity to block the transfer of data from SDN to the cloud. They only pass to the cloud centralization system a copy of the most effective data and compute. As a result, network capacity and reaction times improve. The data in FOG nodes are separated into two categories: data supplied for local processing and data used to generate a network overview. The latter is saved in a flow table.

FOG in the SDN-FOG architecture covers a specific size of the vehicular network known as “fog area”. According to the allowed communication range of Fog, each fog area is predetermined. FOG nodes communicate their contact information inside each relevant fog area to promote communication with smart cars and the deployed SDN in the infrastructure. The FOG nodes automatically generate a flow table based on data collected from the SDN to provide an updated information regarding the current network topology and various road conditions. This table is useful for the navigation since it provides nowcasting rather than forecasting which improves the capacity to take instant action across the vehicular network. With a high rate of transmission reliability, the timeliness of sent messages is undoubtedly increased.

3.3 Cloud services layer

The cloud server can store massive amounts of data for a long time allowing the system to create historical data about the entire automotive network. Thus, the network coverage is improved. Moreover, the cloud servers execute complicated computations using the massive volume of data supplied from the fog layer. It provides analysis, on-demand elastic services, and optimization tools which are only accessible through \(F_N\). Having \(F_N\) in the two lower layers helps reducing network capacity utilization and power consumption due to complete control over the data dissemination rate. As a result, only important traffic events are broadcasted over the network between the SDN-FOG and cloud server layers.

4 Dynamic urban evaluation routing protocol

Dynamic Urban Evaluation Routing (DUEvR) protocol is established between the layers of Vehicle Sensor Network and SDN-FoG, as demonstrated in Fig. 2. The DUEvR protocol is responsible for enhancing the geographic routing for urban VANET environment by selecting the best next-hop forwarding nodes which have high energy level, and high network connectivity.

Each \(F_N\) can determine the vehicle position in its zone via the exchange of “HELLO” message, Table 2 depicts the format of this message. It means that the urban VANET is split into sectors by uneven width segments with equiangular wedges. The BS is a central node, and the FOG nodes are scattered in the whole network for providing immediate traffic services. By default, data packets are forwarded by \(F_N\) closer to the BS more than others. Thus, these nodes are more vulnerable to energy depletion. They can cause energy hole issues that may affect the network lifetime as shown in Fig. 2

Table 2 HELLO message format
Fig. 2
figure 2

Scenario of Dynamic Urban Evaluation Routing (DUEvR) protocol

Remark 1

FOG nodes in the 1st layer have more energy breakdowns than others in the 3rd layer.

Remark 2

A single path shared between different FOG nodes and BS is not ideal as it is prone to high interference rates.

4.1 Energy model

This work follows the energy schema in [33]. The radio model uses the sensor electronics energy \(E_{\rm elec}\) to turn on the transmitter or receiver circuit. The transmitter amplifier uses both channel models of the free space with (\(d^2\) power loss) and the multipath fading with (\(d^4\) power loss). Power control can be utilized to invert this loss by appropriately setting the power amplifier if the distance is less than the value of the threshold \(d_o= \sqrt{\frac{\varepsilon {fs}}{\varepsilon {mp}}}\), where \(\varepsilon {fs}\) is the amplifier energy in the free space model, and \(\varepsilon {mp}\) is the multipath model. Therefore, the measurement of energy consumption for transmitting and receiving l-bit of data packet through the distance d is calculated according to the following equation:

$$\begin{aligned} f(x)= {\left\{ \begin{array}{ll} If\; d < d_{o} \; \text{than} \;E_{\rm tras}(l,d), &{} E_{\rm tras}(l,d)= l \times E_{\rm elec}+ l \times \varepsilon {fs} \times d^2\\ If\; d \geqslant d_{o} \;\text{than}\; E_{\rm tras}(l,d), &{} E_{\rm tras}(l,d)= l \times E_{\rm elec}+ l \times \varepsilon {mp} \times d^4 \end{array}\right. } \end{aligned}$$
(1)

Otherwise, in order to receive this data packet, the following equation will be used:

$$\begin{aligned} E_{rev}= l \times E_{\rm elec} \end{aligned}$$
(2)

4.2 Initial phase

This phase is responsible for two tasks. Those are: (i) splitting the urban VANET into a number of sectors called “cells” with varying dimensions, and (ii) selection the Fog Head Node (FHN) which is done based on the energy level of each node and the distance between the \(F_N\) and BS. Table 3 shows all symbols that are used throughout the DUEvR protocol.

Table 3 Mathematical notations of DUEvR protocol

4.2.1 First step: cell creation

This section presents the division of the urban VANET into a set of cells according to the network density and the available communication range for the BS and the \(F_N\) nodes. This division helps to maintain the network connectivity as well as avoids network topology reformation overhead.

Two optimization scenarios use the packing congruent circles approach [34] to determine the range of communication and connectivity of the networks. In VANET [35, 36], providing dependable communication is increasingly important. One of the significant metrics in measuring connection quality is the system’s ability to build successful communication relationships among the deployed nodes. In this work, the mathematical method for calculating the available communication range for each cell is introduced.

The optimization scenarios for ensuring full network coverage are investigated based on the following steps:

  1. 1.

    Assume circular urban VANET with a fixed radius \(\eta\). The scale is slid as a set of cells with varying dimensions. Let \(C= \{c^i_1,c^i_2,c^i_3,....,c^i_n\}\), where C is the primary circular scale (meaning total network scale) and \(\{c^i_1,c^i_2,c^i_3,....,c^i_n\}\) are the packing circles (meaning internal division of cells).

  2. 2.

    Radius \(c_{\eta }\) is assumed for every circle \(c^i\). Herein, assume that the \(Comm_{rang}\) for BS is predetermined and all \(F_N\) belonging to the same scale are equal in CR. Thus, all packing circles are congruent and they have the same radius \(c_{\eta }\). The general equation for these circles is mathematically expressed as:

$$\begin{aligned} \bigg (\frac{1}{\alpha _1}+\frac{1}{\alpha _2}+\frac{1}{\alpha _3}+....+\frac{1}{\alpha _n}\bigg )^2 \equiv \frac{1}{\alpha _1^2}+\frac{1}{\alpha _2^2}+\frac{1}{\alpha _3^2}+....+\frac{1}{\alpha _n^2} \end{aligned}$$

First Optimization Scenario:

The approach showing the packing of coinciding circles without overlapping for obtaining high coverage network together with optimizing the number of FOG nodes deployment is shown in Fig. 3a. There are two types of overlapping, according to [37], in the primary container: (i) item-container overlapping \((\zeta _lc)\). (ii) item-item overlapping \((\zeta _lu)\). Herein, the optimization formula to achieve full coverage with low number of FOG nodes deployment is represented in Eq. 3 subject to its constraints:

$$\begin{aligned} \begin{aligned}&\text {minimize} \quad \alpha \\&\text{ s.t. } \\&\quad \alpha \le {\rm Comm}_{\rm rang} \\&\quad D_{i,j}= \quad \sqrt{({x}_{i}-{x}_{j})^2 + ({y}_{i}-{y}_{j})^2}\\&\quad \zeta _{lu} = \quad {\text {max}}\bigg (2- D{i,j},0\bigg ), \; (i,j) \in \; V \\&\quad \zeta _{lc} = \quad {\text {min}}\bigg (D_{i,j} + 1 - \mathrm {}(\eta ),0 \bigg ) \end{aligned} \end{aligned}$$
(3)

Second Optimization Scenario:

The approach showing the packing of coinciding circles with overlapping for obtaining high coverage network together with optimizing the number of FOG nodes deployment is shown in Fig. 3b. The optimization formula to achieve full coverage with high number of FOG nodes deployment is represented in Eq. 4 subject to its constraints:

$$\begin{aligned} \begin{aligned}&\text {maximize} \quad \alpha \\&\text{ s.t. } \\&\quad \alpha \le {\rm Comm}_{\rm rang} \\&\quad D_{i,j}= \quad \sqrt{({x}_{i}-{x}_{j})^2 + ({y}_{i}-{y}_{j})^2}\\&\quad \zeta _{lu}=\quad {\text {min}}\bigg (2- D_{i,j}> \Phi \bigg ), \; (i,j) \in V, \; \Phi \longrightarrow 0 \\&\quad \zeta _{lc}=\quad {\text {max}}\bigg (D_{i,j} + 1 - \mathrm {}(\eta ),0\bigg ) \end{aligned} \end{aligned}$$
(4)
Fig. 3
figure 3

The optimization scenarios for network coverage

These two scenarios proposed above are used to adjust VANET network coverage and maximize the resource utilization of the FOG nodes. The second optimization scenario is recommended over the first scenario due to its ability to achieve high signal strength using overlapping between cells and maximizing FOG utilization simultaneously.

4.2.2 Second step: FOG head node selection

VANET environment is considered as highly complex network. This is due to its high mobility, link variability, and frequent difficulty to earn accurate and up-to-date information about all the vehicles and their associated links along a given routing path. This section is introducing a mathematical method that allows for creating a resource pool from the most proper nodes to be the head of the cell. This method ensures high availability and avoids the premature end of the network lifetime.

Initially, the FOG nodes are deployed in the urban vehicular environment as a set of sensor nodes that have disparate capabilities and constraints. BS is considered as a central point at every cell and it is responsible for collecting the information from \(F_N\) and selecting the most proper one to be the head of the cell. This operation ensures both service reliability for all vehicles and high connectivity. As shown in Fig. 4, the urban vehicular environment is represented as a tree with sub-levels. The FOG nodes are divided into parent \({\rm FOG}^{P}\) and children \(N^{C}\) nodes. The \({\rm FOG}^{P}\) nodes are those nodes that fall within level 1 and level 2. Therefore, the degree of \({\rm FOG}^{P}\) must be equal to \(\triangle \leqslant {\rm level} \;2\). These nodes are used to provide transport services for all connected vehicles and perform data aggregation for BS. The \(N^{C}\) nodes are nodes that lay in the levels after level 2. Therefore, the degree of nodes is equal to \(\triangle \geqslant {\rm level}\; 2\). Such nodes are not used to provide any services.

Fig. 4
figure 4

The levels of the distributed FOG nodes

Calculating the amount of power consumed by the \({\rm FOG}^{P}\) nodes in the process of the data transmission to BS is important to avoid the premature end of network lifetime. Therefore, the amount of power consumption can mathematically be expressed according to Eqs. 5 and 6:

$$\begin{aligned}&\begin{aligned} E_{\text{FOG}^{P}}(r,\imath )= {\left\{ \begin{array}{ll} D_{\rm pkt}[\triangle E_{\rm elec}+ N^C \ E_{\rm tras}+\varepsilon {mp}+d^4_{to_{FOG^P}}], &{} d_{to_{FOG^P}}\succ d_o \& j\succ 1\\ D_{\rm pkt}[\triangle E_{\rm elec}+ N^C \ E_{\rm tras}+\varepsilon {fs}+d^4_{to_{FOG^P}}], &{} d_{to_{FOG^P}}\prec d_o \& j\succ 1\\ D_{\rm pkt}[\triangle E_{\rm elec}+ N^C \ E_{\rm tras}+\varepsilon {mp}+d^4_{to_{FOG^P}}], &{} d_{to_{FOG^P}}\succ d_o \& j= 1\\ D_{\rm pkt}[\triangle E_{\rm elec}+ N^C \ E_{\rm tras}+\varepsilon {fs}+d^4_{to_{FOG^P}}], &{} d_{to_{FOG^P}}\prec d_o \& j= 1\\ \end{array}\right. } \end{aligned} \end{aligned}$$
(5)
$$\begin{aligned}&\begin{aligned} E_{{\rm FOG}^{P}}(r,\imath )= {\left\{ \begin{array}{ll} D_{\rm pkt}[\triangle E_{\rm elec}+\varepsilon {mp}+d^4_{to_{{\rm FOG}^{P}}}], &{} d_{to_{{\rm FOG}^{P}}}\geqslant d_{o}\\ D_{\rm pkt}[\triangle E_{\rm elec}+\varepsilon {fs}+d^4_{to_{{\rm FOG}^{P}}}], &{} {\rm else}\\ \end{array}\right. } \end{aligned} \end{aligned}$$
(6)

According to Eqs. 5 and 6, the total consumed energy in the process of data transmission between any \(\text{FOG}^{P}\) node and BS per level is defined as follows:

$$\begin{aligned} \begin{aligned} E_{\rm Trans}(r,\imath )= {\left\{ \begin{array}{ll} BS \times E_{{\rm FOG}^{P}_j}(r,\imath ) &{} \\ &{} 1 \leqslant j \leqslant \ell -1 \& j= \ell \\ BS \times E_{{\rm FOG}^{P}_{\ell }}(r,\imath )&{} \end{array}\right. } \end{aligned} \end{aligned}$$
(7)

Another important calculation, of energy consumption, is the amount of energy consumed in the process of communication between \({\rm FOG}^{P}\) and another deployed node (j) in round (r) which is given by:

$$\begin{aligned} E_{({\rm FOG}^{P},j)}(r,\imath ) =D_{\rm pkt}\left[ (E_{\rm elec}+\varepsilon {fs})E \left[ d(j)_{{\rm FOG}^{P}}^2 \right] \right] d_{to_{{\rm FOG}^{P}}}< d_o \end{aligned}$$
(8)

According to Fig. 4, BS is the root point that appears in level “0” while the \(\text{FOG}^{P}\) nodes are uniformly distributed in the remaining levels. The relationship between \(\text{FOG}^{P}\) and its degree is \(\triangle -1\) whereas the relationship between \(\text{FOG}^{P}\) and its (\(\ell\)) is given by Eqs. 9 and 10:

$$\begin{aligned} R_{\Vert \text{FOG}^{P}}= & {} \left( \text{FOG}^{P}+1 \right) \sum _{j=1}^{\ell } \text{FOG}^{P} \nonumber \\= & {} \frac{\left( \text{FOG}^{P}+1 \right) \left( \text{FOG}^{P}_{\ell +1}-1 \right) }{\text{FOG}^{P}-1} \nonumber \\= & {} \frac{\triangle (\triangle -1)^{\ell +1}-1}{\triangle -1} \end{aligned}$$
(9)

where

$$\begin{aligned} \ell = \frac{log \left( No_{\Vert \text{FOG}^{P}}\left( \frac{\triangle -2}{\triangle +1}\right) \right) }{log(\triangle -1)-1} \end{aligned}$$
(10)

The total energy consumption at single round r is given by:

$$\begin{aligned}&E_{total}\nonumber \\&\quad = D_{\rm pkt}\left[ (\text{FOG}^{P})^{\ell } \ j^{\ell }\ \left[ E_{\rm elec}+\varepsilon {fs} \ E \left[ d(j)_{\text{FOG}^{P}}^2 \right] \right] \right. \nonumber \\&\qquad +\, \text{FOG}^{P} \left[ (\text{FOG}^{P}-1) \ E_{\rm elec}+ (\text{FOG}^{P} j)\ E_{\rm Trans} \right. \nonumber \\&\qquad \left. +\,\varepsilon {mp} \ d_{to_{BS}}^4 \right] + (\text{FOG}^{P})^{\ell }\left[ (\text{FOG}^{P}+1) \ E_{\rm elec} \right. \nonumber \\&\qquad \left. \left. +\,(\text{FOG}^{P} j) \ E_{\rm Trans} + \varepsilon {fs} \ E \left[ d(j)_{to_{\text{FOG}^{P}}}^2 \right] \right] \right] \end{aligned}$$
(11)

Based on Eq. 11, the optimal number of the parent \(\text{FOG}^{P}\) nodes that can deal directly with the single BS and the optimal number of levels \(\ell\) that allow reducing the energy of data transmission can be obtained as follows:

$$\begin{aligned} Min \left\{ E_{total}\left( E_{\text{FOG}^{P},j}\ E_{\rm Trans}\ell \ \varepsilon {fs} \ R_{\Vert \text{FOG}^{P}}\right) \right\} \end{aligned}$$
(12)

Algorithm 1 describes the main steps to select FOG head. All steps of the proposed algorithm are described in the Fig. 5.

figure a
Fig. 5
figure 5

Flowchart of the proposed routing protocol

5 Numerical results

The experiments were conducted using an Intel Core i7 dual-core desktop, up to 3.1 GHz with Turbo Boost, 4 MB cache, 12 GB LPDDR3 SDRAM (1,866 MHz), Intel HD Graphics 520, and a 64-bit Ubuntu operating system. Network Simulation was completed using NS2.35 as the simulation tool to design the network topology. All settings of the network are illustrated in Table 4. The \(F_N\) nodes connect via IEEE 802.11p/WAVE, the IEEE 802.11p configuration is listed in Table 5. Fog Hierarchical Deployment Model from OpenFog Reference Architecture [38] was used to simulate \(F_N\) behavior.

Table 4 Network setting
Table 5 IEEE802.11p configuration [36]

In this experiment, the proposed DUEvR protocol proves its effectiveness in network throughput, power consumption, and packet delivery ratio. To create a constant bit rate traffic source between the \(F_N\) and the vehicular network, ten random connections are set up. This generates 512 bytes packets every 2 s and traffic agent Node-UDP. Transmission of a “HELLO” message between the FOG nodes and BS was used to test the connection. The message interval was set to 1.5 s. Some “HELLO” messages may be lost or delayed owing to collisions, even if they are within the designated FOG communication range. The retrieved information from a delivered “HELLO” message is retained for 2.5 \(\times\) hello interval for each neighbor. The constant-coefficient values are set as follows:

$$\begin{aligned} \omega _{1}=\omega _{2}=\omega _{3}=\omega _{4}=\omega _{5}=....=\omega _{n}\approx 1 \end{aligned}$$
(13)

The measurement of successful packet delivery rate is critical to proving the effectiveness of the proposed routing protocol in term of transmission reliability. The packet delivery metric of DUEvR is shown in Fig. 6 in comparison to existing techniques. The x-axis in Fig. 6 indicates the number of vehicular nodes from 150 to 600 and the average packet delivery ratio (Pkt/sec) is represented on the y-axis. A comparison between DUEvR and other state-of-the-art algorithms to further highlight the influence DUEvR has on the data transmission rate in VANET is conducted in this experiment. The DUEvR is tested against Geographic Routing Protocols - a Cross layer Approach (Geo-CAP) [4], End-To-End Oriented Management Architecture (EEOMA) [25], Energy based with Mobility concerns Hybrid Routing protocol (EMHR with BwEst) [39], an Agent-based Self-Protective method for Unmanned Aerial Vehicle Networks (ASP-UAVN) [40], and Securing Unmanned Autonomous Systems with and without a human-in-the loop (SUAS-HIS) [40]. It is observed that DUEvR has a high rate of packet delivery than the mentioned state-of-the-art algorithms. It is noticed that when the number of vehicles equals 150, DUEvR performance exceeds the others. Nevertheless, the performance of all the algorithms is very close to each other. When the number of vehicles increases, performance differences appear where SUAS-HIS remain with low performance compared to other algorithms. The DUEvR remains in the leadership position while Geo-CAP and EEOMA are close runners particularly when the number of vehicles increases to 600. It is noticed that EEOMA is almost equal to DUEvR. Therefore, the DUEvR has an outstanding performance over the whole network scale as the increase of vehicles results in a high rate of data transmission. Hence, the power of the sensor nodes will be exhausted, and the network lifetime ends prematurely.

Fig. 6
figure 6

Packet delivery ratio versus Vehicle’s numbers

The throughput metric is an important parameter to use when evaluating the proposed routing methodology in terms of network capacity. The x-axis shown in Fig. 7 shows that the vehicular scale is from 150 to 600 nodes, and the network bandwidth is set at 10 MHz. The average network throughput (bps) is shown on the y-axis. The DUEvR offers higher throughput than standard vehicle systems allowing it to maintain network bandwidth under control. This is owing to DUEvR providing good connection quality with low power consumption rates.

The average throughput of DUEvR in contrast to Geo-CAP [4], EEOMA [25], EMHR with BwEst [39], ASP-UAVN [40], and SUAS-HIS [40] is shown in Fig. 7. The DUEvR outperforms other algorithms in most circumstances as data processing is performed locally. Thus, increasing the likelihood of bandwidth savings under control. The Geo-CAP is found to be relatively close to DUEvR. EEOMA earned the third place runner. The reason for this is that the EEOMA is successfully exercised on the bandwidth estimate module. This facilitates the normalization of the throughput packet which enables the pre-definition of the packet size. The SUAS-HIS came in the last position. Despite the fact that DUEvR does not offer packet normalization, it consistently outperformed the competition because of its link quality and packet size control in transmission. DUEvR reduces wireless radio energy consumed in BS. It is normalized to the number of \(F_N\) in the vehicular network to demonstrate the quality of the proposed DUEvR not only in network connectivity but also in data transmission power conservation. The highest proportion of energy depletion was observed by SUAS-HIS, as indicated in Fig. 8. While the DUEvR has the lowest ratio with 5% reduction of energy consumed per packet in the process of data transmission. Due to the FOG server and SDN being installed closer to the vehicle requests, the rate of power consumption utilizing DUEvR may be observed clearly in Fig. 8. The fog server and SDN can bring a high-quality computing paradigm to the network with local data processing and low data transmission rates. In comparison to Geo-CAP [4], EEOMA [25], ASP-UAVN [40], and SUAS-HIS [40], it is observed that there is no significant difference between Geo-CAP and EMHR with BwEst with 1.5% more than DUEvR. The next place was ASP-UAVN, which is considered relatively high as SUAS-HIS.

Fig. 7
figure 7

Overall throughput versus vehicle’s numbers

Fig. 8
figure 8

Energy consumption versus vehicle’s numbers

Routing overhead is calculated as the total size of sent and forwarded data packets per the whole amount of data packets received. This metric is heavily associated with the network throughput. As shown in Fig. 9, the performance of DUEvR is measured at different scales of the network from 150 to 600. The DUEvR has the first place in reducing routing overhead across the network due to its ability to avoid the local maximum issue by creating a robust overview of all neighbors in the network. All this information is stored locally in the fog, and thus it can be retrieved immediately. As observed the second place was SUAS-HIS. It is noted that there is no wild difference between DUEvR and SUAS-HIS, in some cases such as 400, 500, and 600 vehicles, both algorithms have the same behavior. The highest rate of the routing overhead was EEOMA [25], which recorded third place with a huge difference from DUEvR and SUAS-HIS. The fourth place were both Geo-CAP [4] and EMHR with BwEst [39].

Fig. 9
figure 9

Routing Overhead versus the vehicle’s numbers

6 Conclusion

This paper introduced a Software-Defined Road Network architecture based on FOG computing for enhancing overall performance in VANET. This architecture proposed a new routing design for the urban system to accomplish low energy consumption and operational efficiency in data delivery. In this work, the proposed integration methodology ensured high control of the volume of data transmission across the network. Therefore, the network bandwidth and power transmission usage are reduced. The effectiveness of the proposed routing protocol DUEvR was proved by comparing its performance against the state-of-art algorithms, including Geo-CAP, EEOMA, EMHR with BwEst, ASP-UAVN, and SUAS-HIS. The performance of DUEvR was tested based on four QoS metrics. Those are packet delivery ratio, network throughput, power consumption, and routing overhead. The experimental results indicated that there is a 50–60% improvement in both power consumption and packet delivery ratio, while a 60–65% enhancement in network throughput and routing overhead.