# Robust and Secure Data Transmission Using Artificial Intelligence Techniques in Ad-Hoc Networks
## 4 Proposed Work
### Routing Mechanism  
The route has been formed using AODV as a routing protocol, which establishes route on an on demand basis and hence reduces the number of required broadcasts. Using this protocol, the nodes that are not part of the route are not needed to manage the information of routing. Thus, it can be known as a pure on-demand basis process of routing. This reduces the routing packet size. During the route discovery process, two packets such as RREQ and RREP are responsible for forming the route. Both control messages contain an essential attribute known as 'destination sequence number'.  
The enhanced value of this number determines the most suitable path. As presented in Figure 3, the source node (S) broadcasts RREQ messages, which are received by nearby nodes denoted by N2, N6, and N3, respectively.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Running Time** & 0.2 ms to 1 ms \\ \hline
**The Number of Deployed Nodes** & 100 to 200 \\ \hline
**Malicious Nodes Count** & 1 \\ \hline
**Simulation Environment** & 1000 \(\times\) 1000 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Simulation Parameter.  
Figure 2: The flow of proposed work.  
This process is initiated to determine the destination node (D). After receiving their message, the nearby nodes (N2, N6, and N3) send back:  
1. If the node is identified as a destination node then the RREP message is transferred back to the source node.
2. If not, then its routing table needs to be updated with fresh information on the path regarding the destination node. After reaching the RREQ packet on destination (D), this process is stopped. Then the node checks the sequence number of destinations from the routing table. If this sequence number is higher compared to the sequence number of destination then the route has been created through that particular node as shown in Figure 4. Node N3 has a higher sequence number than N2 and N6. Therefore, the final route is created by (S, N3, N2, N7, and D). The algorithm followed for AODV (Algorithm 1) is provided below in pseudo-code.  
The first step is to pre-calculate the optimal route for some pre-existing gateways according to the routing schedule. If a new user requests data transmission, the new user must send a request to the nearest node on the network. This scenario is shown in Figure 4.  
Let us pretend that node (N6) is a brand new user in the network, as indicated by the yellow hue. Following receipt of this request, the AODV algorithm must consult the routing table (shown in Figure 5 under node and association) to determine the best pre-calculated path to the nearest gateway. Figure 5 illustrates this point (the next gateway two has a minimum hop number of two, so it will be used in this situation). After sending the specified route information to the new user (N6), a connection can be established. The network architecture, as well as network parameters, change when a new user joins. Mobile agents exchange this information with all nodes in the network while on the go.  
Figure 3: Node deployment.  
A parallel procedure is triggered in the second stage of the routing process to assign a route to a new user, thus monitoring is focused on the new user's traffic demands and optimizing bandwidth utilization and loading parameters at specified connections.  
Figure 4: AODV routing Process.