# Leveraging Energy Harvesting and Wake-Up Receivers for Long-Term Wireless Sensor Networks
## 4 MAC Protocol Leveraging Wake-up Receivers
### Design of SNW-MAC  
SNW-MAC is an asynchronous scheme that uses the receiver-initiated approach to minimize the energy consumption of WSN nodes. As the power consumption of ULP WuRx has to be orders of magnitude less than the main radio, these devices are usually characterized by low sensitivity and a low data rate [13; 44]. For this reason, sending WuBs to a ULP WuRx can be costly energy-wise as it is done at a low bitrate and high transmission power to achieve the same range as the main radio. Packet transmission using SNW-MAC is illustrated by Figure 2(a). The sink initializes a communication by sending a WuB containing the address of a specific sensor node and then listens to the channel to receive the data packet. The targeted sensor node is awoken by its ULP WuRx, and starts sending the data packet. Each sensor node piggybacks its wake-up interval in data packets. The sink keeps an updated table that associates for each node its wake-up interval and polls each node at the right time. The sink sets for each node a timer for the wake-up interval piggybacked in data packets and polls the node every time the timer expires. Sensing operations are performed by each node at anytime between two sink polls, ensuring that data are ready to be sent when the sink sends the wake-up beacon. Compared to traditional receiver-initiated protocols, this approach reduces the energy consumption of the sink and the nodes as no rendezvous process is required. The sink energy consumption is further reduced as useless periodic WuBs sending is avoided. Because the wake-up interval is typically a 16-bit integer, minimal overhead is incurred by the piggybacking of this information. Moreover, the sink can use it to monitor the sensor node activity. WuB format:  
The WuB format of SNW-MAC is shown in Figure 2(b). A WuB is 19 bits long and is composed of three synchronization bits, the 8-bit address of the node to wake up and an 8-bits sequence number of the expected data packet, used for error control, as explained hereafter. Error control and retransmission:  
By coordinating data packet transmission at the sink, SNW-MAC cancels the risk of collisions compared to traditional pseudo-asynchronous schemes as each node is specifically polled. However, wireless channel interferences may lead to corrupted frames, and energy-efficient error control and packet retransmission is therefore an important issue. As the sink is entirely in charge of coordinating the packet transmission, it is responsible for detecting transmission error and scheduling another attempt. Each WuB embeds an 8-bit sequence number of the expected data packet, as shown in Figure 3b. The sink keeps an updated table that associates for each node the next packet sequence number to poll. When a sensor node ULP WuRx acquires a WuB, it reads both the address and the sequence number. Thanks to the capability of the ULP WuRx to directly recognize the address on the board, it wakes up the node MCU only if the address is valid and then sends to it the sequence number using the serial port. All the packets that have a sequence number lower than the one received are considered as either successfully received or dropped because of a too high number of transmission attempts and are thus erased from the transmission buffer. The data packet that has the sequence number asked by the sink is then sent. The data packet piggybacks its sequence number. When a packet is successfully received by the sink from a given sensor node, the sink checks the data packet sequence number. If the sequence number of the data packet is the one expected by the sink, then the sink increments the sequence number associated with this node. When the sink detects a transmission failure, e.g., the received data packet is corrupted, it does not increment the sequence number and sets a random backoff. When the backoff expires, it initiates a new communication using the same sequence number, as illustrated by Figure 3a.