Iotivity – Connecting Things in Iot
Total Page:16
File Type:pdf, Size:1020Kb
IoTivity – Connecting Things in IoT Ashok Subash Agenda Overview of IoT, OIC & IoTivity IoT Stack, Topologies & Protocol IoTivity Architecture Programming IoTivity Core APIs Programming IoTivity Service APIs Demo 2 Overview Internet of Things – What is it? The Internet of Things is the network of physical objects that contains embedded technology to communicate and sense or interact with the objects' internal state or the external environment.* Smart Energy Vehicle, Asset, Person, Agriculture Pet Monitoring & Consumption Controlling Security & Surveillance M2M & Wireless Internet of Things Building Sensor Network Management Telemedicine & Wearables & Smart Home Healthcare Things & Cities 4 *Gartner, July 2014 What is making IoT possible? • H/W Miniaturization & Lower BOM Cost • Advancements in Sensor Technology • Low Power Connectivity Technologies • IP as key Interoperability Protocol • Devices ability to run on battery for longer duration (> 5 years) 5 What is hindering IoT? • Non IP based standards technology resulting in limited Interoperability • Proprietary Protocols & Technologies • Licensing issues • Companies creating “Closed Ecosystem” (Zero or limited Interoperability with other Vendor devices) • Low adoption of Open Standards by various Industry Consortiums • Security & Privacy concerns • Dilemma in “Ownership” of Data from variety of IoT devices • Lack of Strong Certification for ensuring Protocol & Application Profile Interoperability Need Standards & Reference Implementation which cater to these issues 6 OIC & IoTivity • Open Interconnect Consortium (OIC) • Founded by Leading Technology Companies including Cisco, GE, Intel,, MediaTek & Samsung • Defines standards for connectivity requirements • Ensures interoperability of billions of Internet of Things (IoT) devices. • IoTivity • An open source software framework implementing OIC Standards • Ensures seamless device-to-device connectivity to address the emerging needs of the Internet of Things. OIC IoTivity (Standards) (Open Source) 7 Key Focus of OIC • OIC Standards addresses multiple vertical domains including Home Automation, Automotive, Enterprise, HealthCare, Industrial scenarios • Initial focus on Smart Home & Office solutions • Adopt Open Standards like IETF when applicable & standardize on areas, not addressed http://openinterconnect.org/ 8 Key Focus of IoTivity • Open Source Framework implementing OIC Standards • Licensed under Apache License Version 2.0 • Available on TIZEN, Android, Arduino, Linux(Ubuntu) Platforms • Provide APIs at 2 Levels • IoTivity Base • IoTivity Services 9 TIZEN IoT Ecosystem IoT Cloud & Analytics IoT Communication Protocols & Framework OS Platform TIZEN Multi Platform Profile H/W ARTIK 1 ARTIK 5 ARTIK 10 10 IoT Stack, Topologies & Protocol IoT Technology Stack – End to End - Executive View* Identity & Security PRODUCT CLOUD External Integration Information with Smart Product Applications Sources Business Rules/Analytics Engine Application Platform Systems Tools that manage Product Data Database user authentication A Gateway and system for access, as well as information Tools that secure the product, from external integrate data connectivity, and CONNECTIVITY sources-such from smart product cloud Network Communication as weather, connected layers The Protocols that enable communication traffic, products with between the product and the cloud commodity core enterprise and energy business prices, social systems such media and as ERP, CRM PRODUCT geo mapping and PLM Product Software – that informs An embedded operating System, onboard the product capabilities software applications, an enhanced user interface and product control components Product Hardware Embedded Sensors, processors and a connectivity port/antenna that supplement traditional mechanical and electrical 12 components *Harvard Business Review – Nov 2014 IoT Technology Stack – Technical View IoT Profiles Consumer Enterprise Industrial Automotive Health Common Solution Established Protocols Security & Identity IoT Framework Standardized Profiles Interoperability Data Device Discovery Data Innovation Opportunities Transmission Management Management Necessary connectivity Security IoT Connectivity 13 OIC – Topologies OIC Client OIC Client OIC Server XMPP/ OIC Client P2P Direct STUN/ TURN/ICE OIC Intermediary Cloud Gateway Gateway Smart Device OIC Servers Remote Access Smart Appliance OIC Servers Cloud based Sensors, Wearables intelligent Services 14 Concept of Resource & RESTful Architecture GET /temperature • Client-Server • Stateless Client Server • Cache REST Principles • Uniform Interface 200 OK Application/text 25 C • Layered System 22.2 C Thermostat Resource: Any information that can be named e.g. Document, Image, a collection of other resources, non-virtual objects (Things) 15 Constrained Application Protocol (CoAP) CoAP • Open IETF Standard (RFC 7252) • Compact 4 Byte Header • UDP (Default), SMS, TCP Client Support COAP C C • Strong DTLS Security HTTP Server • Asynchronous Subscription Gateway COAP • Built-In Discovery C C COAP C Server Constrained Environment Internet 16 Constrained Environments – What is it? • Limitations on Code Size (ROM/Flash) • Size of State & Buffers (RAM) • Processing Power (CPU) Constrained • Power Consumption Nodes • User Interface & Accessibility in deployment • Low achievable bitrate/throughput • High packet loss & high variability of packet loss (delivery rate) Constrained • Highly asymmetric link characteristics Networks • Severe penalties for using larger packets • Limits on reachability over time • Lack of advanced services such as IP multicast 17 IoTivity Architecture IoTivity – High Level Architecture Application Profiles (Smart Home, Smart Health, Smart Retail, Auto) OIC Services Things Soft Sensor Notification Protocol Manager Manager Manager Plugin Mgr Service OIC Core OIC Core Resource Resource Messaging Discovery Security Messaging Discovery Security Introspection Introspection Connectivity Abstraction Connectivity Abstraction Smart Devices (OIC Clients) Thin Device (OIC Server) (Smartphone, SmartTV, SmartHub etc) (Thermostat, Motion Sensor etc) 19 IoTivity Framework – Key Functionality Functionality Description Discovery IoTivity discovery supports multiple discovery mechanisms for devices and resources in proximity and remotely Data Transmission IoTivity data transmission supports information exchange and control based on a messaging and streaming model Data Management IoTivity data management supports the collection, storage and analysis of data from various resources. Device Management IoTivity device management supports configuration, provisioning and diagnostics of devices. 20 IoTivity Module View Application Service SDK (C++, Java) Thin Block (Constrained Devices) Soft Sensor Notification Things Manager Manager Manager IoTivity Base (C SDK) IoTivity Base (C++ SDK) Resource Introspection Secure Resource Manager IoTivity Base (C SDK) Unified Connectivity Abstraction Resource Introspection Block CoAP tinydtls (libcoap) Secure Resource Manager BT BLE Connectivity Abstraction UDP/IP CoAP (libcoap) tinydtls BLE 21 UDP/IP BT Programming IoTivity Core APIs Steps involved in using IoTivity Core API Application Profiles (Smart Home, Smart Health, Smart Retail, Auto) • Registering a Resource IoTivity Services Things Soft Sensor Notification Protocol Plugin • Finding a Resource Manager Manager Manager Manager • Querying a Resource State IoTivity Base API • Setting a Resource State • Observing Resource State OIC Core Resource Messaging Discovery Security Introspection Connectivity Abstraction 23 Registering a Resource – Call Flow Resource URI Resource Type Application 1 OCPlatform::registerResource(resourceHandle, “/light/1”, “core.light”, “oic.if.baseline”, entityHandlerCb, Entity Resource Interface OC_DISCOVERABLE | OC_OBSERVABLE); Handler C++ API (SDK) Resource Property 2 OCCreateResource(resourceHandle, resourceTypeName.c_str(), resourceInterface.c_str(), resourceURI.c_str(), C API (SDK) EntityHandlerWrapper, NULL, resourceProperties); JSON/CBOR OCStack Encode/Decoder CoAP Connectivity Manager 24 Registering a Resource – Sequence Diagram ISV Server Server SDK OCStack App Wrapper ocplatform.registerResource InProcServer.registerResource OCCreateResource OCStackResult Success/Failure Success/Failure 25 Finding a Resource – Call Flow Application 1 6 OCPlatform::findResource(host, “/light/1”, connectivityType, resourceHandlerCb); C++ API (SDK) OCDoResource(resourceHandle, OC_REST_GET, “/light/1”, 0, payLoad, 2 5 connectivityType, qos, &cbData, headerOptions, numOptions); C API (SDK) CASendRequest(endPoint, &requestInfo); Sends a multicast query JSON/CBOR OCStack Encode/Decoder //Devices that matches the query answers as indicated below CoAP Connectivity Manager IoTivity IoTivity IoTivity Device Device Device 3 Multicast 26 4 Finding a Resource – System Sequence Diagram Light Light Fan Client 192.168.1.11 192.168.1.12 192.168.1.21 GET /oc/core?rt=light (multicast) GET /oc/core?rt=light (multicast) GET /oc/core?rt=light (multicast) ACK,CONTENT ACK, CONTENT 27 Finding a Resource – Sequence Diagram ISV Server Client SDK OCStack CoAP App Wrapper ocplatform.findResource client.ListenForResource OCDoResource Request via multicast Unicast Response From 192.168.1.11 wrapperAsyncCallbackFunc asyncCallbackFunc Unicast Response From 192.168.1.12 wrapperAsyncCallbackFunc asyncCallbackFunc 28 Querying Resource State [GET] OIC Client OIC Server ISV Client IoTivity Client Client Server Server IoTivity ISV Server App SDK Wrapper