27.10.2014 Views

Wireless Communication - Zigbee, Bluetooth - IIIT

Wireless Communication - Zigbee, Bluetooth - IIIT

Wireless Communication - Zigbee, Bluetooth - IIIT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Wireless</strong> <strong>Communication</strong> -<br />

<strong>Zigbee</strong>, <strong>Bluetooth</strong><br />

Amarjeet Singh<br />

February 19, 2012


Logistics<br />

Sample exam paper on the course website<br />

Derived from mid term exam of last year – will give you an idea<br />

of what can be asked in the exam<br />

Will create projects for those who did not get it since all topics were<br />

over<br />

Will create the presentation schedule for students by this weekend<br />

2


Revision from last class - I<br />

UART<br />

What are specific example interfaces?<br />

RS-232:<br />

How do you make a minimum interface (with/without<br />

handshaking)?<br />

How will you support RS-232 with UART in your microcontroller?<br />

RS-422:<br />

How is it different from RS-232?<br />

How is it extended to support multi-device bus?<br />

Infrared:<br />

How is it different from RS-232?<br />

What bit-encodings are used in infrared?<br />

3


Revision from last class - II<br />

USB:<br />

What does a USB packet contain?<br />

What are different types of token packets?<br />

What are different types of handshake packets?<br />

What are different types of data transfers supported?<br />

How is bandwidth distribution done in USB across different<br />

types of transfers?<br />

4


Range<br />

IEEE 802 <strong>Wireless</strong> Space<br />

WWAN<br />

WMAN<br />

IEEE 802.22<br />

IEEE 802.20<br />

WiMax<br />

IEEE 802.16<br />

WLAN<br />

WPAN<br />

ZigBee<br />

802.15.4<br />

15.4c<br />

<strong>Bluetooth</strong><br />

802.15.1<br />

WiFi<br />

802.11<br />

802.15.3<br />

802.15.3c<br />

0.01 0.1 1 10 100 1000<br />

Data Rate (Mbps)


IEEE 802.15.4<br />

Approved by IEEE in 2003 with revision in 2006 for<br />

<strong>Wireless</strong> Sensor Networks<br />

Specifies only 2 OSI layers - Physical (PHY) and<br />

Medium Access Control (MAC)<br />

Only direct, single hop communication possible<br />

Two types of devices are defined:<br />

RFD - Reduced Functionality Device<br />

Contains limited features<br />

Can only communicate to FFD<br />

Requires little power, memory and processing<br />

resources<br />

FFD - Full Functionality Device<br />

Full set of features - capable to act as network<br />

coordinator<br />

Communicate to both FFD and RFD<br />

Higher power, memory and processing resources


IEEE 802.15.4 Data Transfer Models<br />

Star:<br />

Network Nodes (FFDs, RFDs) are connected to a<br />

coordinator node (FFD)<br />

Peer-to-peer:<br />

FFDs can communicate to all devices in<br />

transmissions range<br />

RFDs can talk to FFDs they are associated with


IEEE 802.15.4 Physical Layer<br />

Available in 3 frequency bands<br />

Frequency<br />

(MHz)<br />

Number of<br />

channels<br />

2450 16 250<br />

Data rates<br />

(kbps)<br />

915 10 40, 250<br />

868 1 20,100<br />

Unlicensed<br />

Availability<br />

Worldwide<br />

America, Australia<br />

Europe<br />

2.4 GHz is most commonly used<br />

Available worldwide without license<br />

Typical device (0 dB power) can transmit up to 200 meters<br />

outside and 30 meters inside


IEEE 802.15.4 MAC Layer<br />

Key MAC layer responsibilities are:<br />

Data framing: Data to be sent is encapsulated in MAC frame<br />

that is passed to RF transceiver<br />

Device addressing: Each device identified by 64-bit long MAC<br />

address<br />

Channel Sense Management (CSMA-CA): Device scans<br />

preconfigured channels and chooses one with least activity<br />

“listen before send” principle for managing access to single<br />

physical channel among multiple devices<br />

Device Association/Disassociation: Upon higher layer requests,<br />

MAC layer enters/leaves network


<strong>Zigbee</strong> Specification<br />

Two lowest layers (PHY and<br />

MAC) are equal to those in IEEE<br />

802.15.4<br />

Higher layers in <strong>Zigbee</strong> stack are<br />

specified to allow efficient<br />

communication within entire<br />

network and on the application<br />

level<br />

Routing mechanisms on network<br />

layer allow multi-hop data<br />

transmission, selection of best<br />

suitable path and rerouting<br />

Application framework provides<br />

interface to enable simultaneous<br />

execution of multiple applications


<strong>Zigbee</strong> Node Types<br />

Coordinator: Only mandatory node type in the network; Acts as root<br />

node and performs multiple network management activities<br />

Only FFD in 802.15.4 terminology can act as network<br />

coordinator<br />

Router: A 802.15.4 FFD node not acting as network coordinator;<br />

Used to extend network coverage area beyond transmission range of<br />

single device; Increase network reliability by creating additional data<br />

routing paths<br />

End device: Correspond to RFD in 802.15.4; Can directly<br />

communicate with a single coordinator/router<br />

Node addressing: Each node that joins the zigbee network gets a 16<br />

bit network address (How many bits was the MAC address?)<br />

<strong>Communication</strong> at network level is performed based on this<br />

address; Direct communication between two neighboring devices is<br />

based on MAC address


<strong>Zigbee</strong> Network Topologies<br />

Extends IEEE 802.15.4 transfer models by specifying tree and mesh<br />

topologies<br />

Star Topology: Corresponds to 802.15.4 star topology<br />

Do you need a network layer in this case?<br />

Tree Topology: Based on 802.15.4 peer-to-peer model<br />

Routers/Coordinators can have child nodes<br />

Direct communication possible in terms of parent-child<br />

Hierarchical routing without alternate paths<br />

Star Topology<br />

Tree Topology<br />

What will happen if a link fails in tree network?


<strong>Zigbee</strong> Network Topologies<br />

Mesh Topology: Based on 802.15.4 peer-to-peer model<br />

Routers/Coordinators can have child nodes<br />

Direct communication possible between any FFD (coordinator/router)<br />

in transmission range<br />

End device can only communicate with its parent<br />

Optimum and dynamic routing with alternate paths<br />

Mesh Topology


ZigBee Mesh Networking


ZigBee Mesh Networking


ZigBee Mesh Networking


ZigBee Mesh Networking


ZigBee Mesh Networking


<strong>Zigbee</strong> Application Operation - I<br />

Each application instance running on a node is a<br />

unique network entity where messages can<br />

originate/terminate<br />

Termed as endpoint and has a unique address<br />

Each node can have up to 240 endpoints - A<br />

endpoint is identified by network address of the<br />

node and its endpoint address on the node<br />

Endpoint 0 reserved for <strong>Zigbee</strong> Device Object<br />

(ZDO)<br />

This application has multiple roles - defines<br />

type of node (coordinator, router, end-point),<br />

initializes the node and participates in<br />

network creation


<strong>Zigbee</strong> Application Operation - II<br />

Binding: Process of establishing a relationship between nodes that can<br />

communicate e.g. in Home Automation, which switches control which lights<br />

Binding between two applications is specified by:<br />

Network address and endpoint of application where data is generated<br />

Network address and endpoint of receiving application<br />

Stored in a binding table (can be stored locally or on the coordinator<br />

node)<br />

Binding types:<br />

One-to-one<br />

One-to-many<br />

Many-to-one<br />

Can you think of application scenarios in light<br />

control for different binding types?


<strong>Zigbee</strong> Operation - I<br />

Network is initialized by the coordinator who pre-configures a number of<br />

network properties :<br />

Network Depth - Maximum number of hops from coordinator to the<br />

farthest end-device<br />

What is the network depth of star topology?<br />

Maximum number of child devices allowed per router<br />

Maximum number of child routers


<strong>Zigbee</strong> Operation - II<br />

Forming a zigbee network by the coordinator<br />

Search for a suitable radio channel<br />

Start the network assigning a PAN ID to the network - can be predetermined<br />

or obtained dynamically<br />

Assigns itself the network id of 0x0000<br />

Ready to respond to queries from other devices<br />

Join process by other nodes:<br />

Search for network: Scan the available channels and find operating<br />

networks (separated by their PAN IDs)<br />

Select parent: from (possibly) multiple routers and coordinator in<br />

range<br />

Send join request<br />

Accept or reject join request (by the coordinator/routers)


<strong>Zigbee</strong> Operation - III<br />

Message propagation:<br />

Message contains two destination addresses - Address of final<br />

destination, Address of next hop node<br />

Are any of these obvious for any network topology?<br />

Route discovery mechanism<br />

Route discovery broadcast is sent by parent router of source end<br />

device - Contains the network address of destination end device<br />

All routers receive the broadcast<br />

Parent router of destination end device replies back to parent router of<br />

source end device<br />

As the reply traverses back, the hop count and signal quality measure<br />

for each hop are recorded - Each router in the path can build a routing<br />

table containing best path to destination end device<br />

Eventually each router in the path will have entry in the routing table


<strong>Zigbee</strong> Network Reliability<br />

<strong>Zigbee</strong> employs a range of techniques for reliable communication<br />

Channel Selection: On initialization, channels with least activity are<br />

selected<br />

CSMA-CA (Listen Before Sending): Before transmitting, node listens to<br />

the channel to check if it is clear<br />

Data coding: Applies a coding mechanism ensuring higher probability<br />

of successful transmission even in case of simultaneous transfer<br />

Acknowledgements: Receiving device acknowledges the successful<br />

receipt of a message; retransmission if ack is not received in time<br />

Route discovery: In mesh network, possibility of finding an alternate<br />

route if the default route is down<br />

Several mechanisms to ensure security:<br />

Access control lists: Only pre-defined nodes can join the network<br />

128-bit AES based Encryption<br />

Message freshness timers: Timed-out messages are rejected,<br />

preventing message replay attacks<br />

Can you give an example of replay attack?


Radio Characteristics Comparison<br />

ZigBee technology relies<br />

upon IEEE 802.15.4, which<br />

has excellent performance<br />

in low SNR environments


Advanced Metering Application


Building/Home Automation


<strong>Bluetooth</strong> Characteristics (I)<br />

Short range radio links intended to replace cables<br />

No line of sight required unlike IrDA<br />

Short range: 0-30 feet (10 meters) with power consumption of 4<br />

dBm (2.5 mW)<br />

Distance can be increased by amplifying the power<br />

Operates in the unlicensed band at 2.4 GHz also used by other<br />

devices such as 802.11, garage door openers, microwave etc.<br />

Higher probability of interference<br />

<strong>Bluetooth</strong> channel is divided into time slots each 625 uS in length<br />

Devices hop through these timeslots making 1600 hops per<br />

second


<strong>Bluetooth</strong> Characteristics (II)<br />

Uses 79 channels in the frequency range 2.402 - 2.480 GHz<br />

Uses Frequency Hop Spread Spectrum (FHSS) to avoid<br />

interference<br />

Transmitter hops between available frequencies according to specified<br />

algorithm<br />

Transmitter operates in sync with receiver<br />

A short burst of data is transmitted on a narrowband<br />

Transmitter then tunes to another frequency and transmits again -<br />

capable of hopping its frequency over a given bandwidth several times a<br />

second<br />

Requires much wider bandwidth than required to transmit the same<br />

information using one carrier frequency


<strong>Bluetooth</strong> Characteristics (III)<br />

Supports two kinds of links<br />

Asynchronous Connectionless (ACL) for data transmission<br />

Synchronous Connection Oriented (SCO) for audio/video<br />

Maximum effective rate around 700 kbps in asymmetric ACL link<br />

Symmetric ACL allows data rates of around 400 kbps


Piconets<br />

Nodes can assume the role of master or slave<br />

One or more slaves can connect to a master, forming a piconet<br />

The master sets the hopping pattern for the piconet, and all<br />

slaves must synchronize to that pattern: All units share the same<br />

channel<br />

Maximum of 7 slaves controlled by a master (How many<br />

address bits are required?)<br />

<strong>Bluetooth</strong> radios are symmetric - same device can act as both<br />

master and slave<br />

Slaves are not allowed to talk to each other directly<br />

Other operational states (low power)<br />

Parked: Device does not participate in the piconet,<br />

synchronized to the master and can be quickly reactivated<br />

Standby: Device does not participate in the piconet,<br />

occasionally monitoring, not synchronized


Operational States<br />

Operational States<br />

A piconet<br />

Master<br />

S<br />

SB<br />

SB<br />

Slave<br />

Parked*<br />

M<br />

P<br />

Standby*<br />

S<br />

* Low power states<br />

S<br />

SB<br />

S


Forming a Piconet (I)<br />

• Initially, devices know only about themselves<br />

• No synchronization<br />

• Everyone monitors in standby mode (performs inquiry or page<br />

scan for 10 ms every 1.28 seconds<br />

• Power consumption in standby mode is reduced by over 98%<br />

• All devices have the capability of serving as master or slave<br />

D<br />

E<br />

F<br />

A<br />

H<br />

C<br />

B<br />

G<br />

• Devices in this illustration are in the same mode but are not<br />

synchronized or coordinated - listening at different times and on<br />

different frequencies


Forming a Piconet (II)<br />

• Unit establishing the piconet automatically becomes the master<br />

• It sends an inquiry to discover other devices out there<br />

• Inquiry procedure: Enables a device to discover which devices are<br />

in range and determine the addresses and clocks for devices<br />

• Paging procedure: Establishes an actual connection; only<br />

bluetooth device address is required to setup the connection<br />

• Master and slave exchange packet using channel access code<br />

and master clock<br />

• Addressing<br />

• Active devices are assigned a 3-bit active member address<br />

(AMA)<br />

• Parked devices are assigned an 8-bit parked member address<br />

(PMA)<br />

• Standby devices do not need an address


Inquiry<br />

Note that a device can<br />

be “Undiscoverable”<br />

D<br />

F<br />

H<br />

G<br />

M<br />

N<br />

O<br />

J<br />

E<br />

I<br />

A<br />

K<br />

C<br />

B<br />

L<br />

P<br />

Q<br />

10 meters


States<br />

standby<br />

disconnected<br />

detach<br />

inquiry<br />

page<br />

connecting<br />

Transmit<br />

AMA<br />

Connected<br />

AMA<br />

active<br />

Park<br />

PMA<br />

Hold<br />

AMA<br />

Sniff<br />

AMA<br />

low power


Connecting to a Piconet<br />

• Device in standby listens periodically<br />

• If a device wants to establish a<br />

piconet, it sends an inquiry,<br />

broadcast over all wake-up carriers<br />

• It will become the master of the<br />

piconet<br />

• If inquiry was successful, device<br />

enters page mode<br />

• Devices in standby may respond to<br />

the inquiry with its device address<br />

• It will become a slave to that<br />

master<br />

standby<br />

Transmit<br />

AMA<br />

Park<br />

PMA<br />

inquiry<br />

Hold<br />

AMA<br />

page<br />

Connected<br />

AMA<br />

Sniff<br />

AMA


Page and Connect States<br />

• After receiving a response from<br />

devices, the master can connect to<br />

each device individually<br />

• An AMA is assigned<br />

• Slaves synchronize to the hopping<br />

sequence established by the<br />

master<br />

standby<br />

inquiry<br />

page<br />

• In active state, master and slaves<br />

listen, transmit and receive<br />

• A disconnect procedure allows<br />

devices to return to standby mode<br />

Transmit<br />

AMA<br />

Park<br />

PMA<br />

Hold<br />

AMA<br />

Connected<br />

AMA<br />

Sniff<br />

AMA


Low Power States<br />

• Sniff state<br />

• Slaves listen to the piconet at a<br />

reduced rate<br />

• Master designates certain slots to<br />

transmit to slaves in sniff state<br />

standby<br />

• Hold state<br />

• Only internal timer is running<br />

• Slave stops ACL transmission, but<br />

can exchange SCO packets<br />

Transmit<br />

AMA<br />

inquiry<br />

page<br />

Connected<br />

AMA<br />

• Park state<br />

• Slave releases its AMA<br />

• Still FH synchronized and wakes up<br />

periodically to listen to beacon<br />

Park<br />

PMA<br />

Hold<br />

AMA<br />

Sniff<br />

AMA


Scatternets (I)<br />

• Piconets with overlapping coverage use different hopping<br />

sequences<br />

• Collisions may occur when multiple piconets use the same<br />

carrier frequency at the same time<br />

• Higher probability of collision with more piconets<br />

• Devices can participate in multiple piconets simultaneously,<br />

creating a scatternet<br />

• A device can only be the master of one piconet at a time<br />

• A device may serve as master in one piconet and slave in<br />

another<br />

• A device may serve as slave in multiple piconets


Scatternets (II)<br />

D<br />

F<br />

H<br />

G<br />

M<br />

N<br />

O<br />

J<br />

E<br />

I<br />

A<br />

K<br />

C<br />

B<br />

L<br />

P<br />

Q

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!