## 4 Proposed Solution
### Packet Transmission at Source Node
In order to ensure end-to-end security of transmission, in terms of the confidentiality, authenticity and integrity, the Rivest-Shamir-Adleman (RSA) based asymmetric encryption is being used in the proposed solution. The RREQ and RREP packet are modified to carry Public Keys, (Figures 3 and 4, respectively). In order to satisfy the authenticity of packets being sent by the genuine source, they are enhanced to carry node ID and timestamp value encrypted by the Private Key (EPiS) of source node \(t^{\prime}\). Meanwhile, to ensure the confidentiality and integrity of data, the encryption of the payload is done with the Public Key (EPD) of the destination node M\({}_{e}\). The encryption process at source end is as follows:

\[\text{M}_{e}=\text{E}_{\text{PD}}\text{ (Payload)} \tag{3}\]

\[t^{\prime}=\text{E}_{\text{P}iS}\text{(NodeID,TIMESTAMP)} \tag{4}\]

\[\text{Data Packet}=\{(\{\text{M}_{e}\},\text{)}\,\text{t}^{\prime}\} \tag{5}\]

### Packet Processing at Destination

At the destination node, upon receiving the data packet, first, the \(t^{\prime}\) is decrypted using the Public Key, EPS, of the source node. Upon successful execution of this step, the payload part is decrypted using the Private Key, EPiD, of the destination node. In order to ensure maximum delivery, the destination node broadcasts a time bound delivery report of the packets it received. To perform this action, a new control packet was created \"SEND_DELIVERY_INFO\" (Figure 5)

### Trust Evaluation of Paths

To ensure the trustworthiness of the paths created, the direct observation mode is used by the source nodes. In order to record the trust values, a new data structure, \"SOURCEINFO\", is used. Based on the performance of the path, its Gateway node is assigned a trust value known as GWStatus. Let GWStatus(i, j) denote the level of direct trust of node \"i\" on its neighbor \"j\". Its values range from \(0\leq\text{GWStatus(i,j)}\leq 3\). In Table 3, the trust values and definitions are listed. By default, every new Gateway node is assigned a value of two. \begin{table}
\begin{tabular}{c c} \hline \hline
**Trust value** & **Definition** \\ \hline
0 & Absolute no trust \\
1 & Partially trusted \\
2 & Default trust \\
3 & Full trust \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Trust values for Gateway Nodes. Figure 5: Delivery info control packet. The trust value is manipulated on the basis of the control packet, \"SEND_DELIVERY_INFO\"; for every successful report, the value is incremented and, in case of failure, it is decremented. Fixed interval timers, \(t\) and \(t^{\prime}\), are used to perform this check on the trust value for nodes, as shown in Equations (6) and (7). In the case of the trust value of node being 1, it is under observation and no packets are transmitted through this Gateway node, but it is not yet marked for blacklisting. Some extra time is given to this node as the delivery reports may be delayed. Once it is assigned the value 0, it is marked for blacklisting and any new RREP from this Gateway node is barred from entry into the new routing table at the source node. \[t>\text{NetTraversalTime: GW}_{\text{Status}}=1 \tag{6}\] \[t^{\prime}>2+\text{NetTraversalTime: GW}_{\text{Status}}=0 \tag{7}\]

In the proposed solution, the HELLO packet processing phase at source node performs an extra task in addition to neighbor discovery, _i.e._, processing the packets existing in the transmission queue. At this stage, if multiple routes still do not exist, the current packets in the transmission queue are sent using a single path only; in the presence of multiple paths, the load is divided among the paths. With this approach, the focus is to achieve maximum efficiency in the case of mission critical operation where the entire information should reach the destination, albeit maybe with some minor delay. The complete process is depicted in the flowchart in Figure 6.

Figure 6: Flowchart for the ESTA processing. ## 5 Implementation and Simulations

For simulation purposes, the NS-3.19 simulator is used.