## 4 MAC Layer in WMSN
### MAC Layer's Main Functions  
Channel Access  
Traditionally, MAC protocols for WSNs can be classified into contention-based and contention-free protocols, according to the methods of cooperation in listen state between neighboring nodes. Figure 2: Traffic Differentiation and Priority Queueing in WMSNs. Contention-free slotted access protocols suffer from synchronization problem and many energy wastes because of synchronization overhead, in addition to channel under-utilization and fixed time-slot assignments. Regarding the structure of these protocols, they use many slots to access the channel and relatively long listening time that wastes more energy. Time Division Multiple Access (TDMA) is the most common example of this class. On the other side, contention-based protocols are based on the random access to the channel. This provides more flexibility to handle different nodes densities, lower delay, and better throughput potential at varying traffic loads. Also, there are no synchronization issues, making these protocols rather simple. The down side of this relaxed, random access approach is the wasted energy due to idle listening and collisions produced with large preamble and hidden nodes problems. Carrier Sense Multiple Access (CSMA) based with, possible, Collision Avoidance (CA) and its variants are examples of this type of protocols. Simplicity, flexibility and scalability of contention-based random access protocols make them attractive for WSNs. However, transmitting multimedia applications with strict QoS-guarantee offers significant new challenges over these energy-constrained sensor networks and makes conventional MAC protocols not suitable for WMSNs. Design of an efficient sensory MAC-protocol, satisfying QoS requirements, is one major step in end-to-end QoS provisioning over WMSNs. Most Contention-based MAC protocols in WSNs, such as S-MAC [20] and T-MAC [21], were proposed to support single-channel architecture, as shown in Table 2. [19] argues that these protocols are not suitable for multimedia applications (because they are designed to be energy efficient at the cost of increased latency and degraded network throughput) and proposes a multi-channel MAC protocol. Of course, neither S-MAC nor T-MAC was originally thought for WMSNs and probably they would not work properly under the new requirements of such networks. We think that exploiting the multi-channel features in the existing sensor platforms is a promising direction in designing a MAC protocol for WMSN, but it is also a mistake to discard the single-channel paradigm. In fact, we will see a proposed single-channel MAC protocol for WMSNs, [22] (further developed in [23]), that clearly outperforms both T-MAC and S-MAC in terms of MAC latency (both T-MAC and S-MAC attain an average transmission delay of 60 ms, while the delay of [23] is less than 30 ms), MAC throughput (while S-MAC and T-MAC achieves a throughput of 20 Kbps and 10 Kbps, the proposal in [23] achieves an average throughput of 50 Kbps), and energy efficiency (it consumes less energy than S-MAC and 14-18% more than T-MAC). COM-MAC is an on-demand multi-channel contention-free MAC protocol proposed in [19]. It exploits the fact that current sensor nodes, such as MICAz and WINS, already support multiple channels for communication, e.g., 40 channels in WINS, to develop a multi-channel MAC protocol in order to effectively utilize the available channel capacity through cooperative work from the other sensor nodes. In this way, a better support for high data rates demanded by multimedia applications can be achieved. As an example of a single-channel MAC protocol, a MAC Protocol for WMSNs is presented in [22] and [23]. It argues that CSMA methods generally offer a lower delay and better throughput, especially at lower traffic loads. Thus, it is based on the CSMA/CA MAC methods to develop a QoS-based MAC protocol for WMSNs.