Wireless Control That Simply Works Introduction to the ZigBee Application Framework Phil Jamieson, ZigBee AFG Chair BuilConn - ZigBee Workshop, Amsterdam, November 8 th, 2005 Copyright 2005 ZigBee TM Alliance. All Rights Reserved.
The ZigBee Stack Application Framework Application Object 240 Application Object 1 ZPUI ZigBee Device Object (ZDO) [On Endpoint 240] [On Endpoint 1] [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP Security Service Provider APSSE-SAP NLSE-SAP Application Support (APS) Sub-Layer NLDE-SAP Network (NWK) Layer APSME-SAP NLME-SAP MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer 2
Application Overview: Addressing & Binding Radio Z1 Switch 1 EP 3 Switch 2 EP 21 Switch unit Switch application object adds functionality to switch unit Can create relationships between applications by adding bindings Lamp application object adds functionality to lamp unit EP = Endpoint Lamp unit Radio Z2 Lamp Lamp Lamp Lamp 1 2 3 4 EP 5 EP 7 EP 8 EP 17 3
Application Overview: Transporting Clusters Radio Z1 Switch 1 EP 3 Switch 2 EP 21 Switch unit Clusters (commands) transported via bindings EP = Endpoint Lamp unit Radio Z2 Lamp 1 EP 5 Lamp 2 EP 7 Lamp 3 EP 8 Lamp 4 EP 17 4
Application Overview: Indirect Transmission Radio Z1 Switch 1 EP 3 Switch 2 EP 21 Switch unit Radio Z0 ZigBee coordinator EP = Endpoint Lamp unit Radio Z2 Lamp 1 EP 5 Lamp 2 EP 7 Lamp 3 EP 8 Lamp 4 EP 17 5
The Application Support Sub-Layer Application Framework Application Object 240 Application Object 1 ZPUI ZigBee Device Object (ZDO) [On Endpoint 240] [On Endpoint 1] [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP Security Service Provider APSSE-SAP NLSE-SAP Application Support (APS) Sub-Layer NLDE-SAP Network (NWK) Layer APSME-SAP NLME-SAP MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer 6
APS Service Primitives Data service APSDE-DATA.request APSDE-DATA.confirm APSDE-DATA.indication Management service APSME-BIND.request APSME-BIND.confirm APSME-UNBIND.request APSME-UNBIND.confirm 7
Request to Transmit Data APSDE-DATA.request ( DstAddrMode, DstAddress, DstEndpoint, ProfileId, ClusterId, SrcEndpoint, asdulength, asdu, TxOptions, DiscoverRoute, RadiusCounter ) Not present, 16-bit or 64-bit According to DstAddrMode Target endpoint: 0x00-0xff Profile to which this command belongs Cluster being transported Source endpoint: 0x00-0xfe The length of asdu The application data Security, NWK key, acknowledgement select Route discovery override Broadcast radius (broadcast transmissions only) 8
Notification of the Arrival of Data APSDE-DATA.indication ( DstEndpoint, SrcAddrMode, SrcAddress, SrcEndpoint, ProfileId, ClusterId, asdulength, asdu, WasBroadcast, SecurityStatus ) Target endpoint on this device: 0x00-0xfe Not present, 16-bit or 64-bit According to SrcAddrMode Originator endpoint: 0x00-0xff Identifier of the profile from which the frame originated Cluster being received The length of asdu The application data Whether the transmission was broadcast Unsecured, NWK key or link key 9
General APDU Frame Format Depending on indirect addressing mode Not included with command frames Not included with command frames Depending on indirect addressing mode Octets:1 0/1 0/1 0/2 0/1 Variable Frame Control Destination endpoint Cluster identifier Profile identifier Addressing fields Source endpoint Frame payload APS header APS payload 10
Frame Control Field Data, command or acknowledgement frame Source/destination endpoint inclusion control Acknowledgement request control Bits:0-1 2-3 4 5 6 7 Frame type Delivery mode Indirect address mode Security Ack. request Reserved Normal unicast, indirect addressing or broadcast transmission Frame security control 11
Binding Link Creation/Removal APSME- (UN)BIND.request ( SrcAddr, SrcEndpoint, ClusterId, DstAddr, DstEndpoint ) 64-bit IEEE address Source endpoint: 0x01-0xff Source cluster to (un)bind with destination 64-bit IEEE address Destination endpoint: 0x01-0xff 12
The Binding Table The binding table forms the mapping: (a s, e s, c s ) = { (a d1, e d1 ), (a d2, e d2 ),, (a dn, e dn ) } Where a s e s c s a di e di = the address of the device as the source of the binding link = the endpoint identifier of the device as the source of the binding link = the cluster identifier used in the binding link = the i th address of the device as the destination of the binding link = the i th endpoint identifier of the device as the destination of the binding link 13
The Application Framework Application Framework Application Object 240 Application Object 1 ZPUI ZigBee Device Object (ZDO) [On Endpoint 240] [On Endpoint 1] [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP Security Service Provider APSSE-SAP NLSE-SAP Application Support (APS) Sub-Layer NLDE-SAP Network (NWK) Layer APSME-SAP NLME-SAP MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer 14
Data Types Data type No data Unsigned 8-bit integer Signed 8-bit integer Unsigned 16-bit integer Signed 16-bit integer Semi-precision Absolute time (s) Relative time (ms) Character string Octet string Data length (octets) 0 1 1 2 2 2 4 4 Defined in 1 st octet Defined in 1 st octet 15
Descriptors Name Mandatory/ Optional Description Node M Type and capabilities of the node (one per device) Node power M Node power characteristics (one per device) Simple M Device descriptions contained in the node (one per active endpoint) Complex O Further information about the device descriptions (one per active endpoint) User O User-definable information 16
Node Descriptor Field name Length (bits) Description Logical type 3 ZigBee coordinator, router, end-device Frequency band MAC capability flags Manufacturer code 5 8 16 868MHz, 915MHz, 2.4GHz Alternative PAN coordinator, MAC logical device type, power source, receiver on when idle, security capability Allocated by the ZigBee Alliance Maximum buffer size 8 Max size of data passed to application 17
Simple Descriptor Field name Length (bits) Description Endpoint 8 The endpoint to which this descriptor refers Application profile ID 16 The profile implemented on this endpoint Application device ID 16 The device description implemented on this endpoint Application device version 4 Version 1.0 Application flags 4 Complex, user descriptor available Application input cluster count 8 Number of input clusters Application input cluster list 8*i List of supported input clusters Application output cluster count 8 Number of output clusters Application output cluster list 8*o List of supported output clusters 18
General AF Frame Format Number of transactions, n, included in the frame Key Value Pair (KVP) or Message (MSG) Bits:4 4 Variable Variable Variable Transaction count Frame type Transaction 1 Transaction n Where each transaction, Transaction i, has the format: Bits:8 Transaction sequence number Transaction header Variable Transaction data Transaction payload Transaction sequence number used to tie response frames to request frames 19
General KVP Command Frame Format Appropriate data type (See Data Types) Defined in appropriate device description Dependent on command, data type and device description Bits: 4 4 16 0/8 Variable Command type identifier Attribute data type Attribute identifier Error code Attribute data Set Event Get with acknowledgement Set with acknowledgement Event with acknowledgement Get response Set response Event response Success Invalid endpoint Unsupported attribute Invalid command type Invalid attribute data length Invalid attribute data Application defined error 20
MSG Frame Format Bits: 8 Message length Variable Message data Designed for commands which do not fit into the KVP structure Free form data No response support All transactions must be defined in the device description 21
The ZigBee Device Object Application Framework Application Object 240 Application Object 1 ZPUI ZigBee Device Object (ZDO) [On Endpoint 240] [On Endpoint 1] [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP Security Service Provider APSSE-SAP NLSE-SAP Application Support (APS) Sub-Layer NLDE-SAP Network (NWK) Layer APSME-SAP NLME-SAP MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer 22
Device & Service Discovery Commands Command Request Addressing Response NWK address Broadcast IEEE address Node descriptor Power descriptor Simple descriptor Active endpoint Match descriptor Complex descriptor User descriptor End device announce Broadcast/unicast to ZC ZC = ZigBee Coordinator 23
Binding Commands Command Request Addressing Response End device bind to ZC Bind Unbind to ZC or Src to ZC or Src ZC = ZigBee Coordinator 24
Network Management Commands Command Request Addressing Response Network discovery Neighbour table Routing table Binding table Leave network Direct network join to ZC/router to ZC/router to ZC/router to ZC/router to ZC/router ZC = ZigBee Coordinator 25
Logical Device Types State machine description for each device type ZigBee Coordinator ZigBee Router ZigBee End Device Device initialisation Device normal operating state 26
Profiles Application Framework Application Object 240 Application Object 1 ZPUI ZigBee Device Object (ZDO) [On Endpoint 240] [On Endpoint 1] [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP Security Service Provider APSSE-SAP NLSE-SAP Application Support (APS) Sub-Layer NLDE-SAP Network (NWK) Layer APSME-SAP NLME-SAP MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer 27
Profile Classes Standard profiles For generically useful applications Developed publicly by members of the ZigBee Alliance Managed within the Application Framework Working Group Development follows the profile lifecycle Enables products to undergo logo certification so that the ZigBee logo can be used Private profiles For manufacturer specific proprietary applications Developed privately by individual manufacturers Private profiles must use a ZigBee allocated profile identifier Commercial products built using private profiles must undergo no harm testing 28
Why Do We Need Profiles? Need a common language for exchanging data Need a well defined set of processing actions Device interoperability across different manufacturers Allows solid conformance test programmes to be created Simplicity and reliability for the end users Realistic application specifications developed through OEM experience 29
Profile Development Lifecycle Pre-development PTG development Qualification & certification Gauge interest and form profile task group Develop market requirements document Develop profile specification Define compliance tests with ZQG Demonstrate interoperable implementations Profile proposal presentation Profile task group formed MRD complete Profile specification complete Compliance test cases complete Profile complete, published & ratified products appear 30
Active Standard Profiles Commercial building automation Complete building control, monitoring and energy management Heating, ventilation, air conditioning HVAC systems for improved efficiency and lower installation cost Home automation Low to high end residential systems for control of devices around the home Home control, lighting Residential lighting control allowing basic control and dimming Industrial plant monitoring Monitoring time varying attributes related to operating environment and machinery conditions 31
Cluster Library Architecture ZigBee Cluster Library ZigBee Profiles Control Lighting HVAC Sensors Industrial Security Home Automation Commercial Building Automation Industrial Plant Monitoring Automatic Meter Reading ZigBee cluster library specifies functional domains Each specification specifies the cluster sets for that functional domain Each specification defines mandatory & optional clusters, attributes, commands and functional descriptions Explicit device descriptions are not defined ZigBee profiles specifies application domains Each profile collects related elements from the cluster library into application domains Each profile defines device descriptions for each required device Each profile specifies the cluster identifiers for each cluster used from the cluster library 32
Cross-Profile Clusters General cluster for basic manipulation and common tasks Mandatory clusters for fundamental functionality Optional clusters for enhanced functionality E.g. Turning a residential sensor into a commercial sensor Proprietary extensions can be added by individual manufacturers Commercial Devices Ballast Unit Occupancy Sensor General General Load control Basic OS ctrl Ballast control Adv. OS ctrl LightSensor ctrl OccSensor ctrl Residential Devices Light Source Occupancy Sensor General Load control OccSensor ctrl General Basic OS ctrl 33
Example: Simple Lighting Control Commissioning Tool Identify Lighting Level Adjustment Device Light Sensor Configure Light Sensor Identify Light Level Notification Light Sensor Configure Lighting Device Identify Light Level Notification 34
Example: Advanced Lighting Control Lighting Level Adjustment Device Light Sensor Configure Commissioning Tool Identify Power Level Config Power fade Config Ballast Config Switch Configuration Light Sensor Light Sensor Configure Identify Light Level Notification Power Switch Identify Power On/Off Power Level Ctl Switch Config Ballast Identify Light Level Notification Power On/Off Power Level Ctrl Power Fade Ctrl Power Level Config Power fade Config Ballast Config 35
Future Standard Profiles Automatic Meter Reading Residential & commercial utility systems Low cost wireless sensor networks Agricultural sensing Environmental sensing Medical & personal health care Body area networks Fitness monitoring: home, gym, on-the-move Patient monitoring Automotive In vehicle control: vehicular & entertainment Status monitoring Others identified by ZigBee members 36
Any Questions??? 37