«Carles Gómez Josep Paradells José E. Caballero Edita: Fundación Vodafone España Autores: Carles Gómez Montenegro* Universitat Politècnica de ...»
4.2. Contention-based protocols In contention-based MAC protocols, nodes have no allocated communication resources; rather they compete for the medium and coordinate in a probabilistic way. In consequence, collisions (i.e. situations where two or more nodes transmit their data simultaneously) can occur.
The ALOHA protocol  is one of the earliest contention-based MAC protocols. In ALOHA, when a device has data to transmit, it simply transmits the data. If a collision takes place between two or more transmissions, the senders retry the transmission later. The theoretical maximum throughput that can be achieved with ALOHA is 18.4% of the channel capacity. The inefficiency of the protocol is due to collisions.
4.2.2. Slotted ALOHA
ALOHA was improved by introducing slots and permitting stations to transmit only at the beginning of a timeslot. This version of ALOHA, called Slotted ALOHA, reduced the amount of collisions and doubled the maximum throughput of ALOHA, reaching a maximum of 36.8% of the channel capacity.
Carrier Sense Multiple Access (CSMA)  is a channel-access mechanism in which nodes listen to the medium to verify that there are no on-going transmissions before transmitting data. There exist two main variants of CSMA, namely non-persistent and p-persistent CSMA.
In non-persistent CSMA, if the medium is idle, a node transmits immediately. Otherwise, it waits a random amount of time and listens to the medium again, repeating the same procedure. If a collision takes place after a transmission, the node waits for a random period (this reduces the probability of collision, since other nodes may also want to transmit data
Chapter 4. MAC layer
once the channel becomes clear) and executes the same operation again for data transmission.
In p-persistent CSMA, if the medium is idle the node transmits with probability p or, with probability 1-p, waits for a certain period before starting carrier sense again. A particular case of p-persistent CSMA is 1-persistent CSMA. In 1-persistent CSMA, if the medium is idle, a node transmits (as in non-persistent CSMA). However, if the medium is busy, it continues to listen until the medium becomes idle and then transmits the data.
CSMA/CA (CSMA with Collision Avoidance) is one of the multiple access protocols belonging to the CSMA family. In CSMA/CA, a node that has a frame to transmit performs the following procedure: first, the node listens to the medium. If the medium is idle then the node transmits the frame.
Otherwise, the node defers transmission for a random amount of time and tries the transmission again. The random back-off and retry are performed again until the channel is sensed idle or a maximum number of transmission attempts are reached. The Collision Avoidance (CA) feature is based on the use of acknowledgments as follows: when a device receives a data frame, it transmits an acknowledgment to the sender. If the sender receives the acknowledgment, it can deduce that a collision has not occurred for the transmission of the data frame. Otherwise, the sender retransmits the data frame.
Essentially, CSMA/CA is based on a non-persistent CSMA scheme.
CSMA/CA forms the basis of the MAC mechanisms used in several wireless standards such as IEEE 802.11 and IEEE 802.15.4. Other standards, such as IEEE 802.3, are based on another derivative of CSMA, which is CSMA with Collision Detection (CSMA/CD). In this case, a node that transmits a frame continues to listen to the medium during the transmission, but stops the transmission if a collision is detected. This scheme can be implemented in wired links, but wireless transceivers cannot transmit and receive at the same time and hence use CSMA/CA.
CSMA/CA suffers from two well known problems, namely: the ‘Hidden terminal problem’ and the ‘Exposed terminal problem’. The ‘Hidden terminal
problem’ is explained next (see Fig. 4.2). Let node A and node S be nodes within the range of receiver node R, while node A is not in the range of S.
Node A cannot detect transmissions from node S to node R. Hence, data frames transmitted from Node A to node R will collide with simultaneous transmissions from node S to node R.
Fig. 4.2. Hidden terminal problem
The ‘Exposed terminal problem’ occurs as shown next (see Fig. 4.3). Let nodes B and C be neighbouring nodes. Let N be within the range of node B but out of the range of node C. Let node M be within the range of node C but out of the range of node B. Node B is prevented from transmitting a frame to node N when node C is transmitting to node M (note that in this case this transmission would not affect node B transmission).
The hidden terminal and exposed terminal problems can be mitigated by using the so-called Request-To-Send/Clear-To-Send (RTS/CTS) mechanism, in which a node wishing to send data sends an RTS frame to the destination, which replies to the sender by transmitting a CTS frame. If a node that has data to transmit overhears an RTS or a CTS frame, it executes a back-off procedure, thus deferring the transmission. With the RTS/CTS mechanism, RTS frames can suffer collisions. However, since these frames are short in comparison with data frames, the cost of collisions is significantly decreased.
Sift  is a MAC protocol designed in order to address appropriately the following characteristics of event-driven WSNs: i) Nodes in the same area may sense the same event, which leads to spatially-correlated contention; ii) in many WSN applications, it is not necessary for all nodes to report the same event. Classical CSMA protocols neither handle the first property nor exploit the second one.
Given the problems described, and assuming that N nodes sense the same event, Sift is designed to minimize the time taken to send the first R messages out of the total of N messages. The remaining N - R messages can then be suppressed in order to increase energy efficiency and decrease channel load.
In contrast with traditional contention window schemes, where the contention window increases after a collision, Sift uses a fixed-size contention window. Thus, very low channel access latency can be achieved. In order to avoid a high collision probability, a geometrically-increasing probability distribution is used for slot selection so that the later slots have a greater probability of being selected. If no node starts to transmit in the first slot of a window, then the probability of choosing the second slot is greater (the intuition behind this scheme is that if no node transmits in the first slot, the number of competing nodes is not as large as a node might have believed).
The same applies for the remaining slots of a window.
The significant low latency of Sift is traded off for increased energy consumption, since a node has to listen to all slots before sending (which is not necessary in traditional contention window protocols). Another drawback is
increased overhearing, since when there is an ongoing transmission, nodes must listen until the end in order to contend for the next transmission, which causes overhearing .
4.3. Duty-cycle-based protocols The main characteristic of duty-cycle-based MAC protocols is that devices turn off the radio during certain periods for the sake of energy conservation. These protocols differ in how they select their active/sleep periods and in how they coordinate for transmitting data.
The Sensor-MAC (S-MAC)  protocol was designed for the goal of low energy consumption. One of the fundamental mechanisms of S-MAC is that nodes listen to the medium for a certain period and subsequently go into sleep mode, turn off the radio and set a timer for the next wake up to verify whether another node wants to talk to it. The duty cycle can be adjusted according to application and performance requirements.
Every node periodically broadcasts a SYNC packet to its neighbours. This packet includes the listen/sleep schedule of the node. This allows neighbouring nodes to synchronize and set up a common listen/sleep schedule.
Note that, in some cases, two neighbouring nodes will not be synchronized if they have to be synchronized with other neighbours. Synchronized nodes form a virtual cluster. If two neighbouring nodes A and B belong to different clusters, and node A wants to transmit some data to node B, node A waits until node B is listening. Although the listen/sleep scheme decreases energy consumption, latency increases. However, some WSN applications (e.g.
monitoring) tolerate certain latencies very well.
S-MAC includes a number of collision-avoidance mechanisms. Each transmitted packet includes a duration field that indicates how long the remaining transmission will be. Nodes that receive a packet sent to another node record the duration in a Network Allocation Vector (NAV) and update
Chapter 4. MAC layer
its value periodically. When a node has data to transmit, it first checks the NAV. If it is not zero, the medium is assumed to be busy. This mechanism is called virtual carrier sensing. In addition, physical carrier sense is performed by listening to the channel. A node decides that the medium is free if both virtual and carrier find that the medium is free.
A node with data to transmit waits until the medium is free and the receiver is listening. RTS/CTS is used to avoid the hidden terminal and exposed terminal problem. After a successful RTS/CTS exchange, data is transmitted in accordance with the listen/sleep schedule of the nodes. An ACK is sent by the receiver in response to correctly received data.
Because sleep and listen periods are predefined and constant, S-MAC is well suited for fixed traffic load. The efficiency of the protocol decreases under variable traffic load.
Timeout-MAC (T-MAC)  is designed to enhance the performance of S-MAC under variable traffic loads. Variable loads are expected in many WSN environments. For example, in applications where a sink collects information reported by the sensors, the nodes closest to the sink must relay more traffic than those far from it. In addition, traffic may change over time depending on the application.
T-MAC is essentially based on S-MAC. However, T-MAC adaptively modifies the duration of the active periods of S-MAC. In particular, the listen period ends when no event requiring the radio to be active has occurred for a time (see Fig. 4.4). This scheme enables unnecessary energy consumption to be reduced.
4.3.3. DSMAC Dynamic Sensor-MAC (DSMAC)  is a variant of S-MAC designed to achieve better performance than S-MAC in terms of latency. In fact, delaysensitive applications (e.g. health, alarms, military areas, etc.) exhibit low latency requirements.
DSMAC achieves low latency by adaptively reducing the sleep time of nodes when the average one-hop latency is high (see Fig. 4.4). This onehop latency is defined as the time-difference between the moment at which a packet gets into the queue of a node and the instant at which the packet is sent out. This value is written in the packet header. The receiver collects this value and updates the average of the one-hop latencies measured in the current SYNC period. If this one-hop latency estimation exceeds a certain threshold, and providing that energy consumption is tolerable, the node doubles its duty cycle by reducing the sleep time accordingly. The new duty cycle is broadcasted in the next SYNC packet.
Nodes that overhear this SYNC message and have packets in their queues will also double their duty cycle. Nodes with different sleep/listen schedules can still communicate, since the duty cycles used are multiples of the lowest duty cycle.
DSMAC improves the latency performance of S-MAC while maintaining an acceptable level of energy consumption.
DMAC10 was essentially designed to achieve very low latency while still remaining energy efficient, in the context of applications where data are delivered to a sink node through a tree composed of multihop paths . In particular, the purpose of DMAC was to solve the so-called data forwarding interruption problem that occurs in a multihop path of active/sleep cycle nodes. This problem arises when a node in an active state transmits a packet and the next hop is also in an active state, but the next nodes in the path are in sleep mode (e.g. because of their fixed duty cycles, as in S-MAC, or because they go to sleep, as in T-MAC, since they cannot overhear the transmission). The transmitted packet must be queued until the next active period, which increases latency.
In DMAC, an interval is composed of receiving, sending and sleeping periods (in the latter the radio is turned off for energy conservation). DMAC uses a staggered wake up schedule, so that a node transmitting data for the sink will use the sending period for the transmission, which is coincident with the receiving period of its next hop. As in a chain reaction, the same procedure is repeated in all the intermediate nodes, so data do not suffer sleep latency (see Fig. 4.5).
Nodes with the same hop distance to the sink have a synchronous schedule. During the receiving period of a node, all its child nodes have What DMAC stands for was not indicated in the paper describing the protocol .
sending periods that contend for the medium. Hence, DMAC can be understood as an improved Slotted Aloha algorithm in which slots are assigned to the sets of nodes to form a tree structure.