CASAN: A New Communication Architecture for Sensors Based on Pierre David pda@unistra.fr Philippe Pittoli p.pittoli@unistra.fr Thomas Noël noel@unistra.fr Laboratoire ICube Université de Strasbourg France 16 march 2016
Outline Introduction The protocol The CASAN architecture Conclusion 2
Outline Introduction The protocol The CASAN architecture Conclusion 3
Introduction Problem statement have multiple sensors manufacturing costs hardware, software operating costs ease of use, scalability maintenance costs reliability adapt IoT to industrial specific constrains avoid electromagnetic interferences new features geolocation of industrial components and products 4
Introduction Context Lack of standard for IoT? industry uses most often proprietary protocols and low-end technologies Software world: trend: service-oriented architectures REST (Representational State Transfer) architecture Generalization of REST using HTTP protocol IETF answer: CoRE working group protocol 5
Outline Introduction The protocol The CASAN architecture Conclusion 6
Overview IETF CoRE working group: : Constrained Application Protocol RFC 7252: June 2014 In short: is HTTP, binary encoded, over UDP Application Application Application HTTP TCP IP Data link Physical UDP IP Data link Physical 6LoWPAN Data link Physical Ex. Data Link Target: IEEE 802.15.4 (127 bytes payload) 7
Overview Architectural view: URL coap://therm1.my.com/temp Internet Local Area Network http://gw.my.com/therm1/temp servers IP everywhere dogma: each sensor must be IP addressable 8
Example use cases End-to-end UDP IPv4/v6 UDP IPv4/v6 L2 Internet UDP IPv4/v6 end-to-end scenario limited by middle-boxes application must handle MTU of sensor network limited to specific perimeters: local networks (car networks, smart buildings, etc.) 9
Example use cases HTTP- proxy with 6LoWPAN Proxy HTTP/ HTTP TCP IPv4/v6 HTTP TCP IPv4/v6 L2 Internet HTTP TCP IPv4/v6 6LoWPAN 6LoWPAN L2 Ethernet / 802.15.4, etc 6LoWPAN 10
Example use cases HTTP- proxy with 6LoWPAN Proxy HTTP/ HTTP TCP IPv4/v6 HTTP TCP IPv4/v6 L2 Internet HTTP TCP IPv4/v6 6LoWPAN 6LoWPAN L2 Ethernet / 802.15.4, etc 6LoWPAN proxy may handle the MTU difference rely on IPv6 deployment on the sensor network added complexity on sensors is not used as an end-to-end protocol it is not the expected universal IoT protocol 10
Is a good solution? is a carefully designed protocol implementations are compact libcoap : 10,000 lines of C, 2,800 semi-columns contiki : 4,000 lines of C, 1,100 semi-columns In practice, is restricted to a local perimeter no end-to-end paradigm itself is not sufficient. Sensors must embed: IPv4, IPv6, UDP, 6LoWPAN, multicast address protocols (DHCP, SLAC, ARP, IPv6-ND, etc.) discovery protocols (DNS-SD, mdns, etc.) 11
Outline Introduction The protocol The CASAN architecture Conclusion 12
CASAN architecture Common Architecture for Sensor and Actuator Networks Goal: reduce sensor complexity as much as possible Example: ATmega328 (8-bits, 16 MHz, 2 KB SRAM) Remove all unnecessary protocols Remove IP, UDP, 6LoWPAN Use directly on any L2 layer Ethernet, IEEE 802.15.4 with 127 bytes of MTU, etc. Shift complexity to a more capable device most realistic use-case: needs a gateway Example: Raspberry PI, with a general purpose OS Master of the CASAN domain (sensors = slaves) 13
CASAN architecture HTTP/ requests over IPv4/v6 CASAN protocol over L2 Application Internet CASAN master CASAN system Local Area Network CASAN slaves 14
CASAN architecture HTTP/ requests over IPv4/v6 CASAN protocol over L2 Application Internet CASAN master CASAN system Local Area Network CASAN slaves 1. Initial pairing: done once 14
CASAN architecture HTTP/ requests over IPv4/v6 CASAN protocol over L2 Application GET /.well known/casan Internet </123/temp> ;... </456/light> ;...... CASAN system Local Area Network CASAN master association </temp> ; title="temperature" ; rt="temp" (/.well known/casan URL, RFC 6690) CASAN slaves 1. Initial pairing: done once 2. Tight coupling (association) 14
CASAN architecture Application HTTP/ requests over IPv4/v6 GET /123/temp Internet 24.3 CASAN master CASAN system CASAN protocol over L2 GET /temp Local Area Network 24.3 CASAN slaves 1. Initial pairing: done once 2. Tight coupling (association) 3. REST-routing 14
CASAN architecture Application HTTP/ requests over IPv4/v6 GET /123/temp Internet 24.3 CASAN master CASAN system CASAN protocol over L2 GET /temp Local Area Network 24.3 CASAN slaves 1. Initial pairing: done once 2. Tight coupling (association) 3. REST-routing All CASAN messages are ones directly over L2 14
CASAN architecture reliability Single point of failure master redundancy Application Internet masters Local Area Network CASAN system Masters are linked with a redundancy protocol (VRRP, CARP, HSRP, etc.) Each sensor associates with all masters 15
CASAN architecture scalability CASAN is not limited to a perimeter: slave A master A master M CASAN system slave B master B CASAN system CASAN system A master may be a slave in another CASAN system Slaves advertise their resources (/.well-known/casan) REST-level routing 16
CASAN Implementation Prototype: Master: C++ (2011) on Linux Slave: Arduino ATmega328 (8-bits, 16 MHz, 2 KB SRAM) + Wiznet W5100 Ethernet shield Zigduino ATmega128RFA1 with on-chip 802.15.4 Comparison: not on performances (CASAN = over L2) on code complexity (code size) and functionalities Contiki (general purpose implementation) Pico-IPv6 (highly specialized stack / Arduino-XBee) 17
CASAN Evaluation Contiki Pico-IPv6 CASAN Sensor code size Software maintainability Sensor hardware cost Interoperability Internet support L2 independence Service discovery Scalability Access control 18
Outline Introduction The protocol The CASAN architecture Conclusion 19
Conclusion is a good protocol, but: in the real world, its use is restricted to local networks -enabled sensors are complex (IPv*, 6LoWPAN, ARP/ND, DHCP/SLAC, DNS-SD, etc.) The CASAN system is reducing sensor complexity without losing functionalities code size similar to a highly specialized one no loss in functionalities compared to a general system such as Contiki added functionalities such as master replication not restricted to local networks (scalability) 20
Conclusion CASAN system is a great base for 4P factories masters can share data, logic, be participative anomalies can be detected locally we have global awareness and a lot more thanks to the high proximity of masters and slaves 21
Conclusion CASAN system is a great base for 4P factories masters can share data, logic, be participative anomalies can be detected locally we have global awareness and a lot more thanks to the high proximity of masters and slaves Future works: security layer smart-building deployment 21
Questions? slave A master A master M CASAN system slave B master B CASAN system CASAN system 22
Additional slides 23
CASAN Protocol stack Master Slave Translator device action HTTP TCP IP DTLS UDP CASAN DTLS CASAN DTLS data link protocols Ethernet 802.15.4 PLC... To slaves data link protocols Incoming messages from the Internet 24
Typical use cases (1/4) End-to-end UDP IPv4/v6 UDP IPv4/v6 L2 Internet UDP IPv4/v6 end-to-end scenario limited by middle-boxes application must handle MTU of sensor network limited to specific perimeters: local networks (car networks, smart buildings, etc.) 25
Typical use cases (2/4) 6LoWPAN compression UDP IPv6 UDP IPv6 L2 Internet Proxy 6LoWPAN UDP 6LoWPAN IPv6 6LoWPAN L2 Ethernet 802.15.4, etc 6LoWPAN 6LoWPAN: message size + IPv6 overhead rely on IPv6 deployment added complexity on sensors: handle compression + process IPv6 packets 26
Typical use cases (3/4) HTTP- proxy with 6LoWPAN Proxy HTTP/ HTTP TCP IPv4/v6 HTTP TCP IPv4/v6 L2 Internet HTTP TCP IPv4/v6 6LoWPAN 6LoWPAN L2 Ethernet / 802.15.4, etc 6LoWPAN proxy may handle the MTU difference rely on IPv6 deployment on the sensor network added complexity on sensors is not used as an end-to-end protocol it is not the expected universal IoT protocol 27
Typical use cases (4/4) HTTP- proxy without 6LoWPAN Proxy HTTP/ HTTP TCP HTTP TCP IPv4/v6 L2 HTTP TCP UDP UDP IPv4/v6 L2 UDP IPv4/v6 Internet IPv4/v6 IPv4/v6 Ethernet / 802.15.4, etc IPv4/v6 more realistic use-case (with IPv4) proxy may handle the MTU difference is not the expected universal IoT protocol end-to-end paradigm is broken 28
CASAN Protocol stack Master Slave Translator device action HTTP TCP IP DTLS UDP CASAN DTLS CASAN DTLS data link protocols Ethernet 802.15.4 PLC... To slaves data link protocols Incoming messages from the Internet 29