IoT Integration Patterns, REST, and CoAP

Slides:



Advertisements
Similar presentations
Advanced Computer Networks Fall 2011
Advertisements

Low-Power Interoperability for the IPv6 Internet of Things Presenter - Bob Kinicki Low-Power Interoperability for the IPv6 Internet of Things Adam Dunkels,
BASIC CRYPTOGRAPHY CONCEPT. Secure Socket Layer (SSL)  SSL was first used by Netscape.  To ensure security of data sent through HTTP, LDAP or POP3.
Gursharan Singh Tatla Transport Layer 16-May
Impact of the Internet of Things on Computer Networks James Byars December 12, 2013 IT422 – Computer Networks Professor Tim Johnson.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.1 ISP Services Working at a Small-to-Medium Business or ISP – Chapter 7.
1 7-Oct-15 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
TCP/IP Transport and Application (Topic 6)
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
1 Seminar on Service Oriented Architecture Principles of REST.
Internet of Things Fall 2015
Voice Over Internet Protocol (VoIP) Copyright © 2006 Heathkit Company, Inc. All Rights Reserved Presentation 5 – VoIP and the OSI Model.
1 14-Jun-16 S Ward Abingdon and Witney College CCNA Exploration Semester 1 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
Low-Power Interoperability for the IPv6 Internet of Things Presenter - Bob Kinicki Low-Power Interoperability for the IPv6 Internet of Things Adam Dunkels,
11/18/2016Basic TCP/IP Networking 1 TCP/IP Overview Basic Networking Concepts.
The Internet of Things ... Babel
Application Layer Functionality and Protocols Abdul Hadi Alaidi
CompTIA Security+ Study Guide (SY0-401)
Introduction to Networks
The Transport Layer Implementation Services Functions Protocols
Chapter 9: Transport Layer
Developing IoT endpoints with mbed Client
Introduction to TCP/IP networking
Chapter 3 outline 3.1 Transport-layer services
Discussion on DDS protocol binding
CSE Retargeting to AE, IPE, and NoDN Hosted Resources
CSE Retargeting to AE, IPE, and NoDN Hosted Resources
The Client-Server Model
Transport of Media Independent HO Messages over IP
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
System Design of Internet-of-Things for Residential Smart Grid
Lecture 1: Introduction
Process-to-Process Delivery, TCP and UDP protocols
Layered Architectures
06- Transport Layer Transport Layer.
Understand the OSI Model Part 2
20th CJK UNIOT-WG (Smart IPv6 Networking)
Chapter 24: Internet of Things (IoT): Growth, Challenges and Security
TCP Transport layer Er. Vikram Dhiman LPU.
Working at a Small-to-Medium Business or ISP – Chapter 7
CS 241 Section (11/18/2010).
Chapter 3: Windows7 Part 4.
CompTIA Security+ Study Guide (SY0-401)
Working at a Small-to-Medium Business or ISP – Chapter 7
Web Of Things REST WoT Integration Patterns CoAP
Ashish Pandit IT Architect, Middleware & Integration Services
Packet Sniffing.
Transport Layer Our goals:
Topic 5: Communication and the Internet
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
WEB API.
The Internet and HTTP and DNS Examples
I. Basic Network Concepts
Working at a Small-to-Medium Business or ISP – Chapter 7
Process-to-Process Delivery:
TCP/IP Protocol Suite: Review
TCP/IP Protocol Suite: Review
Lecture 2: Overview of TCP/IP protocol
CPEG514 Advanced Computer Networkst
William Stallings Data and Computer Communications
Building A Network: Cost Effective Resource Sharing
WEB SERVICES From Chapter 19, Distributed Systems
Mobile IP Outline Homework #4 Solutions Intro to mobile IP Operation
Mobile IP Outline Intro to mobile IP Operation Problems with mobility.
Process-to-Process Delivery: UDP, TCP
Carnegie Mellon Heinz College
Transport Layer 9/22/2019.
Transport Layer Our goals:
More on Discovery and Advertisement
Presentation transcript:

IoT Integration Patterns, REST, and CoAP 95-733 Internet of Things

IoT Integration Patterns, REST, and CoAp. Direct integration Pattern Gateway Integration Pattern Cloud Integration Pattern General Notes on REST CoAp Notes on Integration Patterns from “Building the Web of Things” by Guinard and Trifa Notes from a very nice CoAp tutorial at https://www.youtube.com/watch?v=4bSr5x5gKvA 95-733 Internet of Things

Direct Integration Pattern Some Things have full internet access. These Things may provide an HTTP server running over TCP/IP and can directly connect to the internet – using, say, WiFi or Ethernet or cellular. Rasberry-Pi’s and Photon’s are examples. These may be used to implement a Direct Integration Pattern – REST on devices. 95-733 Internet of Things Thing running an HTPP server providing a REST style interface. Client Typical use case: The Thing is not battery powered and communicates with low latency to a local device like a phone. Example: Use a phone to communicate via WiFi (with WiFi router) to an HTTP server on a device. Use web sockets for publish/subscribe, e.g., phone listens for doorbell events.

Gateway Integration Pattern Some Things do not have full internet access. These Things may support only Zigbee or Bluetooth or 802.15.4. We are not sending IP packets to these devices – they are constrained. This is the Gateway Integration Pattern. 95-733 Internet of Things Gateway providing full REST API Thing providing access via non-web protocol. Client

Cloud Integration Pattern Some Things have access to the cloud and need powerful and scalable cloud support. This is the Cloud Integration Pattern. Cloud resource 95-733 Internet of Things Gateway providing full REST API May or may not use web protocols but is able to communicate with a gateway in the cloud. Client

From an add from AirVantage 95-733 Internet of Things 95-733 Internet of Things 6

REST API Design Principles Implementation Constrained user interface HTTP GET, POST, DELETE, PUT Standard status codes HTTP codes Well designed and standard URI’s (not truly a REST Req.) Naming. Well Designed URI’s representing a resource. Protocol and location. Identification of resources. Standard representations JSON or XML messages HATEOAS (Hypertext as the Engine of application state) Messages returning pointers or links for further discovery Statelessness Simple request/response required no conversational state. Easy to scale. 95-733 Internet of Things Note: REST is not the only game in town. See gRPC from Google.

A REST style request in IoT GET /basement/water/temperature 200 OK application/text 40.5 F GET /basement/water/volume 200 OK 200 G 95-733 Internet of Things Still better to use a standard message format (representations) for return values. Spend more time designing return value format.

Internet Protocol Suite Where are we? Internet Protocol Suite We are here! HTTP, Websockets, DNS, XMPP, MQTT, CoAp Application layer TLS, SSL Application Layer (Encryption) TCP, UDP Transport IP(V4, V6), 6LowPAN Internet Layer Ethernet, 802.11 WiFi, 802.15.4 Link Layer 95-733 Internet of Things 95-733 Internet Technologies 9 9 9 Carnegie Mellon Heinz College

Constrained Application Protocol (CoAp) A key IoT standard Open IETF standard since June 2014 Based on web standards, easily integrates with HTPP. Is not simply a compressed version of HTTP. Built for small, constrained, imbedded, occasionally sleeping devices. Why sleep? Some built-in reliabilty May run over 6LoWPan Use on low power, low bandwidth, lossy networks Over UDP or SMS on cellular networks DTLS for security Asynchronous subscriptions and notifications over UDP Built-in resource discovery Peer to peer or client server and multi-cast requests 95-733 Internet of Things

Recall the typical HTTP Interaction Connection oriented and synchronous TCP 3 way handshake with server HTTP GET /kitchen/light HTTP response with headers and {“setting” : “dim” } TCP 2 way termination Too much work for simple IoT applications CoAP is not a general replacement for HTTP CoAP does not support all features of HTTP 95-733 Internet of Things

CoAp is based on REST CoAP provides a request/response RESTful interaction like HTTP. Smaller messages than HTTP and with very low overhead. BLE nodes, for example, have limited memory and storage. Sensors and actuators on BLE nodes are simply CoAP REST resources. For example, to obtain a current temperature, send a GET request. To turn on/off or toggle LEDs we use PUT requests. CoAP 95-733 Internet of Things Gateway providing full REST API HTTP Battery powered device providing CoAp. Communication uses UDP over a PAN protocol, e.g., 6LoWPAN over IEEE 802.15.4 or Bluetooth Low Energy Client

CoAp Has a scheme coap:// Has a well known port. GET, POST, PUT, DELETE encoded in binary ( 1 == GET) Block transfer support. Confirmable messages requires an ack with message ID. Non-confirmable messages do not require an ack. Less reliable. Example: CoAP Client CoAP Server ----> CON {id} GET /basement/light Confirmable request <---- ACK {id} 200 Content {“status” : “on”} Piggy back response (likely in binary) 95-733 Internet of Things

CoAP Uses Timeouts over UDP CoAP Client CoAP Server ----> CON {id} GET /basement/light lost request timeout -- --> CON {id} GET /basement/light arrives <---- ACK {id} 200 Content {“status” : “on”} The {id} allows us to detect duplicates. 95-733 Internet of Things

CoAP Request/Acknowledge/Callback CoAP Client CoAP Server ----> CON {id} PUT /basement/cleanFloor Token: 0x22 Needs time <---- ACK {id} I am on it <----- CON {newID} 200 Content /basement/cleanFloor Token: 0x22 Done ----> ACK {newID} 95-733 Internet of Things

CoAP Publish/Subscribe CoAP Client CoAP Server ----> CON {id} GET /basement/light Observe: 0 Token: 0x22 <---- ACK 200 {id} Observer: 27 Token 0x22 <---- CON 200 Observe: 28 Token: 0x22 {“light” : ”off”} -----> ACK Token: 0x22 <---- CON 200 Observe: 28 Token: 0x22 {“light” : ”on”} : etc. Block transfer is similar. We may request a transfer (one block at a time). 95-733 Internet of Things

CoAP Resource Discovery Not the same as service discovery. Service discovery is at a lower level. We don’t even know if services are available or how they communicate. We might register a printer, for example, with a discovery service and find it later on the fly. With resource discovery, we know we are looking for web resources. Links are returned. HATEOAS. Links may include a rel attribute. A well known resource is used to discover other resources. Perform a GET on the well known resource. Returned content is a list of links with REL attributes. Resource directories may be used to register services. Registrations are simply POSTs with links. PUTs are used for updates. GETs for discovery. 95-733 Internet of Things