# Energy Sustainability in Wireless Sensor Networks: An Analytical Survey
## 4 Algorithm-Based Energy Sustainability in WSNs
### Algorithm-Based Methods for Energy Sustainability in WSNs
#### 4.3.2 Duty Cycling
To do this, the existence of overlapping periods between the wake-up periods of the nodes is compulsory. In order to discover the transmission of asynchronous senders, the sender transmits either a stream of periodic discovery messages or a single long discovery message. In each case, the duration of listening time has to be adequately adapted to transmission time [20; 23]. * Medium Access Control--MAC layer is a sublayer within the Data Link layer that constitutes the link between the Physical and the Network layer and is responsible for the data transmission between the nodes [65; 66]. To communicate with each other, sensor nodes utilize a shared medium. In the case of WSNs, the medium is the radio channel [67; 68]. The decision regarding the competing nodes that will eventually access the shared medium is handled by MAC protocols that also focus on how to avoid collision during the transmission [69; 70]. In WSNs, designing energy efficient MAC protocols is a challenging task and constitutes one of the major characteristics that defines whether the protocol is well designed or not [71; 72]. MAC protocols are classified in three main categories: scheduled, contention-based and hybrid [67]. In scheduled MAC protocols, nodes can access the shared medium channel utilizing a source which depends on the used protocol. There are three basic types of scheduled MAC protocols: TDMA, FDMA and CDMA. In TDMA--Time Division Multiple Access protocols, time splits into timeframes and each of them is composed by a specific number of equally sized slots, called time slots. One or more time slots of a timeframe are given to each node allowing it to transmit or receive data only through them. Upon agreement between the nodes and-based on the schedules of their adjacent ones, which are handled by the BS, the nodes select their individual time slots on which data can be transmitted or received. Thus, a node can remain in sleep mode and activate its transceiver only when its time slot is reached, resulting in energy saving [23]. Regarding FDMA--Frequency Division Multiple Access and CDMA--Code Division Multiple Access MAC protocols, the medium can be accessed using a frequency band or a specific code, respectively. TDMA-based are the mainly used MAC protocols in WSNs, since the implementation of FDMA requires nodes that are equipped with high-priced transceivers, and CDMA demands higher levels of computational power that leads to energy depletion [68]. * The main objective of the contention-based MAC protocols is the channel collision avoidance that influences the wake-up/sleep time of the nodes. Actually, it is very often for the nodes of a WSN to have to wait for a non-specific period of time in order to access the medium, due to heavy traffic and collision in it. This happens because nodes try to send their packets though the medium but with no success since it is busy, and thus they have to wait until the load in it is decreased. The nodes' resend their data and in case the load remains the same, they will have to wait to resend them. This implies longer periods of nodes' inactivity, leading to the exhaustion of the batteries. Collision avoidance can be achieved utilizing an algorithm called Carrier Sense Multiple Access with Collision Avoidance--CSMA/CA [68]. Several protocols have been developed allowing nodes to enter sleep state and wake up at certain periods of time in order to check the availability of the channel, so as to send their data whenever possible and prevent energy waste;
* Hybrid protocols combine features and methods used by both scheduled and contention-based MAC protocols, in a way that improves the nodes' performance in cases of increased traffic load [67; 68].