Presentazione di PowerPoint - Micrel Lab @ DEIS

Download Report

Transcript Presentazione di PowerPoint - Micrel Lab @ DEIS

WSN Protocols
Marco Benocci, Piero Zappi
{marco.benocci, piero.zappi}@unibo.it
DEIS Università di Bologna
Outiline
 Ambient Intelligence
 Wireless Sensor Networks overview
 Motivations
 Application
 Design objectives
 WSN Protocols
 OSI layers
 Security
 Examples
 Bluetooth
 ZigBee
 6LowPAN
Amb. Int. Context-aware computing
Ambient intelligence (AmI):
Sensor augmented environment able to
sense and react with people moving and
performing activities within.
3 building blocks:
1. Ubiquitous computing: distributed data gathering and
computation
2. Ubiquitous communication: nodes communicates and exchange
their data
3. Natural interfaces: Human-Smart Environment interaction through
natural means without dedicated devices (voice, gestures etc.)
AmI enabling technologies: WSN
The smart environment must understand what is going on
Wireless Sensor Networks are the sense of the smart
environment
 Flexible
 The environment may change
 Nodes may fall
 The information required may grown
 Efficient
 Real time
 Reliable
 Deeply integrated with the environment (unobtrusiveness)
 Cheap
 Easy to deploy
 Minimum or no mainenance
Wireless Sensor Networks

Complex systems made up of a large number of
sensor nodes




Sensing
Computing
Communication
Power (batteries, scavengers)
WSN protocols
Communication unit
(ZigBee, Bluetooth
6lowpan, WiFi)
OS & algorithms
Processing unit
(MCU, DSP, FPGA)
Power Supply
Data analysis
Sensor unit
(MEMS, temperature
light, audio, video,…)
Applications (1)
 Security application
 Surveillance
 Object tracking
 Military application
 Vehicles and soldiers tracking
 Anti intrusive systems
 Environmental application
 Precision agriculture
 Biological environment monitoring
Application (2)
 Biomedical application
 Patient monitoring
 Biofeedback
 Domotic
 Home automation
 Smart space
 Commercial application
 Shipping monitoring
 Museum
 Thief prevention
Design Objectives (1)
Low power
 Reduce wireless communication
 Reduce idle listening
 Alternative sources of power
Low cost




Require low memory
Require low computational power
Self organize network
Self healing
Design Objectives (2)
Latency
 Guarantee delays
Reliability
 Redundancy
 Adaptivity
 Fault tolerant algorithm
Security
 Message encryption
 Privacy
Protocol layers
WSN protocols define
lower levels



Physical
Data Link (MAC)
Network
User application, usually, are
built over Network layer
User specific
Protocols
specific
Physical layer
Provides mechanical, electrical, functional, and procedural
characteristics to establish, maintain, and release physical
connections (e.g. data circuits) between data link entities



Communication bands and number of channels
Spreading and Modulation
Data Rate
Cost – Power consumption – Reactiveness
Physical layer

Data Rate and Modulation
Communication
Spreading
bands and number of
channels

20, 40, 250 kbps

1, 3 Mbps

54 Mbps
Data link layer (MAC)
OSI
Network
Layer 3
Data Link
MAC Protocol
Layer 2
Physical
Layer 1
Data link layer:
 Mapping network packets
 radio frames
 Transmission and
reception of frames over
the air
 Error control
 Security
Data link layer (MAC) (2)
Control access to the shared medium
 Avoid interference and mitigate effects of collisions
Hidden terminal problem
A
B
C
Exposed terminal problem
A
B
C
D
Energy efficient MAC

idle listening (to handle potentially incoming messages)

collisions (wasted resources at sender and receivers)

overhearing (communication between neighbors)

protocol overhead (headers and signaling)

traffic fluctuations (overprovisioning and/or collapse)

scalability/mobility (additional provisions)
Protocols MAC layer
Contention based protocols
…listen before send
Objective: Multiple Access with Collision Avoidance (MA-CA)
Node sense the medium for special packets or energy in order
to understand when there are no communication.
Carrier Sense Multiple Access (CSMA)
 How long device sense the channel?
 How long device remain in idle listening State?
Hidden terminal problem
A and B are
out of range
A
Carrier sense at sender
may not prevent
collision at receiver
Time
cs
B
C
cs
Hidden terminal problem
A
cs
C
Time
Blocked
Multiple Access
Collision
Avoidance
(MACA):
 Request To Send
 Clear To Send
 DATA
 Acknowledge
B
Exposed terminal problem
A
Collision avoidance can
be too restrictive!
D
cs
Blocked
Parallel CSMA transfers
are synchronized by
CSMA/CA
C
Time
cs
B
Protocols MAC layer
Schedule based protocols
Communication is scheduled in advance
 No contention
 No overhearing
Time-Division Multiple Access
 Time is divided into slotted frames
 Access point broadcasts schedule
 Coordination between cells required
 Need of global clock
Hard with WSN
constraints
Protocols MAC layer
Frame n
Frame n+1
Frame n+2
Tx
 Dedicated slot for transmission (no contention)
 Eventually low power period when no transmission is
expected
 Synchronization hard if number of nodes explodes
Network layer
Provides functional and procedural means to exchange
network service data units between two transport entities
over a network connection. It provides transport entities
with independence from routing and switching consideration

Organization of the network



Routing of packets through the network



network formation
Joining/leaving the network
Shortest path
Energy efficient
Tracing of the status of the links


Routing tables
On demand path (e.g. AODV)
Network – Structure
Not always predictable but can follow logical structure
Mesh
Cluster tree
Clustering:

Balance load among nodes




Cluster Head must compute more data
energy efficency
Adapt to network changes
Reduce data transfer
Network – Routing
Hard, due to node failure and mobility
Balance between low duty cycle and frequent path updates
Routing algorithm can be classified in three group
 Connect dominating
 Try to find the shorter path to the destination
 Energy dominant
 Life of network can be longer if energy consumption is balanced
among nodes
 Biological model
 Ants communication paradigm
Protocols – Security (1)
Security Concerns:
 Integrity - Ensure that information is accurate, complete,
and has not been altered in any way.
 Availability - Ensure that a system can accurately perform
it’s intended purpose and is accessible to those who are
authorized to use it.
 Confidentiality - Ensure that information is only disclosed
to those who are authorized to see it.
Protocols – Security (2)
Possible threats:
 Passive threats
 Eavesdrop
 Active threats
 Bogus Routing (against routing information exchanged between nodes)
 Selective forwarding (stop messages propagation)
 Sink hole (attract messages from neighbor)
 Sybil attack (forge multiple identities)
 Wormhole (send wrong information about distance in order to force
different routing path)
 HELLO floods (send packet with higher energy, attract communication)
 Acknowledge Spoofing (send fake ack messages to encourage
communication)
Protocols – Security (3)
Traditional security techniques cannot be applied due
to system constraints
 Power
 Bandwidth
 Computation
Secure protocols uses:
 Encription
 Data authentication
 Data freshness
IEEE 802 LAN/MAN
CONSTRAINTS
1.
2.
3.
4.
5.





Coverage area
QoS
Energy efficienty
Lifetime
Costs
IEEE 802.3 - Ethernet
IEEE 802.5 - Token Ring
IEEE 802.11 - Wi-Fi
IEEE 802.15 - Wireless personal area network
IEEE 802.16 - WiMAX - Broadband wireless access
IEEE 802 Performance
Power Consumption
Range VS Data rate
Mobility VS Data Rate
WPAN – 802.15
802.15.1
MAC and physical layers - based on Bluetooth v1.1.
802.15.2
Coexistence of Wireless Personal Area Networks (802.15) and Wireless Local Area
Networks (802.11)
Quantify the mutual interference of a WLAN and a WPAN
802.15.3
High Rate WPAN.
New standard for high-rate (20Mbit/s or greater) WPANs.
Besides: low power, low cost solutions, portable, multimedia applications.
802.15.4
Low Rate WPAN.
From multi-month to multi-year battery life, very low complexity.
802.15.5
Mesh Networking.
Mechanisms in the PHY and MAC layers of WPANs to enable mesh networking.
IEEE 802.15.4 – ZigBee
Motivation:
define a complete open global standard for reliable, costeffective, low-power, wirelessly networked products
addressing monitoring and control
Applications:





Building automation
Consumer electronics
Personal health care
Industrial control
Commercial control
ZigBee
Wireless Control that
Simply Works
IEEE 802.15.4 – ZigBee
 Physical layer
 Media Access Control layers
 Network layer
 Security
 Standard interface to the
application (APS, ZDO, AF)
IEEE 802.15.4 – ZigBee
Physical layer (1)
Communication over 26 channel in 3 ISM band



868 MHz Europe
915 MHz U.S.A.
2.4 GHz Worldwide
IEEE 802.15.4 – ZigBee
Physical layer (2)
Direct Sequence Spread Spectrum modulation (DSSS)
 B-PSK: 20kb/s (868MHz), 40kb/s(915MHz)
 Q-PSK: 250 kb/s (2.4GHz)
DSSS modulation work on a single channel
 quicker discovery/association
 easyer synchronization
 coexistence of multiple Zigbee networks
IEEE 802.15.4 – ZigBee
MAC layer (1)
Defines two device type
 Full Function Device (FFD)





higher cost (35kB FLASH and 200Byte RAM, 8bit CPU)
higher power (typically main powered)
full function
can join another FFD and accept association
Reduced Function Device (RFD)




low cost (22kB FLASH and 200Byte RAM, 8bit CPU)
low power consumption (typically battery powered)
no routing
join a FFD
IEEE 802.15.4 – ZigBee
MAC layer (2)
Two Roles
 Coordinator


Start the network
Associated device


join the network
accept association (if FFD)
Three topologies:

Star

Mesh

Cluster Tree
IEEE 802.15.4 – ZigBee
MAC layer (3)
Hybrid contention and scheduled based MAC
Superframe
C.A.P.
Beacon
C.F.P.
GTS
inactive
Low power state
Security is available
 Encryption: Advanced Encryption Standard (AES) 128bit
 ACL, Access Control List
IEEE 802.15.4 – ZigBee
Network layer (1)
Three device types
 Zigbee Coordinator (ZC)




Zigbee Router (ZR)




as the MAC Coordinator
starts the network
not a dedicated device
as MAC FFD Associated device
route packet
manage ZED associated with it
Zigbee End Device (ZED)



as MAC RFD associated device
no routing nor association
low power
IEEE 802.15.4 – ZigBee
Network layer (2)
Network architecture defined by 4 parameters
 Max depth
 Max child node
 Max router
 Security level
IEEE 802.15.4 – ZigBee
Network layer (3)
Addressing follow a tree structure
Routing tables keep trace of spatially close nodes
IEEE 802.15.4 – ZigBee
Upper layer (1)

APS sublayer




Application Framework (AF)





provide interface to network layer
handle data transmission
handle binding
the environment where application object are hosted
up to 240 application on a single device (EndPoints, EP)
standard descriptors to define each application
EP 255 to broadcast, EP 0 to ZDO
Zigbee Device Object (ZDO)



provide functionality to interface Application Object and APS
Initialize APS, NWK and security
manage the network (discovery, binding, ecc.)
IEEE 802.15.4 – ZigBee
Upper layer (2)
Application are modeled by means of Clusters and EndPoints
 On a single device up to 240 EP
 Different EP communicate through clusters
 Cluster are unique set of messages




2
2
4
2
devices
EP on device 1
EP on device 2
clusters
clusters
IEEE 802.15.4 – ZigBee
Upper layer (3)
Service Discovery is the process whereby a services
available on endpoints are discovered by external
devices

Uses descriptor to find which EP match device
needs
 matching input/output clusters
 matching power capabilities
 matching profile


Uses unicast and broadcast messages
Each device can start a service discovery
IEEE 802.15.4 – ZigBee
Upper layer (4)
Binding is the creation of logical link between Applications
IEEE 802.15.4 – ZigBee
Upper layer (5)
ZDO manage the role of the device within the network
 Network association and/or formation


Discovery managment


application may use ZDO API to start a discovery process
Binding managment


Access to network API to create/join a network
construct and manage binding tables
Security managment

enable/disable secure communication
IEEE 802.15.4 – ZigBee
Upper layer (6)
Profiles are an agreement on messages, message formats
and processing action that enable applications residing on
separate devices to create a distribuited application

They are the key to unify solutions




defines a common language
defines action taken on recipt of messages
allow conformance test
They are developed by ZigBee vendors
Examples:


Home control
Lighting control
IEEE 802.15.4 – ZigBee
Security (1)

128 bit Link key



shared among two device
used for unicast communication
128 bit Network key
shared among all device in the
network
 used for broadcast
communication


Includes method for:
 Key estabilishment



Key transport
Frame protection
authentication and
encryption
 freshness
 message integrity

Master key
used in high level security
application
Trust center


Device managment
IEEE 802.15.4 – ZigBee
Security (2)
Trust center
 Device trusted by all other devices in the network
 Distribute link and network keys
Play three roles
 Trust manager


Network manager


handle master key
handle network key
Configuration manager

handle link key
IEEE 802.15.4 – ZigBee


ZigBee protocol specification has been ratified in
december 2004 (pubilc since 2nd half 2005 )
Actual version (1.0) has been updated to version 1.1






public from first trimester 2007
use of new IEEE 802.15.4 – 2006
group devices
easy maintenance (information stored on neighbourn)
target broadcast (e.g. only to awake/sleep device)
Over the air setup
Further information and specification can be found at:
ZigBee Alliance home page: www.zigbee.org
IEEE 802.15 TG 4 home page: www.ieee802.org/15/pub/TG4.html
WSNs
1012
The Fringe
109
Core
Internet
106
Courtesy of Clemens Lombriser and Mirco Rossi, Wearable Lab, ETH Zurich
6LoWPAN
IPv6 over Low Power Wireless Personal Area Network

Extends IP networking into resource constrained devices
IPv6 – Link and Network layers
Adaptation layer
IEEE 802.15.4
MAC and Physical layers
6LoWPAN
IEEE 802.15.4 and IPv6 – different design choices
IEEE 802.15.4
 Address space 64 bits
 Maximum packet 128 bytes
 Low power, long lifetime
applications
 Low cost nodes (< RAM,
Flash, CPU power)
 no services provided
IPv6 



Successor of IPv4
Address space 128 bits
Minimum packet 1278 bytes
Several sevices
 Network Discovery (ND)
 Duplicate Address
Detection (DA)
 Stateless Address
Autoconfiguration (SAA)
High speed links with large
amount of data transfers
6LoWPAN
6LoWPAN adaptation layer

Stateless Address Autoconfiguration:

Host generates itself his address





Local address: unique Identifier (from data link
layer)
Global address: network prefix (from router) +
unique Identifier
No server is needed
Faster address allocation
Helpful in supporting mobility of IP devices
UI !?
6LoWPAN
6LoWPAN adaptation layer – Header compression
127 B Frame
7B
3B
MAC hdr
lowpan
dis
1B
3B
cIP cUDP
4B
108 B Payload
FCS
HC1 HC2
Mesh & Fragmentation
127 B Frame
Flat address space (the WPAN
is a subnetwork)
7B
13 B
1B
3B
 Each
node
has
its
unique
MAC
MAC hdr
lowpan
cIP cUDP
99 B Payload
 Shared global prefix

mesh
frag
dis HC1HC2
Compress in a well known context
4B
FCS
6LoWPAN
6LoWPAN adaptation layer – Routing and mobility
Router Advertisement (RA) Messages
are used to discover Neighbor and
routes
Node Registration (NR) and Node
Confirmation (NC) messages are used
to setup path and adresses
ROLL
Route Over Low-power and Lossy
Networks
http://www.ietf.org/html.charters/rollcharter.html
Bluetooth
Purpose:


Create a cable replacement standard for personal area network
Handle simultaneously both data and voice between a wide range of
devices
Scenario:
Key features:






Robustness
Interoperability
Low complexity of use
Low power (ca. 50mA while transmitting)
Low cost ($5 per device)
Small form factor (9mm^2 single chip)
History



Harald Bluetooth: 10th century Danish King, managed to unite
Denmark and Norway
Began as a private development effort at Ericsson in 1994 (radio
freq. communication between cell phone over short distance)
Bluetooth SIG (Special Interest Group) :
– Founded in 1998 by : Ericsson, Intel, IBM, Toshiba and Nokia
– Currently more than 2500 adopter companies
– Created in order to promote, shape an define the specification and position Bluetooth in the
market place

Current specification : Bluetooth 3.0 introducing ‘Alternate
MAC/PHY’ (AMP) achieving faster throughput with momentary use
of a secondary radio already present in the device.
[http://www.bluetooth.com/Bluetooth/Press/SIG/BLUETOOTH_TECHNOLOGY_TO_HARNESS_THE_SPEED_OF_80211.htm]
Protocol Stack
•
General-purpose
–
–
–
–
–
•
Widcomm
Microsoft Windows stack
Toshiba stack
BlueSoleil
Bluez
Embedded systems
–
–
BlueCore Host Software (BCHS)
BlueMagic
Physical Layer
•
2.4GHz ISM radio band
A CDMA-FH/TDD system is used:
• 79 carriers spaced 1 MHz, in the band 2400-2483,5 MHz
• the channel is divided into time slots (625us slot  1600 hop/sec)
• a TDD scheme is used where master and slave alternatively transmit.
• all Bluetooth units participating in the piconet are time- and hopsynchronized to the channel
• Automatic power control
Power classes :
• I : max output power : 100mW (20dBm) => 100m
• II : max output power : 2.5mW (4dBm) => 20m
• III : max output power : 1mW(0dBm) => 10m
•
Baseband

Enables RF to form a piconet
(physical channel shared among
several devices)





Up to 7 slaves can be connected to 1 master
A Bluetooth device can function as either a
master as or a slave.
Each piconet can only have a single master,
but a master in one piconet can be a slave in
another piconet.
This allows a dynamic topology construction
of complex scatternet.
Provides 2 different kind of
physical links, with their
corresponding packets:


Synchronous Connection-Oriented (SCO)
Asynchronous Connection-Oriented (ACL)
The SCO link is a point-to-point link
between a master and a single slave in
the piconet. The master maintains the
SCO link by using reserved slots at regular
intervals.

The ACL link is a point-to-multipoint link
between the master and all the slaves
participating on the piconet.

Host Controller Interface (HCI)
•
•
•
Uniform interface method of accessing the
Bluetooth controller capabilities
Allows the software stack on the

host processor to communicate

with Bluetooth hardware
Not used for communicating among devices
Link Manager Protocol (LMP)



Responsible for link set-up between devices, including
security functions :

Authentication

Encryption
Controls and negociates baseband packet size
Controls power modes and connection states
Logical Link Control and
Adaptation Protocol (L2CAP)

Its role is to adapt upper protocols over
the Baseband :




Multiplexing capability
Segmentation and reassembly operations
Permits to transmit and receive upper layer data packets
up to 64kB in length
Also permits per-channel flow control and retransmission
Service Discovery Protocol (SDP)



Provides a means for a Bluetooth device to
discover what services of another device are
available and determine the characteristics of those
available services
Client-Server interaction
Service records (database) provide a list of services
and associated attributes
Cable replacement & telephony
•
•
RFCOMM : cable replacement protocol
– Emulates an RS-232 control and data signals over
Bluetooth Baseband
– Provides transport capabilities for upper level
services (e.g. OBEX)
TCS : Telephony Control protocol – Binary
– Defines the call control signaling for the
establishment of speech and data calls between
Bluetooth devices
Adopted protocols




Point-to-Point Protocol (runs over RFCOMM)
TCP/UDP/IP : allows communication with any other
device connected to the Internet/WAP
OBEX : objects exchange (developed by the IrDA)
WAP : allows to build application gateways
Profiles 1/2




A Bluetooth profile is a wireless interface
specification for Bluetooth-based communication
between devices.
Set of instructions specifying how to implement a
service
Defines the functionality that a device must be able to
support in a given application
4 generic profiles :
–
–
–
–
Generic Access Profile (GAP)
Service Discovery Application Profile (DSAP)
Serial Port Profile (SPP)
Generic Object Exchange Profile (OBEX)
Profiles 2/2




























1.1 Advanced Audio Distribution Profile (A2DP)
1.2 Audio/Video Remote Control Profile (AVRCP)
1.3 Basic Imaging Profile (BIP)
1.4 Basic Printing Profile (BPP)
1.5 Common ISDN Access Profile (CIP)
1.6 Cordless Telephony Profile (CTP)
1.7 Device ID Profile (DID)
1.8 Dial-up Networking Profile (DUN)
1.9 Fax Profile (FAX)
1.10 File Transfer Profile (FTP)
1.11 Generic Audio/Video Distribution Profile (GAVDP)
1.12 Generic Access Profile (GAP)
1.13 Generic Object Exchange Profile (GOEP)
1.14 Hard Copy Cable Replacement Profile (HCRP)
1.15 Hands-Free Profile (HFP)
1.16 Human Interface Device Profile (HID)
1.17 Headset Profile (HSP)
1.18 Intercom Profile (ICP)
1.19 LAN Access Profile (LAP)
1.20 Object Push Profile (OPP)
1.21 Personal Area Networking Profile (PAN)
1.22 Phone Book Access Profile (PBAP, PBA)
1.23 Serial Port Profile (SPP)
1.24 Service Discovery Application Profile (SDAP)
1.25 SIM Access Profile (SAP, SIM, rSAP)
1.26 Synchronisation Profile (SYNCH)
1.27 Video Distribution Profile (VDP)
1.28 Wireless Application Protocol Bearer (WAPB)
Operational States
Energy management
Wibree  ULP Bluetooth

Ultra low power BT technology is designed with two implementation
options:



Enhances the current BT use cases around personal devices (e.g.
mobile phones)


Stand-alone implementation
Dual-mode implementation (extension to a Bluetooth radio)
Seamless connectivity with very low power sensor type devices
Consumes only a fraction of the power of the classic BT radio
allowing small and low cost implementations
Stand-alone IC
Dual-mode IC
Data rate
1 Mbps
1 Mbps
Range
5-10m
5-10m
Power
0.1-0.25*BT
0.75-0.80*BT
Cost
0.5-0.6*BT
1.1*BT
ZigBee vs. ULP-BT

ULP-BT focuses on low power & low cost communications
between mobile phones and small sensor devices,



Mobile phones will have several radios (many @ 2.4 GHz): ULP-BT
is cost- and power-wise optimized for sensor connectivity in this
environment,
ULP-BT ~ZigBee in terms of peak power, but due to the higher bit
rate, Wibree results in lower energy per bit @ high utilization
ZigBee focuses on home and industry automation.


Wibree does not support mesh networks as does ZigBee
ZigBee support higher range operation
Proprietary or Standard?
Integration
System-on-Chip
Proprietary narrowband
Proprietary
CC1111
CC1110
ZigBee and IEEE 802.15.4
Proprietary
CC2511
CC2431
CC2510
CC2430
CC1010
Transceiver
CC1101
CC1100
CC1020
CC1021
CC1000
CC2500
CC2420
CC2400
Transmitter
CC2550
CC1070
CC1150
CC1050
< 1 GHz
TI Product Roadmap
Sub-1 GHz and 2.4 GHz SoC Family

Frequency
2.4 GHz
Proprietary - ANT



Proprietary wireless sensor network technology
featuring a wireless communications protocol stack
that enables semiconductor radios operating in the
2.4GHz Industrial (Garmin, Nike, and Suunto)
Low computational overhead, and high efficiency
(47%) that results in low power consumption (22mA
in tx, 13.5mA in rx)
Three types of messaging: broadcast, acknowledged
and burst.
BT - Case Study
Wii-Mote
Vibe motor

BCM2042
Broadcom radio

Serial ADD-ON
(gyroscope)

ADXL330
3D accelerometer

IR sensor


Speaker
Simplifying the Architecture…
SPI/UART
RADIO (class 1/2)
- Bluecore SoC: radio + uC
- 8 Mbit Flash: store stack
70mA (PEAK)
SPI/I2C
uC
- 8 bit 8MIPS
WIRELESS NODE POWER BUDGET
ca. 10mA (PEAK)
SENSING
- Analog or digital Sensors
(i.e. accelerometer)
1mA (PEAK)
Try to connect Wii to your PC
hcitool is used to configure Bluetooth connections and send
some special command to Bluetooth devices
1.
2.
Check your hardware: hcitool dev
Scan 4 devices: hcitool scan
Scanning ...
00:19:FD:C3:28:80

Nintendo RVL-CNT-01
3.
Connect: hidd –-connect 00:19:FD:C3:28:80
4.
Disconnect: sudo hidd --unplug 00:19:FD:C3:28:80
Just 4 fun



http://johnnylee.net/projects/wii/
http://wiibrew.org/wiki/Wiimote_Driver
http://abstrakraft.org/cwiid/