S-MAC Software: Information and Source Code
S-MAC is an energy-efficient MAC protocol designed for wireless sensor
networks. The major design goals are energy efficiency,
self-configuration and flexibility to node changes. S-MAC has four
components. First, it enables low-duty-cycle operation of nodes in a
multi-hop network. Nodes periodically listen and sleep, and form
virtual clusters based on common sleep schedules. Second, S-MAC adopts
similar contention schemes as the IEEE 802.11 ad hoc mode. Third, S-MAC
avoids overhearing unnecessary traffic to further save energy. Finally,
S-MAC supports efficient transmissions of long messages. For details of
S-MAC design, please look at S-MAC
We have implemented S-MAC in both TinyOS on the Mote
platform and in ns-2, the network simulator.
S-MAC Implementation in TinyOS
S-MAC implementation in TinyOS provides a different communication stack
than Berkeley stack. It replaces Berkeley stack from the packet layer
and below with a layered architecture. The functions of MAC and
the physical layer (PHY) are cleanly separated. S-MAC only replaces the
communication stack, and does not affect other components in TinyOS
such as timers and senor stacks.
Major features of current S-MAC implementation are listed as follows.
Examples of Energy Consumption.
Several people have measured the energy consumption on Berkeley motes
when S-MAC is used. This example is
done by Mohammad Rahimi
at UCLA Center for Embedded
Networked Sensing (CENS). It measures the timing and energy
consumption of S-MAC on Mica2 motes with an oscilloscope.
- Nested header structure:
The implementation uses a nested header structure to allows different
components to freely add header fields to a packet and define its own
- Compile-time configurations:
The user can specify the duty cycle of nodes at compile time (from 1%
to fully active mode).
- Reliable unicast:
RTS-CTS-DATA-ACK packet exchange handles collisions and hidden terminal
problems and enables fast error recovery through retransmissions.
- Support long messages:
The implementation supports variable length packets up to 250 bytes at
the physical layer. With the fragmentation support, even longer packets
- Link state statistics:
S-MAC collects link state statistics to help upper layers make better
estimation on link quality and wisely use each link.
- Compatibility mode: The
native S-MAC interface is incompatible with Berkeley stack, due to the
limitations of the single TOS_Msg in Berkeley stack. However, S-MAC
provides a compatibility layer that allows applications developed over
Berkeley stack to run over S-MAC without modifications. To have better
performance, the native S-MAC interface needs to be used.
S-MAC Implementation in NS-2
S-MAC implementation in ns-2 reflects
S-MAC design described in
S-MAC journal paper. It does not contain some latest features presented
in S-MAC implementation in TinyOS, such as link statistics and the global
Pleaes note that the experiments described in S-MAC papers are based on
S-MAC implementation in TinyOS, not
To get S-MAC implementation in ns-2, go to this page. S-MAC
is in ns-2.26 and later releases. The latest code is in ns-2 CVS.
Please note that an important update to the energy
model is checked in to
ns-2 on June 14, 2005, and you
should use a version later than that date.
For details, please check this page.
We created a mailing list for S-MAC announcement and discussions, called
Everyone who is using S-MAC is encouraged to
to the mailing list.
To prevent spam, only subscribers can post to the list, but non-subscribers can
browse the mail
The following people have contributed to S-MAC source code.
MACSS: MAC Protocols Specific
for Sensor Networks
I-LENSE: ISI Laboratory for
Embedded Networked Sensor Experimentation
CENS: Center for Embedded Networked
Please send comments to Wei Ye.
Last modified on Sept. 27, 2005.