Top Banner
OCF/IoTivity로 사물인터넷 개발하기 KCC 2017 Joo-Chul Lee ([email protected] )
26

OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

May 22, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF/IoTivity로사물인터넷 개발하기

KCC 2017Joo-Chul Lee ([email protected])

Page 2: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Contents

OCF & IoTivity 개요- About OCF- About IoTivity

How to Build IoTivity Application- IoTivity Application Programming Procedure- Building IoTivity- Structure of IoTivity Application

Page 3: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF & IoTivity 개요• About OCF & IoTivity …

Page 4: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Why OCF?

Dilemma of current IoT world- Fragmentation, Fragmentation, Fragmentation !! (No universal language

for IoT)- Device maker

Limiting market, increasing costs- End users

Always check compatibility & interoperability

OCF’s mission- Bring “OCF products” to the market

Provides “Specifications”, “Codes”, “Certification program”- Make end users’ experience better

Seamless bridging to other ecosystems

Page 5: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF Members

Over 300 member companies…- Diamond members- Platinum members- Gold members- Nonprofit/academic members- Basic members

Page 6: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Three Pillars – OCF Approach

Specification- Defines OCF framework including standard model for IoT devices, apps, &

services to interact Stop fragmentation and increase device orchestration by creating a common

standard for IoT device connectivity

IoTivity Open Source- Delivers reference implementation of OCF framework & translation layers

for non-OCF devices Ease developers’ burden

Certification- Ensures interoperability via compliance and interop testing

Page 7: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Scope of OCF Framework

From OCF Overview, Matt Perry

Page 8: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF Resource

What is OCF resource?- In OCF world, entities are modeled as “Resource”- Entities :

Virtual object (e.g. data, logical state) Physical object (e.g. sensor, actuator)

How OCF resource is described?- Identifier: Resource Type (e.g. oic.r.temperature)- Properties: type, name, value - Resource is described in “json file”

How OCF resource is accessed?- Use URI: ocf://<authority>/<path> (e.g. ocf://192.168.1.1/room/light )

How to manipulate resource?- Use RESTful API (CRUDN: Create, Retrieve, Update, Delete, Notify)- Operations for resource is descried in “RAML file”

Page 9: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF Resource – schema example

oic.r.temperature.json

Page 10: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF Resource – RAML example

temperature.raml

Page 11: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF Resource – where can I find this info?

oneIoTa- OCF’s standardized data model repository- http://www.oneiota.org- “Schema in json” & “API in RAML” for OCF resource- E.g.) temperature

https://www.oneIoTa.org/documents?q=temperature Schema: https://www.oneIoTa.org/revisions/2358 API: https://www.oneIoTa.org/revisions/2190

File materials- https://github.com/OpenInterConnect/IoTDataModels

Page 12: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

OCF application protocol

OCF adopted RESTful API- 2 Roles (Client, Server) & - 2 Messages (Request, Response) & - 5 operations (CRUDN)

OCF Client: A logical entity that accesses a Resource on a Server- Initiates a transaction (send a request)

OCF Server: A logical entity that exposes hosted Resources- Hosts resources- Sends response

CRUDN operation - Implemented over CoAP (The Constrained Application Protocol, RFC7252) by default- Delivered over UDP by default

Payload encoding- CBOR (Concise Binary Object Representation, RFC7049) is used by default

client server R

Page 13: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Putting all together

Page 14: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

IoTivity

One of 3 pillars of OCF- Implement reference implementation of OCF specifications- Open source project hosted by Linux Foundation- Apache ver 2.0 license

Features- Resource / Endpoint Discovery (based on CoAP/Multicast)- Communication (RESTful API on CoAP) with Security (DTLS)- Supports various connectivity (Wifi, Eth, BT, BLE, NFC…)- Supports various OS (Linux, Android, Tizen, Windows…)- Supports various service (Mini Plugin Manager, Simulator, CoAP-HTTP

proxy…)

IoTivity information repository- https://wiki.iotivity.org

Page 15: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

IoTivity Protocol Stack

Connectivity Layer

Resource Layer

Application Layer

Wifi, Ethernet, Bluetooth, zigbee, z-wave…TCP, UDP over IP

Session protection (DTLS)Session management (CoAP)

Core resourcesSecurity resources

Security Resource Manager (SRM)

Application specific resources

OCF Client OCF Server OCF bridge

Page 16: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

How to Build IoTivity Application• IoTivity Application Programming Procedure

• Building IoTivity

• Structure of IoTivity Application

Page 17: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Procedure of IoTivity App Programming

Step 1. Identify required Things (devices)

Step 2. Find “OCF Resource Standard Model” for Things- http://www.oneiota.org

Step 3. Choose Platform & Connectivity Technology- Linux, Windows, Android …- Wifi, Ethernet …

Step 4. Coding main logic- Server- Client

Page 18: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Building IoTivity

Getting sources- Clone GIT repository from IoTivity directly

(https://www.iotivity.org/documentation/linux/getting-started)- Get from GitHub mirror (https://github.com/iotivity/iotivity)- Get tarball from IoTivity site (https://www.iotivity.org/downloads)

How to build IoTivity - https://wiki.iotivity.org/build_for_your_system

SCONS, build tool- A python-based software construction tool, easier than autoconf/automake- Get document (http://scons.org/documentation.html)- Get instant help

scons -h scons TARGET_OS=linux –h /* get context-aware help */ scons –c /* clean up */

- Example: scons TARGET_OS=linux TARGET_TRANSPORT=IP TARGET_ARCH=x86_64

LOGGING=true BUILD_SAMPLE=ON Generally, “scons <enter>” is ok

Page 19: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Building IoTivity (cont’d)

Where is Binaries?- /<IoTivity source folder>/out/<TARGET_OS>/<TARGET_ARCH>/release

E.g) /iotivity/out/linux/x86_64/release

Where is Samples?- /<IoTivity source folder>/out/<TARGET_OS>/<TARGET_ARCH>/release/

resource/examples- /<IoTivity source folder>/out/<TARGET_OS>/<TARGET_ARCH>/release/

resource/csdk/stack/samples

APIs for IoTivity application- C++ API (1)

For rich device (i.e. Linux) Examples: ./resource/examples

- C API (2) For constrained device (i.e. arduino) Examples: ./resource/csdk/stack/samples

Application

Page 20: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Structure of IoTivity Application –Initialization

From Prototyping IoT devices on GNU/Linux, Philippe Coval

Page 21: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Structure of IoTivity Application –Registration of resource on server

From Prototyping IoT devices on GNU/Linux, Philippe Coval

Page 22: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Structure of IoTivity Application –Resource Discovery (1)

From Prototyping IoT devices on GNU/Linux, Philippe Coval

Page 23: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Structure of IoTivity Application –Resource Discovery (2)

From Prototyping IoT devices on GNU/Linux, Philippe Coval

Page 24: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Structure of IoTivity Application –Discovering from client

From Prototyping IoT devices on GNU/Linux, Philippe Coval

Page 25: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Structure of IoTivity Application –GET/POST using entity handler

From Prototyping IoT devices on GNU/Linux, Philippe Coval

Page 26: OCF bridge 표준개발현황 소개 - WordPress.com · 2017-06-18 · Three Pillars – OCF Approach Specification - Defines OCF framework including standard model for IoT devices,

Any questions?