3.1 Markov chain model
In the considered setting, the nodes of either network are able to sense and detect transmissions from any other nodes. Therefore, we analyze the coexistence performance by defining a MC that captures the interactions for a typical pair of WLAN and ZigBee nodes. The behavior of the pair of the tagged (WLAN, ZigBee) nodes is characterized by the bidimensional discretetime MC {a(t),b(t)} where:

a(t) represents the states of the WLAN node including the backoff stages W
_{
i
} (i=1,…,m
_{
w
}) and idle state I
_{w} at time t. From this definition, \(W_{m_{w}}\) denotes the “maximum backoff stage” of the WLAN node.

b(t) describes the states of the ZigBee node comprising the idle state I
_{z}, backoff stage Z
_{
j
} (j=1,…,m
_{
z
}), the first CCA state C
_{1j
} and the second CCA state C
_{2,j
} in backoff stage j, and transmission state T
_{
x
} of the ZigBee node at time t. Again, \(Z_{m_{z}}\) represents the “maximum backoff stage” of the ZigBee node.
Note that most existing MC models for analyzing either IEEE 802.11 or IEEE 802.15.4 MAC protocol individually are based on twodimensional MC (e.g. the models in [15] and [21]). Applying this approach for coexistence performance analysis of IEEE 802.11 and IEEE 802.15.4 networks would require to establish a fourdimensional MC, which is too complex and nontractable. By representing the states of each node in the considered (WLAN, ZigBee) pair by a single variable, we attain a much more manageable model. Modeling of the IEEE 802.15.4 MAC protocol using onedimensional MC has been adopted in [18]; however, analyzing the coexistence performance of the two networks is far more challenging and still an open problem. Note also that the idle states I
_{w} and I
_{z} for WLAN and ZigBee nodes, respectively, are utilized to capture the cases where the buffers at these nodes are empty.
To analyze the achievable throughput of each network in the considered heterogeneous environment, one has to characterize the transition probabilities of all possible transitions of the MC {a(t),b(t)} based on which the steadystate probabilities can be calculated. Since the two MAC protocols of IEEE 802.11 and IEEE 802.15.4 networks operate in different time scales (i.e. t
_{bo}≫δ), we propose to analyze the {a(t),b(t)} over the shorter time scale of WLAN and approximate the backoff mechanisms of both MAC protocols by the corresponding ppersistent MAC. In fact, this approximation has been confirmed to be very accurate for analyzing the WLAN MAC protocol [16]. We will validate the excellent accuracy of this approximation for coexistence performance analysis later in Section 6.
Specifically, in the approximated WLAN ppersistent MAC protocol, the random backoff time is drawn according to a geometric distribution with parameters s
_{
i
} in backoff stage W
_{
i
} where s
_{
i
}=2/(CW_{
i
}+1) and CW_{
i
} is the contention window in the backoff stage W
_{
i
} [16]. That means if the channel is idle in a backoff slot, the WLAN node transmits and defers the transmission at backoff stage W
_{
i
} with probability s
_{
i
} and (1−s
_{
i
}), respectively. In contrast, if the channel is busy, no action is taken. The backoff stage increases when a transmission fails and the retry limit has not been reached. When a transmission succeeds, the WLAN node moves to the idle state I
_{w} with probability (1−q
_{w}) or to the first backoff stage W
_{1} with probability q
_{w}. We also assume that the WLAN transmission collides with probability p or succeeds with probability 1−p.
To resolve the heterogeneous timescale issue, we consider the operations of the IEEE 802.15.4 MAC over the WLAN time slot unit. Toward this end, the length of the first and second CCAs, denoted as L
_{C} and measured in WLAN backoff slot, is \(L_{\mathrm {C}}=\frac {t_{\text {bo}}}{\delta }L_{\text {cca}}\) where L
_{cca} is the length of CCA measured in the ZigBee backoff slot. We also approximate the IEEE 802.15.4 MAC protocol by the corresponding ppersistent MAC protocol. That means the random backoff time in the backoff stage Z
_{
j
} follows the geometric distribution with parameter p
_{
j
} where p
_{
j
} is calculated as [18]
$$\begin{array}{*{20}l} p_{j} &= \frac{2}{2^{\text{BE}_{j}}{t_{\text{bo}}}/{\delta}+1}. \end{array} $$
((1))
Moreover, upon a successful transmission, the tagged ZigBee node changes to the idle state I
_{z} with probability 1−q
_{z} and to the first backoff state Z
_{1} with probability q
_{z}. At the backoff state Z
_{
j
}, the ZigBee node remains in this backoff state with probability (1−p
_{
j
}) or enters the first CCA state C
_{1,j
} with probability p
_{
j
}. We assumed that the channel is sensed busy in the first CCA and the second CCA occurs with probabilities α and β, respectively. This is the case if there is at least one node rather than tagged pair of (WLAN, ZigBee) nodes that transmit their packets. In the following, we describe the transitions and the corresponding transition probabilities of the MC {a(t),b(t)}.
3.2 Transition probabilities of Markov chain
We can describe the state space S of the MC {a(t),b(t)} as
$$\begin{array}{*{20}l} & S = \left\{\text{all states}~x\text{:} \left(I_{\mathrm{w}}, I_{\mathrm{z}}\right),\left(I_{\mathrm{w}},Z_{j}\right), \left(I_{\mathrm{w}}, C_{k,j}\right),\right. \\ &\left. \left(I_{\mathrm{w}}, T_{x}\right), \left(W_{i}, I_{\mathrm{z}}\right),\left(W_{i},Z_{j}\right), \left(W_{i},C_{k,j}\right),\left(W_{i}, T_{x}\right),\right. \\ &\left. ~i=1,\dots,m_{w};~ j=1,\dots,m_{z};~ k=1,2\right\}. \end{array} $$
((2))
To analyze this MC, we have to determine all possible transitions and the corresponding transition probabilities of this MC. To demonstrate the derivations, we present the transitions of the MC as the tagged WLAN node is in the idle state I
_{w} considering all possible transitions between the states of the ZigBee node, which are shown in Fig. 2, in the following. The underlying transitions have the form (I
_{w},y)→(I
_{w},z) for the tagged (WLAN, ZigBee) nodes. Due to the space constraint, derivations for other transitions are given in the online technical report [26].
Here, the WLAN node remains in the idle state with probability (1−q
_{w}) where there is no new packet arrival while the ZigBee node can transit to one of the possible states. Specifically, the transitions illustrated in Fig. 2 occur with the following transition probabilities^{1}
$$ P \left\{I_{\mathrm{w}},C_{1,j}I_{\mathrm{w}},Z_{j}\right\} = \left(1q_{\mathrm{w}}\right) p_{j}, \: j \in \left[1,m_{z}\right] $$
((3))
$$ P \left\{I_{\mathrm{w}},C_{2,j}I_{\mathrm{w}},C_{1,j}\right\} = (1q_{\mathrm{w}})(1\alpha), \: j \in \left[1,m_{z}\right] $$
((4))
$$ P \left\{I_{\mathrm{w}},T_{x}I_{\mathrm{w}}, C_{2,j}\right\} = (1q_{\mathrm{w}})(1\beta), \: j \in \left[1,m_{z}\right] $$
((5))
$$ \begin{aligned} {}P \left\{I_{\mathrm{w}},C_{1,j}I_{\mathrm{w}},C_{k,j1}\right\} = \left\{ \begin{array}{l} (1q_{\mathrm{w}})\alpha p_{j},\: j \in (1,m_{z}], k=1 \\ (1q_{\mathrm{w}})\beta p_{j}, \: j \in (1,m_{z}], k=2 \end{array}\right. \end{aligned} $$
((6))
$$\begin{array}{*{20}l} & P \left\{I_{\mathrm{w}},C_{1,1}I_{\mathrm{w}},C_{k,m_{z}}\right\} = \left\{ \begin{array}{l} (1q_{\mathrm{w}})\alpha q_{\mathrm{z}} p_{1}, \: k=1 \\ (1q_{\mathrm{w}})\beta q_{\mathrm{z}} p_{1}, \: k=2 \end{array}\right. \end{array} $$
((7))
$$\begin{array}{*{20}l} & P \left\{I_{\mathrm{w}},Z_{j}I_{\mathrm{w}},C_{k,j1}\right\} = \frac{\left(1p_{j}\right)}{p_{j}} P \left\{I_{\mathrm{w}},C_{1,j}I_{\mathrm{w}},C_{k,j1}\right\} \end{array} $$
((8))
$$\begin{array}{*{20}l} & P \left\{I_{\mathrm{w}},Z_{1}I_{\mathrm{w}},C_{k,m_{z}}\right\} = \frac{\left(1p_{1}\right)}{p_{1}} P\left\{I_{\mathrm{w}},C_{1,1}I_{\mathrm{w}},C_{k,m_{z}}\right\} \end{array} $$
((9))
$$\begin{array}{*{20}l} & P \left\{I_{\mathrm{w}},I_{\mathrm{z}}I_{\mathrm{w}}, C_{k,m_{z}}\right\} = \left\{ \begin{array}{l} (1q_{\mathrm{w}})\alpha(1q_{\mathrm{z}}), \: k=1 \\ (1q_{\mathrm{w}})\beta(1q_{\mathrm{z}}), \: k=1 \end{array}\right. \end{array} $$
((10))
$$\begin{array}{*{20}l} &{} P\left\{I_{\mathrm{w}}, Z_{1}I_{\mathrm{w}}, T_{x}\right\} = P\left\{I_{\mathrm{w}}, Z_{1}I_{\mathrm{w}}, I_{\mathrm{z}}\right\} = (1q_{\mathrm{w}})q_{\mathrm{z}}(1p_{1}) \end{array} $$
((11))
$$\begin{array}{*{20}l} & P \left\{I_{\mathrm{w}}, C_{1,1}I_{\mathrm{w}}, T_{x}\right\} = P \left\{I_{\mathrm{w}}, C_{1,1}I_{\mathrm{w}}, I_{\mathrm{z}}\right\} = (1q_{\mathrm{w}})q_{\mathrm{z}}p_{1} \end{array} $$
((12))
$$\begin{array}{*{20}l} & P \left\{I_{\mathrm{w}}, I_{\mathrm{z}}I_{\mathrm{w}},T_{x}\right\} = P \left\{I_{\mathrm{w}}, I_{\mathrm{z}}I_{\mathrm{w}}, I_{\mathrm{z}}\right\} = (1q_{\mathrm{w}})(1q_{\mathrm{z}}). \end{array} $$
((13))
Equation (3) captures the case where the tagged ZigBee node finishes the backoff in the backoff stages Z
_{
j
} and proceeds to the first CCA state C
_{1,j
}. Equation (4) represents the case the channel is sensed idle during the first CCA with probability (1−α) after which the ZigBee node enters the second CCA. In (5), we consider the transition of the ZigBee node from the idle channel state during the second CCA to the transmitting state. Equations (6) and (7) describe the scenarios where the ZigBee node experiences the busy channel in the first and second CCAs, respectively. In these cases, the ZigBee node enters the first CCA of the next backoff stage in Eq. (6) or the first CCA of the first backoff stage when it is at the maximum backoff state and its buffer is backlogged in Eq. (7).
Similarly, Eqs. (8) and (9) capture the transitions where the ZigBee node experiences all busy CCAs, and it enters the next backoff stage. Equation (10) corresponds to transitions where the ZigBee node experiences the busy channel for all CCAs at the maximum backoff stage and its buffer is empty; consequently, it enters the idle state. For transitions whose probabilities are given in (11) and (12), the ZigBee node finishes the transmission, its buffer is backlogged, and it evolves to either the first backoff stage or the first CCA of the first backoff stage, respectively. Equation (13) accounts for the case where the ZigBee node’s buffer is empty after its transmission; therefore, it enters the idle state.
3.3 Throughput analysis
Recall that we employ either x or explicit description {a(t),b(t)} to specify a particular state of the MC. Let π(x) denote the steady probability of state x, which is in the state space described in (2). Suppose we arrange all the states x such that their indices range from 0 to v
_{max}. In order to calculate the steadystate distribution of the MC, we can write all transition probabilities into the corresponding matrix P whose elements P{x
^{′}x} denote the transition probability from states x to states x
^{′}. Then, the steadystate probabilities can be determined by solving the following equations:
$$ {\boldsymbol{\pi}} \mathbf{P} = {\boldsymbol{\pi}}; \quad \sum\limits_{x=0}^{v_{\max}}\pi(x) = 1. $$
((14))
where π denotes the steadystate probability vector, which is defined as π=[π(0),…,π(v
_{max})]. These steadystate probabilities π are the functions of p, q
_{w}, q
_{z}, α, and β.
The probability that one node (either WLAN or ZigBee node) attempts to transmit in a generic backoff slot τ is equal to the total probability of the following events: the ZigBee node is in one of the backoff states, it senses the idle channel in the second CCA, and the WLAN node starts transmission at one of the backoff stages. The dwell time of the states in which the ZigBee node is in the transmission states (i.e. states (I
_{w},T
_{
x
}) and (W
_{
i
},T
_{
x
})) and the sensing states (i.e. states (I
_{w},C
_{
k,j
}) and (W
_{
i
},C
_{
k,j
})) are T
_{
z
} and L
_{C}, respectively where i=1,…,m
_{
w
}, j=1,…,m
_{
z
} and k=1,2; and the dwell time of all other states are 1. Hence, the transmission probability τ can be calculated as in (15) where Ψ is given in (16).
$$ \begin{aligned} \tau &= \frac{1}{\psi} \left(\sum\limits_{i=1}^{m_{w}} s_{i} \sum\limits_{j=1}^{m_{z}} \left[ \pi \left(W_{i},Z_{j}\right) + L_{C} \pi \left(W_{i},C_{1,j}\right) \right]\right. \\ &\left.\quad+ L_{C} \sum\limits_{j=1}^{m_{z}} \sum\limits_{i=1}^{m_{w}}\left(1\beta+s_{i}\right) \pi\left(W_{i},C_{2,j}\right)\right. \\ & \quad\left. + \, L_{\mathrm{C}}(1\beta) \sum\limits_{j=1}^{m_{z}} \pi\left(I_{\mathrm{w}},C_{2,j}\right) + \sum\limits_{i=1}^{m_{w}} s_{i} \pi\left(W_{i}, I_{\mathrm{z}}\right)\right) \\ \end{aligned} $$
((15))
$$ \begin{aligned} {}\psi &= \sum\limits_{j=1}^{m_{z}} \left[\sum\limits_{i=1}^{m_{w}} \pi\left(W_{i},Z_{j}\right) + \sum\limits_{k=1}^{2} \pi\left(W_{i},C_{k,j}\right) L_{\mathrm{C}}\right] \\ &\quad+\! \sum\limits_{i=1}^{m_{w}} \left[T_{z} \pi\left(W_{i},T_{x}\right) + \pi\left(W_{i}, I_{\mathrm{z}}\right)\right] \!+ \!T_{z} \pi\left(I_{\mathrm{w}},T_{x}\right)\,+\, \pi\left(I_{\mathrm{w}}, I_{\mathrm{z}}\right)\\ &\quad + \sum\limits_{j=1}^{m_{z}} \left[\pi\left(I_{\mathrm{w}}, Z_{j}\right) + \sum\limits_{k=1}^{2}\pi\left(I_{\mathrm{w}}, C_{k,j}\right) L_{\mathrm{C}}\right] \end{aligned} $$
((16))
Similar to the derivation of τ, the probability that a WLAN node attempts to transmit in a generic slot τ
_{
w
}, the probability that a ZigBee node starts sensing in a generic slot ϕ, and the probability that the ZigBee node attempts to transmit in a generic slot τ
_{
z
} are given respectively as
$$\begin{array}{*{20}l} \tau_{w} &= \frac{1}{\psi} \left(\sum\limits_{i=1}^{m_{w}}s_{i} \sum\limits_{j=1}^{m_{z}} \left[\pi\left(W_{i},Z_{j}\right) + \sum\limits_{k=1}^{2} \pi\left(W_{i},C_{k,j}\right) L_{\mathrm{C}}\right] \right. \\ & \qquad\qquad\qquad\qquad\qquad\qquad\quad \left. + \sum\limits_{i=1}^{m_{w}}s_{i} \pi\left(W_{i}, I_{\mathrm{z}}\right) \right) \end{array} $$
((17))
$$\begin{array}{*{20}l} \phi &= \frac{1}{\psi} \left[ \sum\limits_{i=1}^{m_{w}} \sum\limits_{j=1}^{m_{z}}p_{j}\pi\left(W_{i}, Z_{j}\right) + \sum\limits_{j=1}^{m_{z}}p_{j}\pi\left(I_{\mathrm{w}}, Z_{j}\right)\right] \end{array} $$
((18))
$$\begin{array}{*{20}l} \tau_{z} &= \frac{(1\beta)L_{\mathrm{C}}}{\psi} \left(\sum\limits_{i=1}^{m_{w}}(1s_{i})\sum\limits_{j=1}^{m_{z}}\pi\left(W_{i},C_{2,j}\right)\right. \\ & \qquad\qquad\qquad\qquad\qquad\quad\left. + \sum\limits_{j=1}^{m_{z}}\pi\left(I_{\mathrm{w}}, C_{2,j}\right) \right). \end{array} $$
((19))
The collision probability p is calculated as p=1−(1−τ)^{(n−1)} [15] for n=n
_{w}+n
_{z} where n
_{w} and n
_{z} denote the number of WLAN and ZigBeez nodes, respectively. The expected length of a generic WLAN slot \(E[S_{t_{w}}]\) can be calculated as^{2}
$${} \begin{aligned} E[S_{ts_{w}}] &= (1P_{\mathrm{t}})\delta + P_{\text{tw}}(1P_{\mathrm{s}})(1P_{\text{tz}})T_{cw} \\ & \quad + P_{\text{tw}}P_{\text{tz}} T_{z} \,+\, P_{\text{tw}} P_{\mathrm{s}} T_{s}\! +\! P_{\text{tz}} (1P_{\mathrm{s}})T_{z} \!+ \!P_{\text{tz}}P_{\mathrm{s}}T_{z} \end{aligned} $$
((20))
where P
_{t} is the probability that there is at least one transmission (either WLAN transmission or ZigBee transmission); P
_{tw} and P
_{tz} denote the probabilities that there is at least one WLAN transmission and one ZigBee transmission in the considered slot, respectively; and P
_{s} represents the conditional probability that there is exactly one node transmitting in a given slot. We can compute these probabilities as follows:
$$\begin{array}{*{20}l} P_{\mathrm{t}} &= 1(1\tau)^{n} ;~ P_{\text{tw}} = 1(1\tau_{w})^{n_{\mathrm{w}}} \end{array} $$
((21))
$$\begin{array}{*{20}l} P_{tz} &= 1(1\tau_{z})^{n_{\mathrm{z}}} ;~ P_{\mathrm{s}} = n\tau(1\tau)^{n1}/P_{\mathrm{t}}. \end{array} $$
((22))
The probabilities q
_{w} and q
_{z} that there is at least one packet to be transmitted from the MAC buffer of a WLAN or ZigBee node can be estimated as [17]
$$\begin{array}{*{20}l} q_{\mathrm{w}} = 1e^{\lambda_{\mathrm{w}} E[S_{t_{w}}]} ;~ q_{\mathrm{z}} = 1e^{\lambda_{\mathrm{z}} E[S_{t_{w}}]} \end{array} $$
((23))
where λ
_{w} and λ
_{z} are the packet arrival rates of WLAN and ZigBee nodes, respectively. Therefore, q
_{w} and q
_{z} are the functions of τ, λ
_{w} and λ
_{z}.
We now derive the probabilities α and β that the channel is busy in the first and second CCAs, respectively. Let P
_{
ii
} denote the probability that the channel progresses to the idle state in the next slot given that it is idle in the current slot where these slots are the ZigBee backoff slots. The probability that the channel is idle in a general ZigBee slot can be computed as
$$\begin{array}{*{20}l} P_{i} &= P_{ii}P_{i}+P_{ib}\left(1P_{i}\right) \end{array} $$
((24))
where P
_{
ib
} denotes the probability that the channel becomes idle given that it is busy at the current slot. Since a busy duration lasts for L=P
_{tw}(1−P
_{s})(1−P
_{tz})T
_{cw}+P
_{tw}
P
_{s}
T
_{
s
}+P
_{tw}
P
_{tz}
T
_{
z
}+P
_{tz}
T
_{
z
} on average, a busy slot will end with probability \(\frac {1}{L}\) during a random slot [19]. There is always an idle slot after the end of a busy slot for ZigBee node. Therefore, an idle slot follows the end of the busy slot occurs if none of WLAN nodes transmits during one ZigBee backoff slot, which yields
$$\begin{array}{*{20}l} P_{ib} &= \frac{1}{L}(1P_{\text{tw}})^{L_{\mathrm{C}}}. \end{array} $$
((25))
Let P
_{
bi
} denote the probability that the channel is busy in current slot k given that it is idle in the previous slot k−1 measured in the ZigBee backoff slot. This can occur when the channel is idle in slot k−2 and at least one ZigBee node performs sensing in that time slot or there is at least one WLAN node transmitting at any WLAN slots in slot k given none of the node transmits during slot k−1. Hence,
$$\begin{array}{*{20}l} P_{bi} &= (1(1\phi)^{n_{\mathrm{z}}})P_{ii}+(1P_{\mathrm{t}})^{L_{\mathrm{C}}}P_{\text{tw}}L_{\mathrm{C}}. \end{array} $$
((26))
In addition, we have
$$\begin{array}{*{20}l} P_{ii} &= 1P_{bi}. \end{array} $$
((27))
From (26) and (27), we have
$$\begin{array}{*{20}l} P_{ii} &= \frac{1(1P_{\mathrm{t}})^{L_{\mathrm{C}}}P_{\text{tw}}L_{\mathrm{C}}}{1+(1(1\phi)^{n_{\mathrm{z}}})}. \end{array} $$
((28))
Substituting the results in (25) and (28) into (24), we have P
_{
i
} is equal to 1−α.
Finally, the probability that the channel is found to be idle in the second CCA state given the channel is idle in the first CCA is equal to 1−β, which is indeed P
_{
ii
}. Therefore, α and β are the functions of τ, τ
_{
w
}, τ
_{
z
} and ϕ through P
_{
i
} and P
_{
ii
}. Hence, we have a system of equations based on which the steadystate probabilities, and probabilities p, q
_{w}, q
_{z}, α, β can be found by using the numerical method. The throughput achieved by each ZigBee and WLAN nodes can be expressed as
$$ S_{\mathrm{z}} = \frac{T_{z} n_{\mathrm{z}}\tau_{z}(1\tau)^{n1}} {E[S_{t_{w}}]} $$
((29))
$$ S_{\mathrm{w}} = \frac{T_{s}n_{\mathrm{w}}\tau_{w}(1\tau)^{n1}}{E[S_{t_{w}}]} $$
((30))
which completes the throughput analysis.