## 3 Secure FSO Link in GNU Radio Simulation
### Channel  
FSO systems are prone to random channels, and hence, received power varies due to atmospheric conditions such as fog and turbulence losses [27]. In addition, other sources of randomness occur due to link geometry, such as pointing errors and geometric losses. This can become problematic for the receiver. To simulate an accurate free space optical channel, an OOT module in [28] was used. The FSO channel is implemented using hierarchal blocks as shown in Figure 5. The FSO channel blocks account for channel variables that can be adjusted and tested in simulation.  
The output of the packet transmit block is complex. However, FSO channel only allows real float vectors to pass through. The data type conversion methods in GNU Radio do not support direct complex-to-float conversion. Alternatively, to deal with this, the transmitted data must be split into its individual magnitude and phase samples and then passed through identical channels before being combined back into a single complex sample.  
There are a total of eight channel variables to simulate four types of losses: geometric, turbulence, pointing errors and weather. Geometric losses describe the beam spreads over a distance as in (1); hence, not all the light from the transmitter can be focused onto the receiver. The amount of power lost from this is affected by the transmitter/receiver diameters, the link length and the transmitter half-angle divergence [19]. A higher divergence angle means the light spreads out more, and the receiver does not receive the full power. As the link length increases, the beam will also spread out more, meaning the receiver power will be lower [20].  
Turbulence losses are a type of optical loss, caused by slight fluctuations in humidity, pressure and temperature in the air [29]. These losses are negligible in a lab environment but can have a significant impact over a longer distance in free space. For that reason, the simulated turbulence losses are also assumed to be small. The variables that will change  
Figure 5: Secure FSO link Channel blocks in GNU Radio.  
the amount of loss are the refractive index and the channel temporal correlation; however, increasing the link length will also increase losses.  
Pointing errors are affected by the alignment between the transmitter and receiver. This type of error is caused by the Jitter variable, which determines how far the centre of the beam can deviate from the centre of the receiver. It is caused by mechanical vibrations or a swaying structure [29]. Other factors, such as the link length, transmitter/receiver diameter and divergence angle, will change how much the jitter affects the final signal strength. For example, a longer link length will amplify these jitters at the receiver. Pointing errors are also negligible in a lab environment, so the pointing error jitter is kept at 0 in the simulation.  
Weather losses, or fog losses, refer to losses caused by microscopic particles in the air (usually water droplets) that can reflect or block small parts of the beam and reduce the overall received power at the receiver. These losses are amplified over larger distances and are usually a major hurdle in industrial applications where air quality is lower [30]. However, in a lab, these losses are much less of a problem. The visibility variable has the utmost effect on the weather losses; however, as with other losses, the link length also changes the weather losses.  
Each of these variables can be adjusted in the UI while the simulation is running by using a slider to make testing and data gathering as efficient as possible. Now that the data have passed through the simulated channel, depending on the values of the variables, noise is introduced, and the transmitted optical power decays. The receiver recovers the data from the noisy signal so that it can demodulate and decipher the important data from the packet.