# Design and Analysis of a Low Latency Deterministic Network MAC for Wireless Sensor Networks
## 4 Proposed MAC for LLDN
### Proposed CSMA/CA Mechanism for LLDN  
Consider a node that tries to transmit a generated packet at a certain time. According to the procedure of the IEEE 802.15.4e MAC protocol, the node needs to wait for a random number of back-off periods and then goes for CCAs twice. The node is allowed to transmit data, if the channel is idle during both CCAs. Unfortunately, this procedure can cause collision due to simultaneous transmissions, if any two nodes generate the same random back-off period. Since a node remains unaware of the collision until the acknowledgment is received, it goes for the data transmission, which increases the energy consumption of the node. Our proposed approach wants to eliminate the simultaneous transmissions to avoid the collision, which can reduce energy consumption. According to the standard, one backoff slot is 20 symbol periods, and the CCA detection time requires eight symbol periods. One symbol is considered as 16 \(\upmu\)s, and the data rate is 250 kbps. Therefore, using the  
Figure 1: LLDN superframe structure with separate group acknowledgment (GACK). rest 12 symbols of a mini slot, we can send a signal of \(\frac{12\times 16\leavevmode\
obreak\ \mu\text{s}}{32\leavevmode\
obreak\ \mu\text{s}} \doteq 6\) bytes. We use these remaining 12 symbols and design a uniquely computed known signal (KS) set of the six-byte uniquely-computed signal (\(KS=\{KS^{1},KS^{2},KS^{3},...,KS^{m}\}\), and each element has the length of six bytes) for our proposed method to avoid the simultaneous collision. These known signals are the random patterns designed by the coordinator that distract from the information. In our proposed method, these six-byte signals acts like a preamble to sense the medium in order to know whether any other node is performing CCA at the same slot within the communication range of the node. It is proposed that a node utilizes two antennas in which one is used for normal transmissions and the other one is dedicated to listening to the intended signal. The presence of a dual antenna in the sensor may increase the hardware cost. However, it reduces the power consumption significantly [27]. The concept of using two antennas in our protocol is similar to the idea given in [27], but the power consumption of our protocol is less than [27], as both antennas in our design are active during the CCA period only instead of being fully active throughout the communication duration in [27]. When a node has a packet to transmit, it goes for the random backoff and CCA. During the first 128 \(\upmu\)s of the mini slot, a node can find the channel busy if any other node is transmitting at the same time. The node can enable its transmitter after 128 \(\upmu\)s of the CCA, and sends one random six-byte signal from \(KS\) (say \(KS^{k}\)). All nodes performing CCA at the same time also transmit one random signal. The node of the received signal in the same slot will calculate the signal correlation with the rest of the signals in \(KS\). This signal correlation is the optimal technique [27] for detecting a known waveform in the environment with random noise. Let \(X[n]\) be the complex number representing the \(n\)-th transmitted symbol and \(Y[n]\) be the complex number representing the \(n\)-th received symbol. Then:  
\[Y[n]=H\times X[n]+\omega[n] \tag{1}\]  
where \(H\) is a complex number representing the channel coefficient between the transmitter and the receiver and \(\omega[n]\) is the random noise. The cross-correlation known symbol pattern of length \(L\) in the received signal \(Y\) at a shifted length \(l\) is:  
\[C(KS^{j},Y,l)=\sum_{i=1}^{l}\overline{KS^{j}[i]}\times Y[i+l],\leavevmode \
obreak\ for\leavevmode\
obreak\ all\leavevmode\
obreak\ j\in[1,m]\leavevmode \
obreak\ and\leavevmode\
obreak\ j\
eq k. \tag{2}\]  
where \(\overline{KS^{j}[i]}\) is the complex conjugate of \(KS^{j}[i]\). The cross-correlation value \(C(KS^{j},Y,l)\) is low, when \(KS^{j}\) is not present in \(Y\). Taking a threshold for the correlation coefficient, we can detect the presence of \((KS^{j})\).