Resource allocation in a multi-color DS-OCDMA VLC cellular architecture

: In this paper we present two resource allocations techniques in a visible light communication network with overlapping coverage areas due to the use of access points. Particularly, the ﬁrst approach exploits the rate maximization criteria, and then aims at maximizing the network rate under constraints on minimum and maximum rates, while the other procedure focuses on achieving fairness in the rate of each user accessing the network. The proposed system relays on optical code division multiple access mechanism, and resource allocation is intended in terms of codes assigned to a given user. Simulation results have been addressed in terms of achievable data rates, outage probability and percentage of accessing users.


Introduction
The noticeable advances in "white" light emitting diodes (LEDs) technology motivated utilizing the visible light spectrum for data transmission along with illumination purpose, as well discussed in [1][2][3][4][5]. This carried to a new paradigm referred as Visible Light Communications (VLC). In addition to providing the bandwidth required to meet the increasing demand for wireless services, using white LEDs for data transmission has many advantages over the radio frequency (RF) technology. For instance, LEDs are cheap, energy efficient and no extra infrastructure is needed since they would be already installed for lighting.
In principle, white LEDs are commonly made by using blue LEDs with an extra yellow phosphor, as well described in [5]. Although this technique can significantly reduce the fabrication complexity, in [6] the modulation bandwidth is shown to be limited to just a few MHz due to the slow response of the phosphor. Alternatively, white LEDs can be made by combining blue, red, and green LEDs. While this latter technique has a higher per-channel bandwidth, it also can enhance the data rate by simultaneously transmitting over the three LEDs (channels). A work that utilized this latter approach is [7].
From the communications perspective, each luminary acts as an access point (AP) that covers a confined area around its location, known as a attocell. In typical indoor scenarios like offices, airports, and hospitals, adjacent access points normally overlap in order to illuminate the entire indoor space and avoid dark spots. Furthermore, multiple users are expected to be simultaneously active and need to be served within each attocell. Consequently, the problems of resource allocation (RA) and interference management become two main concerns for system designers, and they have been addressed in several studies, see e.g., [8][9][10][11][12][13]. Nevertheless, all these studies are mainly based on the assumptions that each AP is equipped with a single LED, and that each AP employs the orthogonal frequency division multiple access (OFDMA) scheme to serve multiple users simultaneously by dividing the available bandwidth and power resources among users.
Conventional multiple-access schemes used in RF systems are not suitable to VLC systems without essential modifications. Regarding specific access techniques, it is known from [14] that optical code division multiple access (OCDMA) technique introduces a new dimension in multiple access schemes with respect time and frequency domains. OCDMA exploits optically orthogonal codes for multiple users sharing the same channel. Among the main advantages, OCDMA allows the use of asynchronous transmission and a more flexible bandwidth usage. OCDMA operates in a similar manner as RF-based CDMA with the difference that the latter uses optical orthogonal codes (OOCs). In the optical domain, the performance of optical CDMA is bounded by the choice of the high rate signature sequences. Code-based access schemes are classified depending on the coherence of the sources, and the coding and detection methods. A coherent OCDMA network requires highly coherent sources, whereas a low-cost LED can be used in incoherent systems. Also, in order to guarantee optimal recovery at the receiver, the codes should be clearly distinguished from a shifted version of itself, and also should be clearly distinguished from a possibly shifted version of every other sequence.
In VLC systems, OCDMA-based techniques consider each device is assigned a code such that the data can be encoded in time domain via On Off Key (OOK) modulation. Traditional bipolar spreading codes can be accordingly modified as unipolar codes to be applicable to VLC scenarios. OOCs are then used in synchronous OCDMA. However, long OOCs are needed to ensure optimality, which in turn reduces the achievable data rate of devices.
Another feature of OCDMA is the mitigation of the multiple access interference (MAI) due to the feature of orthogonality inherent in the spreading codes. Optical codes need to have good auto-and cross-correlation properties for accurate synchronization and low interference from neighboring LEDs. It is known from [15] that OOCs are used to code the ID of the LEDs and the decoder will perform auto-and cross-correlation functions to decode the IDs. In [16], the authors present a Bipolar-to-Unipolar encoding to enhance the overall system performance, thus improving the transmission quality. The authors in [17] use random optical codes (ROC) for an OCDMA scheme. ROCs are used in multi-user scenarios where a large number of devices share the channel. These codes do not present optimal correlation properties but are characterized by their ease of generation with respect to OOCs.
A framework for OCDMA-based VLC, which may incur lower hardware and computation costs, to achieve interference-free message broadcasting was presented in [18]. The proposed framework is based on a frame structure to coordinate broadcasting messages from different light sources. An interesting technique for MAI mitigation is the spectral amplitude coding-optical code division multiple access (SAC-OCDMA) technique [19]. In SAC-OCDMA systems, a unique sequence code that serves as an address is allocated to each user. Each user modulates a unique code with each data bit by a modulator to change the optical spectrum appearance in such a way that the assigned user can only be interpret it at the receiver. Several researchers have developed several codes for SAC-OCDMA network to reduce the effect of MAI, like Random Diagonal [20], Hadamard [21], and Khazani-Syed codes [19].
OCDMA has been largely exploited also for dimming control. In [22], the authors present a multi carrier (MC)-CDMA based on OFDM. This approach uses an OFDM transceiver to multiply the codes on the frequency domain. The application of MC-CDMA in VLC is mainly motivated by the need to support high-data-rate services in a multi-user wireless environment characterized by highly hostile indoor optical channels. The authors in [23] present a CDMA-based VLC system with a micro-LED array in order to address the non-linearity issue of LEDs. Finally, in [24] Chen and Chow present a novel color shift key (CSK) -CDMA VLC system by using RGB LEDs and a mobile-phone camera. CSK is used to enhance the VLC system capacity and to mitigate the single color light interference, while CDMA allows multiple users to access the network. Each user then decodes the individual data by its own CDMA spreading code.

Main contributions
In all previous works, the authors mainly investigate on the use of novel optical codes to mitigate MAI. However, none of the above schemes appear to take care of some aspects involving upper OSI layers. In example, when a cellular-like network is considered, the aspect related to the fact that a single user can be served during communication by different APs, and some interference can raise, is not taken into account. This scenario can easily occur specially when mobile devices are present.
In this paper, our goal is to present a cellular-like system architecture able to manage multiple downlink connections in a multi-user environment, where each AP utilizes different wavelengths still guaranteeing white light. In this direction, the proposed framework can be interpreted as a rephrasing of well-known RF cellular frequency reuse, with its own features. In the areas of a room where lighting due to different APs illuminate the environment, we suppose to be able to combine signals and we show how to do so with direct sequence (DS) CDMA scheme. In this framework we propose two different RA approaches i.e., one aims at maximizing the network rate under constraints on minimum and maximum rates, while the other procedure focuses on achieving fairness in the rate of each user accessing the network. Also, based on the promising results obtained in a previous work [25], where a lighting cell was designed according to different radii inside the cell, in this paper we exploit the concept of different areas (i.e., lighting zones) where users can experience different performances. According to [25], based on a given position, a user can be classified as "primary" or "secondary" user if it is closer to or further from the transmitting LED. Of course, overlapping areas can occur, but this aspect was not addressed in [25].
Briefly, differently from [25], in this paper: 1. We propose OCDMA system for managing a multi-user scenario with multiple access points; 2. Interference due to neighboring attocells is not an issue since a wavelength reuse approach is adopted by resorting to color and metamerism; To summarize, in this paper we propose a new architecture for multi-cell and multi-user VLC networks in which each access point is equipped with red, green, and blue LEDs. In particular, we apply optical CDMA in each cell and wavelength reuse among adjacent cells to mitigate inter-channel and inter-cell interference, respectively. The joint use of OCDMA on the OSI second layer, together with the wavelength reuse in the physical layer is one of the main novelty of this paper. We highlight that exploring the performance levels of either principles, i.e., optical CDMA and wavelength reuse, is beyond the main scope of this paper. Instead, we are interested in providing a system architecture that can benefit from both principles. In this regard, we refer interested readers to [24], and reference therein, for more details about the operation principles of the optical CDMA method. Furthermore, we refer to, for example, the specifications of the 4-Wavelength LED source [26], provided by THOR LABS for detailed descriptions about the transmitted signal in the wavelength domain.
The remained of the paper is organized as follows. The network architecture is detailed in Section 2, while the two RA techniques are introduced in Section 3. The performance achieved by the mentioned resource allocation procedures is presented in Section 4, while Section 5 draws the conclusions.

System model
We assume Λ APs able to cover the entire room from both illumination and communication point of view. Each AP is equipped with a triplet of LEDs (namely red, green and blue -RGB-). To do so, we resort to the concept of frequency reuse, well-known from traditional cellular networks. Some systems, like for example GSM, consider the presence of base stations operating at different carrier frequencies. The concept of frequency reuse relies on the inability of generating interference to users of other base stations working at the same frequency due to long distance and consequent attenuation.
In the architecture we are proposing, the first access point (namely, A) works with a RGB triplet that differs from other neighboring APs with a different label, while APs with the same label use LEDs with identical features. Since the VLC-AP has a limited angular emission, we can exploit the reuse of RGB triplet as in Fig. 1 by repeating the pattern ABCD, with B, C and D as neighboring LEDs. This means that A will transmit at different RGB wavelengths with respect to B, C and D, and the same do the other APs as reported by Fig. 1. The overlapping areas can be limited to two, three or four APs, depending on the LEDs features. Since we aim at producing white light for illumination purposes, the RGB sources and their light level are not arbitrary but should follow the trichromatic laws [27], as stated by colorimetry theory. In this way the receiver can distinguish the signal coming from an AP and avoid interference with signals coming from different APs. This is not only useful so as to avoid interference at the receiver but, more, it allows to combine signals (i.e., channels) coming from different APs (i.e., combining takes place from 2 to 4 APs, depending on the light coverage as previously disclosed).
Before proceeding, it is important to detail how to manage the multiple signals coming from other APs. We assume to have a photodetector as those available in the market (e.g., see [28]) that is essentially constituted by a photodetector (PD) array and we equip each micro-photodiode (that is the single element of the array) with an analog optical filter so as to be able on the receiving ports to measure the frequency domain response of the detector, i.e., the discrete Fourier transform (DFT). So, despite of the scheme proposed in [25] where only two areas exist for providing access to the network, namely Zone 0 (just under the LED or very close) and Zone 1 (a bit far from the LED with worse performance), in this paper we consider an additional area where interference should be managed. As depicted in Fig. 2, the network design considers still two main areas (i.e., Zone 0 and Zone 1) with the overlapping region (namely, Zone 0 ) where the performance may increase with respect to Zone 1, and worsening with respect to Zone 0 due to the combination of two or more signals.
Hence, the main difference with the work in [25] is that we do not manage interference simply because in Zone 0 we manage the signals and combine them. This well justifies the behavior of the network regarding a single user. However, here we are interested in a more realistic scenario, and we consider that the resources available to the k-AP is shared among N k users. For the access of the users to the k-AP we resort to orthogonal access schemes. The mechanism we have chosen is direct-sequence spread-spectrum (DSSS) CDMA.
The choice of CDMA instead of time division multiple access (TDMA) or time/frequency hopping (T/FH) is due to different reasons. First, FH leads to loose the property of having RGB LEDs sending signals that are separated AP-by-AP so interference is generated. Second, TDMA leads to use less illumination if few users are present in the network and, as limit, a single user can lead to send signals very sporadically. This could be managed by sending illumination signals, that is no data, in the empty slots; however, a node that would like to access may perceive the frame as full, so it drops its access opportunity. Besides, if the goal is combining signals, TDMA can induce latency since the same information can be sent over different times. The same if for TH. However this can be counterbalanced by sending a non-data signal for illumination purpose. Finally, the biggest issue with TH and TDMA is related to the possible combinations of signal coming from different APs. In that case we should be able to read different time slots and filtering in the frequency domain, while by using DSSS-CDMA we require the AP to be synchronized in sending the spreading sequences but the receiver can continue to receive continuously without the need of taking the signal from one time slot on a specific wavelength and so forth.

Optical CDMA Principles
Analytically, we assume that the k-th AP sends data at time instance t according to where the index k is related the the -th user served by the k-th AP, β k (t) is the spreading sequence used for the same user and s k (t) is the information sent. Notice that if C k denotes the number of the (orthogonal) codewords available in the k-th AP, then we have N k ≤ C k . The received signal by the k -th user at time instance t will be where h k (t) models the whole channel including the effect of the photodiode and n(t) describes the additive white Gaussian noise. The generic user k will apply different mechanism for detection. If it is in Zone 0 or 1, then it simply needs to require information by using its signature β k (t) that it is expected to be orthogonal to all the other β j (t), j k. In this regard we have Hence, by sampling the signal at symbol period we are able to detecting the signal according to the modulation used.
In the case of user j being in a zone where the lights of different APs overlap, it will apply a detection that is based on both wavelength and de-spreading. This is possible thanks to the nature of the photodetector that can select pins to be used being aware of its position. In fact, as previously disclosed, it is possible to select the interested pins of the photodetector that can have multiple pins as demonstrated by some photodiode arrays in the market, so as to detect the response to the wavelength corresponding to the analog optical filter, and so, the APs' triplets. This can be seen from an analytical point of view as with f (k) (τ) being the effect of RGB filtering. However, that signal is still spread so we should proceed with de-spreading. To handle this operation we have thus meaning that in this case the receiver is able to separate (and also collect) the signal coming from different access points. As depicted in Fig. 3, the k-th AP is equipped with three LEDs, namely blue, green, and red, each tuned to operate at a certain wavelength, i.e., λ B,k , λ G,k , and λ R,k , respectively. Throughout this paper, we refer to the wavelength triplet assigned to the k-th AP to as W k = {λ B,k , λ G,k , λ R,k }. Notice that the human eye responses differently to the blue, green, and red colors at different wavelength ranges with the peak responses at 420 mm, 534 mm, and 564 mm, respectively, [29] (see Fig. 4). Therefore, to mitigate inter-cell interference, the wavelengths of each color (i.e., blue, green, or red) assigned to adjacent attocells should be chosen to be as far as possible from each other on the corresponding response curve shown in Fig. 4 of that color.  . Photopic relative luminous efficiency function. The three solid curves, from left to right, correspond to the wavelength ranges over which the blue, green, and red colors are perceived by the human eye, respectively. The dashed curve describes the range of monotonic vision. The peak value of each curve defines the wavelength at which the eye has the peak sensitivity to the corresponding color.
Recalling that the transmitted light intensity should have positive values, a DC current is normally added to the signal before being transmitted. Notice that this bias current is also required for the illumination functionality of the LED. Let x m,k (t) be the T c -length signal to be transmitted via the m-th LED, i.e., m ∈ {blue(B), green(G), red(R)}, at a time instance t, where T c is the chip length. Consequently, the emitted light by the k-th AP at the time instant t can be expressed as follows: where g m,k , and I m,k are the unit-power waveform and the DC bias current associated with the m-th color (LED), respectively. Nevertheless, since the human eye cannot notice the instantaneous changes in the light intensity, light perception is related to the mean of the transmitted light intensity, i.e., where is the transmitted (optical) power associated with the m-th color (LED), as shown in Fig. 3.
Herein, we consider zero-mean data sequences and spreading codes for each user, i.e., s l k and β l,k , respectively, then we can easily observe that E{x k } = 0. Consequently, we have E{ m x m,k (t)g m,k (t)} = 0 and we can rewrite Eq. (7) as From (2) and (9), we observe that while the received signal at the photodiode depends on the data transmitted, light perception at the human eye depends only on the DC bias current. Notice that, since the emitted light should be white, the DC levels I m,k (t) should be adjusted accordingly. However, adjusting the DC levels is beyond the main scope of this paper.
Notice that, in CDMA systems the signal of one user is normally demodulated while treating the other users' signals as interference. Subsequently, if the generic user l k is located in either Zone 0 or Zone 1, then the received (electrical) signal-to-interference-plus-noise ratio (SINR) at the terminal of the m-th micro-photodiode can be expressed as follows [30, 31]: where σ 2 n = N 0 B is the noise power, N 0 is the noise power spectral density, B is the modulation bandwidth, and ς is the ratio between the average optical power and the average electrical power of the transmitted signal. Setting ς = 3 can guarantee a negligible clipping noise, and hence the LED can be considered to be working in its linear region [32]. In (10), the second term of the denominator represents the interference induced by the other users' signals transmitted (received) by the same LED (micro-photodiode), which is commonly referred to as aggregate multiple access interference (MAI). Nevertheless, if we consider sequences, β l k with strict (ideal) orthogonality conditions [33], i.e., then the MAI interference can be completely mitigated. On the other hand, the term n m ϕ mn,k in (10) represents the interference induced by the other signals transmitted by the other two LEDs, i.e., n ∈ {B, G, R} and n m, and received by the m-th micro-photodiode due to the possible imperfection in the optical filter response. In principle, this term can be mitigated if the wavelengths triplet of the k-th AP are chosen to be as far as possible from each other. As shown from Fig. 4, the mutual interference between the blue LED and the other two LEDs can be easily mitigated since the blue response curve has a wide wavelength curve. On the other hand, the mutual interference between the green and red LEDs should be carefully handled since the overlapping between the two curves is high.
On the other hand, let Zone 0 be the intersection region of certain access points that are defined by the set K, e.g., K = {AP1, AP2} in Fig. 2. Consequently, if the l-th user is located in this region, then it will have the ability to receive data from multiple attocells by combining the corresponding signals. Notice that the combination process occurs in the electrical domain after the optical-to-electrical conversion since each of the overlapping attocells is using a different wavelength triplet than the other attocells, even for the same color. This implies that the multiple signals from the multiple attocells will activate different pins at the photodiode array, each one corresponding to one wavelength, and then the electrical signals are combined. Therefore, the number of activated photodiode pins are expected to be more than the number of the primary colors, and hence we use the index m to refer to the signal obtained from the same primary color, which is a combination of signals transmitted from different LEDs with different wavelengths on the same color curve.
Based on the above discussion, two combining approaches can be distinguished. First, we assume that all of the overlapping attocells are transmitting the same information to a given user, which employs a diversity-based combining method. Second, each attocell transmits different and independent data streams to the same user towards increasing the degrees of freedom, and hence obtaining a multiplexing gain. While the first scheme improves the transmission reliability, the other scheme boosts the transmission rate. If the first approach is considered, then the different signals are combined before further signal processing takes place. Hence, assuming an equal-gain combining scheme, the received SINR obtained from the m-th color can be simply expressed as where ζ 0,1 l k ,m is as given in (10). Notice that we omit the AP index k from the SINR expression since the user is supported by multiple APs and not only one. Also, we use the subscript "div" to indicate that it is a diversity-based SINR. On the other hand, if the second approach is applied then the data from each attocell is independently processed towards enhancing the user achievable rate. Specifically, if R 0,1 l k ,m denotes the achievable rate of the user l k when being served only by the k-th AP, i.e., being located in either Zone 0 or Zone 1 of that AP, then the rate of that user when being supported by the set K of APs is given as where we use the subscript "mux" to indicate that it is a multiplexing-based achievable rate.
In principle, if we consider the M-ary pulse amplitude modulation scheme (M-PAM), then the achievable rate for the l k -th user while being located in either Zone 0 or Zone 1 of the k-th AP can be expressed as follows: where B l k is the set of the orthogonal codes allocated to the l k -th user. Note that the cardinality of the set B l k , i.e., |B l k |, defines the number of independent (orthogonal) codes (channels) allocated to the l k -th user. For a given symbol error probability, P e , we can express the per-color and the per-code achievable rate R 0,1 l k ,m as [34] where and ∫ ∞ x e − u 2 2 du is the Q function.

Defining Zone 0
Recall that the coverage area of each attocell is divided into three non-overlapping areas, namely Zone 0, Zone 1, and Zone 0 , as shown in Fig. 2. By definition, Zone 0 of one AP is the intersection area between that AP and one of the adjacent APs. This implies that one AP can have multiple Zone 0 regions, based on the number of overlapping APs. On the other side, Zone 0 is the region close to the AP center, while Zone 1 is the remaining area after defining Zone 0 and Zone 0. Consequently, in this section we focus our attention on defining Zone 0. Physically, Zone 0 of the k-th AP is defined as a circle around the attocell center with the radius r 0,k . From the resource management perspectives, in this paper we define Zone 0 as the region where the minimum quality-of-service (QoS) level is guaranteed with the minimum resources, in terms of the number of allocated codes and modulation order. Formally, let Q(d l k ) be the QoS metric, where d l k is the horizontal distance from the attocell center and the l k -th user. Subsequently, if Q min is the minimum QoS level to be ensured for each user, then the following condition holds: while the l k -th user is being allocated the minimum resources, i.e., |B l k | = 1 and the modulation order is M = 2. Now, let us consider the case when the QoS metric is defined in terms of the user achievable rate, i.e., Q(d l k ) = R(d l k ) and Q min = R min ; then, we can rewrite (17) by combining (10) and (14) for |B l k | = 1 as where the approximation in (20) is based on the assumption that 1, which is a reasonable assumption since the received signal strength in Zone 0 is expected to be very high. We further omit the interference terms in (21). Now, if we express the minimum required rate as where h l k ,m models the whole channel including the effect of the photodiode that corresponds to the m-th color, while the user is located at a horizontal distance r 0,k from the attocell center. VLC channels are normally composed of both Line-of-Sight (LoS) and diffuse (multi-path) components caused by reflections on walls, floor and ceiling. However, it was observed in [3] that, in typical indoor scenarios the majority of the collected energy at the photodiode (more than 95%) comes from the LoS component. Therefore, in this paper we assume a dominant LoS link between each AP and all users served by that AP. We further assume that all LEDs in the APs are directed downwards and all photodiodes in the receivers are directed upwards. Note that these assumption have been considered in many literature studies, see e.g., [32,35]. Nevertheless, we emphasize that the main concepts and results in this paper are valid for more general scenarios. Consequently, the DC channel response is given by [36] h l k ,m = where ρ m and A m are, respectively, the responsivity and the physical area of the m-th photodiode. Moreover, d v is the vertical distance between transmitting and receiving planes, b m = −1/log 2 (cos(θ m )) is the Lambertian index of the m-th color LED, where θ m is the LED half intensity viewing angle, T s is the optical filter gain, and is the optical concentrator gain at the receiver, where n is the refractive index and ψ C,m is the field of view angle of the m-th receiver. In this paper, we assume that each AP has a perfect knowledge of channel gains to all users located in its coverage area. Note that the way by which this knowledge is obtained at the APs is beyond the scope of this paper. Nevertheless, we refer interested readers to [37,38], where the authors propose VLC/RF hybrid scenarios in which VLC is used for the downlink and RF is used for the uplink only. In this way, the users can share their locations in the uplink via the RF links. Moreover, please notice that in indoor scenarios users are normally either stationary or move very slowly. In this regard, we refer to [39] that shows that knowing the VLC channels by updating only the average power, which is a location-dependent parameter, can significantly reduce the average amount of feedback information in the uplink. Now, by plugging (23) into (22) and after some manipulations, we can express the radius of Zone 0 as follows: where Recall that we refer to the overlapping area between adjacent attocells to as Zone 0 . Therefore, it is reasonable to assume that Zone 0 of the k-th AP as overlapping-free area. In this regard, let d kq be the distance between the k-th and the q-th APs, where q ∈ {K}. Thus, we have the following limit when defining Zone 0: where r k is the radius of the k-th AP. Finally, combining the limits in (25) and (27), we can formulate the following design criteria:

Resource allocation
In this section, we focus on two different RA strategies. The first one -namely, rate maximizationaims at considering the maximization of the sum rate in the networks. This implies that we can accept that few users will access with a very high rate. The other approach -namely, fairness Initialization; while used codes < available codes do Find the maximum SINR user index l; if user l with an additional channel does not exceed R max then Assign a new orthogonal code to l; Reduce by 1 the number of available codes; Update the rate R l ; else Remove user l by the list of user that must receive new resources; end end Algorithm 1: Pseudocode for rate maximization.
maximization-presents as main goal to allow access by achieving equity in the user rate. It is important to note that we resort to a static version of the access problems, thus meaning that each problem must be solved when something changes in the network, that is, when a new user joins the network, or when a user leaves the network or moves toward a different area.

Rate maximization
We start defining the problem by considering the maximization of the total rate of the network. To do so, we resort to the sum of the rate of each connected users in the network. Hence, we consider the following problem statement, where l indicates the user number and U is the maximum number of users in the network we are considering in the optimization procedure. So, we have where we assign CDMA codes to maximize the rate. Notice that we have as constraints (i) the opportunity of providing access only to the users exhibiting at least a minimum required rate and (ii) a bounded limited rate in order to avoid that a user can allocate all the resources. This solution can be pursued by considering the possibility to give access to users with more than one CDMA code, and by allowing the use of M-ary modulations. We can achieve the optimal resource allocation of the problem in (29) by applying a greedy solution [40], thus meaning that we start to give a CDMA code to the user exhibiting the lowest attenuation i.e., the highest SINR. Then we proceed by giving resources to the best user still by taking care of the constraint on the maximum rate. The proposed RA technique -namely, rate maximization-is detailed by Algorithm 1. Essentially, the algorithm aims at giving channel (i.e., a code) to transmit to the users closer to the AP, since a user does not exceed the maximum rate. Then, that user is removed by the list of users needing for resources, and the algorithm proceeds in the same way with the remaining users.

Fairness maximization
While the previous approach aims at providing access without taking care of the equity in rate assignment, we start tackling the problem of fair rate obtained by the users by formally introducing the fairness, here defined as In this case the constraints are exactly the same of the rate maximization problem in order to avoid to have a trivial solution, that is, a single user accessing so maximizing the fairness. An examination of the above problem leads to conclude that it is a max-min problem since the optimal solution, fairness achieving one, may be achieved when all the nodes share the same rate. However, in this case, it is not guaranteed that the problem can always achieve the same rate since the rate depends on (i) the number of assigned channels, that is, OCDMA codes, (ii) the user position, and consequently (iii) the SINR.
A brief discussion about the algorithm for fairness maximization leads to highlight that users in Zone 0 are assigned at the beginning one code. Then, still in an iterative fashion, new codes are assigned to the users (from each area) leading to increase the fairness. This procedure stops when all codes are assigned. The proposed RA technique -namely, fairness maximization-is detailed by Algorithm 2.
It is important to highlight that, although a greedy approach allows the achievement in fast iterative way, the solution is local. However, when the algebraic structure behind the problem retains the properties of a matroid, the local optimum is a global one [41]. Hence, in this case we emphasize that we are able to achieve the maximum both for MR and MF. Moreover, as it appears clear from the different metrics used by MR and MF, the algorithms are generally in trade-off since maximizing the sum rate can lead to be unfair in allocation and vice versa. This can be justified by the topology distribution of the users in the network. In the particular case of users at the same distance from the AP -then, achieving homogeneous SNRs-and not so high SF, we have that the rate maximization is obtained by providing access to all the users with a single channel and the MF achieves exactly the same result.

Numerical results
In this section, we provide the numerical result. Throughout this paper, we assume that the transmission power in each cell is equally allocated among the available codes in that cell. Unless specified otherwise, we consider the parameters and settings as defined in Table I.
We initially demonstrate the gain achieved by defining different zones in each attocell, and by employing a wavelength reuse scheme in adjacent attocells. To this end, we consider a simple scenario in which two APs serve multiple users, as shown in Fig. 2. In Fig. 5, we assume that there is no overlapping between the two APs and we plot the radius of Zone 0 of the first AP, i.e.,   (25) for k = 1, as a function of the AP viewing angle and for different values of the minimum normalized rate and error probability requirements, i.e., R min and P e , respectively. We clearly observe that the radius of Zone 0 is equal to the attocell radius, i.e., r 0,1 = r 1 , as the viewing angle increases to a certain value, after which the radius of Zone 0 increases just slightly, i.e., r 0,1 < r 1 . For instance, when P e = 0.1 and R min = 1 Mbit/s we have r 0,1 = r 1 for θ ≤ 73 • . However, this angle limit decreases with increasing the minimum rate and/or decreasing the required error probability, since only users closer to the AP can satisfy stricter requirements while being allocated a single code. Next, we assume that both APs have the same transmission parameters with θ 1 = θ 2 = θ = 60 • . In Fig. 6, we plot the average rates achieved in different zones as a function of the number of users when the distance between the two APs is d 12 ≈ 5.6 m, thus the maximum overlapping distance is ≈ 1.9 m. Herein, we assume that the number of available codes in each attocell is  SF = 12, while we set the minimum and maximum normalized rates to R min = 1 Mbit/s and R max = 4 Mbit/s, respectively. We further assume that the users are randomly and uniformly located within the area of both cells. For comparison purposes, we also show the average rates achieved by a reference interference scenario (referred to as Inter.) in which no signal combining is considered in the overlapping area. In particular, each user in the overlapping area, i.e., Zone 0 , is served by one of the two APs (herein, the nearest AP), while the other AP is considered as an interference. In both scenarios, each AP employs the rate maximization algorithm for code allocation.
As clearly seen, the rates achieved in Zone 0 are remarkably higher with signal combining that those obtained in the interference scenario. On the other hand, both scenarios achieve comparable results in Zone 0 and Zone 1. This is explained since each AP serves less number of users in the overlapping area than in the interference scenario, and hence some more codes can be allocated in Zone 0 and Zone 1. Nevertheless, the gain achieved in Zone 0 is marginal due to the maximum rate limitation, R max , while the rates achieved in Zone 1 remain very low even with the new allocated codes. In both scenarios, we also see that the rates in Zone 0 and Zone 0 increase with the number of users to a certain limit, after which the rates decrease. This is explained due to the maximum rate limit and since more users are expected to be in both zones while the number of codes remain the same. Following the results shown in Fig. 6, we observe that from the communication perspectives it is more beneficial for users to be located in either Zone 0 or Zone 0 , which are also the main targets in this paper. We also know that the illumination is expected to be better in Zone 0 for being closer to the AP, and in Zone 0 since it is lit by different light sources. Subsequently, both zones are also preferred from the illumination perspectives as well.
Concerning the performance levels from the user perspective, we plot the average user rate as a function of the user location for the spreading factor (SF) equal to 10 and 16, respectively in Figs. 7(a) and 7(b). Herein, we set the number of users to 25, one of which has different locations along a horizontal straight line that passes through the centers of the two APs, while the other users are randomly located within the entire coverage area of the two APs. Results are shown for (i) the rate maximization algorithm (MR), (ii) the fairness maximization algorithm (MF), (iii) the interference scenario (namely, Inter.) in which no signal combining is considered in the overlapping area, and (iv) the approach proposed in [25], in which only Zone 0 and Zone 1 are assumed. The approach in [25] mainly targets Zone 0, which is allocated the majority of the resources, while the resources allocated in Zone 1 are only to support the handover process and the mobility of users in Zone 0.
We notice that the MR and the MF algorithms achieve the best performance in Zone 0 due to the signal combining feature, while the technique in [25] has the worst results in Zone 0 since only very few channels are allocated in that zone. To better understand the behavior of the rate curves in Zone 0, we highlight two of the main different aspects between [25] and our study. First, the inter-channel interference is not considered in [25] as we do in this paper. This explains the slightly better performance than the MR algorithm in Zone 0 for SF = 10, as shown in Fig. 7(a). Second, unlike our approaches that enable allocating more than one channel (code) to a single user, the approach in [25] assumes that each user is allocated only a single channel (sub-frequency band). Subsequently, the performance difference due to the inter-channel interference can be substituted by increasing the number of available codes, as clearly seen in Fig. 7(b) when increasing the number of codes in each attocell to 16. Finally, we notice that the difference between the rates achieved in Zone 0 and Zone 1, i.e., the rate variance, with the MF algorithm is less than that with the MR algorithm. Nevertheless, the rates achieved in Zone 0 are much higher than those obtained in Zone 0 when the MF is applied due to the signal combining property. This issue can be solved if both APs are cooperating to manage the combining process in the overlapping area. Now, let us consider an indoor scenario comprised of four LEDs deployed in a 10 × 10 × 3 m 3 room in given positions. Specific parameters used in the simulation results are collected in Table 1. The power distribution [dBm] within the room is depicted in Fig. 8. In such scenario, we assume 10 fixed users laying in random positions. For each user, we compute the data rate [Mbit/s] achieved in case of MR and MF approaches, as shown in Fig. 9. It is easy to notice the decrease of data rate with the MF technique with respect to that one obtained with MR. This is due to the fairness criterium achieved by MF approach.
Still in the same scenario, in Fig. 10(a) we present the impact of the LED angle aperture, that is, coverage area, with respect to the outage probability when MF algorithm is taken into account and 12 users are in the room with a maximum normalized rate of 10 Mbit/s. It is possible to appreciate that when the angle is really low, the outage probability is 1, thus meaning that the access is not possible for any user. This can be easily justified by observing that the area covered by the LED is really small so it is largely improbable that a user falls in that zone. When the angle increases, we are able to achieve lower outage values. This can be explained by observing that the LED footprint is able to cover more users, so reducing the outage probability.
Furthermore, the increasing angle leads to let the footprints overlap so allowing the signal combining as previously detailed. Obviously, when the minimum rate required for accessing the network is low, then it is reasonable to have lower outage. This justifies while, for the same angle value, higher minimum rates will reflect on higher outage since few users are able to achieve the (higher) minimum rate.
The same kind of performance evaluation is reported in Fig. 10(b) for the MR algorithm and minimum normalized rate is 2 Mbit/s. We show the impact of maximum rate in place of minimum as for the previous case. The behavior is similar to MF in the sense that the outage is 1 when a small angle is considered, while for emission angle approaching 30 • the outage probability starts decreasing. The curves behavior presents some knees and this fact is due to the overlapping of two, then three and four areas. Analogously to the previous case, MR presents higher outage at  higher maximum rates. This can be justified by considering the behavior of such a scheme that aims at giving resources till achieving the maximum rate. Hence, the users able to achieve highest rate are satisfied, if possible, by allocating to them several channels, so leaving few resources to other users. The percentage of accessing users is reported in Figs. 11(a) and 11(b), for MF and MR techniques, respectively. In Fig. 11(a), we consider as parameter the minimum rate expressed as spectral efficiency and ranging from 1 to 3 Mbit/s, vs. the number of users in the network. The angle is 80 • and R max = 12 Mbit/s. While the behavior of the case R min = 3 Mbit/s is almost flat when the rate is low R min = 1 Mbit/s, the percentage of accessing user ranges from 95% to 40%. In Fig. 11(b) we consider the outage in the same operating conditions of the previous case, when R min = 2 Mbit/s. It is possible to appreciate how the number of accessing users is high and decreases slowly till achieving, however, a value that is considerably lower with respect to the case of MF.  Finally, we provide simulation results in terms of achievable data rate for MR and MF approaches, in case of a user moving in a given path within the room, as depicted in Fig. 12 (white line). In the room, we also assume three fixed users (i.e., User 1, User 2, and User 3), acting as interfering users. In such a scenario, Figs. 13(a) and 13(b) depict the data rate distribution for MR and MF techniques, respectively. In Fig. 13 we plot the data rate experienced by both fixed users and a mobile user versus the path length. It is important to underline that we refer to the case where at each (spatial) step the reference user requests the access, so the procedure for assigning the channel is re-run at each step while, in a realistic scenario, this is not needed. However, we report this kind of performance plot just to show the interaction between user position, rate allocation and other parameters as viewing angle (herein very small and equal to 40 • ).
The intermittent trend of the data rate for MR algorithm in Fig. 13(a) is due to the different positions of the mobile user and so its SNR, as well as the impact of maximum rate on allocation. In fact, setting a too low maximum rate value can lead to fail to avoid exceeding the maximum rate. This happens since here we are not allocating power, as in RF problems, but access codes. A symmetric trend is noticed due to the U-shape path of the mobile user, as depicted in Fig. 12. On the other hand, in Fig. 13(b) also fixed users experience intermittent trend of data rate. This is mainly due to the fact that here the MF approach is used, which does not allow the maximization of single-user data rate and pays attention in the equity in the allocation. In Fig. 13(a) we notice that data rate is constant at 2.5 Mbit/s for the fixed users, while the mobile users experiences variable data rate for different positions. The mobile user walks 17 m along the path in Fig. 12. The worst performance are for a distance walked ranging in [0.2, 3.9] m and then at the end of the path i.e. > 14 m. Such intervals correspond to spatial positions of poor achievable data rates. On the other side, the MF technique provides on average higher performances w.r.t MR for what concerns the moving users, as shown in Fig. 13(b). Also, fixed users experience variable data rates for different positions. However, we need to observe that in the simulation results we assumed R min = 1 Mb/s and R max = 4 Mb/s, and then the data rate gap is 3 Mbit/s. Instead, if we consider a higher value for the difference (R max − R min ), we do not meet the problem of exceeding the maximum rate per user. For instance, let us consider the same scenario, but R max = 8 Mbit/s. Figure 14(a) depicts the performance for MR approach; as expected, we observe a positive trend of data rate without nulls. A similar behavior is observed in Fig. 14(b) in case of MF approach.

Conclusions
In this paper we investigated the concept of resource allocation in a VLC network with overlapping lighting attocells. We assumed an OCDMA model and different LED transmitters working at given wavelengths in order to manage multi-user connections. User QoS levels are addressed according to users' positions, since in each lighting attocell served by a LED, we distinguish different areas with at least one connection (i.e., Zone 0, Zone 1 and Zone 0 ).
Two resource allocation techniques have been presented. The first approach -namely, the rate maximization (MR) technique-aims at maximizing the sum rate in the whole network. On the other hand, the fairness maximization (MF) approach considers the fairness level to be guaranteed among all the users. As expected, simulation results have shown best performance in terms of achievable data rate per user is provided through the MR technique, and then the number of users accessing the network is lower with respect to the case of MF approach.