## 4 Performance Analysis  
In the considered RF/FSO hybrid system, failures are possible in any state. However, the probabilities of states FSO \(\rightarrow\) RF and RF \(\rightarrow\) FSO are associated with specific losses. The incorrect use of the FSO instead of the RF can lead to an increase in the bit error rate, a degradation of service quality, or even the complete failure of communication in adverse weather conditions. On the other hand, failure to use the FSO in the correct way leads to a decrease in the data transfer rate, a decrease in the reliability of the system due to its susceptibility to interference from other RF sources, and an increase in the energy consumed during the transmission of messages. In this section, we consider the generalized losses. Therefore, we define the probabilistic loss metric as the sum of the probabilities of states FSO \(\rightarrow\) RF and RF \(\rightarrow\) FSO. Please note that the contribution of loss states to QoS degradation may be heterogenous. In this case, it is necessary to use the corresponding weighting coefficients. Probabilities \(p_{1}\) and \(p_{3}\) are linked to specific losses that result from the application of the data transmission principle, which proves to be the least favorable current situation. Therefore, the probabilistic loss metric is as follows:  
\[L=p_{1}+p_{3}. \tag{19}\]  
and considering Equations (1)-(3),  
\[L\Big{(}w_{f},w_{r},\mu\Big{)}=\frac{\frac{\mu_{f}}{\mu_{r}}+1}{1+\frac{w_{r}+ \mu_{f}}{w_{f}}+\frac{\mu_{f}}{\mu_{r}}\Big{(}\frac{w_{r}+\mu_{r}}{w_{r}}+1 \Big{)}}. \tag{20}\]  
From a network protocol perspective, hybrid networks can use the same rules to switch between FSO and RF to ensure that transmission is smooth and minimize communication disruptions while remaining independent of the physical layer implementation. Network protocols are designed to operate above the lower layers, abstracting away the complexities of the underlying transmission technologies. This enables switching decisions based on high-level performance metrics such as the packet latency or bit error rate to be made, without the need to know the specific characteristics or limitations of the FSO or RF systems. This abstraction provides flexibility and adaptability to the network, allowing it to easily switch between communication media depending on the current conditions, while maintaining the efficiency and transparency of network operation in the higher layers. We can thus accept that \(\mu_{f}=\mu_{r}=\mu\). Therefore, the loss metrics is simplified as follows:  
\[L\Big{(}w_{f},w_{r},\mu\Big{)}=\frac{2}{2+\frac{w_{r}+\mu}{w_{f}}+\frac{w_{f} +\mu}{w_{r}}}. \tag{21}\]  
This is a symmetric function in the sense that \(L(X,Y,\mu)=L(Y,X,\mu)\), where \(X\) and \(Y\) are any values. The behavior of the loss function is shown in Figure 3.  
In hybrid FSO/RF communication systems, environmental instability caused by factors such as fog, turbulence, rain, or network node mobility increases losses. These losses can be significantly reduced by improving the mechanism used to select the optimal communication type in real-time. Proactive switching, implemented using machine learning (ML) and environmental sensors, can significantly reduce losses and ensure reliable communication. In this situation, approaches based on convolutional neural networks and recurrent neural networks have shown high efficiency [37; 38]. Figure 4 demonstrates that the strategy used to improve the switching mechanisms between the FSO and the RF in the long term may lose out to the strategy used to reduce the instability of the environment (for example, through the use of relay nodes, parallel paths, mobile sinks, etc.). Here, we also retain the assumption of a homogeneous output intensity from FSO \(\rightarrow\) RF and RF \(\rightarrow\) FSO. By using the proper approach to collecting test data and organizing training, a high effectiveness of the ML method can be achieved, regardless of the nature of the phenomenon [39].