P2P networks may provide a solution to the exponential growth of connected devices. Indeed, by 2030, researchers expect to have hundreds of millions of devices in indoor environments 
. As such, P2P networks reduce—and in some cases avoid—bottlenecks at the servers, since each node connected to the system provides additional resources. P2P networks have been extensively studied before in works such as 
. However, the work proposes a totally different mathematical analysis based on transitory CTMCs, while in these previous works, they use irreducible CTMCs. The reason for this is to model static P2P networks, where nodes have to maintain a certain degree of alignment to allow for the use of LiFi communications. Also, since nodes are not allowed to enter or leave the system in the considered applications, reseasrchers model managed networks where the administrator controls the download procedure. As stated earlier, this is the first work that develops such models for P2P networks with LiFi capabilities. Although there are a large number of works related to performance analysis in LiFi networks, most of them focus on the study and modeling of sender–receiver orientations 
, as well as their radiation patterns, distances, and angles of incidences 
to estimate metrics such as signal-to-noise ratio (SNR), signal-to-interference-and-noise ratio (SINR), and bit error ratio (BER). Therefore, another important contribution of the work is to present relevant data about the performance of a LiFi network through the estimation of its download times under certain environments and configurations.
By taking a look at alternatives to improve network performance, researchers find the use of decentralized networks such as those implemented in decentralized federated learning (DFL)
models through machine learning (ML)
as presented by Mengxuan Du et al. 
, which looks for the exchange of parameters between neighbors promoting device-to-device communication (D2D)
to reduce communication costs in IoT environments and thereby improve data compression and collaboration efficiency. In the same way, Fitsum 
presents the idea of a decentralized system through a decentralized deep reinforcement learning (DRL) for each user to dynamically learn the selection of bands that maximizes its download rate, improving resource utilization and predominance of quality of service (QoS)
in the system and modeling the behavior of each access point (AP)
as a Markov chain. The previous work shows the efforts being made in the field of decentralization structures in networks for the optimization of resources due to the way that nodes behave in the network and that they can be modeled by Markovian processes. However, important efforts also predominate in the types of technologies that are used, and in many cases, complement to give way to new technological alternatives. Despite the fact that most research considers total mobility in P2P networks, in the context of static managed networks, there are some interesting works, such as those presented by Charalambous 
, Vicino 
, and Tsoumakos 
, where semistatic P2P networks are studied using mathematical models and simulations, in which some of the nodes are maintained with some mobility over time and the rest remains static, obtaining network performance metrics such as success rate, messages per requests, successful delivery ratio, and latency, among others (unlike these works, researchers do not measure the impact of network mobility; on the contrary, researchers consider nodes with null mobility, according to the principles of operation of LiFi).
Interestingly, there is another range of work related to P2P networks in which a description is made of the advantages of using decentralized structures instead of classical ones through specific techniques and protocols such as Juxtapose (JXTA) 
, Context-Aware Recommendations (CARS) 
or Coordinated Multi-RobotExploration Aquila Optimizer (CME-AO) 
in the branches of genetic computing, networking, and automation. In addition, all these analyses can be potentially applied in static scenarios such as hospitals, robotized processes, and museums 
On the other hand, an important branch has emerged in the use of optical and radio frequency technologies; although there are currently no works related to the comparison of their performances in many metrics, major studies focus on the formation and development of hybrid networks between these technologies, as can be seen in works about LiFi and WiFi hybrid networks 
, which is based on the AP selection of the most convenient technology in energy consumption, taking into account the number of nodes in IoT networks and preferably looking for static APs. Likewise, the work presented by Sanusi 
describes load-balancing processes in LiFi and WiFi channels for the handover process (processes approached with various techniques like self-adaptive medium access control (SA-MAC) protocols 
or hidden Markov models (HMMs) 
). In addition to focusing on LiFi and WiFi networks, some other works model and measure metrics such as permanence times (performing simulations with Monte Carlo, also capturing the mobility of users in the system 
), throughput, delay (using the enhanced distributed channel access (EDCA) protocol for channel selection 
), and packet drop rate (analyzing the MAC layer to improve throughput across the network and calculating collision probability and packet drop rate 
), among others. Since nodes are static, and the download procedure is fully controlled by the administrator, researchers do not consider mobility or packet drop rate. Conversely, researchers provide average file download times in different architectures and scenarios.
Finally, and keeping in mind that there are not many works about LiFi performance and use cases, this article proposes a novel comparison between pre-existing scenarios, such as those in which WiFi is used, and unprecedented scenarios, which use LiFi in P2P and centralized environments, describing the characteristics and considerations of each of these systems and providing guidance to enable the use of new alternatives for the exchange of large amounts of information. Consequently, new concepts of LiFi networks are added to the literature, supported by quantitative results.
2. LiFi- and WiFi-Based Communication P2P Architectures
Having explained the potential of centralized and decentralized structures, this section describes the details and characteristics when these structures are analyzed with the parameters of LiFi 2.0 and WiFi 7, stressing that the use of LiFi applications is not usually straightforward nor the connections are usually direct as in the case of WiFi, considering node alignment, power and reflections of the signal, transmission and reception angles, and even electronic limitations. In this regard, this work makes an important contribution by proposing network architectures to allow the concept of P2P-LiFi to be really useful in the efficient distribution of information. Further, this research presents the visualization, practical approach, simulation, and implementation proposal of LiFi networks for static node environments (classrooms, museums, offices, control systems, and storage systems, among others) through a formal evaluation and quantitative values that allow for the comparison of LiFi-based technology with WiFi in centralized and distributed structures, to clearly define the cases in which one scenario is better than another.
In detail, LiFi prototypes in general behave like Lambertian sources with a determined field of view (FOV)
and a 𝐿𝑂𝑆
between the optical emitter and receiver, as described in Figure 1
. However, there are scenarios in which due to phenomena such as reflections or scattering, LiFi can act as a non-Lambertian source (𝑁𝐿𝑂𝑆
propagation mode), as depicted in Figure 2
, where the light beams corresponding to the emitter and the receiver constitute an overlapping volume through their 𝐹𝑂𝑉𝑠 
. In this regard, LiFi 2.0 is a constantly growing technology that can coexist with current and future RF technologies, providing extra capacity to offload traffic and reducing latency for critical applications. Due to its features and utilities, LiFi 2.0 has been considered as a complement to radio frequency technologies in scenarios that can provide solutions in fields like IoT, artificial intelligence (AI), big data, or vehicle communications, where hundreds of nodes are placed in a small region, generating high traffic rates that may cause congestion and high packet loss probability under RF transmissions that are usually omnidirectional 
. In contrast, LiFi communications comprise a much more restricted coverage area that allows for communication among a reduced number of nodes, which can improve the system’s performance. However, there has not been an extensive study where both technologies are evaluated and analyzed. Indeed, researchers believe that LiFi cannot only complement WiFi networks but rather has certain characteristics that provide better performance than RF-based systems.
Figure 1. LiFi 2.0 prototype in LOS propagation mode used for VL and IR spectrum.
Figure 2. LiFi 2.0 prototype in NLOS propagation mode used for UV spectrum.
LiFi networks can use the whole spectrum of light, going through infrared, visible, and ultraviolet lengths. Generally, the first two ranges of spectra behave like Lambertian sources, then they require LOS propagation, opposite to the ultraviolet range, which is commonly used in NLOS propagation modes. In Figure 3, researchers show a P2P-LiFi LOS connectivity scenario, in which LOS propagation is needed to connect with the pairs of adjacent nodes that are in the north, south, east, and west positions (if it is applicable). Another architecture of P2P-LiFi with NLOS conditions is shown in Figure 4 where data are transmitted in one sense between adjacent levels, assuming that the first seed in the network (level 0) is in charge of distributing information through the nodes that it can reach, i.e., nodes in level 1, and so forth. Note that nodes in the same level can share chunks among them.
Figure 3. P2P-LiFi propagation scenario: a node (green) can download or upload information with its adjacent nodes (blue) in the cardinal points through their LOS and not with nodes that are out of range (gray).
Figure 4. P2P-LiFi NLOS propagation scenario: nodes in level 1 (green nodes) can download information from upper nodes in level 0 (blue nodes) or upload information to immediate lower nodes in level 2 (yellow nodes) and upload data from the peers in the same level (red nodes).
For the case of WiFi-based networks, researchers could assume that all nodes inside the transmission range are reachable by a given peer in the network, i.e., nodes do not require a strict alignment, as in the case of LiFi-based transmissions. Nevertheless, sometimes nodes cannot reach all nodes in the network due to obstacles, power restriction, and propagation of the signals. In general, the transmission range is adjusted in such a way as to avoid interference among neighbor systems or clusters, and also to provide an adequate service in terms of bit error rate and data rate transmissions. This WiFi scenario is illustrated in Figure 5.
Figure 5. In the proposed P2P-WiFi scenarios, a node that acts as a server (green) can connect with the nodes that are within its coverage radius (blue) but not with nodes that are out of its range (gray nodes).
It is important to mention that in centralized networks, unlike P2P networks, all clients are reachable from the server whose capacity allows for connecting and sharing information with up to four nodes at the same time, allowing information to be propagated through the network directly from the server. Figure 5, Figure 6 and Figure 7 outline scenarios for the proposed LiFi and WiFi networks, stressing that for centralized LiFi 2.0 and WiFi 7 networks, a single server is used.
Figure 6. WiFi centralized case: maximum coverage range (green circle with dotted line) is strictly required for connections where a server (green node) reaches all the clients (blue nodes).
Figure 7. The centralized scenario proposed for LiFi environments requires that all the leechers (blue) have a LOS towards the server (green) channel, in which they will establish upload and download links.
It is important to mention that for the LiFi case, and in order to have an adequate comparison with WiFi-based networks, researchers consider a fixed number of nodes without mobility to provide the required alignment in light-based communications. In the literature, it is common to consider an infinite population model where nodes can enter and leave the system. Hence, researchers develop a new mathematical model considering these restricted mobility conditions where the system administrator initiates the file-sharing procedure in the fixed population network.