Unit 4 Notes
Unit 4 Notes
Scope of IoT
Vertical
Controller
Profiles Smart Home Industrial Healthcare …
service #1 service #2
domain domain
2
Definition of various Things
• By defining resourc es of things and • By defining functions/operations
its properties of things
SetSwitch
BinarySwitch -Power(in)
-true(on), false(off)
Resources Dimming
-properties SetDimmingLevel Functions
-dimmingSetting (int) -Input & Output Parameters
-step (int) -step(in), range(in)
-range [0-100]
Brightness SetBrightness
-brightness (int) -brightness (in)
e.g., Light bulb
• Low Complexity
- Simple Resource Model
>Short URI (Late Binding w/ resource type defined)
>Broad and Shallow Hierarchy
4
Support of Multiple Verticals
• Legacy vertical services usually designed as silos
Home Health Domain → No common way to communicate among them
Insulin level low!
Need Help! …
Health Home Industrial
5
Interoperability
• Full interoperability from the conne ctivity layer up to the service layer is
the only way to truly guarantee a satisfactory UX
• Interoperability at the Conne ctivity and/or Platform layer only provides
partial interoperability which can ultimately lead to fragmentation
6
Interoperability & Certification
• Conformanc e test -Each device proves conformanc e to specifications
• Interoperability test -Each device prov es interoperability with other devices
Conformance
Test
Certificate Issue
CERTIFIED & Logo Licensing
Device under Test Interopera bility
Prerequisites: Test
Dep end ency Certific ation
(e.g. Connectivity)
• Certification Scope
Tested
Optional Tested
Open
Optional Mandatory Optional
Optional
Open (in spe c, c ert & committed Spec
Sourc e Spec
Sourc e in Open Source Project) Fe atures
Fe atures Fe atures
Fe atures
RESTful
Architecture
Common Certification
Platform Program
CoAP for
Full Stack
Constrained
Interop. Test
Devices
8
OIC Key Concepts (1/2)
9
OIC Key Concepts (2/2)
10
OIC Structure
OIC
Board of Directors
Standard IoTivity
Specification & Certification Open Source Project
Infrastructure
• Core Framework
• Security
• Remote Access
• Certification Test Plans and Test Cases
Resourc e Model
• Resource Specification (Domain agnostic)
20
OIC Roles
• OIC Client
– i) Initiate an transaction (send a request) & ii) access
an OIC Server to get a service
• OIC Server
– i) host OIC Resource & ii) send a response & provide
service
13
OIC Architecture
OIC OIC
Client Server
R
Model 1
14
Organization of an OIC Device
Optional
15
Device example: light device (oic.d.light)
• Example overview
- Smart light device with i) binary switch & ii) brightness resource
• Device type: Light device (oic.d.light) [Defined by the domain]
• Associated resources
- Core resourc es: ① oic/res, ② oic/d
- Device specific resourc es: ③ Binary switch (oic.r.switch.binary),
- Other optional resources can be exposed, in this example ④ Brightness resourc e
(oic.r.light.brightness)
Example: Smart light device with 4 resources
17
OIC Core Framework Basic Operation
Discovery Operation
Discovery
-Discover access policies, device info and resources on the devices
Operation
- Get device information by retrieving resources
-Control devices by changing resources
-Observe change on the properties of resources
Conne ctivity
Connectivity Networking Transport Se curity
Security
18
Protocol Stack
Application Alternatives
JSON or XML/EXI can
Resource Model Encoding
be negotiated
Encoding (CBOR) v6 (v4 supported for
IP Version
legacy devices)
CoAP
DTLS TLS
UDP TCP
IPv6
19
End point Discovery (CoAP Discovery)
• OIC devices make use of CoAP Discovery (defined by IETF RFC 7252)
- Resource Discovery (Possible to discovery resource being hosted by device directly)
- Low processing overhead on each node
- High traffic efficiency (in terms of amount of data sent/received for discovery)
20
Encoding Schemes – JSON, XML/EXI, CBOR
• OIC resourc e is represented as sequence of bits by encoding schemes when to
transfer it over the network
• OIC supports several encoding schemes and it will be negotiated and accepted by
OIC Server when OIC Client requests
• OIC has mandated CBOR as the default encoding scheme
JSON XML/EXI CBOR
Description - Lightweight, text- - Binary - Concise binary obje ct
based, language- compression representation based on
independent data standard for XML JSON data model
interchange format
Standard IETF RFC 7159 W3C Efficient XML IETF RFC 7049
Interchange Format 1.0
21
Collection Resources
1/13/2016 22
Resource Directory
/oic/res
Multicast
OIC
Group
Device D
1/13/2016 23
Scenes/Rules/Scripts (1 of 3)
• Overview
• Mechanisms for automating certain operations
• Rules, Scripts and Scenes can be grouped and reused
• Scenes
• A static entity that stores a set of defined resourc e property
values for a colle ction of resourc es.
• Provide a mechanism to store a setting over multiple OIC
Resourc es that may be hosted by multiple separate OIC
Servers.
• Once set up, can be used by multiple OIC Clients to recall a
setup
1/13/2016 24
Scenes/Rules/Scripts (2 of 3)
• Rules
• A logical “if then” statement
• Consists of a rule condition and a Rule Member (a script)
• The rule condition is an evaluation criterion which can include
evaluation of the value of a sensor on an OIC Server
• When the evaluation criterion is evaluated true then the Rule
Members are set to a specific determined value
• A rule condition is evaluated when one of the observed
resourc es in the rule condition changes
1/13/2016 25
Scenes/Rules/Scripts (3 of 3)
• Scripts
• A programmatic element that can be used to incorporate conditionals,
delays, loops and other programmatic devices, including reading and
writing scenes
• Scripts can consist of a set of steps that are executed either upon meeting
the conditions of a rule or as part of another script, in order to automate
tasks
• Scripts can also be used to set a scene to a specific value
• A Script is realized as the set of Rule Members that are executed when a
rule condition holds true
• Summary
• Sc enes are bundled user settings
• Scripts are automated background tasks
• Rules are conditional statements that execute scripts when the condition is
true
1/13/2016 26
Block Transfer with CoAP Messaging
1/13/2016 27
Messaging Protocol Negotiation
1/13/2016 28
CoAP Serialization over TCP
1/13/2016 29
OIC Specification Overview
Smart Home Device and Resource Specification
OIC Resourc e
• Defined by resource identifier: standardized name of the
resourc e
• List of mandatory properties per resourc e
• List of allowed actions (read/readwrite/..) per resource
1/13/2016 32
Vendor extensions
1/13/2016 33
Tooling
• SHTG defines all resource schemas using JSON, all resource APIs
using RAML
• SHTG developed Python based tool chain that auto-generates
specification text based on the RAML and JSON that is defined
per resourc e.
• Capabilities provided by the tooling include:
- Auto validation of the RAML against RAML syntax rules
- Auto validation of the JSON schemas against JSON Draft-04 rules
- Auto valid ation of all example JSON against the applica ble JSON
schemas
High confidence level in the validity of the resource definitions
Ability to simulate all resources
1/13/2016 34
Specifications
35
Device Specification
• Contains profiles of
• Core specification
• security specification
36
Resource Specification
37
Smart Home Use Cases
• Selected key enabling use cases to scope activity
Use Case Priority
Indoor Environment Control
Cloud
Lighting control
OIC OIC
Energy Saving Washer/Dryer 1
OIC
Energy Management 3
Remote Acc ess for Devic e Control
Smart watch notify and control 6 2
Smart Video Environment 1 Smart
Smart Home Offic e Phone
OIC Gateway OIC
3
Smart Garage
Device Grouping and Control 1 Control proximal OIC Devices
Multi player gaming
7 2 On board new Devices
Smart watch gaming on TV
3 Control remotely with an OIC Client
Fire safety monitor and Notify 4
Keyless Entry
2
Home Security
Health Monitor and Notify 5 38
Indoor Environment Control
Smart device
WAN
Network
(Cloud)
LAN
Network
(Home)
Home GW
Windows
Smart device
A/C
Temperature Humidity
51
Lighting Control
Smartphone
WAN
Network
(Cloud)
LAN
Network
(Home)
Home GW
Lighting
Lighting
Smartphone
Lighting
40
Energy-saving washer/ dryer
Smart device
WAN
Network
(Cloud)
LAN
Network
(Home)
Home GW
Smart device
Washer
Dryer
41
Energy Management
42
Remote Access Device Control
43
Keyless Entry
WAN
Network Smartphone
(Cloud)
LAN
Network
(Home)
Home GW
Door lock
Smartphone
Door locks
44
Home Security
45
Health Monitor & Notify
WAN
Network
(Cloud)
LAN
Network
(Home)
Home GW
Smartphone
46
Smart Home Device Type
Device Type Minimum Resource Set Device Type Minimum Resource Set
Resource Types are Conditionally Mandatory. If an OIC Server hosts an OIC known resource then it shall follow all normative
requirements in the Resource Specification applicable to that Resource. 61
OIC Bridge - Background & technical need
• There are many different IoT standards out there
• There are many different vendor solutions out there
Hence it would be good for OIC if OIC could use these devices and
create a (vendor defined) bridge to these non-OIC devices.
Goal:
• To represent non OIC devices by means of a bridge as an OIC server on
the network.
Conceptual:
• Bridge establishes an OIC stand ardized north bridge so that all OIC
clients can use the bridged devices.
• The south bridge will be vendor/implementation specific: it uses the
protocol defined by the bridged device.
(for example: it needs to realize Philips Hue APIs if a Hue light is bridged)
50
OIC Bridge - Definition
• An OIC smart home bridging device is a device that represents one or more other non-OIC devices
as OIC Smart Home Devices on the network.
• The represented devices themselves are out of the scope of OIC. The bridging (that is, how the
bridge communicates with the non-OIC devices) is implementation and vendor specific.
• The only difference between a ‘regular’ OIC Device and a bridged device is that the latter is
encapsulated in an OIC Smart Home Bridge Device.
• An OIC Smart Home Bridge Device shall be indica ted on the network with an “rt” of
“oic.d.bridge”. When such a device is discovered the exposed resources on the OIC Smart Home
describe the devices that are being bridged.
Bridge Device
Entity
51
Bridge Device example: bridge (oic.d.bridge)
baseURI: 100.0.0.1:5683/0
oic/res
oic/d (oic.d.light)
OIC bridge device
Binary switch
baseURI: 100.0.0.1:5683
oic/res
oic/d
OIC fan device
baseURI: 100.0.0.1:5683/1
oic/res
oic/d (oic.d.fan)
Binary switch
52
Bridging relationship with oic /res
/oic/res
/oic/d
[
{"di": "bridge_device_id",
{
"links": [
"n": "myRoomBridgeDevice",
{ "href": "/oic/d",
"rt": “oic.d.bridge",
"rt": "oic.d.bridge",
"if": "oic.if.r",
"if": "oic.if.r",
“di": “bridge_device_id“,
"rel": "hosts"}]},
"icv": "oic.1.5“,
}
{"di": "light_device_id",
"links": [
{ "href": "0/oic/d",
"rt": "oic.d.light",
"if": "oic.if.r",
"rel": “contains external"},
{ "href": "1/myLightSwitch",
"rt": "oic.r.switch.binary",
"if": "oic.if.a",
"rel": “contains external"}]},
{"di": "fan_device_id",
"links": [
{ "href": "1/oic/d", /oic/d
/oic/d
"rt": "oic.d.fan",
"if": "oic.if.r", { {
"n": "myRoomLightDevice", "n": "myRoomFanDevice",
"rel": “contains external"}, "rt": “oic.d.light", "rt": “oic.d.light",
{ "href": "1/myFanSwitch", "if": "oic.if.r", "if": "oic.if.r",
“di": “light_device_id“, “di": “fan_device_id“,
"rt": "oic.r.switch.binary", "icv": "oic.1.5" "icv": "oic.1.5"
"if": "oic.if.a", } }
54
To Cross a Boundary We Must Define the Endpoint
OIC Device • An OIC d evic e is the endpoint
• ...more spe cifically it is the OIC
resourc e layer
• OIC resourc es define how
device capabilities are exposed
to other OIC devices
• Resourc es are acc essed
securely through a secure
channel such as DTLS
• End-to-end message encryption,
integrity and replay protection
• OIC does not define endpoint
hardening techniques
• Resource layer hardening is
implied
55
Secure Resource Manager (SRM)
OIC Device
OIC Applic ation
56
Ownership Transfer and Bootstrapping
• Devices typically ship from a manufacturer in an “un-owned” state
• The user does some magic to affect taking ownership of the device,
using an Onboarding Tool (OBT)
Take over responsibility of the device and relieve manufacturer of any
liability due any actions the devic e may take under user’s ownership
• Ownership transfer creates a relationship between an OIC device and
an OBT.
The relationship is defined through esta blishment of an Ownership
Credential and a set of ownership-complete states
1/13/2016 57
Ownership Transfer and Bootstrapping
• Security Spec Defines Several Ownership Transfer Methods (OTM):
• Just-Works, DECAP, Random-PIN, Manufacturer Certificates
• Also allows Vendor Specific Method
• All OTMs are optional for an OIC device to implement, but it is
mandatory to support at least one among Just-Works, DECAP,
Random-PIN or Manufacturer Certificates.
• (We will need to be able to test all for certification ultimately)
• Might change in the future spe c
• OTMs differ in:
• How a devic e esta blishes trust
• How the physical owner’s “intent” is proved
• What cipher suites are used
• OTMs should bring the devic e to a well defined state
1/13/2016 58
Secured vs. Un-secured
1/13/2016 59
Message Integrity and Confidentiality
1/13/2016 60
Access Control
1/13/2016 61
Access Control : example
/oic/sec/acl {
"Subject": ”switch1",
"Resource": "/light",
Subject: d evic e / group or role "Permission": "00000100", <update>
"Period": " ",
Resource(s): one or more URN "Re currenc e": " ",
"Rowner": "oic.se c.ams"
Permission: bitma p of CRUDN }
Period(s): validity periods
1/13/2016 62
Resource Access Example
OIC Client OIC Server Device3
Device1 acl0
Devic e1 /oic/d /oic/light/0
GET /oic/d /oic/d Properties: Properties:
Read
Model On-Off
[{“/ oic / d”, “Model”, “T”, “Mfg Date”, “1/1/2015”}] Mfg Date DimLevel
OIC
Stack acl1
OIC Client /oic/light/1
Device2
Device2
Properties:
x
PUT/oic/light/1 /oic/light/1
On-Off
Read, Write
DimLevel
11 – 5p
RSP 4.01 [{“/ oic / light/ 1”, “On-Off”, “Off”, “DimLevel”, “80”}]
Daily
1/13/2016 64
Credential Management : example
/oic/se c/cred {
”CredID": ”1”,
"Subje ctID": ”devic e1”,
CredID: Local short ID
”RoleID”: ” ”,
SubjectID: device or group ”CredType": "1”, <symmetric pair-wise>
”PublicData”: “”,
RoleID(s): roles this credential allows a subje ct to assert
“PrivateData ”: “ABCDEFGHIJKLMNP”,
CredType: sym/asym/cert/… "Period": ”P1W ",
PublicData, PrivateData, OptionalData
"Re currenc e": " ",
"Rowner": "oic.se c.ams"
Period: Expiration period of credential
}
Credential Refresh Method:
1/13/2016 65
OIC Specification Overview
Remote Access
80
The OIC RA Model
“RAE”
“RA-Proxy”
CoAP
XMPP-native Q R
Realm II
Realm I K L M
S
N
A F
P
G
? H
B J
C D E
1/13/2016 81
Remote Access XMPP
Servers
Application
Discovery,
RI Layer Resource Model Routing
control
SRM DM Client ACL/Cred
IP
BT BLE XMPP Media data
CA Layer
69
RA as defined in Spec 1.0
70
RA-Roadmap – Post Spec 1.0 priorities
71
Thank you!