# A Reliable Low-Latency Multipath Routing Algorithm for Urban Rail Transit Ad Hoc Networks
## 3 The Improved Multipath Routing Algorithm
### Adaptive Multipath Selection Algorithm Based on Service Requirements
The constraint Equation (2) is obtained according to the latency requirement. \[\tau_{q}>\alpha\sum_{k=1}^{\max\{hc_{i}\}}\left(T_{trans,k}+T_{queue,k}\right) \tag{2}\]  
\[T_{trans,k}=\frac{L/M}{B} \tag{3}\]  
\[L_{que}=\frac{\rho^{2}}{(1-\rho)} \tag{4}\]  
\[T_{queue,k}=\frac{L_{que}}{\lambda M}=\frac{\lambda}{(\mu-\lambda)\mu M} \tag{5}\]  
where \(\tau_{q}\) represents the latency requirement of different services, \(q\) is the service type, \(\alpha\) is the estimation factor, which represents the maximum number of retransmissions, \(\{hc_{1},hc_{2},\ldots,hc_{i}\}\) is the number of hops corresponding to different paths, \(T_{trans,k}\) represents the transmission delay of the kth node, \(T_{queue,k}\) represents the queue delay of the kth node, \(L\) is the packet length, \(L_{que}\) is the queue length, and \(\rho\) represents the queuing strength of the system, in which \(\rho=\lambda/\mu\). According to Equations (2)-(5), the minimum number of parallel links \(M\) (\(M\) should be less than the number of independent disjoint paths) can be calculated. The average end-to-end latency of transmitting \(n\) packets using \(M\) paths is shown in Equation (6). \[\overline{T_{d2d}}=\left[n*(1-p)*T+p*n*\left\{T+T^{\prime}\right\}\right]/n \tag{6}\]  
\[T=\max_{M}\{\sum_{k=1}^{hc_{i}}\left(T_{trans,k}+T_{queue,k}\right)\} \tag{7}\]  
where \(p\) is the packet loss rate of data transmission, and \(T\) represents the longest latency of transmitting packet data in the path. The traditional AOMDV only considers one factor of hop count in the routing selection process, and it ensures transmission efficiency by selecting the least-hop-count path. However, this selection scheme cannot guarantee the quality of the propagation path while ensuring transmission efficiency. When selecting the bad-quality path to transmit data, even though this path has a few hop counts, it causes frequent packet loss because of the bad path quality and affects the transmission efficiency. So, in this paper, the hop count \(x\) and link quality \(y\) are chosen as the influencing factors to select a better path by establishing the link cost function. Among them, a larger parameter x means a longer path, which has a significant impact on the end-to-end latency and is negatively correlated with the reduction in latency; a larger parameter y means a good link quality, which is beneficial for improving the reliability, and it is positively correlated with the reduction in the packet loss rate. The link cost function is shown in Equation (8). \[LS(x,y)=\alpha*x+\beta*\frac{1}{y},\alpha+\beta=1 \tag{8}\]  
where \(\alpha\) and \(\beta\) are weight coefficients, which represent the degree of contribution of the parameters to the delay and reliability, and it can be obtained according to the AHPalgorithm. Then, according to the Dijkstra principle, select the M links with the lowest link cost as the transmission path. The traditional AOMDV routing protocol will select one or more routes with the minimized hop count from the remaining paths as alternate routes after the completion of the primary path selection, and when a path fails, the node will generate a route errors (RRER) message and then inform the source node to enable the alternate path for retransmission; this way can improve the reliability of communication. In general, researchers use the packet loss rate as a measure of reliability, and the nodes can calculate the packet loss rate by counting the number of successfully received packets, as shown in Equation (9).