# Hybrid RF/VLC Network Architecture for the Internet of Things
## 5 Implementation
### Network Implementation  
The next step is to establish communication between both Zigbee and LoRaWAN protocols. As mentioned above, the understanding procedure between these two protocols is based on the use of the defined HFN, since this will be the one used in both communication protocols.  
A coverage simulation using the Okumura-Hata model [36] for the LoRa protocol and the general urban path loss (GUPL) model for ZigBee [37] was carried out using the parameters of Table 3, where the experimental setup's environment is assumed to be urban. The communication parameters were extracted from the nominal characteristics of the used components. The transmitter and receiver antenna heights are assumed to be similar to those used in an actual deployment (LoRaWAN gateway on top of a building and Access Points at street-light height). Figure 14 depicts the estimated coverage of the LoRaWAN gateway and several ZigBee coordinator nodes.  
The LoRaWAN gateway has been defined to work through an implementation with The Things Network service and the TagoIO integration; thus, the user can view the frames and the associated data received in the LoRaWAN network, besides having the possibility of sending data destined to the devices to it.  
In the VLC network, the data sent through the LED lamp is previously received through LoRaWAN. In order to achieve this, the corresponding access point has to send an empty frame to the gateway prior to sending the VLC frame. This must be performed in this way because it works with Class A modules, which, to receive data, needs to send a frame to open a reception window, allowing the LoRaWAN gateway to send the associated data.  
\begin{table}
\begin{tabular}{l r} \hline \hline  & **LoRa** \\ \hline Tx power & 14 dBm \\ Tx height & 15 m \\ Rx height & 5 m \\ Center frequency & 860 MHz \\ Rx sensitivity & –134 dBm \\ Antenna pattern & 5/4 Dipole \\ Antenna gain & 4.5 dBi \\ \hline \multicolumn{3}{c}{**ZigBee**} \\ \hline Tx power & 0 dBm \\ Tx height & 5 m \\ Rx height & 1.5 m \\ Center frequency & 2.4 GHz \\ Rx sensitivity & –100 dBm \\ Antenna pattern & 5/4 Dipole \\ Antenna gain & 5 dBi \\ \hline \multicolumn{3}{c}{**GUPL Parameters**} \\ \hline Power component & 2.2 \\ Path loss exponent at 2.4 GHz & 2.7 \\ Attenuation constant at 2.4 GHz & 0.06 dB/m \\ \hline \hline \end{tabular}
\end{table}
Table 3: Simulation parameters obtained from the developed demonstrator’s datasheets.  
Once the data is received, the HFN is extracted to subsequently carry out the communication via VLC with the LED lamp. Another possibility of this architecture is that the lamp can be used to download content that can be stored in the central node of the cell and updated through the LoRaWAN connection to the IP network.  
Regarding the used LoRaWAN gateway, it has been configured in such a way that it establishes a link between LoRaWAN and the Internet, which allows for implementation with a user interface and a service that stores the data collected by the network. To do this, it is useful to add an implementation, so that the user can not only visualize the data collected and sent through the LoRaWAN network, but also can interact with the LoRaWAN network and the other networks and devices that are part of the sub-network. This implementation is made with the service provided by The Things Network.