You are on page 1of 61

04 – Medium Access Control

(
(MAC))
ENRECM158
Wireless Sensor Networks
D Alex
Dr Al Mason
M

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 1 of 61


Correction from last week (1)
Esaved =
[(t 2 − t1) Pactive ] − Energy used with no sleep

[tdown ( Pactive + Psleep ) / 2 − ] Energy consumed getting to


sleep state

[(t 2 − t1 − tdown) Psleep ] Energy consumed while


asleep
Esaved Eoverhead

Pactive

Psleep tdown tup

t1 t2 Time
ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 2 of 61
Correction from last week (2)
- Apologies for this confusion, there are number of
ways to calculate the energy saved (its geometry,
area of shapes, etc).
- You need to be able to solve these problems…
p
-One of the main ideas to take away is that if Esaved <
Eoverheads, sleep is not worthwhile!
- Slides on Blackboard have been updated!

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 3 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols.
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 4 of 61


Recap (1)
- Familiar now with the major hardware
components of a sensor node (controller, memory,
transceiver, sensors, battery).
- Aware of transceiver characteristics and
operational states.
- Have an idea about the different classes of sensors
that we can attach.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 5 of 61


Recap (2)
- Different types of power source can be used, although
batteries are the typical case.
- Know that dynamic power management is one key to
saving energy for sensor nodes; the hardware is low
power, but we need software to manage this effectively.
- Learnt that there are overheads involved in power
management which need consideration.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 6 of 61


Recap (3)
- Had an overview of the ideas behind WSN operating
systems, particularly TinyOS.
- Seen the layered structure used, how this relates to
tasks and events and how concurrency is achieved.
- Know that there are sacrifices to be made.
- Learnt a little about the different types of sensor node
available on the market at the moment.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 7 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols.
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 8 of 61


The purpose of MAC
- MAC protocols co-ordinate the times where a
number of nodes access a shared medium.
- Critically important for wireless transmission as
many nodes may be sharing the airwaves!!
- Many different MAC protocols available for
wireless networks in general…
general

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 9 of 61


Where is MAC in the OSI model?

MAC protocol is in
the data link layer
of the OSI model

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 10 of 61


Key MAC requirements
- Delay
- Throughput
- Fairness Traditional concerns
- Stability
- Low overhead
- Energy conservation WSN
WSNs

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 11 of 61


MAC overheads
- A number of sources of overhead are involved in
MAC:
- Per-packet overhead
- Collisions
- Control packets
- Some packets may even need to be prioritised.
prioritised

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 12 of 61


Influences on MAC performance
- Heavy dependence on physical layer (i.e. air).
- Time variable error rates
- Multipath fading
- Path loss
- Attenuation
- Interference

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 13 of 61


Question??
- If nodes check the channel for activity before
transmitting, what happens in this case if A and C
transmit simultaneously to B? Why?

A B C

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 14 of 61


Hidden terminal problem (1)
- Path loss and other attenuation factors may put
two nodes out of range.
- Therefore they are hidden from each other!

A B C

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 15 of 61


Hidden terminal problem (2)
- If A begins to transmit, and a short time later C
does too, we have a collision!
- We cannot use CSMA because C is hidden from A!

A B C

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 16 of 61


Question??
- In this case, what would happen if nodes check the
channel for activity and want to communicate from
B to A and from C to D?

A B C D

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 17 of 61


Exposed terminal problem
- Now consider B transmitting to A and then C to D.
- Using CSMA C would wait until B completed…
therefore we waste bandwidth!

A B C D

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 18 of 61


Collision detection
- On a wired network, transmitter can detect collision at
receiver; results in aborted transmission.
- Low wired attenuation makes this possible; SNR at
transmitter and receiver is similar.
- We cannot make this assumption with wireless
transmission.
- Also, WSN nodes typically have simple half duplex
transceivers.
ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 19 of 61
No dedicated frequency band…
- MAC has to contend with sharing frequency band with
other systems.
- Commonly this is the 2.4GHz ISM band, used by
802.11 and Bluetooth.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 20 of 61


Traffic patterns
- MAC protocols generally are designed based on
“expected” traffic patterns.
- Constant sensing will have a consistent low bandwidth
usage.
- Event sensing will have large spikes of traffic.
- The MAC protocol needs to be highly efficient in one or
both situations (application dependant).

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 21 of 61


Summarising MAC challenges
- Hidden and exposed terminal problems
- Collision detection difficult
- Lack of dedicated frequency band
- Traffic patterns

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 22 of 61


Classes of MAC protocols
- Since there are such a large number of MAC protocols
available, we cannot speak of them all… however can
loot at the general classes:
- Fixed assignment protocols
- Demand assignment protocols
- Random access protocols

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 23 of 61


Fixed assignment
- Available resources are divided between nodes in long
term fashion.
- Duration could be minutes, hours or more…
- Changes require control packets to reorganise
allocation.
- Scalability can be an issue!!
- Examples: TDMA, FDMA, CDMA.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 24 of 61


Demand assignment
- Resources are allocated on a short term basis, quite
often as a result of some data burst.
- Can be centrally controlled or distributed.
- Central control schemes (e.g. HIPERLAN/2,
MASCARA, DQRUMA) require a central node.
- Distributed systems require no central node, but can be
hard to maintain if nodes are mobile.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 25 of 61


Random access
- No node co-ordination.
- Random elements; e.g. random packet arrival, random
timing for transmission.
- CSMA protocols fall also into this category, and so we
have still the high probability of collisions.
- Energy spent on collisions is wasted and packets often
have to be retransmitted.
- How can this problem be overcome?
ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 26 of 61
Busy tone
- One way to solve collisions is the so called busy tone
- We have two different frequency channels; one for
data, and one for control.
- As soon as a node starts to receive it transmits a tone
on the control channel.
- Any nodes wanting to subsequently transmit listen for
the control channel tone first; if busy they will back off.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 27 of 61


RTS/CTS
- IEEE 802.11 implements the RTS/CTS handshake
system. C
A B D

RTS

CTS

DATA
NAV
NAV

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 28 of 61


Balancing requirements for WSN
- Conserve energy… having lots of overheads goes
against this notion!!
- Avoid collisions!
- Reduce the cases where nodes overhear data packets.
- Intelligent amounts of idle listening.
- MAC protocols designed for WSN will tackle one or
more of these issues.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 29 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 30 of 61


Aims of low duty cycle
- Avoid spending as much time in idle mode as possible.
- Reduce communication activities to a minimum.
- Both points indicate low duty cycle, and therefore
energy conservation.
- There are problems however…
- Heavy loading and competition, high latency, and sleep
phases cannot be too short or we negate energy saving.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 31 of 61


Periodic wakeup scheme

Listen period
Wakeup period

Sleep period

Time

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 32 of 61


S-MAC
- S-MAC = Sensor-MAC.
- Has mechanisms to avoid collisions, overhearing
and idle listening.
- Listen periods between neighbours are
synchronised so that data is not lost.
- During the listen period data can be transmitted
as well as received.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 33 of 61


S-MAC listen period
Listen period
Wakeup period

Sleep period

SYNC RTS CTS

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 34 of 61


S-MAC clustering
- For SYNC, S-MAC forms virtual clusters of nodes.
- This means that we have border nodes… nodes
which have to follow two schedules due to being at
the border of two clusters.
- These nodes have to expend more energy than
nodes with single schedules.
schedules

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 35 of 61


S-MAC latency and timing
- S-MAC lets nodes stay asleep, but this increases
latency.
- Can use adaptive listening to roughly half per hop
latency.
- A drawback of S-MAC is that it cannot change the
length of the wakeup period to changing situations.
- Therefore in low activity situations we have a longer
listening period than necessary.
ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 36 of 61
Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 37 of 61


Contention-based protocols
- A transmit opportunity can be taken by any
neighbouring nodes.
- If only one node tries its luck then the message will get
through onto the channel.
- If two or more neighbours try to transmit then they
have to try their luck against one another and compete.
- In unlucky cases collisions will occur and waste energy.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 38 of 61


Collisions caused by contention
- Many CSMA protocols for WSNs consider the data
harvesting case: i.e. – many nodes transmitting
data back to a handful of sink nodes.
- Event occurrences tend to create lots of
simultaneous traffic and therefore lead to collisions.
- Therefore we need measures to prevent this
this…

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 39 of 61


Saving energy
- If an event occurs, all nodes are synchronised by the event.
- Hence we can use a random delay initially to delay packets,
and put the node to sleep during the delay.
- Carrier sensing periodically… if medium busy, back off.
- Wait
W it a random
d amountt off ti
time and
d ttry again.
i
- If the maximum number of retries is met the we drop the
packet.
packet

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 40 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 41 of 61


Scheduling
- These schemes are not always directly aimed at idle
listening avoidance, but they do it implicitly and so are
useful for WSNs.
- With these protocols some sort of timing in involved in
order to schedule transmission and reception.
- Good and bad points to this type of protocol (TDMA is
one general purpose example)

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 42 of 61


The good and the bad…
- No collisions in theory…
- We don’t need any special mechanism to avoid
hidden terminals.
- Signalling traffic required to maintain schedules
via updates = energy usage.
- Time resynchronisation required frequently on
cheap nodes = energy usage.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 43 of 61


LEACH
- LEACH = (Low-energy Adaptive Clustering
Hierarchy).
- Designed to use low energy sensor nodes.
- TDMA based.
- Includes clustering; data transmission is only
between peers and cluster heads
heads, not peer-peer.
peer peer
- Therefore, energy consumption can be high.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 44 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 45 of 61


IEEE 802.15.4
- Standard finalised in October 2003 by IEEE.
- Covers physical layer and MAC layer for WPAN;
can include WSN but not limited to this!
- Covers 868-868.6MHz,
868 868.6MHz, 905-928MHz
905 928MHz and 2.4-
2.4
2.485GHz.
- 20,
20 40 and 250kbit/s respectively.
respectively
- Not the same as Zigbee (http://www.zigbee.org/)!!

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 46 of 61


Network architecture
- Consists of full and reduced function devices (FFD
and RFD)
- A device (RFD or RRD) must be associated with a
PAN co-ordinator
co ordinator (FFD).
- RFD can only communicate with FFD.
- Usually utilise a star topology.
topology
- PAN co-ordinators use peer-peer.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 47 of 61


PAN co-ordinator
- Manages a list of associated devices.
- Allocates short addresses to devices.
- Acts as a beacon (more on this later).
- Exchanges data with devices and other co
co-
ordinators.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 48 of 61


Superframe structure

Active period Inactive period


(sleep)

Contention Guaranteed
Beacon access period time slots

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 49 of 61


Beacon vs. non-beaconed
- IEEE 802.15.4 can operate in beacon or non-
beaconed mode.
- In beaconed more the PAN co-ordinator schedules
time slots so we need time synchronisation.
- In non-beaconed mode CSMA-CA is used alone for
transmission and co
co-ordinators
ordinators must always be
switched on.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 50 of 61


Beacon vs. non-beaconed
- IEEE 802.15.4 can operate in beacon or non-
beaconed mode.
- In beaconed more the PAN co-ordinator schedules
time slots so we need time synchronisation.
- In non-beaconed mode CSMA-CA is used alone for
transmission and co
co-ordinators
ordinators must always be
switched on.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 51 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 52 of 61


Bluetooth
- Here devices are organised in piconets; 1 master
with 7 slaves.
- Frequency hopping is used which requires tight
time synchronisation.
- We always need a master node so this nodes
battery can deplete quickly
quickly.
- Only 7 slaves per master… no good for dense WSN

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 53 of 61


IEEE 802.11x
- Requires nodes to always be listening, and for
them to be able to overhead for NAV setting.
- Has power saving, but not aimed at WSN type
applications.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 54 of 61


Lecture structure
- Fundamentals of MAC protocols (wireless!).
- Low duty cycle protocols
- Contention based protocols.
- Schedule based protocols.
- IEEE 802.15.4 MAC protocol.
- How about 802.11
802 11 and Bluetooth?
- Coursework information and summary.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 55 of 61


Class register
- I have noticed an odd number of people coming to
lectures, more than that currently enrolled on the
module via blackboard
- If you cannot now see the module on blackboard
could you please check your registration status!
- If you are here
here, and you know you shouldn
shouldn’tt be
please do not sign the register in future!

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 56 of 61


Summary (1)
- MAC important for co-ordinating communication,
particularly in WSN as collisions represent wasted
energy.
- Part of the data link layer if thinking in terms of
the OSI model.
- Energy conservation is key concern.
concern
- Overheads and environment influence MAC.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 57 of 61


Summary (2)
- Large number of challenges for MAC.
- Classes of MAC protocol.
- RTS/CTS in 802.11.
- Low duty cycle (S-MAC)
(S MAC)
- Contention based (CSMA)
- Scheduling (TDMA,
(TDMA LEACH)

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 58 of 61


Summary (3)
- IEEE 802.15.4 is designed for low bit rate WPAN.
- Do not confuse this with Zigbee!!
- Bluetooth and 802.11 are not really suited to WSN
applications.

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 59 of 61


Class Test
- There will be a class test in two weeks time (Tuesday
February 16th, 2010), and it will take place inside the normal
lecture period.
- It will start at 9:30 and end at 11:30, so there is plenty of
ti
time tto answer questions!
ti !
- The test will include all material taught so far, and will be
multiple choice.
choice
- It is not an open book test, and it will contribute 20% of your
odu e mark.
module a .
ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 60 of 61
Questions?
- If you have any questions, now is a good time!
- No further reading this week, just ensure you are
familiar with the concepts talked about in this
lecture
- Remember to start revising for the class test!!!

ENRECM158 – Medium Access Control (MAC) Dr Alex Mason Slide 61 of 61

You might also like