Embedded Actors Towards Distributed Programming in the IoT Raphael - - PowerPoint PPT Presentation

embedded actors towards distributed programming in the iot
SMART_READER_LITE
LIVE PREVIEW

Embedded Actors Towards Distributed Programming in the IoT Raphael - - PowerPoint PPT Presentation

Embedded Actors Towards Distributed Programming in the IoT Raphael Hiesgen, Dominik Charousset, Thomas C. Schmidt HAW Hamburg raphael.hiesgen@haw-hamburg.de September 2014, ICCE-Berlin Agenda 1 The Internet of Things (IoT) 2 The Actor


slide-1
SLIDE 1

Embedded Actors — Towards Distributed Programming in the IoT

Raphael Hiesgen, Dominik Charousset, Thomas C. Schmidt HAW Hamburg raphael.hiesgen@haw-hamburg.de

September 2014, ICCE-Berlin

slide-2
SLIDE 2

Agenda

1 The Internet of Things (IoT) 2 The Actor Model 3 Communication in the IoT 4 Messaging Architecture 5 Evaluation 6 Conclusion & Outlook

Raphael Hiesgen iNET – HAW Hamburg 2

slide-3
SLIDE 3

The Internet of Things (IoT)

Characteristics

Cooperatively process complex duties Dependent on machine-to-machine communication Connected to the Internet Implemented with networking standards Often constrained environment

Developing for the IoT

Fall back to low-level programming Hand-crafted network code Barely portable code

⇒ Raise the level of abstraction through the actor model

Raphael Hiesgen iNET – HAW Hamburg 3

slide-4
SLIDE 4

Agenda

1 The Internet of Things (IoT) 2 The Actor Model 3 Communication in the IoT 4 Messaging Architecture 5 Evaluation 6 Conclusion & Outlook

Raphael Hiesgen iNET – HAW Hamburg 4

slide-5
SLIDE 5

The Actor Model

Isolated, concurrent software entities: actors Network-transparent message passing Divide & conquer via “spawn” Strong, hierarchical failure model Re-deployment at runtime

Raphael Hiesgen iNET – HAW Hamburg 5

slide-6
SLIDE 6

Limitations

Actors not yet established in the native programming domain

Need to broaden range of applications Deploy actors in performance-critical systems

Actors not available for embedded systems

Why not model the “Internet of Things” as network of actors? HW platform should not dictate programming model

Raphael Hiesgen iNET – HAW Hamburg 6

slide-7
SLIDE 7

The C++ Actor Framework

The C++ Actor Framework (CAF) is an C++11 actor system Previously named libcppa Efficient program execution

Low memory footprint Fast, lock-free mailbox implementation

Targets both high-end and low-end computing

Multi-core & many-node systems Embedded HW, e.g., running

1

1http://www.riot-os.org Raphael Hiesgen iNET – HAW Hamburg 7

slide-8
SLIDE 8

Memory Usage

CAF scala erlang 500 1000 1500 2000 2500 3000 3500 Resident Set Size [MB]

x

99th percentile 1st percentile 95th percentile 5th percentile

x

Median 75th percentile 25th percentile Mean

Raphael Hiesgen iNET – HAW Hamburg 8

slide-9
SLIDE 9

Agenda

1 The Internet of Things (IoT) 2 The Actor Model 3 Communication in the IoT 4 Messaging Architecture 5 Evaluation 6 Conclusion & Outlook

Raphael Hiesgen iNET – HAW Hamburg 9

slide-10
SLIDE 10

Communication in the IoT

Loosely coupled

Unreliable links Infrastructure failure

Challenges

Error propagation for non-hierarchical systems Secure and authenticated connectivity

Multiple open standards available to meet these challenges

Raphael Hiesgen iNET – HAW Hamburg 10

slide-11
SLIDE 11

Standards for the IoT

Bluetooth low energy

Supported by all major OSs

IEEE 802.15.4

WPAN for embedded devices 127 bytes frame size

IPv6 over Low-Power Wireless Personal Area Networks (6LoWPAN)

IPv6 compatibility Header compression

UDP / Datagram Transport Layer Security (DTLS)

Features of TLS with datagrams Reordering, retransmission and fragmentation for the handshake

Constrained Application Protocol (CoAP)

Request-response model adapted from HTTP Works asynchronously over datagram protocols Offers reliability through Confirmable messages (CON)

Raphael Hiesgen iNET – HAW Hamburg 11

slide-12
SLIDE 12

Agenda

1 The Internet of Things (IoT) 2 The Actor Model 3 Communication in the IoT 4 Messaging Architecture 5 Evaluation 6 Conclusion & Outlook

Raphael Hiesgen iNET – HAW Hamburg 12

slide-13
SLIDE 13

CAF Network Stack

802.15.4 / Bluetooth LE 6LoWPAN UDP DTLS CoAP C++ Actor Framework Ethernet / WLAN IPv4 / IPv6 TCP

Raphael Hiesgen iNET – HAW Hamburg 13

slide-14
SLIDE 14

Messaging Architecture Between Actors

Map CoAP messages to CAF

Reliability (CON) → synchronous messages Unreliability (NON) → asynchronous messages

Handle small frame sizes

Compress meta-information to slim down headers Type-exchange & annotation introduces more state Fragmentation on the application layer (CoAP block messages)

Concept for error-propagation

No longer connection oriented Based on asynchronous transactions (CoAP) Take unreliable messages into account

Raphael Hiesgen iNET – HAW Hamburg 14

slide-15
SLIDE 15

Agenda

1 The Internet of Things (IoT) 2 The Actor Model 3 Communication in the IoT 4 Messaging Architecture 5 Evaluation 6 Conclusion & Outlook

Raphael Hiesgen iNET – HAW Hamburg 15

slide-16
SLIDE 16

Packet Flow Evaluation

Proof-of-concept implementation

Network stack composed of Ethernet, UDP and CoAP Based on libcoap 2

Bitrate & message count compared to TCP based impl. Raspberry Pi sends 10 bytes to a desktop PC every 100 ms

Characteristic scenario for sensor nodes

Trace network traffic (handshakes, ACKs, messages, ...)

2http://libcoap.sourceforge.net Raphael Hiesgen iNET – HAW Hamburg 16

slide-17
SLIDE 17

Packet Flow

500 1000 20k 40k 60k 80k 100k 120k

Bit rate (bit/s) Time (ms) CoAP + UDP TCP

Raphael Hiesgen iNET – HAW Hamburg 17

slide-18
SLIDE 18

Packet Size Distribution

20 40 60 80 100 120 140 160 180 200 220 240 260 5 10 15 20

Count Packet Size (bytes)

CoAP + UDP TCP

Raphael Hiesgen iNET – HAW Hamburg 18

slide-19
SLIDE 19

Agenda

1 The Internet of Things (IoT) 2 The Actor Model 3 Communication in the IoT 4 Messaging Architecture 5 Evaluation 6 Conclusion & Outlook

Raphael Hiesgen iNET – HAW Hamburg 19

slide-20
SLIDE 20

Conclusion & Outlook

Development for the IoT requires specialized knowledge

Network communication & synchronization Port software to different hardware

The actor model abstracts over distributed systems Adjusted the CAF network stack to the IoT Proof-of-concept with first measurements Future work

Concept for error-propagation Additional CoAP drafts (CoCoA, block messages, ...) Evaluation of packet loss, message sizes Adaption to RIOT

Raphael Hiesgen iNET – HAW Hamburg 20

slide-21
SLIDE 21

Thank you for your attention!

Website: http://actor-framework.org Sources: https://github.com/actor-framework iNET working group: http://inet.cpt.haw-hamburg.de

Raphael Hiesgen iNET – HAW Hamburg 21