Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments....

6
Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks WOOCHUL LEE*, YUTAE LEE*, SOONGHEE LEE**, DONGIL KIM* *Department of Information and Communications Engineering Dong-Eui University, 996 Eomgwan-no, Busanjin-gu, Busan 614-714, Korea **Department of Information and Communications Engineering InJe University 607 Obang-dong, Gimhae, Gyeongnam 621-749, Korea Abstract: - In this paper, S-MAC(Sensor MAC) is based on the concept of the ‘listen/sleep mode cycle’ and is single-frequency contention-based protocol for sensor networks. This applies message passing to reduce contention latency for sensor-network applications that require store-and-forward processing as data moves through the network. However, unlike the S-MAC, where the duration of the cycle is fixed, T-MAC(Time-out MAC) introduces an adaptive duty cycle in a novel way: by dynamical ending the active part of it. This reduces the amount of energy wasted on idle listening, in which nodes wait for potentially incoming messages while still maintaining a reasonable throughput. The novel idea of the T-MAC protocol is to reduce idle listening by transmitting all messages in bursts of variable length, and sleeping between bursts. In this paper we discuss the design of these two Protocols. We analyze them from the aspect of power savings using the OMNET++ simulator and real environment with MICA Mote2 kit on MIB510 Sensor board with simulation application, Surge-View. Key-Words: - sensor networks, S-MAC/T-MAC protocol, Energy-Efficiency 1 Introduction Wireless sensor networks have an additional aspect: as sensor nodes are generally battery-operated, energy consumption is very important. And it consists of a considerable amount of smart sensor nodes with limited battery life and energy expensive short-range radio communication. Due to these energy critical characteristics and high probability of network failure, wireless sensor networks need an efficient MAC protocol design. Especially, minimizing power consumption is a main goal in sensor MAC protocol design because a power drain of each sensor node can stop all the necessary functions of sensor networks. Over the years power-saving issues, therefore, have received much attention on developing energy efficient MAC protocols in wireless sensor networks [1-6]. These protocols can be classified into 2 parts, schedule-based [3, 4] and contention-based [1, 2, 5, 6]. Schedule-based protocols are naturally energy preserving in that they have a duty cycle built-in with an inherent collision-free nature, but they often have high complexity in design due to a non-trivial problem of synchronization in wireless sensor networks. Therefore in this paper, we more focus on the contention-based MAC protocol. 2 S-MAC S-MAC[1] is a contention-based random access protocol with a fixed listen/sleep cycle. It uses a coordinated sleeping mechanism, similar to the power saving mechanism of IEEE 802.11[7]. A time frame in S-MAC is divided into two parts: one for a sleeping session and the other for a listening session (See Fig. 1). Just only for a listen period, sensor nodes are able to communicate with other nodes and send some control packets such as SYNC, RTS, and CTS. The real goal in S-MAC design is to reduce energy consumption from all the sources that we have identified to cause energy waste(collision, overhearing, idle listening, and control overhead) while supporting good scalability and collision avoidance. To achieve the design goal, we will discuss the S-MAC that consists of three major components: periodic listen and sleep, collision and overhearing avoidance, and message passing. Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)

Transcript of Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments....

Page 1: Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver.

Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks

WOOCHUL LEE*, YUTAE LEE*, SOONGHEE LEE**, DONGIL KIM* *Department of Information and Communications Engineering

Dong-Eui University, 996 Eomgwan-no, Busanjin-gu, Busan 614-714, Korea

**Department of Information and Communications Engineering InJe University

607 Obang-dong, Gimhae, Gyeongnam 621-749, Korea

Abstract: - In this paper, S-MAC(Sensor MAC) is based on the concept of the ‘listen/sleep mode cycle’ and is single-frequency contention-based protocol for sensor networks. This applies message passing to reduce contention latency for sensor-network applications that require store-and-forward processing as data moves through the network. However, unlike the S-MAC, where the duration of the cycle is fixed, T-MAC(Time-out MAC) introduces an adaptive duty cycle in a novel way: by dynamical ending the active part of it. This reduces the amount of energy wasted on idle listening, in which nodes wait for potentially incoming messages while still maintaining a reasonable throughput. The novel idea of the T-MAC protocol is to reduce idle listening by transmitting all messages in bursts of variable length, and sleeping between bursts. In this paper we discuss the design of these two Protocols. We analyze them from the aspect of power savings using the OMNET++ simulator and real environment with MICA Mote2 kit on MIB510 Sensor board with simulation application, Surge-View. Key-Words: - sensor networks, S-MAC/T-MAC protocol, Energy-Efficiency 1 Introduction

Wireless sensor networks have an additional aspect: as sensor nodes are generally battery-operated, energy consumption is very important. And it consists of a considerable amount of smart sensor nodes with limited battery life and energy expensive short-range radio communication. Due to these energy critical characteristics and high probability of network failure, wireless sensor networks need an efficient MAC protocol design. Especially, minimizing power consumption is a main goal in sensor MAC protocol design because a power drain of each sensor node can stop all the necessary functions of sensor networks.

Over the years power-saving issues, therefore, have received much attention on developing energy efficient MAC protocols in wireless sensor networks [1-6]. These protocols can be classified into 2 parts, schedule-based [3, 4] and contention-based [1, 2, 5, 6]. Schedule-based protocols are naturally energy preserving in that they have a duty cycle built-in with an inherent collision-free nature, but they often have high complexity in design due to a non-trivial problem of synchronization in wireless sensor networks.

Therefore in this paper, we more focus on the contention-based MAC protocol. 2 S-MAC

S-MAC[1] is a contention-based random access

protocol with a fixed listen/sleep cycle. It uses a coordinated sleeping mechanism, similar to the power saving mechanism of IEEE 802.11[7]. A time frame in S-MAC is divided into two parts: one for a sleeping session and the other for a listening session (See Fig. 1). Just only for a listen period, sensor nodes are able to communicate with other nodes and send some control packets such as SYNC, RTS, and CTS.

The real goal in S-MAC design is to reduce energy consumption from all the sources that we have identified to cause energy waste(collision, overhearing, idle listening, and control overhead) while supporting good scalability and collision avoidance. To achieve the design goal, we will discuss the S-MAC that consists of three major components: periodic listen and sleep, collision and overhearing avoidance, and message passing.

Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)

Page 2: Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver.

2.1 Periodic Sleep and Listen state Each of nodes in sensor network actually has a

fixed cycle consisting of three different states, initiation, sleep, and listen. The first step, init state, when a node is spread into the field, is to initiate and start its own schedule, and then each node goes to sleep for some time and then wakes up to listen if any other node wants to talk to it. So the cycle for sleep/listen period is repeated until it is switched off due to its battery life. For the sleep period, the node turns off its radio, and determine a timer to awake itself later. All nodes are free to choose their own listen/sleep schedules. However, to reduce control overhead, we prefer neighboring nodes to synchronize together. This means they listen at the same time and go to sleep concurrently. It should be noticed that not all neighboring nodes can synchronize together in a multi-hop network. Nodes broadcast their schedules to exchange their own for its immediate neighbors.

If there are multiple neighbors, Nodes should contend for the medium by using RTS (Request To Send) and CTS (Clear To Send) packets when the node is listening. The node who first sends out the RTS packet wins the medium, and the receiver will reply with a CTS. After they start data transmission, they do not follow their sleep schedules until they finish transmission. 2.2 Overhearing Avoidance

In proposed MAC like IEEE 802.11, each node overhears lots of packets that are not directed to itself. This is a significant waste of energy, especially when node density is high and traffic lode is heavy. S-MAC tries to avoid overhearing by letting interfering nodes go to sleep after they hear an RTS or CTS packet. Since DATA packets are normally much longer than control packets, the approach prevents neighboring nodes from overhearing long DATA packets and the following ACKs. Therefore, all immediate neighbors of both the sender and the receiver should sleep after they hear the RTS or CTS packet until the current transmission is over. 2.3 Collision Avoidance

Collision due to multiple senders may occur when more then two node want to send some packet to same node in the multi-hop network. So S-MAC adapt the RTS/CTS mechanism to address the Collision and the hidden terminal problem[15]. In order to achieve that mechanism efficiently, it uses the physical and virtual carrier sensing.

There is a duration field in each transmitted packet that indicates how long the remaining transmission will be. So if a node receives a packet destined to another node, it knows how long it has to keep silent. The node records this value in an variable called the network allocation vector (NAV) [1] and sets a timer for it. Every time when the NAV timer fires, the node decrements the NAV value until it reaches zero. When a node has data to send, it first looks at the NAV. If its value is not zero, the node determines that the medium is busy. This is called virtual carrier sense.

Physical carrier sense is performed at the physical layer by listening to the channel for possible transmissions. The randomized carrier sense time is very important for collision avoidance. The medium is determined as free if both virtual and physical carrier sense indicate that it is free. All senders perform carrier sense before initiating a transmission. Broadcast packets are sent without using RTS/CTS. Unicast packets follow the sequence of RTS/CTS/DATA/ACK between the sender and the receiver.

2.4 Message Passing

This subsection describes how to efficiently transmit a long message. A message can be a long series of packets, and usually the receiver needs to obtain all the data units before it can perform in-network data processing or aggregation. The disadvantage of transmitting a long message as a single packet is the high cost of re-transmitting the long packet if only a few bits have been corrupted in the first transmission. S-MAC approach is to fragment the long message into many small fragments, and transmit them in burst. Only one RTS packet and one CTS packet are used. They reserve the medium for transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver. If it fails to receive the ACK, it will extend the reserved transmission time for one more fragment, and re-transmit the current fragment immediately. All packets have the duration field, which is now the time needed for transmitting all the remaining data fragments and ACK packets. If a neighboring node hears a RTS or CTS, it will go to sleep for the time that is needed to transmit all the fragments. Switching the radio from sleep to active does not occur instantaneously. Therefore, it is desirable to reduce the frequency of switching modes.

The message passing scheme tries to put nodes into sleep state as long as possible, and hence reduces

Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)

Page 3: Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver.

switching overhead. The purpose of using ACK after each data fragment is to prevent the hidden terminal problem. It is possible that a neighboring node wakes up or a new node joins in the middle of a transmission. If the node is only the neighbor of the receiver but not the sender, it will not hear the data fragments being sent by the sender. If the receiver does not send ACK frequently, the new node may mistakenly infer from its carrier sense that the medium is clear. If it starts transmitting, the current transmission will be corrupted at the receiver. Each data fragment and ACK packet also has the duration field. In this way, if a node wakes up or a new node joins in the middle, it can properly go to sleep no matter if it is the neighbor of the sender or the receiver.

2.5 S-MAC problem

S-MAC has the long listen interval, divided into three parts for SYNC, RTS, and CTS packets, respectively. The overall listen interval in the current S-MAC implementation on Mica motes[11]

Fig. 1. shows the basic scheme of the S-MAC protocol. In this figure, node A wins the competition for sending out its SYNC packet. Assuming to have data traffic towards node B in its queue, node A again wins the competition for sending a RTS packet (Fig. 1(b)). Upon receiving this RTS, node B may acknowledge to node A with its CTS packet.

Successful exchange of RTS/CTS packets between two nodes implies that they should stay awake in the whole sleep period, followed by the current listen interval, for the completion of their data communication (i.e., until the next listening interval).Again, all other nodes that are not involved in data communication can enter a sleep mode.

Fig. 1. Basic mechanism of S-MAC

Although S-MAC can reduce the idle listening time, it is not optimal due to a fixed interval of listening mode. The problem is that, while no nodes have data traffic to send during some time frame and hence no RTS/CTS

packet transmissions may occur in the corresponding listen period, every node still has to be awake and just

waste their energies-refer to Fig.1(a).

3 T-MAC

A solution with a fixed duty cycle like the S-MAC[1] is not optimal. The nodes must be deployed with an active time that can handle the highest expected load. And whenever the load is lower than that, the active time is not optimally used and energy will be wasted on idle listening.

The idea of the T-MAC[9] protocol is to reduce idle listening by transmitting all messages in bursts of variable length, and sleeping between bursts. To maintain an optimal active time under variable load, we dynamically determine its length. T-MAC end the active time in an intuitive way.

3.1 T-MAC Protocol design Fig. 2 shows the basic scheme of the T-MAC protocol. Every node periodically wake up to communicate with its neighbors, and then goes to sleep again until the next frame. Meanwhile, new messages are queued. Nodes communicate using a RTS, CTS and ACK.

A node will keep listening and potentially transmitting, as long as it is in an active period. An active period ends when no activation event has occurred for a time TA. An activation event is “the periodic frame timer, “the reception of any data on the radio”, “the end-of-transmission of a node’s own data packet or acknowledgement”, “the overhearing prior RTS and CTS packets”. A node will sleep if it is not in an active period. Consequently, TA determines that minimal amount of idle listening per frame.

The described timeout scheme moves all communication to a burst at the beginning of the frame. Since messages between active times must be buffered, the buffer capacity determines an upper bound on the maximum frame time.

3.2 RTS operation and choosing TA

Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)

Page 4: Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver.

In IEEE 802.11, contention-based protocols, nodes wait for a random time within a contention interval after detecting a collision. Usually, a back-off scheme is used: the contention interval increases when traffic is higher, because the back-off scheme reduces the probability of collisions when the load is high.

In the T-MAC protocol, every node transmits its queued messages in a burst at the start of the frame. During this burst, the medium is saturated: messages are transmitted at maximum rate. An increasing contention interval is not useful, since the load is mostly high and does not change. Therefore, RTS transmission in T-MAC starts by waiting and listening for a random time within a fixed contention interval. This interval is tuned for maximum load. The contention time is always used, even if no collision has occurred yet.

When the sending node receives no answer within

the interval TA, it might go to sleep. However, that would be wrong in cases 1 and 2: we would then have a situation where the sending node goes to sleep, while the receiving node is still awake. Since this situation might occur even at the first message of the frame, the throughput dramatically decreases. Therefore, a node should retry by re-sending the RTS if it receives no answer. If there is still no reply after two retries, it should give up and go to sleep. 3.2.1 Determining TA

A node should not go to sleep if its neighbors are still communicating, since it may be the receiver of a subsequent message. Receiving the start of the RTS or CTS packet from a neighbor is enough to trigger a renewed interval TA. Since a node may not hear, because it is not in range, the RTS that starts a communication with its neighbor, the interval TA must be long enough to receive at least the start of the CTS packet (Fig. 3). This observation gives us a lower limit on the length of the interval TA:

TA > C + R + T where C is the length of the contention interval, R is

the length of an RTS packet, and T is the turn-around time (i.e. the short time between the end of the RTS packet and the beginning of the CTS packet). In

T-MAC experiments, TA = 1.5 × (C + R + T), which proved to be satisfactory. A larger TA increases the energy used. 3.3 T-MAC Problem

In Fig. 4. Each of the nodes A though D in the picture forms a cell with its neighbors. Messages flow from top to bottom, so node A sends only to B, B only to C, and C only to D. Now consider node C. Every time it wants to send a message to D, it must contend for the medium and may loose to either node B (by receiving an RTS packet) or to node A (indirectly, by overhearing a CTS packet from node B). If node C looses contention because of an RTS packet from node B, it will reply with a CTS packet, which can also be heard by node D. In that case, node D will be awake when the communication between C and B ends. However, if node C looses contention because it overhears a CTS packet from B to A (see Fig. 4), C must remain silent. Since D does not know of the communication between A and B, its active time will end, and node D will go to sleep. Only at the start of the next frame will node C have a new chance to send to node D.

Thus for every packet that node C wants to send to node D, it may either succeed or fail (by loosing to node A). Both of these events have equal probability. Failure implies that the frame ends and C can send no more packets. We can therefore calculate that, in this simplified setup, node C has a 50% probability of sending a single packet to node D, a 25% probability of sending two packets (it must succeed twice), etcetera, in each frame. We call the observed effect the early sleeping problem, since a node goes to sleep when a neighbor still has messages for it. In the nodes-to-sink communication pattern, the early sleeping problem reduced the total possible throughput of T-MAC to less than half of the maximum throughput of traditional protocols or S-MAC. In later experiments, we have also encountered this problem at the border of a highly active part of the networks. We believe that the problem may occur in any asymmetric communication pattern.

Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)

Page 5: Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver.

4 Experiments The purpose of the experiments is to measure the

energy consumption of two protocols: S-MAC, T-MAC. To evaluate the performance of two protocols, we use OMNET++ simulator performing the tests on a simple topology of 10 nodes and 20 nodes. We change the number of nodes in order to measure energy consumption in different traffic load.

In the Fig. 5 events occur in the network with a

frequency of one per 10 seconds. Events have an average duration of 5 seconds and affect an area of approximately 10 nodes. A neighbor that receives one of these messages replies with a probability of 20%. We performed multiple measurements, with different message frequencies during events. This frequency is on the horizontal axis of the graph (Fig. 5). T-MAC is using overhearing avoidance but no full-buffer priority. T-MAC uses much less energy than the S-MAC, especially when the message frequency during events increases. However, the maximum frequency that T-MAC can handle is lower than that of S-MAC, Thus it may occur that the energy consumption increases if the traffic load and the number of nodes is increasing. Again, T-MAC suffers from the early sleeping problem. 5 Real Implementation on T-MAC

In this section, we use the term power instead of

energy to emphasize that we are talking about actual electrical characteristics. In strict sense, the terms are mostly interchangeable : power is energy divided by time. We also speak of power usage, or energy consumption, when we should strictly say electrical current. This is permitted, since the voltage is constant (joules are consumed at a rate of (I ×3V) per second).

Fig 6 MPR400CB(MICA2),

MPR500CA(MICA2DOT) We did not implement all features of the T-MAC

protocol onto the MICA2 hardware. To test the effectiveness of the full-buffer-priority and future-RTS schemes, a large-scale experiment is needed, involving a lot of nodes. We have not implemented the possibility to keep multiple schedules yet.

Although this is fairly easy to implement, we have only tested with single-cluster configurations. During testing, we noted that the nodes’ schedules would drift apart relatively fast. Even though the time-keeping on all nodes is based on ticks of a quartz crystal, some of the nodes became unreachable within as little as 10 minutes. we used a simple correction scheme: when a node receives a SYNC message that contains almost, but not exactly, it s own schedule, the node adjusts its own schedule towards the received schedule. To allow a converging situation, the schedule is only adjusted for 50% of the difference between the two schedules. This paper correction solved the problem: an experiment showed that nodes were still perfectly synchronized after more than 10 hours. The final implementation performs well.

T-MAC setup has the following functions. 1) Adaptive duty-cycle operation on radio

- periodic listen and sleep 2) Broadcast only uses CSMA 3) Many features for uni-cast - RTS/CTS for hidden terminal problem - fragmentation support for a long message A long

message is divided (by upper layer) into multiple fragments. The RTS/CTS reserves the medium for the entire message. ACK is used for each fragment for immediate error recovery.

- Node goes to sleep when its neighbors are talking to other nodes.

5.1 Power usage

After the implementation of the T-MAC protocol, we performed a number of a power usage experiments. In these experiments, one node was sending, another receiving.

Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)

Page 6: Analysis of S-MAC/T-MAC Protocols for Wireless Sensor Networks · transmitting all the fragments. Every time a data fragment is transmitted, the sender waits for an ACK from the receiver.

Fig 7. Power usage trace idle.

Fig. 8. Power usage trace,

transmitting node, 10 messages / second. We measured the power consumption of both the

sending and the receiving node. The message length is 20 bytes. The voltage over the resistor is a measure for the electrical current. This voltage was measured using Surge View, which is a Java application that comes standard in the TinyOS Tools distribution. The Surge View is useful for monitoring a sensor network and analyzing mesh network performance. At the computer, we captured the values. After precise calibration, we could measure the electrical current through the node with a precision of approximately 15µA.

Fig 7. shows a power usage trace of an idle node. The power consumption is low most of the time. At regular intervals (0.61 seconds, the frame time) we see spikes to 4mA. These are the active times, during which the radio is on. We also see two higher spikes. These are SYNC packet transmissions. Fig 8. shows a close up of a node transmitting 3 messages during a single frame. We expected that there is no control packet like RTS/CTS/ACK causing reasonable power consumptions. 6 Conclusions

In this paper, we have simply focused on the

performance of MAC power consumption[2] and identified a problem with the T-MAC which saves energy by turning off the radio as much as possible. The time-out scheme, as implemented by the T-MAC

protocol, uses significantly less energy than fixed duty cycle, such as the S-MAC protocol, when applied to an environment with varying message rates. The exact advantage depends on the amount of variation in the message rate. T-MAC protocol can be advantageous, since it requires no tuning to the specific message rate, while the S-MAC protocol must be tuned precisely for optimal energy savings. The performance of T-MAC[3] under low peak load having a low traffic is better than the S-MAC in same condition in small networks.[6] Future work is needed more research on virtual clustering, both in static and in mobile networks. Acknowledgement This work was supported by grant No. R01-2001-000-00007-0 from the Basic Research Program of the Korea Science & Engineering Foundation. References: [1] M. Stemm and R. H. Katz, “Measuring and reducing energy consumption of network interfaces in hand-held devices”, IEICE Transactions on Communications, E80-B(8), pp. 1125-1131, 1997. [2] W. Ye, J. Heidemann, and D. Estrin. “An energy-efficient MAC protocol for wireless sensornetworks,” in IEEE INFOCOM 2002, June 2002. [3] T. V. Dam and K. Langendoen, "An adaptive energy-efficient MAC protocol for wireless sensor networks," in ACM Sensys’03, Nov. 2003. [4] Katayoun Sohrabi, Jay Gao, Vishal Ailawadhi, and Gregory J. Pottie., “Protocols for self-organization of a wireless sensor network,” in IEEE Personal Communications, pp.16-27, Oct. 2000. [5] V. Rajendran, K. Obraczka, and J.J. Garcia-Luna-Aceves, “Energy-efficient, collision-free medium access control for wireless sensor networks,” in ACM Sensys’03, Nov. 2003. [6] J.M. van Dam An Adaptive Energy-Effcient MAC Protocol for Wireless Sensor Networks, June, 2003 [7] P. Lin, C. Qiao, and X. Wang “Medium Access Control With A Dynamic Duty Cycle For Sensor Networks,” in WCNC, Mar 2004. [17]http://www.chipcon.com/files/CC1000_Data_sheet_2_1.pdf [18]http://webs.cs.berkeley.edu/retreat-1-04/slides/joep-nest-cc1000.ppt

Proceedings of the 10th WSEAS International Conference on COMMUNICATIONS, Vouliagmeni, Athens, Greece, July 10-12, 2006 (pp260-265)