# Energy-Aware Wireless Sensor Networks for Smart Buildings: A Review
## 6 Networking Layer
### The Data Link Layer Protocols  
Medium Access Control (MAC) protocols focused on throughput, with less emphasis on energy optimization. Recently, several MAC protocols have been designed to consider energy optimization. In WSN, the focus of most MAC protocols is to minimize the idle power consumption by setting the RF module into a sleep mode whenever possible. In this part, we discuss the different energy-aware MAC protocols.  
Sensor-MAC Protocol  
S-MAC is among the first MAC protocols designed for WSN [86]. In SMAC, nodes create a schedule that decides when to activate their RF module and enter sleep mode. In this protocol, nodes must share four sleep schedules' information using periodic SYNC packets. When a node is willing to send a packet to another node, it waits until the destination wakes up and then sends the packet using CSMA/CA. S-MAC also supports a message-passing mechanism that breaks long packets into fragments. These fragments are sent and acknowledged (RTS-CTS exchange). Additionally, to avoid retransmission of long packets, fragments and ACKs can serve the purposes of the RTS and CTS packets, especially for nodes that wake up in the middle of transmission and have already missed the original RTS-CTS exchange.  
Timeout-MAC Protocol  
T-MAC aims to eliminate idle energy by setting the length of the active portion of the frames [87]. Instead of sending messages during a predetermined active period, messages are forwarded in bursts mode at the beginning of the frame. After a certain amount of time, when no event occurs, sensor nodes put their RF modules into a sleep state and wait for the next scheduled active frame. The events include the firing of the frame timer, received data packets or transmitted data packets, the sensing of radio communication, neighboring sensors' data exchanges, or any radioactivity. When node A starts sending data to node B, considering that node B and node D did not detect node A's transmissions, they start sending data to A after a timeout. The data transmission from A to E is interrupted and continued during the coming active period. T-MAC is better because S-MAC requires a long active period to make sure that traffic is transmitted.  
D-MAC Protocol  
In some data acquisition techniques, the time for packets to arrive at the gateway is mostly stable and can be predictable [88]. DMAC takes this advantage and wakes up nodes based on their distance from the gateway. The wake-up scheme is composed of a receiving period and a sending period that are needed for a single transmission (period = P). This period is followed by a long sleep time. The nodes on the data acquisition tree begin the receiving period after T, where T = D * P, and D is the depth of the node on the tree. Hence, a node's receiving period goes with its neighbor's send period.  
Traffic-Adaptive Medium Access (TRAMA)  
TRAMA tries to reduce the energy that is wasted by packet collisions [89]. In the beginning, nodes exchange information with each other via a Neighbor Protocol (NP). Afterward, nodes transmit the schedule and data packets via the Schedule Exchange Protocol (SEP). Based on the neighbor traffic and schedule information, nodes determine their priorities. When two nodes are willing to communicate, the node with the highest priority sends its data first.  
Sparse Topology and Energy Management (STEM)  
In STEM, all sensor nodes go into sleep mode while monitoring the environment [90]. They wake up only when traffic is generated and ready to be sent. The STEM-T version uses a separate channel to awaken neighboring nodes, while in the STEM-B version, the node sends beacons on the control channel so sleeping nodes switch on their RF modules to receive the messages. The STEM-T guarantees a minimum delay because receivers are turned on immediately after data are ready, but it requires more overhead regarding the STEM-B. STEM-T might also require extra hardware such as the RF module.