«Carles Gómez Josep Paradells José E. Caballero Edita: Fundación Vodafone España Autores: Carles Gómez Montenegro* Universitat Politècnica de ...»
DMAC has a mechanism that allows a node to increase the duty cycle of the nodes in its multi-hop path to the sink, should it have more than one packet to be transmitted in the same sending slot. Another technique used in DMAC is data prediction, which allows a receiver to switch back to receiving state rapidly if the aggregated rate at an intermediate node exceeds the capacity of the basic duty cycle. Additionally, DMAC deals with the interruption that a flow may suffer if two neighbouring nodes with different parents have data to transmit at the same time. This problem is solved by the use of More To Send (MTS) control packets.
DMAC achieves very good latency compared to other sleep/listen period assignment methods, such as S-MAC. However, because collision avoidance methods are not utilized, when a number of nodes with the same tree level try to send to the same node, collisions will occur.
4.4. Other protocols This section is devoted to MAC protocols of a different nature from those described in the previous sections.
4.4.1. STEM STEM (Sparse Topology and Energy Management)  is a protocol that assumes that in many applications nodes may be sleeping for most of the time, until they detect an event that has to be reported (e.g. to a sink) and for which a multi-hop path to the destination must be formed. In the sleep state, nodes retract from the network topology, and hence the topology can be sparse.
The key feature of STEM is that it operates on nodes equipped with two radios at different frequency bands. One band is used for communications in the ‘wake up plane’ and the other one is used for the ‘data plane’. A node that wants to communicate with a neighbour uses the wake up band for sending beacons
Chapter 4. MAC layer
that include the identifier of the neighbour. When this target node, which periodically listens to the wake up band, receives the beacon, it sends a response to the initiator and both nodes activate the data plane radio. Once the data transmission has finished, both nodes turn off the data plane radio. This procedure is repeated for each hop in the multi-hop path towards the destination.
The approach used by STEM trades off considerable energy savings by a latency increase, which is a consequence of the time needed for waking up every intermediate node in the multi-hop path.
The WiseMAC protocol  combines several techniques. WiseMAC uses non-persistent CSMA with preamble sampling to decrease idle listening. In the preamble sampling technique, a preamble precedes each data packet for alerting the receiving node. If a node finds the medium busy after it wakes up and samples the medium, it continues to listen until it receives a data packet or the medium becomes idle again. According to the neighbours’ sleep schedule tables (which nodes learn through reception of acknowledgments from neighbours), WiseMAC schedules transmissions and dynamically determines the preamble length so that the destination node’s sampling time corresponds to the middle of the sender’s preamble, which results in energy-saving.
Simulations have shown that WiseMAC performs better than one of S-MAC variants. Furthermore, the dynamic preamble length adjustment results in better performance under variable traffic load. The main drawback of WiseMAC is that decentralized sleep-listen schedules give rise to different sleep and wake up times for each neighbour. This is a problem for broadcast packets, since they will be buffered for neighbours in sleep mode and will be delivered many times as each neighbour wakes up.
4.5. Comparison of MAC protocols The previous sections presented the main proposals of MAC protocols for WSNs, categorized as scheduling-based, contention-based, duty cyclebased and other protocols. Table 4.1 shows a comparative summary of the
main features of each particular MAC protocol. While scheduling-based MAC protocols are collision-free, contention-based ones are not and thus incur greater energy consumption. However, in terms of delay the latter offer better performance than scheduling-based protocols. The various types of duty-cycle-based MAC protocols turn off the radio of devices during certain periods in order to save energy. These protocols trade energy savings for latency. Finally, other approaches follow different principles, such as the use of a wake-up plane in addition to the data plane, or combinations of contention-based and duty-cycle-based mechanisms.
4.6. IEEE 802.15.4 MAC This section describes the main features of the IEEE 802.15.4 MAC layer.
4.6.1. Device types and roles IEEE 802.15.
4 defines two types of devices, namely: Full Function Devices (FFDs) and Reduced Function Devices (RFDs). The first can perform all the tasks specified in the standard, while the second are limited. For instance, an RFD can only communicate with an FFD. In contrast, FFDs can communicate with any other type of device. RFDs are expected to exhibit a higher degree of hardware constraints than FFDs.
4 defines three roles, namely: PAN coordinator, coordinator and device. FFDs can perform all the roles, while RFDs can only act as devices. A coordinator is capable of relaying messages. If a coordinator is the main controller of the network, it is called a PAN coordinator. A node that is not a coordinator is called a device.
4.6.2. Network configuration
An IEEE 802.15.4 network may fall into one of the following configuration categories: i) beacon-enabled or ii) non-beacon-enabled. In the first category, the network uses a superframe structure bounded by network beacons (see subsection 4.5.3), which is absent in the second one. The channel access mechanism used depends on the network configuration.
4.6.3. Superframe structure
An IEEE 802.15.4 network may use a superframe structure, which requires the presence of a coordinator in the network. The superframe is divided into 16 slots of the same size and is bounded by network beacons (see Fig. 4.6). These beacons describe the specific format of the superframe, identify the PAN and are used for synchronization. The coordinator is in charge of transmitting the network beacons at predetermined intervals, between 15 ms and 251 s.
Chapter 4. MAC layer
The superframe may have an inactive period during which nodes enter a low-power mode and cannot transmit data. Hence, communication takes place only during the active period. The active period is composed of the Contention Access Period (CAP) and, optionally, the Contention Free Period (CFP). During the CAP, any device uses slotted CSMA/CA for channel access.
The CFP may be composed of up to seven Guaranteed Time Slots (GTSs), which are portions of the superframe devoted to a specific application. GTSs are useful for applications that require low latency or a certain bandwidth.
All transactions have to be completed before the next superframe period.
4.6.4. IEEE 802.15.4 CSMA/CA mechanisms Beacon-enabled networks use a slotted CSMA/CA mechanism for channel access. When a device has data to be transmitted, it aligns with the next slot and waits for a number of slots that is obtained randomly. This procedure is known as back-off. After the back-off period, the device senses the medium. If the medium is idle, then the device transmits the data.
Otherwise, the device performs another back-off procedure again, up to a maximum number of times.
Non-beacon-enabled networks use also a CSMA/CA channel access mechanism, but in contrast with the aforementioned one, it is unslotted.
In any case, acknowledgments (see subsection 4.5.4) and beacons are transmitted without using the CSMA/CA mechanism.
4.6.5. Error control IEEE 802.15.
4 allows reliable communication (by the use of acknowledgments) and unreliable communication. If a frame is successfully received, the receiving device can confirm that situation by transmitting an acknowledgment. Beacon frames and acknowledgments are never acknowledged.
In reliable mode, if the sender does not receive an acknowledgment, it assumes that the transmission was not successful and carries out a retransmission. Several retries can be performed up to a maximum number.
In applications where reliability requirements are relaxed, or in deployments with a low error probability, network designers may prefer not to use acknowledgments for saving energy. In this case, the sender of a frame assumes that the transmission is always successful.
In order to detect errors, a 16-bit ITU-T Cyclic Redundancy Check (CRC) mechanism is used. The CRC is computed on the header and the payload of a frame.
Frame transmission is followed by an InterFrame Space (IFS) to allow the MAC layer a finite time for processing the data received at the PHY layer. In the reliable mode, the IFS follows the acknowledgment frame. Before starting a back-off period, the device waits for an IFS.
After the transmission of a long frame, a Long IFS (LIFS) follows, while after transmission of a short frame, a Short IFS (SIFS) follows. Fig. 4.7 and Fig.
4.8 show examples of acknowledged and unacknowledged transmissions with their related LIFS and SIFS, respectively.
Fig. 4.7. Example of acknowledged transmissions and the related IFSs Fig. 4.8. Example of unacknowledged transmissions and the related IFSs 4.6.7. Data transactions Three types of data transactions can take place in an IEEE 802.15.4 network: i) from a device to a coordinator, ii) from a coordinator to a device, and iii) data transmission between two peers.
126.96.36.199. Data transfer from a device to a coordinator In a beacon-enabled network, a device that wishes to transfer data first synchronizes to the superframe and then transmits the data to the coordinator using slotted CSMA/CA. The coordinator may optionally transmit an ACK to the device after successful reception of the data.
In a non-beacon-enabled network, a device transmits its data frame to the coordinator using unslotted CSMA/CA. Successful reception of the data frame may be optionally acknowledged by the coordinator.
188.8.131.52. Data transfer from a coordinator to a device In a beacon-enabled network, when the coordinator has data to transmit to a device, it indicates in the beacon that the data is pending
for that device. If the device listens to the beacon and finds that a message is pending for it, then it sends a data request to the coordinator using slotted CSMA/CA, which may be optionally acknowledged by the coordinator. The pending message is then sent using slotted CSMA/CA and in case of successful reception can be optionally acknowledged by the device. The approach of this data transfer allows flexibility in the sleep schedules of the devices, which are not forced to listen to all the beacons.
In a non-beacon-enabled network, a device may send a request for data to the coordinator using unslotted CSMA/CA. The coordinator acknowledges the data request if it has been successfully received. If the coordinator has pending data for the device, it transmits the data frame using unslotted CSMA/CA. Otherwise, the coordinator sends a data frame with a zero-length payload using the same mechanism. If the data frame is successfully received by the device, it sends an acknowledgement to the coordinator.
184.108.40.206. Data transfer between peers
In a peer-to-peer topology, a node can communicate with any other node within its transmission range. The 2003 standard offers two options to make this scheme possible: i) nodes receive constantly and send data using unslotted CSMA/CA, or ii) nodes synchronize with each other. However, no method is specified for synchronization.
4.6.8. Frame formats of IEEE 802.15.4 MAC
4 specifies four types of MAC frames, namely: beacon frame, data frame, acknowledgment frame and MAC command frame. In general, the formats of these frame types are composed of three main parts: the MAC header (MHR), the MAC service data unit (MSDU) and an MAC footer (MFR).
The MHR contains the frame control, sequence number and addressing information fields. The frame control field has a size of two bytes and contains information about the frame type, addressing fields
Chapter 4. MAC layer
and other control flags. The sequence number field has a size of one byte and specifies a unique number for a frame. The addressing fields may include a two-byte destination PAN identifier, a 16- or 64-bit destination address, a two-byte source PAN identifier and a 16- or 64-bit source address.
The purpose of the MSDU (and its presence) depends on the frame type.
The MFR is a 16-bit Frame Check Sequence (FCS).
220.127.116.11. Beacon frame
Fig. 4.9 illustrates the structure of the beacon frame. The addressing fields contain only the PAN identifier and the address of the device that transmits the frame. The superframe specification codifies parameters related with the superframe structure, such as the interval between beacons, the length of the CAP, etc. The GTS fields include information about the devices that take advantage of GTSs and the resources devoted to them. The pending address fields specify the list of addresses for which the coordinator has pending messages.
18.104.22.168. Data frame Fig. 4.10 shows the structure of the data frame. The addressing fields may comprise the destination address and/or the source address fields, depending on the values encoded in the frame control field.
22.214.171.124. Acknowledgment frame Fig. 4.11 depicts the structure of the data frame. Note that ACKs do not contain an MSDU. Another relevant fact is that ACKs do not have addressing fields. This feature may lead to false positives. For example, a node A transmits data to a node B, and after that A receives an ACK.