28
IoT Broker GE Internet-of-Things Service Enablement Stefan Gessler [email protected] Flavio Cirillo [email protected] Hanno Hildmann [email protected] Tobias Jacobs [email protected] NEC Laboratories Europe, Heidelberg, Germany, 2014

IoT-Broker Developers Week

Embed Size (px)

Citation preview

IoT Broker GEInternet-of-Things Service Enablement

Stefan Gessler [email protected]

Flavio Cirillo [email protected]

Hanno Hildmann [email protected]

Tobias Jacobs [email protected]

NEC Laboratories Europe, Heidelberg, Germany, 2014

Page 2

IoT Broker GE links

Documentation of the IoT Broker GE

FIWARE Open Specification: https://forge.fi-

ware.eu/plugins/mediawiki/wiki/fiware/index.php/FIWARE.OpenSpecifi

cation.IoT.Backend.IoTBroker

FIWARE/OMA NGSI interface: https://forge.fi-

ware.eu/plugins/mediawiki/wiki/fiware/index.php/FI-

WARE_NGSI_Open_RESTful_API_Specification_(PRELIMINARY)

IoT-Broker Installation Guide:

https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/IoT_Br

oker_-_User_and_Programmers_Guide

IoT-Broker User Guide:

https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/IoT_Br

oker_-_Installation_and_Administration_Guide

Page 3

Page 4

Outline

1. IoT Broker GE: Brief Introduction

• Role in FIWARE Platform

• What it does

• What it does not

• Pros and Cons

2. OMA / FIWARE Next Generation Service Interface

• General Concepts

• Interface specification & RESTful binding

3. IoT Broker GE: Interactions and Data flow

• query operation

• subscriptions

• update operation

IoT Scenario II: NGSI Native Scenario

Page 5

GE specification vs. GE implementation

Page 6

defines Generic Enabler (GE)

open specificationsGE implementation

implements

Generally in FIWARE:

In case of the IoT Broker:

Internet-of-Things

Service Enablement

Chapter

definitionIoT Broker GE

open specification

NEC IoT Broker

(open-source software)implements

Page 7

FIWARE GE:

IoT Broker

What does the IoT Broker GE do?

Organizing the information

flow for Thing-level

interaction

- execute information

queries on behalf of

applications

- finding the

resources providing

the requested

information

- collecting &

aggregating the

received information

apps

Devices Gateways other sources

Page 8

What does the IoT Broker GE NOT do?

FIWARE

GENERIC ENABLER:

IoT Broker

o The IoT Broker GE does NOTstore any actual IoT data or

configuration information.

o Any data sent to it will be

forwarded towards the Context

Broker GE (or any other pre-

configured data sink.

o possibly after translation

to higher information level

(i.e. associations)

o own data caching features

might be defined &

implemented in future versions

o Configuration information

needs to be registered at

another Generic Enabler, the

Configuration Management

(ConfMan) GE

(1) updateContext

(2) updateContext

(1) notifyContext

(2) notifyContext

Application

ConfMan GE

Page 9

Pros and Cons

1. Pro: Static metadata

• NGSI-9 offers metadata data structure for specifying metadata of the

Entity

• E.g. If a sensor is fixed in a place, the location is specified at the

registration time

2. Pro/Con: Data is not owned by the IoT Broker

• Data is managed by the NGSI devices

3. Con: More effort for the developer

• NGSI devices implementation are up to developers

Page 10

Page 11

NGSI-9/10 API specification documents

OMA-TS-NGSI_Context_Management-V1_0-20100803-C

OMA Approved Version 1.0 – 29 May 2012

- Definition of NGSI-9 and NGSI-10 operations and their parameters

- Definition of data structures to represent context information

- Only abstract definitions

OMA NGSI 10 RESTful

binding

“FIWARE NGSI 10”

- definition of resource structure and

interaction verbs

- done within FIWARE

OMA NGSI 9 RESTful

binding

“FIWARE NGSI 9”

- definition of resource structure and

interaction verbs

- done within FIWARE

FIWARE NGSI 9/10 xml schema files

- defined by FIWARE

- xml schema files for data structures and

operations of NGSI 9 and 10

- can be used for validation of NGSI xml files

Associations Concept

- how to use NGSI to express

associations between Entities

- defined by IoT Chapter of FIWARE

Page 12

FIWARE

GENERIC ENABLER:

IoT Broker

Data Model of OMA NGSI 9/10

Context

Information

=

Information about

Entities and their

attribute values

Page 13

OMA NGSI-9 and 10

OMA NGSI 10: Interface for

exchanging information about

entities and their attribute values

OMA NGSI 9: Interface for

exchanging information about the

availability of information about

entities and their attribute values

NGSI 10 Operation definitions:

- queryContext

- subscribeContext + notifyContext

- updateContext

NGSI 9 Operation definitions:

- discoverContextAvailability

- subscribeContextAvailability + notifyContextAvailability

- registerContext

133.122.44.6

abstract

interfaces

-

official

standards

of

Open

Mobile

Alliance

Page 14

NGSI 10 RESTful binding: resources (1/2)

//{serverRoot}/NGSI10

/queryContext

/subscribeContext

/updateContextSubscription

/unsubscribeContext

/updateContext

NGSI-10 operations

to be invoked by

HTTP POST

+ direct & straightforward representation of NGSI 10 operations

- complicated message bodies

- not truly RESTful

One resource per NGSI-10 operation

which supports the respective

functionality by providing a HTTP POST

operation

defined by FIWARE

Page 15

NGSI 10 RESTful binding: resources (2/2)

//{serverRoot}/NGSI10

/{EntityID}

/{attributeName}

/{attributeDomainName}/contextEntityTypes

/{typeName}

/attributes

/{attributeName}

/{attributeDomainName}/contextSubscriptions

/{subscriptionID}

/contextEntities

/attributes

/attributeDomains

/attributeDomains

Convenience

Resources

representing

entities

attributes

of entities

entity

types

subscriptions

of context

defined by FIWARE

Page 16

Page 17

ApplicationApplicationApplications

IoT AgentsContext

Providers

Interaction Overview

NGSI 10

NGSI10

NG

SI 9

IoT Broker

GEN

GS

I 9

Configuration

Management

GE

Maintains Information about

- available Entity Information

- Context Providers

- Associationsinformation

requests*

information

requests*

registration

availability

requests*

Page 18

Interaction 1: One-Time Queries

FIWARE

GENERIC ENABLER:

IoT Broker

Context

Provider

(1) queryContext (NGSI 10)

(3) queryContext (NGSI 10)

Applications

FIWARE

GENERIC ENABLER:

Conf. Man

(2)

discoverContext Availability

(NGSI 9)

The IoT Broker accepts queries from

applications, queries for the relevant

context providers from the Configuration

Management GE, and accesses these

context providers on behalf of the

application.

FIWARE

Publish/Subscribe

Broker GE

QueryContext – Example 1

<?xml version="1.0" encoding="UTF-8"?>

<queryContextRequest>

<entityIdList>

<entityId type="Room">

<id>Kitchen</id>

</entityId>

</entityIdList>

<attributeList>

<attribute>temperature</attribute>

</attributeList>

</queryContextRequest>

Page 19

<?xml version="1.0" encoding="UTF-8"?>

<queryContextResponse>

<contextResponseList>

<contextElementResponse>

<contextElement>

<entityId type=“Room”>

<id>Kitchen</id>

</entityId>

<contextAttributeList>

<contextAttribute>

<name>temperature</name>

<type>celsius</type>

<value>22</value>

</contextAttribute>

</contextAttributeList>

</contextElement>

<statusCode>

<code>200</code>

<reasonPhrase>OK</reasonPhrase>

</statusCode>

</contextElementResponse>

</contextResponseList>

QueryContext – Example 2

<?xml version="1.0" encoding="UTF-8"?>

<queryContextRequest>

<entityIdList>

<entityId type="Room">

<id>Kitchen</id>

</entityId>

</entityIdList>

</queryContextRequest>

Page 20

<?xml version="1.0" encoding="UTF-8"?>

<queryContextResponse>

<contextResponseList>

<contextElementResponse>

<contextElement>

<entityId type=“Room”>

<id>Kitchen</id>

</entityId>

<contextAttributeList>

<contextAttribute>

<name>temperature</name>

<type>celsius</type>

<value>22</value>

</contextAttribute>

<contextAttribute>

<name>noise</name>

<type>decibel</type>

<value>43</value>

</contextAttribute>

</contextAttributeList>

</contextElement>

<statusCode>

<code>200</code>

<reasonPhrase>OK</reasonPhrase>

</statusCode>

</contextElementResponse>

</contextResponseList>

Page 21

(3) notifyContextAvailability

(NGSI 9)

Interaction 2a: Subscriptions

Context

Provider

FIWARE

GENERIC ENABLER:

IoT Broker

(1) subscribeContext

(NGSI 10)

(4) subscribeContext (NGSI 10)

The IoT Broker accepts subscriptions

from applications, finds out and

subscribes for the relevant context

providers, and subscribes to them on

behalf of the applications.

FIWARE

GENERIC ENABLER:

Conf. Man

(2)

subscribeContextAvailability

Applications

FIWARE

Publish/Subscribe

Broker GE

Subscription – Example

Sender: http://192.168.1.45

<?xml version="1.0" encoding="UTF-8"?>

<subscribeContextRequest>

<entityIdList>

<entityId type="Room">

<id>Kitchen</id>

</entityId>

</entityIdList>

<reference>http://192.168.1.45:8001/ngsi10</reference>

</subscribeContextRequest>

Page 22

<?xml version="1.0" encoding="UTF-8"?>

<subscribeContextResponse>

<subscribeResponse>

<subscriptionId>18090-63a6f-c3367-d3b7e-

45161-b4a6e5ea8faeb26ab66_-_1-

deed11c3efa4b6045fd1e15f1b9af287

</subscriptionId>

</subscribeResponse>

<subscribeError>

<errorCode>

<code>200</code>

<reasonPhrase>OK</reasonPhrase>

</errorCode>

</subscribeError>

</subscribeContextResponse >

Page 23

Interaction 2b: Notification

Context

Provider

FIWARE

GENERIC ENABLER:

IoT Broker

(2) notifyContext (NGSI 10)

(1) notifyContext (NGSI 10)

Notification received in reaction to

subscriptions will be forwarded by the

IoT broker to the applications that have

issued the original subscriptions.Applications

FIWARE

Publish/Subscribe

Broker GE

Notification – Example

<?xml version="1.0" encoding="UTF-8"?>

<notifyContextRequest>

<subscriptionId>18090-63a6f-c3367-d3b7e-45161-

b4a6e5ea8faeb26ab66_-_1-

deed11c3efa4b6045fd1e15f1b9af287

</subscriptionId>

<originator>http://192.168.1.45/</originator>

<contextResponseList>

<contextElementResponse>

<contextElement>

<entityId type=“Room”>

<id>Kitchen</id>

</entityId>

<contextAttributeList>

<contextAttribute>

<name>temperature</name>

<type>celsius</type>

<value>22</value>

</contextAttribute>

</contextAttributeList>

</contextElement>

……………….

</contextElementResponse>

</contextResponseList>

</notifyContextRequest >

Page 24

<?xml version="1.0" encoding="UTF-8"?>

<notifyContextResponse>

</subscribeResponse>

<statusCode>

<code>200</code>

<reasonPhrase>OK</reasonPhrase>

</statusCode>

</ notifyContextResponse>

Page 25

Interaction 3:Update

Context

Provider

FIWARE

GENERIC ENABLER:

IoT Broker

(2) updateContext (NGSI 10)

(1) updateContext (NGSI 10)

The UpdateContext operation

allow receiving updates

about the Context Information

from IoT Agents and is forwarded to

the Publish/Subscribe Broker GE (or to

an application).

Applications

FIWARE

Publish/Subscribe

Broker GE

Page 26

What´s next

1. Standalone IoT-Broker (end of March 2015)

• Simple Configuration Management implementation

2. JSon support (end of March 2015)

• NGSI Json bindings similar to the Orion Context Broker ones

3. Dump data in a DB (end of March 2015)

• Currently in CouchDB

4. Plugin architecture (end of June 2015)

• Possibility for other developers to implement its own plugin on IoT-

Broker

Summary

Summary of this course:

▐ The IoT Broker GE is a middleware component for the IoT

Backend.

▐ Its purpose is to hide the complexity of IoT installations from

applications by providing a single interface to them.

▐ Instead of acting like a database where all information is dumped,

the IoT Broker acquires data on demand by query and

subscriptions.

▐ The IoT Broker needs to be connected to at least an instance of

the Configuration Management GE.

Page 27

Page 28