## 2 A Generic Multi-Path and Multi-Channel Proposal for HWMP
### Routing Selection and Assignment  
The proposed mechanisms modify the default HWMP routing table. On the one hand, the number of entries in the table will be higher, due to the availability of multiple paths for each destination address. In addition, the number of fields of each entry will also be higher to allow the appropriate path selections. The added fields are summarized in Table 2.  
The general route assignment tasks performed by the network nodes every time they have to (re)transmit a packet are detailed in Algorithm 3. First, the node extracts the following parameters from the packet header: source node, destination node, access category, and time to live. Then, the algorithm verifies if there is an available route. In the affirmative case, the next hop node is obtained by means of the route selection algorithm (Algorithm 4), considering the destination node and the access category, and finally, the transmission is assigned to a specific channel. In the case that there is no route, the packet is queued, and the path discovery mechanism is activated. This mechanism tries to obtain the route a fixed number of times, and if that threshold is exceeded, the route to that destination is considered invalid and the packet is eliminated. As can be seen in Algorithm 4, the route selection process first searches all available paths according to the destination address and then deletes the routes that have expired. Later, these paths are sorted from the best to the worst according to the metric, and then, they are resorted taking into account the number of hops to the destination. Our implementation considers the number of hops to avoid the creation of undesired loops, as will be explained with the help of Figure 5. This figure represents a simple scenario with four nodes: source (\(S\)), destination (\(D\)) and two intermediate nodes (\(N_{1}\) and \(N_{2}\)). The source node has two available paths to send its packets to the destination, \(P1_{S\to D}\) through \(N_{1}\) and \(P2_{S\to D}\) through \(N_{2}\). Suppose that at a given moment, the metric value of \(P1_{S\to D}\) is better than the metric value of \(P2_{S\to D}\). Therefore, according to the multi-path mechanism, high priority packets will be sent to \(N_{1}\) and low priority packets will be sent to \(N_{2}\). Similarly, \(N_{2}\) has two available paths to \(D\), one with a better metric value directly to D, \(P1_{N_{2}\to D}\), and another with a worse metric value \(P2_{N_{2}\to D}\) through \(S\). In this way, low priority packets would be sent back to S, building a loop \begin{table}
\begin{tabular}{c c} \hline \hline
**Field** & **Description** \\ \hline
**Control channel metric** & Metric value of the control channel, obtained by the PREQ-PREP mechanism. \\
**Data channel metric** & Metric value of each data channel, obtained by the PREQ-PREP mechanism. \\
**Hop count** & Number of hops between two nodes. \\
**PathID** & Path identifier used by PREP messages. \\ \hline \hline \end{tabular}
\end{table} 
Table 2: New fields added to the HWMP routing table. Figure 4: Path request and path reply modifications. (**a**) Path request. (**b**) Path reply. from which they would never leave. To avoid this problem, the criteria of the minimum number of hops is also taken into account, so that \(N_{2}\) will never use the \(P2_{N_{2}\to D}\) path, sending all the packets with destination in \(D\) directly to \(D\) regardless of their priority. This way, the source node \(S\) is allowed to use its two available paths, sending high priority packets through \(N_{1}\) and low priority packets through \(N_{2}\), but \(N_{2}\) must use always the same path to \(D\). As previously said, this mechanism reduces the number of available paths, but avoids the creation of undesired loops, eliminating the need for packet hop counters and unnecessary retransmissions which consume network resources in a completely useless way. ```
Input: NAN application Output: Forward the data to the next hop depending on the multiple paths available at the node.