data distribution service dds tutorial building internet of things systems with ease

69
Angelo Corsaro, PhD CTO, ADLINK Tech. Inc. Co-Chair, OMG DDS-SIG [email protected] The DDS Tutorial Building IoT Systems with Ease

Upload: prismtech

Post on 08-Jan-2017

586 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

AngeloCorsaro,PhDCTO,ADLINKTech.Inc.Co-Chair,[email protected]

The DDS TutorialBuildingIoTSystemswithEase

Page 2: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Internet of Things

Page 3: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

The Industrial Internet Consortium (IIC) and the Industrie 4.0 (I4.0)

have defined reference models and architectures for IIoT systems.

As IIoT requirements are a superset of CIoT’s we’ll

investigate the need of the former

CIoT and IIoT

Page 4: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Interoperability. Machines, devices, sensors, and people can freely communicate with each other

Information Transparency. A virtual representation of the physical world is made available by enriching digital plant models with sensor data

Technical assistance. Leverage information to make more informed decisions and solving urgent problems on short notice. Physically support humans by conducting a range of tasks that are unpleasant, too exhausting, or unsafe for humans.

Decentralised Decisions. Autonomous decisions are the norm. Higher level delegation happens only in presence of interferences or conflicting goals

Industrie 4.0Design Principles

Page 5: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

The Industrie 4.0 Reference Architecture (RAMI) is three dimensional and organises

the life-cycle/value streams and the manufacturing

hierarchy levels across the six layers of the IT

representation of Industrie 4.0

RAMI 4.0

Imagefrom:“ReferenceArchitectureModelIndustrie4.0”

Page 6: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

The ability to virtualise physical entities and make

information available is key to RAMI4.0 and captured

as part of the Virtual Representation layer

RAMI 4.0

Imagefrom:“ReferenceArchitectureModelIndustrie4.0”

Page 7: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

The IIC Reference architecture is defined on a three tier model and

across four different view points

The key requirements for each viewpoint and tier are identified by

the IIRA

IIRA

Imagefrom:“IndustrialInternetConsortiumReferenceImplementationv1.7”

Page 8: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

IIRA connectivity foresees the use of a Connectivity

Core Standard (such as DDS) and then Gateways

to integrate other connectivity technologies

IIRA Connectivity

Imagefrom:“IndustrialInternetReferenceArchitecturev1.7”

Page 9: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

IIRA/I4.0 relationship

Page 10: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Connectivity, syntactic interoperability and ubiquitously available virtual representation of physical entities are common needs of both the IIRA and RAMI4.0

DDS, OPC-UA, MQTT, AMQP are some of the key the standards that have been identified as supporting some or all the connectivity and data sharing needs of IIRA/RAMI4.0

IIRA /RAMI4.ocommonalities

Page 11: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Desirable Properties of a Large Scale Distributed System

Page 12: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Performance

Performance requirements in IIoT

can vary from real-time low latency to

soft real-time and interactive Rea

l-Time

SoftRe

al-Time

Interact

ive

Page 13: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Scalability

The architecture should be designed to promote

scale-out and scale-down as opposed to

scale up

Page 14: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Loose Coupling

Functionalities should be completely isolated

from each other in time and space

Page 15: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Unconstrained

Innovation should not be constrained with respect to

supporting devices, new target platforms, new visualisation

engines, new control or optimisation strategies, etc.

Functionalities should be implemented in the most

effective programming language

Innovation

Page 16: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Incremental

The platform should be as modular as possible to facilitate the individual

functionalities updates and upgrade

Additionally, adding new features should be as much as

possible transparent for the currently running system

Change

Page 17: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Fault-Tolerance

The system should be self-healing and

autonomous

Page 18: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS: The Data Distribution Service

Page 19: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS. Describes the semantics of the information sharing

abstraction supported by DDS. Defines a nominal type system for

describing DDS information models and ensuring syntactical

interoperability.

DDSI-RTPS. Defines a protocol for interoperable wire implementation

of the DDS semantics.

Standard Structure

Page 20: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS-XTypes. Extends the DDS type system with support for structural typing as well as a

dynamic type definition.

DDS-Security. Introduces data centric security in DDS for data in

movement as as well as data at rest.

Standard Structure

Page 21: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS-RPC. Extends DDS with support for Remote Procedure Calls.

DDS-PSM-*. Defines highly ergonomic and optimised API

mapping for specific programming languages instead of deriving those

for the DDS-PSM-IDL

DLRL. Defines a language independent Object/Relational

Mapping for DDS

Standard Structure

Page 22: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS functionalities span from the Session to the Application level in the

ISO OSI Stack

DDS & ISO OSI

UDP TCP

DDSI-RTPS

DDS

User App.

7. ApplicationHigh-level APIs, including resource sharing, remote file access, directory services and virtual terminals

6. Presentation

Translation of data between a networking service and an application; including character encoding, data compression and encryption/decryption

5. Session

Managing communication sessions, i.e. continuous exchange of information in the form of multiple back-and-forth transmissions between two nodes

4. Transport

Reliable transmission of data segments between points on a network, including segmentation, acknowledgement and multiplexing

3. NetworkStructuring and managing a multi-node network, including addressing, routing and traffic control

2. Data LinkReliable transmission of data frames between two nodes connected by a physical layer

1. PhysicalTransmission and reception of raw bit streams over a physical medium

IP

Page 23: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Programming language, Operating System,

and HW architecture Independent

PlatformIndependent

Page 24: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS Abstractions

Page 25: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Applications can autonomously and

asynchronously read and write data enjoying

spatial and temporal decoupling

Virtualised Data Space

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Page 26: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Virtualised Data Space

Page 27: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Virtualised Data Space

Data Writer

Page 28: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Virtualised Data Space

Data Writer

Page 29: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Virtualised Data Space

Page 30: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Virtualised Data Space

Data Reader

Page 31: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS’s virtualised data space is key in enabling loose coupling essential to deal with the fault-tolerance, scale and the heterogeneity needs of IIoT systems

Virtualised Data Space

Page 32: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS’s Data Space is eventually consistent with

respect to writes

That means that readers of some kind of data will

eventually see a write, but they may not observe it at

the “same time”

CONSISTENCYMODEL

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Page 33: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

A Topic defines a domain-wide information’s class by a

<name, type, qos> triple

DDS Topics allow to express functional and non-

functional properties of a system information model

Topic

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

TopicType

Name

QoS

Page 34: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Topic types can be expressed using

different syntaxes, including IDL and

ProtoBuf

Topic Type

struct TempSensor { long sid; float temp; float hum; float precision; }; #pragma keylist CarDynamics cid

IDL

Page 35: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Built-in dynamic discovery isolates applications from

network topology and connectivity details

Dynamic

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Discovery

Page 36: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

locationtransparency

Cloud Computing

Fog Computing

Device-to-Cloud Communication

Device-to-Device Communication

Fog-to-Cloud Communication

Cloud-to-Cloud Communication

Device-to-Device Communication

Collect | Store | Analyse | Share

Fog Computing

Fog Computing

Page 37: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

No single point of failure or bottleneck

Decentralised

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

TopicDQoS

TopicDQoS

TopicAQoS

Data-Space

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Page 38: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Connectivity is dynamically adapted

to choose the most effective way of

sharing data

Adaptive

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

TopicDQoS

TopicDQoS

TopicAQoS

ThecommunicationbetweentheDataWriterandmatchingDataReaderscanbepeer-to-peerexploitingUDP/IP(UnicastandMulticast)orTCP/IP

ThecommunicationbetweentheDataWriterandmatchingDataReaderscanbe“brokered”butstillexploitingUDP/IP(UnicastandMulticast)orTCP/IP

Connectivity

Page 39: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

QoS policies allow the expression and control over data’s temporal

and availability constraints

QoS Enabled

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Page 40: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

QoS Policies controlling end-to-end

properties follow a Request vs. Offered

QoS Domain

Participant

DURABILITY

OWENERSHIP

DEADLINE

LATENCY BUDGET

LIVELINESS

RELIABILITY

DEST. ORDER

Publisher

DataWriter

PARTITION

DataReader

Subscriber

DomainParticipant

offered QoS

Topicwrites reads

Domain Idjoins joins

produces-in consumes-from

RxO QoS Policies

requested QoS

Page 41: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS support for peer-to-peer communication along with its rich set of QoS enable extremely high and controlled performances

Performance

Page 42: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS has applicability across the 6 IT levels

Concerning the SCADA and the life-cycle layers, DDS

applicability depends on the constraints of the device

DDS-XRCE will bring connectivity to extremely small devices, i.e. at

most 100KB of RAM

Applicability

DDS

DDSD

DS

Page 43: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Due to its performance and scalability

characteristics DDS is applicable across the

three theirs identified by the IIRA

Applicability

DD

S

Page 44: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Data Modeling Idioms

Page 45: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

A state that is periodically updated

Examples are the reading of a sensor (e.g. Temperature

Sensor), the position of a vehicle, etc.

Soft State

Reliability=>BestEffortDurability=>VolatileHistory=>KeepLast(n)Deadline=>updatePeriodLatencyBudget=>updatePeriod/3DestinationOrder=>SourceTimestamp

Page 46: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

A state that is sporadically updated and that often has

temporal persistence requirements

Examples are system configuration, a price

estimate, etc.

Hard State

Reliability=>ReliableDurability=>Transient|PersistentHistory=>KeepLast(n)DestinationOrder=>SourceTimestamp

Page 47: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

The occurrence of something noteworthy for

our system

Examples are a collision alert, the temperature

beyond a given threshold, etc.

Events

Reliability=>ReliableDurability=>anyHistory=>KeepAllDestinationOrder=>SourceTimestamp

Page 48: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Data-centric design leverage the same principle of Feedback-

control loops to assert a state

In other terms, the desired state is asserted by writing a topic and

the actual state is monitored.

A control action is taken when the desired and the actual state

differ

Control-Loop

Page 49: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Data-centric design leverage the same principle of Feedback-

control loops to assert a state

In other terms, the desired state is asserted by writing a topic and

the actual state is monitored.

A control action is taken when the desired and the actual state

differ

Control-LoopHard State

microservice

Soft State

Page 50: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

DDS. Microservices. IoT.

Page 51: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

microservice“The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms.” [2]

Architecturalstyle

Page 52: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Server Tier

ProcessFunctionality

Microservice

Individual functionalities become unit of

deployment and run in their own process

Architectures

Page 53: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Microservice Architectures

Microservices communicate through

some lightweight mechanism

Server Tier

ProcessFunctionality

Page 54: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Server TierBenefits

Scaling microservice applications is easier as

we can scale out individual functionalities

Page 55: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Benefits

Unconstrained Innovation as we

choose the technologies stack that makes the

most sense for implementing a given

feature

Server Tier

ProcessFunctionality

Page 56: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Incremental Change is facilitated allowing

incremental deployment of new functionalities.

Potentially different version of the same micro service

could be running at the same time!

Benefits

Server Tier

ProcessFunctionality

Page 57: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Loose Coupling and High Cohesion are

easier to achieved to preserve as the

“barriers” between functionalities are very

thick

Server Tier

Process Boundary / Share Nothing

Benefits

Page 58: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Performance of microservice

architectures may be degraded by the higher

cost of communication if the right technology is

not used

Server Tier

Challenges

Monolithic Implementation

Microservice Implementation

In-Process Communication

Inter-Process/Host Communication

Page 59: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Deployment and Operation of systems

based on the microservice

architectures is inherently more complex,

especially at scale and when the right

technologies are not used

Server Tier

Challenges

Monolithic Implementation

Microservice Implementation

Page 60: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Putting it All Together

Page 61: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

The architectural style promoted by DDS is ideal for Microservices

architectures

Microservices are one of the emerging paradigms to design

IIoT systems

Additionally DDS mitigates some of the challenges posed by

Microservices

DDS + Microsvcs

Page 62: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

A DDS-based Microservice Framework

First class support for Data-Centric modelling idioms, i.e.

Soft/Hard State and Events

Currently supporting only JVM as a target

AgentV

Page 63: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

AgentV provides a set of microsvcs that facilitate

the development and deployment of IoT

applications with the Intel Edison IoT board

Agentv and Edison IOT

Page 64: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Thanks to Vortex AgentV micro services can be

seamless deployed on anything, devices, fog

nodes and cloud

Agentv and Vortex

Page 65: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Coding Lab

Page 66: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

Your First AgentV Microsvc

Page 67: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

IIRA and RAMI4.0 define the key architectural attributes and concerns that need to be addressed in IoT systems

DDS provides a very good match for providing the connectivity and syntactical interoperability

DDS-based Microservices provide a very elegant way of composing IoT systems

Summing Up

Page 68: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease
Page 69: Data Distribution Service DDS Tutorial Building Internet of Things Systems with Ease

AgentV