MAC layer performance modelling for IEEE 802.15.7 based on discrete-time Markov chain

Potential lack of enough wireless frequency spectrum has guided researchers towards visible light communication (VLC), emerging as a sturdy support to Wi-Fi. Though the IEEE 802.15.7 standard has comprehensive medium access control (MAC) and physical (PHY) layer speciﬁcations, the emerging VLC technology still faces MAC challenges. Further, throughput is one of the major concerns for the VLC personal area network (VPAN) as it directly impacts the network speed. We propose a novel Markov chain model with two clear channel assessments, which proves to be a signiﬁcant milestone in improving the network throughput for a star topology VPAN. This paper extends the already available analytical models for the MAC layer to efﬁciently plan and predict the VPAN performance. We also extensively evaluate other network metrics, like network collision probability and end-to-end epoch, to demonstrate the proposed model’s applicability. We verify the model’s analytical results with elaborate MATLAB simulations and obtain good estimation, especially for large network sizes.

range of each other and are trying to transmit simultaneously to a single recipient.
The proposed model evaluates the effect of using clear channel assessment (CCA) twice in communication performance when using a slotted CSMA/CA random access procedure as defined in the IEEE 802.15.7 standard. CCA is the technique to find the channel condition suitable for data transmission.
The novel contributions of this document are as mentioned: (a) We revise and substantially extend the already available models. (b) We introduce a novel analytical model to optimize the VLC network throughput, collision probability, and packet drop rate. (c) We propose an updated Random-access algorithm with minor add-ons to the IEEE 802.15.7 standard specifications. (d) We present comparative graphs to determine the relative throughput enhancement using our model instead of the Shames model [5]. (e) The research investigates VLC-MAC with the impact of simplifying assumptions analytically and, finally, validates every result with appropriately described simulations in MATLAB. (f) Furthermore, there is no such literature available to the authors' best knowledge that thoroughly explains the simulation analysis for analytically calculated performance metrics.
The paper organizes as follows: Section 2 describes the related state-of-the-art algorithms. Section 3 portraits IEEE 802.15.7 specific MAC and the proposed fragment for random access. Section 4 explains the importance of clear channel assessment. Section 5 describes the Markov chain modelling. Section 6 investigates the performance metrics for the model. Section 7 evaluates the proposed model's performance via results comparisons, and finally, Section 8 concludes the paper.

STATE-OF-THE-ART ALGORITHMS FOR MAC LAYER ANALYTICAL MODELLING
There are many standards available under the IEEE 802 family to analyze personal, local, and metropolitan area networks' performance. Out of these, IEEE 802.15.7 standard [6] describes a globally acceptable PHY and MAC Layer for short-range VLC. Furthermore, related to MAC layer analytical modelling, there are numerous models available in the literature.
Bianchi [7] presents a rugged and extremely accurate analytical model to analyze the IEEE 802.11 distributed coordination function (DCF) using Markov chains. DCF is the primary MAC technique for IEEE 802.11, which employs a carrier sense multiple access-collision avoidance (CSMA/CA) mechanism with binary slotted exponential back-off. The proposed model assumes an infinite number of nodes and an ideal channel. The author examines RTS/CTS (Request to send/clear to send) mechanism too, to encounter Wi-Fi hidden nodes.
Manshaei et al. [8] examine MAC layer functioning for IEEE 802.11a and 802.11b networks using Bianchi's model.
In 2006, Pollin et al. [9] extended Bianchi's model to examine IEEE 802.15.4 MAC for saturated and unsaturated traffic. Nodes consider fixed slots and independent channel sensing probability. However, there is no provision for retransmissions (in case of collision or transmission failure) and acknowledgment of packets. In 2008, the same author [10,11] continued with the work, this time under-acknowledged transmission mode. The author predicts the performance considering an all-new "per-node" Markov model. The model outperforms a large group of nodes but fails to match simulations under a small network size.
Wen et al. [12] document another variant for a comprehensive evaluation of the same protocol. The author introduces an idle state in the Markov chain to cater to the dynamic network load. Further, a new performance metric, "access delay," is introduced and calculated. However, the collision probability increases beyond the limit as the number of nodes reaches 25.
Wang et al. [13] put forward an integrated channel and node model using 3D Markov chains to analyze the MAC performance of IEEE 802.15.4. Both slotted and unslotted CSMA/CA strategies are specified. Unslotted algorithm is like the slotted one, except that the latter require beacons and superframes.
Musa et al. [14] propose CSMA/CA for IEEE 802.15.7 MAC using DTMC state node model. The same author [15] explains VLC MAC again, considering packet drops, too, as a function of the per-packet arrival rate. Both the papers have assumed no transmission failures, and packet loss is due to collision only. Further, the work lacks any timing information, as it does not consider any superframe structure while analyzing throughput and packet drop.
Hwang et al. [16] consider the IEEE 802.15.7 superframe structure to analyze the MAC layer's performance. The author evaluates the impact of SO (superframe order) and BO (beacon order) on throughput and collision probability. However, the examination deprives of any delay calculations.
Nobar et al. [17] stipulate a 2D Markov model to analyze VPAN (VLC personal area network) MAC for saturated traffic in the contention access period (CAP). The performance metrics include packet discard probability and power consumption. Nevertheless, the model assumes that the probability of sensing a channel busy by a node is independent of the back-off stage and the value of the back-off counter, which is chosen randomly during the back-off stage. Further, the CCA failure probability is considered the same for different back-off stages, which is not valid. The critical network parameters examined include packet drop and network collision probability, with many simplifying assumptions, as mentioned in [17]. Mehr et al. [18] dissect the same model under unsaturated traffic for delay and jitter. The author obtains the service time distributions for packets using the M/G/1 queue model. The model shows that the queue state (empty/non-empty) decides the number of active nodes. Dang et al. also investigate VLC-MAC performance for throughput, delay, and power consumption via the 2D Markov chain in [19]. The paper provides a thorough PHY/MAC cross-layer analysis employing CCA twice, which further motivates our research.
Shams et al. [5] contribute greatly to analyzing theoretical performance bounds via a Markov chain-based generalized approach in a saturation environment. Taking this as the base-paper, we have altered the model by adding an extra CCA.

IEEE 802.15.7 MAC STRUCTURAL DELINEATION
This section specifies the MAC sub-layer functionality per the IEEE 802.15.7 standard. Three different topologies have been considered in the document for VPAN as peer-to-peer, star, and broadcast. Each topology comprises a central controller nominated as coordinator. The self-governing VPAN coordinator has a unique 16-bit identifier. Initially, the device and coordinators have exclusive 64-bit extended addresses, shortening to 16-bit after association.
The IEEE 802.15.7 architecture describes various logical and PHY configurations. PHY-I envisions low data rates for an outdoor scenario. PHY-II intends for indoor usage with moderate data rates. PHY-III is suitable for applications exploiting multiple light sources using CSK (colour shift keying). We propose our system with PHY-II as the physical model. The MAC layer is responsible for generating and synchronizing network beacons, superframe timing, VPAN association-disassociation, flickering mitigation, dimming, colour function, and mobility support.
The standard also defines a superframe format, which is purely optional. Figure 1 shows an example of the structure. It comprises active and inactive (optional) portion, surrounded by beacons. Beacons synchronize network devices, and all transactions must complete before the next one. Evenly spaced slots share the active fraction comprising CAP (contention access period) and an immediately following CFP (contention-free period). Low latency applications requiring pre-allocated bandwidths can use CFP slots nominated as GTS (guaranteed time slots). The CAP shall take at least an aMinCAPLength to accommodate all management related activities.
The standard proposes four diverse random-access mechanisms for VLC, namely: unslotted random access (beacon-enabled), slotted random access (non-beacon-enabled), unslotted random access with CSMA/CA, and slotted random access without CSMA/CA. In beacon-enabled mode, every time a device needs to transmit a frame, it waits for some random slots (the irregular period for non-beacon-enabled). If the optional CSMA/CA mechanism is active, the device must back-off for another random amount of time before attempting to access the channel.
It is significant to mention here that beacons, ack frames, and data frames transmitted in CFP do not follow any randomaccess mechanism. VPANs can work without beacons (unslotted fashion) by keeping SO = BO = 15. The slotted version requires periodic beacons transmission, and every VPAN device aligns with the coordinator's superframe boundaries. Figure 2 shows the flowchart related to the random access algorithm for all four possible mechanisms. Each device upholds two variables: NB and BE, for each transmission attempt. NB indicates the number of times the access algorithm is required to back off while attempting the current event. Hence the value is initialized to zero before the commencement of each new attempt. The variable BE is back off exponent, which designates how many slots the device shall wait in a particular back-off before accessing the channel and has value macMinBE (default: 3). For an unslotted system, the transmission starts immediately. The slotted version locates the next back off boundary, and MAC sub-layer delays transmission for random back-off periods within the range 0 to 2 BE −1 .
Next, the MAC requests PHY to perform the optional CCA (clear channel assessment). If the channel is idle, the frame is transmitted, and the sub-layer waits for macAckWaitDuration for the optional Ack. Otherwise, for a busy medium, NB and BE are both incremented by one and checked for their constraints. If any of the parameters outbounds, the attempt is discarded.

CLEAR CHANNEL ASSESSMENT
Now, we explain CCA, which is an indispensable element of the CSMA/CA algorithm. A node prevents any collision with other nodes by sensing the channel status first. This paper proposes a CCA fragment for CSMA/CA algorithm aimed at VLC MAC. Figure 3 gives a glimpse of the same. We explain the rational motive behind two CCAs as under: Consider a VLC PAN scenario as in Figure 4(a), in which device one has transmitted a packet in slots (3)(4)(5) and is waiting for the Ack in the macAckWaitDuration period (single slot 6). In this continuance, another node (device 2) senses the channel; it will encounter an idle channel. Now, in the next slot (slot 7), there is a possibility that the Ack for device one collides with a packet transmitted from device 2.
However, if another CCA would have been there as in Figure 4(b), this collision is avoided. Device two executes CCA2 (second CCA) in slot seven and find the medium busy (Ack for device one on the line). It, thus, refrains from any further transmission. Consequently, CCA2 failure does not let packet-Ack collision happen. Further, we originate a relation between the optimum number of CCAs and macAckWaitDuration as: If macAckWaitDuration = n slots Optimal value for CCAs to be performed will be: (n+1) As, in our case, macAckWaitDuration is taken as one slot; hence the optimized number of CCAs come out to be 2.

MARKOV CHAIN MODELLING
If we want to study a system's behaviour without building it, analytical modelling always helps to see the real insight and This paper presents a new 2D DTMC (2-dimensional discrete-time markov chain) model to investigate the performance of the IEEE 802.15.7. The proposed model is an advancement of Bianchi's model [7] with an amalgamation of Pollin's [10] and Shams' model [5]. Figure 5 shows the proposed per node Markov model considering slotted random access. We have concentrated only on the saturated case, that is, when each node in VLC PAN always has a packet available to transmit. It reflects the scenario where an event is detected by many other nodes, which want to communicate the gathered data simultaneously. Further, Ack increases transmission reliability. Our model considers superframe structure. The data and Ack packet length is fixed and as integral multiples of the back-off period. Only the CAP (Contention access period) portion of the superframe is under consideration, as CFP (Contention free period) has nothing to do with CSMA. The complete model has five different stages with corresponding states. Each state is represented by two random state variables s(t) and c(t), where t corresponds back-off period. We call this period a time slot or slot. All the events start from the commencement of a new slot.
Before starting any transmission, the node waits for random number of slots between [0, CW], where CW is contention window size and is given by: where aUnitBackoffPeriod has a constant value of 20 optical clocks according to the standard [6]. This is shown as first stage of model, that is, back-off stage.
The delay window W x is initially W 0 and doubles for every next stage until W x reaches W max .
The second and third stages correspond to two CCAs, that is, CCA1 and CCA2, respectively. s(t)takes similar values as stage 1 in both CCAs, whereas back-off counter (CCA counter) reduces to 0 and then -1 respectively. Zero value for CCA counter corresponds to no waiting and immediate sensing. The parameter in Figure 5 is the probability of sensing the channel busy during CCA1, and is the probability of assessing the channel busy during CCA2, given that it was idle in CCA1.
Although the values of are independent across other nodes, is not.
The fourth stage shows the transmission of the packet after CCA1 and CCA2. Here s(t) varies takes a stationary value 4. Further, c(t) denotes the number of slots needed to transmit the packet (MAC overheads included). If L p denotes the packet transmission duration in slots; Acknowledgment brings us to the last stage of the model. Here, P c signifies the probability of collisions and hence (1-P c ) is probability of successful transmission. In this case, s(t) varies from 5 till 8 and c(t) have two ways to proceed. If there is no Ack received, c(t) represents the number of slots went in vain in vain to get the Acknowledgment frame. Otherwise, it is the macIdle-waitTime, which is assumed to be one slot in our case. Ultimately, s(t) = 9 corresponds to Ack transmission with c(t) varying from 0 to (L a -1). Table 1 recapitulates the values for s(t) and c(t) for all five stages, where, L c denotes the time wasted in waiting for Ack, L p represents data packet length, and L a stands for acknowledgement packet length. All of these take values in terms of slots. Consider now, a VPAN with N+1 nodes, that is, N devices and a coordinator, as star topology. Slot boundaries of each device and coordinator are aligned. Now, let's say b x,z represents the steady state probability for s(t) = x and c(t) = z. It is denoted as: The initial rudimentary equations (2-3) commonly used to analyse the Markov model are similar to those used in [20].
Equation (3) represents state probability for any device (node) of being in back-off stage. Equations (4) and (5) signify state probabilities to be in CCA1 and CCA2, respectively. The probability of being in transmission stage is indicated in Equation (7). Further, likelihood of being in Ack stage is designated by Equations (8) and (9). As all steady state probabilities of Markov model must sum to 1, it may be written as: Here stands for probability of failure in each of the backoff stage, P c is the node collision probability. 0 correlates with as probability to succeed in any of the four possible states. Φ corresponds to the probability that a node spends a randomly chosen time-slot in CCA. We have developed a novel Markov model to determine , and as network operating points.
From Equation (10), we have From Equations (14) and (15), we have: -ACK received --  (16) gives the first expression for , and ; we need two more such relations to solve out for network operating points. Table 2 depicts the notations practiced in the pursuing sections.
To calculate , we need to look for the transmission prototype, that is, we need to consider the interaction of all nodes in the medium. The conditional probability in terms of alpha is expressed as: at least one node is in transmission, given that N th node is sensing the medium, that is, Equation (17) justifies as the probability of more than one device exploiting the medium when N th node is sensing, which is rewritten in equation (18) as a product of two terms. The first term is expressed in Equation (18) corresponding to the probability that node 1 is in transmission, which is rewritten in Equation (19) as a sum of two cases, that is, with and without collision. The first case suggests the probability of node 1 in transmission, conditioned that it was the only device in transmission, leading to success. On the other hand, the collision case is depicted as the probability that node 1 is in transmission, given that more than one nodes were in transmission. Finally, Equation (19) solves out for term 1.
.P (D 1 ) Equation (20) depicts term 2 as the probability of two or more consecutive transmissions conditioned on the fact that they started sensing in the same idle slots. Two consecutive transmissions in a specific slot occur only if they have started with the same slot because if a device started later to already transmitting device, it would detect medium busy. Thus, term 2 is rewritten as: Now by using Equations (19) and (20) in (18), we get, Manipulating these equations, we have Equation (22) as our second equation having , and .  .
The third relation is still required to be able to solve the system. For that, the aim is to compute , the probability for CCA2 failure. To do so, let us have a look at the transmission pattern again: A packet transmission starts only if the medium is idle To elaborate on the same, Table 3 represents slot timings of successful transmission for node-N. Equation (23) expresses as the probability of CCA2 failure for Nth device as at least one device is transmitting in slot c 2 , while in c 1 , at least one device was in CCA2 or waiting for Ack and Nth device was doing CCA1. It is the same as at least one device uses the medium for transmission (states 4 or 9) while the Nth device is performing CCA2. It further breaks down into a sum of two terms as at least one device using the medium for data packet transmission (state 4) or Ack packet transmission (state 9). transmission corresponds to CCA2 failure due to data packet transmission. At the same time, Acknowledgement represents failure due to Ack transmission. We must keep one thing in mind that CCA2 for N th device may fail if some transmission starts in the same slot from any other devices, let us say x devices. This means that while N th device is in CCA1, x devices are doing CCA2. Alternatively, x devices have started sensing during slot 1 of device-N.
The expression for the probability of x devices is sensing the medium during slot 1 is given as: Here, P (M 1 (s) ∈ [0, 3]|M c 1 (s) ∈ {[0, 3], [5,8]}, M 1 (c ) = 0, D N c 1 (c ) = 0) is the probability of finding an idle slot preceded by another idle slot, and using the law of probability is rewritten as: [5,8] Alternatively, reversing the probability for slot 1, that is, if any device is not in back off, it is in any stage from 4 till 9. [4,9] ⋂ M c 1 (s)∈{[0,3], [5,8] Now the numerator is broken down into three terms: transmission, Ack wait, and Ack transmission. The second possibility is ruled out because it is already in the Ack wait stage during slot c 1 . To compute for the numerator of this equation, we need to list all the cases in which we can find slot c 1 idle. This is achieved by concentrating on slot 1, that is, the slot just before CCA1 (see Table 3). There are two possible cases concerning slot 1: a busy or an idle slot 1, while slot c 1 will be idle in each case. Let us take these cases one by one.
Case (1): A busy slot before the idle slot c 1 . This is further divided into two sub-cases: Slot 1 may be busy due to transmission of data packet or an Ack packet.
Case (1.1): When the busy slot is due to transmission of data packets This is similar to the computation of , the probability of assessing the medium busy in a particular slot. This case has a start of transmission strictly L p slots before the slot c 1 . Considering that when device N is sensing in c 1 slot, at least one of the (N-1) devices were doing in CCA1 in slot 1, and let us say k devices were in transmission from slot W and going to end the same in slot 1. This is expressed as: where P N −k Tx denotes that probability of transmission by any other node other than k nodes at a particular slot.
Case (1.2): When the busy slot is due to acknowledgement packets. Here, the busy slot before the idle slot is due to an Ack following successful transmission.We have considered that x devices is sensing the medium during slot c 1 . Hence, the probability getting the medium busy, due to acknowledgment transmission is given as: [5,8]}| Case (2): An idle slot before the idle slot c 1 . This happens only when no device start sensing after a successful transmission in any one of the previous slots i ∈ [3, ∞] and no device is sensing in slots after slot i and before slot 1. So, now to incorporate this case, we have to sum up the valid probabilities as: Now, combining Equations (29-36), we get: Acknowledgement is the probability of getting medium busy by device N during slot c 2 , due to Ack transmission by any other device in the same slot. Now if in slot c 2 , any device is transmitting Ack, it has to be in Ack wait stage in the previous slot, that is, c 1 . Using law of probability Acknowledgement is rewritten as: Using Equations (33-35), we get: Now, with Equations 37 and 38, expression for comes out to be: Now, the third equation having , and :

PERFORMANCE METRICS
This section calculates the performance metrics, both analytically and via simulations. Simulations are performed on the MATLAB platform, while logical computations use the earlier section's operating points.

Throughput
Throughput gives the quantum of data travelled from one location to another in a given period. The paper manifests in the paper as per-node throughput and network throughput. Both the parameters are a function of time, that is, superframe slots.
Total transmission time is superframeDuration as we have considered only one superframe. For a node to have successful transmission at time t, it must quest for the idle channel for the duration t ′ ∈ [t − (L p + L a + t ack ), t − 1], and the node must take a hold over the channel for a period of (L p + L a + t ack ) slots. Hence, per-node throughput is: Now, the probability that the node is the only one performing CCAs is given by ( (1 − ) N −1 . Moreover, the probability of finding the channel idle is given by 1 − ) (1 − ). Therefore, As all the nodes are analogous, network throughput is given as: In Simulation, S n = Number of slots spend by the network in Successful Transmission Total slots the Simulation run for = Slots Counted of (

Collision probability
Collision may happen when two or more nodes, which have been allotted the same physical medium, wish to communicate simultaneously. Here, we estimate packet collision probability on behalf of the node as well as the network. Two nodes encounter conflict only if they execute CCA cumulatively. Hence, Equation (12) gives the per node collision probability (P c ) as the possibility that node i is experiencing collision, that is, probability that two or more nodes are sensing the channel, given that node i is sensing the channel. Network collision probability (P Nc ) is the probability that two or more nodes are transmitting at the same time, given that any one node is already in transmission or, possibility that two or more nodes are sensing the channel, given that anyone node is sensing the medium, that is, In Simulation, the same is interpreted as:

Packet drop probability
Network congestion is the primary cause for loss of collision or CCA failure, which leads to the loss of the packet. Packet drop probability gives us the fraction of those unsuccessful transmission attempts.
In Simulation, P d = Probability of failed transmission due to collision or unsuccessful CCA.

End-to-end epoch
The end-to-end epoch is nothing but the procrastination experienced by a successfully transmitted packet in a network. A packet goes through many phases before it eventually arrives at its destination. Figure 5 shows these stages as back-off, CCA, transmission, and acknowledgment in terms of the superframe's back-off slots. Thus,

RESULTS AND DISCUSSION
For VLC PAN, this paper analyzes CSMA efficiency both analytically and through simulations. Via the Markov model, all network parameters are first obtained and then compared to the simulation prototype. Via the outcomes of conflict from both approaches, this section diagnoses all network parameters.
The system parameters used in simulations for each layer are stated in Table 4.
As is clear from the Markov model, CCA states are the only states where nodes' dependence comes into play. Calculating and accurately is the key to the correct analysis of the network. We have plotted the values of and via different simulations. Figure 6 shows the probability of finding the channel busy during CCA1. Though the graph shows different simulation values for different back-off stages, our model assumes i = , for simplicity. The graph converges as the number of devices reaches 8. To determine via simulations, the number of times a node senses the channel is busy, divided by the total number of times, which the node senses the channel. Figure 7 shows the plot for , that is, probability for CCA2 failure. As we see, both and values do not overlap with the reference values. The reason is the assumption that the proba- We will assess the main network metrics as, throughput, collision probability, packet drop probability, and the end-to-end epoch from here onwards. For the sake of the same, we have considered the network scalability factor (N) of VPAN as the degree of freedom, which varies from 2-12. Though the simulation results are in good approximation with the theoretical ones, still a disparity is seen. The argument is that the sensing probabilities have been considered independent of the backoff stages. Figure 8 depicts throughput variance with network size. It can be seen that the parameters have an inverse relation. The wherefore is answered as N increases the flow of transport in the network and hence the contention to access the medium, resulting in access failures, collisions, and finally, low throughput values. Despite that, our model provides more than 60% of the  Network packet drop/discard probability maximum network throughput even in the worst-case scenario, that is, at N= 12.
Next, Figure 9 provides the likelihood of transmissions that end up in a collision. As the network grows, offered traffic increases, which impacts finding channel free and resulting in the rise of collision probability. It is in agreement with the throughput graph too. Further, with the maximum load on the network, our model manages to have a collision probability below 40 percent. Figure 10 shows the next performance metric as the packet drop probability. It is clear that collisions due to the increase in the number of nodes directly influence packets' loss. Simulation results have a deviation from analytical results at a relatively low number of nodes.
The last metric is the end to and epoch, as demonstrated in Figure 11. As expected, the delay also increases as the network evolves. The reason is the fact that with an increase in load,

FIGURE 11
End-to-End epoch nodes may encounter a busy channel at a higher rate, resulting in a high end to end epoch.
Furthermore, Figures 12-15 show a crisp comparison of the proposed model with Shames Model [5]. Throughput shows a great improvement in the case of all network sizes. The use of two CCAs increases delay, but this may not be an issue for models concerning bit-rate.

CONCLUSION
Though VLC has proved itself to be a complementary solution to already available wireless technologies, it currently faces some MAC layer challenges. This paper analyses VPAN MAC layer performance, considering the CSMA/CA mechanism in CAP. Further, a mathematical model is developed using DTMC for a per node abstraction. VPAN is presumed to be in a star  The probability of sensing the channel idle is considered independent of other nodes' back-off interval. The performance metrics examined in the paper are throughput, collision probability, packet drop probability, and end-to-end epoch. The theoretical results are in close approximation with the simulations, especially as the network grows. The same is not seen for small network size as the alpha values are assumed for every backoff stage. Compared to the reference model (Shams model), our proposed model shows a maximum of 20% throughput improvement with the network size of 2 and a minimum of 12% with a maximum network size of 12. Furthermore, our model shows significant improvement in network collision and packet drop probability compared to the previous investigations.