# User QoS-Based Optimized Handover Algorithm for Wireless Networks
## 3 User QoS-Based Optimized Handover Algorithm
### Optimized Handover Algorithm  
An improved handover algorithm referenced in [14] was proposed to further help the system to select the best nearby handover AP and avoid unnecessary handovers. For the \"single-threshold handover judgment method\", when the RSSI between the UE and the currently connected AP is inferior to the RSSI between the UE and the nearby connectable APs with the best RSSI between the UE, the connection with the currently connected AP will be transferred to the AP with the best RSSI with the UE among the nearby APs. The definition of RSSI is as follows [20]:  
\[RSSI=P_{r}-P_{L}(d_{0})-10n\ log10(d_{i}/d_{0})+X_{0} \tag{1}\]  
\(P_{r}\) represents the transmission power of the signal. \(P_{L}(d_{0})\) represents the path loss of the signal per unit distance \(d_{0}\) due to environmental factors. \(d_{i}\) is the distance between the actual position of the UE and the set reference point. \(d_{0}\) is the mentioned unit distance. \(n\) is the attenuation factor of the signal. \(X_{0}\) is a random value of Gaussian distribution. The algorithm of the OHA is described in Algorithm 1. When the system is started, the UE will start to search for nearby APs, start to collect the relevant information of these APs, and exclude the data of the AP that the UE is currently connected to from the collected data. Afterward, the UE will start to test the maximum throughput capability, and the severity of the packet loss problem between the server and itself will be the basis for further handover decisions. If the system finds that there are other APs nearby that can be handed over, it will start to check the current signal strength (\(RSSI^{C}\)) of the connection between the UE and the AP. If the measured signal strength is greater than or equal to the threshold (\(T\)) set by the user, it means that it is in the \"good signal condition range\", which means that its current connection signal quality is good and there is no urgent need to hand over (as shown in Figure 2a, and lines 3 to 7 of Algorithm 1). Note that the two curves in Figure 2a represent the RSSIs of AP1 and AP2, respectively. In this sense, the handover decision tends to reduce the probability of triggering the handover procedure. Conversely, if the measured signal strength is less than or equal to the threshold set by the user, this means that when it is in the \"bad signal condition range\", we set an increased basis for decision-making for handover than in the good signal condition range, to prevent the UE from encountering poor connection or low service throughput (as shown in Figure 2a, and lines 9 to 13 of Algorithm 1). Regardless of whether the current signal connection quality is in the range of good or bad signal conditions, the system will first make a rigorous \"overstep AP handover\" judgment to decide whether to directly hand over to the AP that can provide the second-best service quality. The method is that when we find the farthest AP in the direction that the UE is moving, the system will ensure that the UE can receive stable network services after connecting with it, to prevent the service instability problem caused by frequent handovers when the UE is handed over to the AP that can provide the best signal quality, and when it is about to leave the signal coverage of this AP, the UE then needs to switch the connection to another AP that can provide the best signal. Therefore, by judging the \"signal strength of the second-best nearby AP\" and the \"UE heading direction\", to determine whether the user will move to the coverage of the nearby AP with the second-best service quality, and only when the following judgment conditions are met at the same time, will the handover procedure be triggered.