# Route Availability as a Communication Quality Metric of a Mobile Ad Hoc Network
## 3 Route Nonuniformity Path Modelling
### How to Measure Route Feature Values for RA Calculation
#### 3.2.3 Algorithm for Calculating RA  
The algorithm used to calculate RA is described below, starting with a step of measuring route feature values at the source node. The flowchart of the algorithm is shown in Figure 6.  
#### 3.2.3 Algorithm for Calculating RA  
The algorithm used to calculate RA is described below, starting with a step of measuring route feature values at the source node. The flowchart of the algorithm is shown in Figure 6.  
2.4 Example whether the destination node address is added to the route entry of the source node. If yes, go to STEP 2, else go to STEP 1. 1. [label=STEP 1]
2. Detect \(\mathrm{T_{i}}\), time at which the route entry of the destination node is updated, and \(\mathrm{F_{i}}\), event information that indicates whether the entry event is an addition or a deletion, and store these items of information in S (i) = \(\{\mathrm{T_{i}}\), \(\mathrm{F_{i}}\}\). The initial value of i is 1. Each time an item of information is added, i is incremented by 1. 1. [label=STEP 1]
2. Branch off based on whether the latest two unprocessed events have been stored, as follows:  
1. [label=Case 3-1]
2. If only one event has been stored (only S (i) has information), go to STEP 1. 3. If two events have been stored (both S (i-1) and S (i) have information), go to STEP 3. 1. [label=STEP 1]
2. Branch off based on the content of F stored in S (i-1) and S (i), as follows:  
1. [label=Case 4-1]
2. If \(\{\mathrm{F_{i-1}},\mathrm{F_{i}}\}=\{\text{addition, addition}\}\), go to STEP 7. 3. If \(\{\mathrm{F_{i-1}},\mathrm{F_{i}}\}=\{\text{addition, deletion}\}\), go to STEP 5 (the connection processing). 4. If \(\{\mathrm{F_{i-1}},\mathrm{F_{i}}\}=\{\text{addition, addition}\}\), go to STEP 6 (the disconnection processing). 5. If \(\{\mathrm{F_{i-1}},\mathrm{F_{i}}\}=\{\text{addition, addition}\}\), go to STEP 8 (the exception processing). 6. Add the difference between \(\mathrm{T_{i}}\) and \(\mathrm{T_{i-1}}\) to total connected time, \(\mathrm{C_{T}}\); namely, \(\mathrm{C_{T}}\leftarrow\mathrm{C_{T}}\) + \((\mathrm{T_{i}}-\mathrm{T_{i-1}})\). Go to STEP 9. 7. Add the difference between \(\mathrm{T_{i}}\) and \(\mathrm{T_{i-1}}\) to total disconnected time, \(\mathrm{D_{T}}\); namely \(\mathrm{D_{T}}\leftarrow\mathrm{D_{T}}\) + \((\mathrm{T_{i}}-\mathrm{T_{i-1}})\). Go to STEP 9. 8. Branch off based on the routing protocol used, as follows:  
1. [label=Case 7-1]
2. If the routing protocol is AODV, go to STEP 8 (exception processing). 3. If the routing protocol is OLSR, this is a route change. Go to STEP 5 (connection processing). 4. This is an unexpected combination of events. Issue an alarm and stop the processing. Go to STEP 9. 5. Branch off based on whether the communication has terminated, as follows:  
1. [label=Case 9-1]
2. If the communication has not terminated, go to STEP 1. 3. If the communication has terminated, calculate RA from \(\mathrm{C_{T}}\), and \(\mathrm{D_{T}}\) using Equation (4). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Previous Event** & **Latest Event** & **Processing** \\ \hline Addition to the entry & Addition to the entry & Considered that the route has been changed \\ Addition to the entry & Deletion from the entry & Connection \\ Deletion from the entry & Addition to the entry & Disconnection \\ Deletion from the entry & Deletion from the entry & Treated as an exception \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Determination of connection/disconnection for OLSR (Optimized Link State Routing). As mentioned above, RA can be calculated from the connected time, disconnected time, and the number of route disconnections. These items of information are obtained by detecting information additions to or information deletions from the source node's route entry. These events occur when the source node receives routing control messages. In other words, these events are confined to the source node. This means that RA can be calculated without any need to receive feedback information from the destination node.