Building Open Source IoT Cloud
-
Upload
dejanb -
Category
Technology
-
view
349 -
download
2
Transcript of Building Open Source IoT Cloud
![Page 1: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/1.jpg)
BUILDING OPEN SOURCE IOT CLOUD
Dejan Bosanac
![Page 2: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/2.jpg)
WHO AM I?
Dejan Bosanac
• Senior Software Engineer at Red Hat • Messaging and Integration background (ActiveMQ, Camel, Fabric8) • Focused more on messaging and backend for IoT lately
![Page 3: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/3.jpg)
AGENDA
• Describe typical IoT application • Describe all the components and common pitfalls • Introduce Eclipse IoT projects to the rescue
• Kura • Hono • Kapua
• Future
![Page 4: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/4.jpg)
IOT APPLICATIONS
![Page 5: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/5.jpg)
Devices Cloud
Applications
IOT APPLICATIONS
Device
Device
Applica+on
Device Applica+on
Applica+onIOTCloud
![Page 6: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/6.jpg)
DEVICES
• Everything from simple sensors to small computers • Connectivity
• Some are IP enabled • Some have just near-range connectivity, like Bluetooth • Variety of network protocols used (MQTT, LWM2M,…)
• Functions • Sensors – send data – temperature sensor • Actuators – control environment – A/C Unit
![Page 7: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/7.jpg)
APPLICATIONS
• Enterprise applications, micro-services and everything in between • Want to use data generated by devices • Want to control devices • Want to control the cloud environment … more about that in a minute
![Page 8: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/8.jpg)
CLOUD
• Connects devices and applications • Provides connectivity layer • Provides security layer • Provides device state • Handle device data
![Page 9: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/9.jpg)
PITFALLS
• Create a silo application • Hard to upgrade and maintain • Solution don't scale • Security is an afterthought
![Page 10: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/10.jpg)
SOLUTION
• Build well maintained open source stack • Scalable, secure and maintainable • Developers should focus on devices and applications
![Page 11: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/11.jpg)
STACK
• Device Gateway - Eclipse Kura - https://www.eclipse.org/kura/ • IoT Connector – Eclipse Hono - https://projects.eclipse.org/projects/iot.hono • IoT Cloud – Eclipse Kapua - https://projects.eclipse.org/projects/iot.kapua
![Page 12: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/12.jpg)
GATEWAY
![Page 13: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/13.jpg)
DEVICE GATEWAY
• Device IP onboarding • Data pre-processing • Control devices • Operational management
![Page 14: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/14.jpg)
GATEWAY ARCHITECTURE
Data Center
Gateway
Application
Sensors
![Page 15: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/15.jpg)
INSERT DESIGNATOR, IF NEEDED 15
KURA ARCHITECTURE
![Page 16: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/16.jpg)
KURA SERVICES
• I/O Services – serial, Bluetooth, GPS, … • Data services - Store and forward data using MQTT, Apache Camel • Cloud services – request/reply • Configuration service – OSGi configuration • Web administration interface
![Page 17: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/17.jpg)
KURA APPLICATION
• OSGi Bundle • Deployed and managed by Kura • Using Kura APIs to communicate with devices and cloud • Apache Camel Integration
![Page 18: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/18.jpg)
KURA APPLICATION public void setCloudService(CloudService cloudService) { cloudService = cloudService;}protected void activate(ComponentContext componentContext, Map<String, Object> properties) { ... // Acquire a Cloud Application Client for this Application cloudClient = cloudService.newCloudClient("greenhouse"); cloudClient.addCloudClientListener(this); ...}protected void doPublish() { ... KuraPayload kuraPayload = new KuraPayload(); kuraPayload.addMetric("temperature", temperature); cloudClient.publish("sensors", kuraPayload, DFLT_QOS, DFLT_RETAIN,DFLT_PRIORITY); ...}
![Page 19: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/19.jpg)
KURA CAMEL
public class MyKuraRouter extends KuraRouter { @Override public void configure() throws Exception {
from("timer://heartbeat"). setBody(constant("Hello")). to("kura-cloud:myApplication/myTopic"); }}
![Page 20: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/20.jpg)
CONNECTOR
![Page 21: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/21.jpg)
CONNECTOR
• Messaging infrastructure that connects gateways and applications • Eclipse Kura uses MQTT • Usually combined with message brokers like Apache ActiveMQ or Eclipse Paho
![Page 22: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/22.jpg)
MQTT
• OASIS standard (v3.1.1) • Created by IBM and Eurotech • Lightweight
• Small network message • Simple protocol
• Pub / Sub • Quality of Service • Connection failures • Very popular in IoT scenarios
![Page 23: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/23.jpg)
LIMITATIONS
• Scalability • Connections • Destinations
• Security based on broker addresses • General purpose messaging
• No message format
![Page 24: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/24.jpg)
ECLIPSE HONO – GOALS
• Tailored general messaging for IoT solutions • Solve recurring problems • Provide messaging APIs for common operations • Support multiple IoT protocols (MQTT, AMQP, LWM2M,…) • Support any underlying messaging infrastructure
• JMS • Kafka
![Page 25: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/25.jpg)
ECLIPSE HONO – FEATURES
• Scalability • Multi-tenancy • Device-based security • Multi-protocol support
![Page 26: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/26.jpg)
ECLIPSE HONO – APIS
• AMPQ 1.0 based • Defines message formats coming in and out of Hono • Defines message exchange patterns
![Page 27: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/27.jpg)
INSERT DESIGNATOR, IF NEEDED 27
AMQP
• International Standard (ISO/IEC ISO 19464) • Binary Protocol • Rich feature set:
• conversation multiplexing • advanced flow control • Type system • QoS Guarantees
• Symmetrical message exchange • No Broker required
![Page 28: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/28.jpg)
INSERT DESIGNATOR, IF NEEDED 28
AMQP
Message(properties: {
correlation-id: 1,to: "$management",reply-to: "/myaddress"
},application-properties: {
"name" -> "newQueue","operation" -> "CREATE","type" -> "org.example.queue"
},application-data: AmqpValue(
Map("max_size" -> "2000Mb"
))
)
![Page 29: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/29.jpg)
• It is not a broker • It never owns a message • It propagates AMQP transfer, settlement and disposition frames between endpoints • Message based or link based routing
AMQP ROUTER
Router
/device1
/device2
/device2
![Page 30: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/30.jpg)
INSERT DESIGNATOR, IF NEEDED 30
AMQP ROUTER
• It can be deployed in multiple router-broker-endpoint topology • Redundant paths • Benefits
• Better scaling due to more focused tasks • Smart routing can be used to partition the traffic • Ideal candidate for gateway into the system
![Page 31: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/31.jpg)
INSERT DESIGNATOR, IF NEEDED 31
SCALABLE MESSAGING
• Combination of brokers and routers provides powerful tool box • Brokers should focus on storing messages • Routers should do the rest • Allows for horizontal scaling topologies that can solve IoT challenges
![Page 32: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/32.jpg)
ECLIPSE HONO- APIS
• Telemetry • Command and Control • Device Registration • Device Lifecycle
![Page 33: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/33.jpg)
ECLIPSE HONO – ARCHITECTURE
MQTTDevice
LWM2M Device
AMQP Device
HONO
ProtocolAdapter
ProtocolAdapter
Device Management
DataCollec+on
AMQP
AMQP
AMQP
AMQPAMQP
![Page 34: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/34.jpg)
ECLIPSE HONO – ARCHITECTURE
• Protocol Adapters • Stateless • Provide conversion to common protocols used in IoT
• MQTT • LWM2M • HTTP/Rest
• Clients – devices and Cloud services • Connects using AMQP using well defined APIs
![Page 35: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/35.jpg)
ECLIPSE HONO – ARCHITECTURE
Client
Client
Client
Router Network
HonoServer
HonoServer
App
App
HonoServer
Brokers
![Page 36: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/36.jpg)
ECLIPSE HONO – ARCHITECTURE
• Hono server • Stateless – can be scaled • Validates message format • Does device-based authentication
![Page 37: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/37.jpg)
ECLIPSE HONO – ARCHITECTURE
• Router Network • Provide connection scalability • Routes AMQP messages through the system
• Brokers • Any AMQP 1.0 compatible system • Used to save persistent messages
![Page 38: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/38.jpg)
ECLIPSE HONO – TECHNOLOGY
• Hono server • Vert.x + Qpid Proton • Spring Boot • Docker
• Scalable and Cloud Ready!
![Page 39: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/39.jpg)
ECLIPSE HONO – TECHNOLOGY
• Scalable messaging • Apache Qpid Dispatch Router • Apache ActiveMQ Artemis
• Scalable and Cloud Ready!
![Page 40: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/40.jpg)
ECLIPSE KAPUA
![Page 41: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/41.jpg)
ECLIPSE KAPUA – GOALS
• Provide complete IoT Cloud solution • Define and Implement needed services • Ready to run
![Page 42: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/42.jpg)
ECLIPSE KAPUA – ARCHITECTURE
![Page 43: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/43.jpg)
ECLIPSE KAPUA – BACKHAND SERVICES
• Data Management • Device Registry • Device Management
![Page 44: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/44.jpg)
ECLIPSE KAPUA – FRONTEND SERVICES
• Management Console • API Gateway
![Page 45: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/45.jpg)
ECLIPSE KAPUA - IMPLEMENTATION
• Micro-services oriented • Pluggable service locator
• Single JVM • OSGi • Cloud Deployment
![Page 46: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/46.jpg)
ECLIPSE KAPUA – 1.0
• MQTT based • Apache ActiveMQ in the messaging layer • JDBC store for services • Elasticsearch for data store • Single VM deployment
![Page 47: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/47.jpg)
FUTURE
INSERT DESIGNATOR, IF NEEDED 47
![Page 48: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/48.jpg)
INSERT DESIGNATOR, IF NEEDED 48
FUTURE - KURA
• More data pre-processing • BPM integration
• AMQP support • Gateway support proxy
![Page 49: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/49.jpg)
INSERT DESIGNATOR, IF NEEDED 49
KAPUA
• Micorservice implementation • Docker images • REST/AMQP APIs
• Hono support
![Page 50: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/50.jpg)
KAPUA + HONO
![Page 51: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/51.jpg)
CONCLUSION
• Together Kura, Hono and Kapua will be able to answer even the most challenging IOT demands • Lots of work ahead • Everything open source • Backed by big companies, like Red Hat, Eurotech, Bosch, … • Join the effort
![Page 52: Building Open Source IoT Cloud](https://reader033.fdocuments.net/reader033/viewer/2022051503/5871ae6f1a28abda6a8b61ad/html5/thumbnails/52.jpg)
THANK YOU
• https://www.eclipse.org/kura/
• https://projects.eclipse.org/projects/iot.hono
• https://projects.eclipse.org/projects/iot.kapua