# QoS Aware and Fault Tolerance Based Software-Defined Vehicular Networks Using Cloud-Fog Computing
## 4 Proposed Solution
### Qaft-SDVN Proposed Model
From the different simulation/implementation runs, we obtain data and evaluate the data for further analysis, as provided in Section 5.5. ### Performance Parameters

The following performance parameters are used to evaluate the proposed model:

#### 5.4.1 Response Time

Response time is the actual time of the resource's response to the vehicles sent messages. Response time is calculated according to the following (1):

\[\Re p=\text{Communication from }V_{i}\text{ to Fog Node }+\text{ Service Time }+\text{Communication from }V_{i}\text{ to Cloud} \tag{1}\] \begin{table}
\begin{tabular}{c l l l} \hline \hline
**Setup** & **Power** & **Tasks/Messages** & **Users/Broker** & **VMs** \\ \hline Cloud Setup & One datacenter & 40 Cloudlets & One Broker & One VM \\ Fog Setup & Three fog nodes & – & – & 3 SDN \\ Vehicles Setup & 15 Vehicles & 40 messages & 15 brokers & – \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Application modeling. \begin{table}
\begin{tabular}{c l l l} \hline \hline
**S. No.** & **Message with ID** & **Deadline (Seconds)** & **Size (Bits)** \\ \hline
1 & Rescue call 010 & 67 & 2300 \\
2 & Hospital Emergency call (011) & 65 & 2100 \\
3 & Call to nearest traffic signal (012) & 77 & 2800 \\
4 & Police help for accident (013) & 61 & 2000 \\
5 & Nearest petrol help (014) & 72 & 2700 \\
6 & Robbery (015) & 59 & 1900 \\
7 & Murder information (016) & 60 & 2100 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Message types with deadline and size. \begin{table}
\begin{tabular}{c l l} \hline \hline
**S. No.** & **Configuration** & **Detail** \\ \hline
1 & DC Architecture & x86 \\
2 & DCRAM (MB) & 512 \\
3 & DC Storage (MB) & 2048 \\
4 & DC OS Hypervisor & Xen \\
5 & DC Computation Power (MIPS) & 1000/sec \\
6 & DC Bandwidth (MBPS) & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Datacenter detail. #### 5.4.2 Execution Time

Execution time of the vehicles messages is the total time taken by the execution node to prioritize it and forward it to the destination. \[E=\text{Service Start Time}-\text{Finish Service Time} \tag{2}\]

#### 5.4.3 Tasks/Messages Failure Ratio

Messages failure ratio is the actual messages that failed to send and did not receive via the destination party. The following (3) is used to calculate the tasks/messages failure ratio. \[F=\text{No of failed messages}*100/\text{Total no of sent messages} \tag{3}\]

### Results Comparison

The following scenarios are created to evaluate the proposed model:

#### 5.5.1 Response Time Comparison with Random and Previous Work of Safety and Non-Safety Messages

We created one cloud node with a data center; the details are provided in Tables 3 and 4. Three fog nodes are created with equal specification and placed three SDN nodes in which one was considered as SDN main controller. 15 vehicles randomly sent messages, and we observed their response time using fog nodes and fog nodes. Figure 4 shows the response time comparison of the proposed model with the latest work using fog and without fog nodes. Figure 4 x-axis shows No messages/Cloudlets/Tasks executed, and the y-axis shows response time milliseconds. We sent the first 10 messages to fog and then to cloud, then we sent 20 messages, 30 messages, and 40 messages. Due to fog usage, we reduced the response time of safety messages by up 50%, which is sufficient for vehicles in an emergency. So, the proposed QAFT-SDVN model perfumed very well in terms of response time while forwarding safety messages. The other non-safety messages were sent by FCPS methods whose response time was also reduced by fog nodes. Similarly, as shown in Figure 5, response time comparison non-safety messages are provided, and the results show that our proposed model performed well, as we used fog nodes for SDN technology instead of the cloud. #### 5.5.2 Effect of the Execution Time of Latest Model with the Proposed QAFT-SDVN Model

In this scenario, fifteen vehicles were created, one cloud datacenter, three fog nodes placed with SDN nodes.