# User QoS-Based Optimized Handover Algorithm for Wireless Networks
## 3 User QoS-Based Optimized Handover Algorithm
### Optimized Handover Algorithm
The handover process is not performed until the signal strength and quality of the currently connected AP are in this condition, which can effectively reduce the occurrence of the ping-pong effect (i.e., \(T^{S\_HO}\geq RSSI^{C}+HM^{S\_HO}\)). 3. The signal strength quality of the AP near the UE is the best (\(RSSI^{Max}\)) and better than the sum of the signal strength of the second-best AP (\(RSSI^{2 nd\_best}\)) and the HM with the second-best signal strength in the bad signal quality (\(HM^{2 nd\_H}\)). This means that for the UE, the quality of service of the nearby AP with the best signal strength is much better than the service quality of the second-best nearby AP (i.e., \(RSSI^{Max}\geq RSSI^{2 nd\_best}+HM^{2 nd\_H}\)). 4. When selecting the best nearby AP for handover, the AP with the largest signal increment will be selected as the best handover AP; that is, the UE keeps moving to it (i.e., UE is moving toward \(RSSI^{Max}\) AP). 5. \"The worst acceptable signal strength that urgently requires handover\" (\(T^{U\_HO}\)) should be considered as a top priority when making handover decisions. If the signal strength between the UE and the currently connected AP is lower than the worst acceptable signal strength that urgently requires handover for the connection, this means that the signal quality of the current connection is extremely poor, and the UE must immediately initiate a handover procedure to connect to a nearby AP with better signal quality (i.e., \(T^{U\_HO}\geq RSSI^{C}\)). In other connection situations, such as when the UE has not been connected to any AP, the algorithm proposed in this paper will require the UE to check whether there is an AP nearby that can be connected to. If there is, it will connect to the one with the strongest signal strength between it and the UE; if not, it will wait until the UE moves to a nearby AP that can be connected to, and then connect to the one with the strongest signal between it and the UE. A schematic diagram of its operation is shown in Figure 2b. The advantage of the proposed algorithm is that it enables the UE to connect to the most stable and most suitable AP for its connection. Assume that the number of all APs is \(n\). The proposed OHA algorithm needs to calculate the difference in signal strength between the AP that the UE is currently connected to and other APs in the remaining nearby range, and take into account \(HM\) and \(T\) as the basis for whether to perform the handover procedure. The calculation of the difference in signal strength between APs is at most \(n-1\) times, so it can be deduced that the computational complexity of this algorithm is \(O(n)\). ```
1:Function HAND-OFF TRIGGERING
2:if(\(RSS^{C}\geq T\)) then
3:if(\(RSS^{I}\)) \(\geq T\) \({}^{2 nd\_best}\) \(\geq T\)\({}^{2 nd\_best}\)\(-\)\(HM^{2 nd\_best}\)) AND (UE is moving toward \(RSS^{2 nd\_best}\) AP) then
4:return True
5:elseif(\(RSS^{Max}\geq RSS^{C}\) + \(HM^{Goad}\)) AND (\(T\)\({}^{S\_HO}\geq RSS^{C}\)+ \(HM^{S\_HO}\))
6:AND (\(RSS^{Max}\geq RSS^{2 nd\_best}\) + \(HM^{2 nd\_good}\)) AND (UE is moving toward \(RSS^{Max}\) AP) then
7:return True
8:endif
9:else
10:if(\(RSS^{2 nd\_best}\geq T\) \({}^{2 nd\_best}\)\(-\)\(HM^{2 nd\_best}\)) AND (UE is moving toward \(RSS^{2 nd\_best}\) AP) then
11:return True
12:elseif(\(RSS^{Max}\geq RSS^{C}\) + \(HM^{Bad}\)) AND (\(T\)\({}^{S\_HO}\geq RSS^{C}\) + \(HM^{S\_HO}\))
13:AND (\(RSS^{Max}\geq RSS^{2 nd\_best}\)+ \(HM^{2 nd\_}\)) AND (UE is moving toward \(RSS^{Max}\) AP)]
14:OR (\(T\)\({}^{1\_HO}\geq RSS^{C}\)) then
15:return True
16:endif
17:endif
18:return False
19:endfunction
```  
**Algorithm 1** Optimized Handover Algorithm