Showing posts with label MAC Protocol. Show all posts
Showing posts with label MAC Protocol. Show all posts

Thursday, October 6, 2011

802.15.4 : An IEEE standard of Low Rate Personal Area Networks

802.15.4 is an IEEE standard of Low Rate Personal Area Networks. This standard covers Physical and MAC layer of Low Rate Personal Area Networks. Zigbee uses services provided by 802.15.4 and provides network constructions, security features and applications.

Two types of nodes are supported by this standard, FFD and RFD, which stand for Fully Functional Device and Reduced Functional Device. A FFD can act as coordinator or PAN coordinator or as a device. A RFD can only act as device. For more detailed description and understanding, of RFD and FFD one can refer to the standard itself.
A device must always be associated with a coordinator. The device has to communicate everything to the coordinator only. A coordinator can communicate with peer coordinators, and associated devices.

The standard offers two modes of operations; they are beaconed and non beaconed mode. The coordinator of a star network operating in the beaconed mode organizes channel access and data transmission with the help of a super frame structure shown below.



Super Frame structure in 802.15.4


The coordinator starts the superframe with the frame beacon packet, this will contains superframe specifications. The superframe has active and inactive periods. During inactive periods all nodes including the coordinator can sleep. They wake up just before the active period. The active period is divided into 16 slots, the first slot is used for beacon, and rests of slots are divided among the CAP and GTS.
The nodes operate using slotted CSMA-CA during CAP, the nodes can go to sleep mode during CAP if they do not have any data to receive or transmit. The nodes are active during GTS phase in their respective time slots. The coordinator is active throughout the active period.

All nodes send a request for GTS time slot during CAP to the coordinator. A field in the request packet specifies if the time slot is to transmit data to coordinator form the node or vice versa. There is also a field in the request packet, which specifies the number of GTS time slots required by the node. The coordinator specifies the slot allocated to the node using beacon frame.

If the node has been assigned slots to transmit data to the coordinator, then the node transmits data during that slot and it receives an acknowledgement for the same. If a slot is not assigned to the node and if the node wants to transmit data then, the node transmits data during CAP using slotted CSMA-CA and gets acknowledgement form the coordinator.

The coordinator sends any data it needs to send to a particular node, during node’s slot allocated. If it is not able to send during that slot then, the coordinator specifies that a data to be received is pending, in the beacon frame, by specifying the address of the node on which data is pending. The node requests for the same data during CAP using slotted CSMA-CA and the coordinator updates the data to the node.In non beaconed mode of operation, there is no GTS mechanism or beacon frame. All nodes operate in unslotted CSMA-CA mode and transmit and receive data.

CAP stands for contention access period, during this period all the nodes that want to communicate with the coordinator try to access the medium using slotted CSMA-CA protocol, the nodes request for some number of GTS form the coordinator during this CAP. The nodes also may send some data or receive some data during this period form the coordinator, if there was not slot assigned to the nodes. GTS stands for Guaranteed Time Slot, every node may have some slots assigned to them to receive or transmit data during this phase. One can refer to 802.15.4 for more detailed understanding of this standard.

Wednesday, October 5, 2011

LEACH : Low Energy Adaptive Clustering Hierarchy

LEACH stands for Low Energy Adaptive Clustering Hierarchy. This is a TDMA based protocol for wireless sensor networks with homogeneous nodes. LEACH is self organizing, adaptive clustering protocol. LEACH aims to distribute energy consumption at every node in the sensor network uniformly, aggregate data, i.e. support data fusion and localized coordination, between nodes to form and operate clusters.

All nodes in the network organize themselves into local clusters, with one node in the local cluster acting as cluster head. All nodes communicate only to the cluster head, and the cluster head conveys data to the base station. Nodes with higher capability advertise themselves as cluster heads, other nodes join the cluster head which is nearest to them. As cluster head has to spend lot of energy ,after certain time, randomized rotation of the cluster head is done, so that only node does not drain its energy. Every cluster head will prepare a schedule, to each of its members. The members communicate with the head only during that duration and sleep for the rest of the time. The diagram below shows the architecture of LEACH.



Architecture of LEACH

The operation of LEACH is broken into rounds. Each round starting with setup phase, during which clusters are formed and steady phase during which data is transferred to base station. Steady phase is longer than set up phase. Initially at the beginning of each round, each node decides if it has to be cluster head or not. The node which decides to be cluster head sends broadcasts a message. All other nodes will keep their receiver on and decide to which cluster head they need to join. Every node selects a cluster head which is nearest to it.

All nodes send messages to respective cluster heads. The cluster head based on the number of requesting node creates a TDMA schedule for all the nodes. Only during their respective schedules nodes interact with the cluster head, else the nodes will sleep.The cluster heads receives data form all nodes in its cluster, aggregates the data and sends it to the base station. The phase after the schedule is announced, is the steady phase and phase before schedule is announced, is setup phase. This can be seen in the diagram below. After the steady phase next round starts.



States in operation of LEACH

To avoid interference between clusters, all nodes in a cluster communicate using a CDMA code selected by the cluster head. There can also be hierarchy of clusters.

SMAC : Sensor MAC

SMAC stands for Sensor MAC . This protocol tries to reduce energy consumption due to overhearing, idle listening and collision. In this protocol also every node has two states, sleep state and active state. Unlike STEM, SMAC does not use two channels. A node can receive and transmit data during its listen period.

SMAC adopts a periodic wake up scheme. SMAC tries to synchronize the listen periods of neighboring nodes. The listen period of a node is divided into three phases as shown below. The listen period is the time during which a node is awake, rest of the time node is sleeping. The listen and sleep periods in the S-MAC are fixed intervals.



Three phases of listen period

In sync phase the neighboring synchronize their listen periods, a table is maintained regarding neighbors schedules, in RTS phase all nodes wishing to communicate to a particular node send RTS in CSMA mode with additional back off and in CTS the node acknowledges a particular RTS and communication between the two nodes starts and proceeds even in their sleep periods. The neighbors synchronize periodically.
SYNC packet is used to synchronize periodically. The SYNC packet contains senders address and time of its next sleep. The next sleep time is according to the sender, the receiver will adjust its timers after it receives the SYNC packet and updates the neighbor’s schedule.
In SMAC long data messages are fragmented and sent form transmitter to receiver. The receiver has to acknowledge for every fragment, else it is retransmitted. A series of fragments are sent with only one CTS and RTS message. This method is called as message passing. A protocol called T-MAC is proposed which is similar to S-MAC but with variable Listen and Sleep periods, this will help to suit the listen and sleep periods according to the load in the network.
The main concept in SMAC is that, all the neighboring nodes form virtual clusters and synchronize their sleep and listen periods. They communicate during their listen periods and sleep rest of the time. The immediate neighbors of nodes, which are transmitting and receiving, sleep until the communication is completed. A long message is divided into many fragments and all the fragments are sent as burst.
S-MAC contributes in these ways; reduction of idle listening(as nodes sleep and not stay in idle state),collision and overhearing avoidance by using RTS and CTS, and saving energy and time, by sending a series of fragments of a long message together, rather than going for contention after sending every fragment.

STEM: Sparse Topology and Energy Management

STEM stands for Sparse Topology and Energy Management. This protocol tries to save energy due to idle listening. This protocol does not provide a complete MAC protocol, however a MAC protocol can be used along with it to give a complete MAC protocol. This protocol proposes to use two channels, wake up channel and data channel. Wake up channel is used to inform the receiver that a transmitter wants to transmit data to it. Data channel is used to transmit data, underlying MAC protocol is used for this data transmission. STEM is designed for applications which wait for an event and report that event, when the event takes place. In other words STEM is applicable where nodes have two states, monitor sate, where nodes monitor and no event takes place, and transfer state, where event is detected and data has to be transmitted.
On the Wake up channel time is divided into sleep period and listen period, these together are called wake up period. This can be seen in the diagram below



Channels in STEM

There will be two transceivers in every sensor node. One is for wake up channel and other is for data channel. The transceiver of the data channel will always be in sleep mode until some has to received or transmitted by the node and the transceiver of the wake up channel will be sleep in sleep period and be active in listen period. During the listen period the wake up channel receiver is switched on and the node waits to check if any data is to be received if so the data channel transceiver is switched on or else the wake up channel transceiver goes to sleep.

The STEM protocol has two flavors; they are STEM-B and STEM-T. In STEM-B a node which wishes to transmit to another node, sends beacons periodically on the wake up channel. This beacon contains the address of transmitter and receiver. The receiver detects the beacons during its listen period and acknowledges the transmitter, and then both shift to data channel and exchange data. In STEM-T the transmitter sends busy tone on wake up channel for a long enough time to hit the receivers listen period. As there is no address of the receiver in the busy tone all neighboring nodes which hear busy shift to data channel, however on receiving the data, only the node for which the data was intended will reply and all others go back to sleep.