SlideShare a Scribd company logo
1 of 21
Download to read offline
A Low-Power CoAP for Contiki
Matthias Kovatsch, Simon Duquennoy, and Adam Dunkels
kovatsch@inf.ethz.ch   simonduq@sics.se   adam@sics.se




Monday, 17 Oct 2011
Internet of Things Protocol Stack

 Layer                           Protocol
 Application                     CoAP / REST Engine (Erbium)

 Transport                       UDP

 Network                         IPv6 / RPL

 Adaption                        6LoWPAN

 MAC                             CSMA / link-layer bursts

 Radio Duty Cycling              ContikiMAC

 Physical                        IEEE 802.15.4

Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki   2
ContikiMAC                                                                  Radio on
                                                                          D Data frame
                                                                          A ACK frame


         Sender                  D   D    D        D A



    Receiver                                       D A


                   Channel check         Transmission detected



Matthias Kovatsch – ETH Zürich             A Low-Power CoAP for Contiki                  3
Link-layer Bursts                                                           Radio on
                                                                          D Data frame
                                                                          A ACK frame


         Sender                  D   D    D        D A D A D A D A



    Receiver                                       D A D A D A D A


                   Channel check         Transmission detected



Matthias Kovatsch – ETH Zürich             A Low-Power CoAP for Contiki                  4
Constrained Application Protocol (CoAP)

 RESTful Web services for networked embedded devices
        Idealized architectural style of the Web
        HTTP for the Internet of Things


                                                                         coap://sky2/


                                                     coap://sky1/




                                                                    coap://sky3/



Matthias Kovatsch – ETH Zürich     A Low-Power CoAP for Contiki                         5
«Erbium» CoAP for Contiki




 Implements draft-ietf-core-coap-07
 Available in the Contiki repository on SourceForge


Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki   6
«Erbium» CoAP

 Reliable UDP transport

 Observing resources

 Blockwise transfers

 Resource discovery

 Separate responses



 Blocking client requests

Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki   7
«Erbium» REST Engine                                            CoRE Link Format
                                                                title="Hello world";
                                                                rt="TemperatureC";
 Resource abstraction
   RESOURCE(handle, METHODs, URI-Path, Web Linking info);
     Resource handler

   PERIODIC_RESOURCE(handle, METHODs, URI-Path, info, period);
     Additional periodic handler

   EVENT_RESOURCE(handle, METHODs, URI-Path, info);
     Additional event handler
                                                                         Observable




Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki                          8
«Erbium» Memory Footprint

                                                                ROM [kB]   RAM [kB]
 CoAP REST Engine total                                           8.5        1.5
       Measured stack usage                                        –         0.1
       REST Engine                                                0.7         0
       CoAP-07 base                                               4.5         0
       CoAP-07 server                                             1.9        0.3
       CoAP-07 transport                                          0.4        0.9
       CoAP-07 observing                                          0.9        0.2
       CoAP-07 separate                                           0.1         0

Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki                         9
Experimental Set-up

                                                                           4 hops

                                 Energy data over USB


                                           100 Requests each
                                                                                    3 hops

    Laptop with                                           Static routing
   border router



                                      1 hop                             2 hops


Matthias Kovatsch – ETH Zürich           A Low-Power CoAP for Contiki                        10
No duty cycling
                                                                                                        ContikiMAC
Energy vs Latency for 64B Payload
                                                                                           8 Hz channel check rate
                                                                                     1.0
                                                                                           0.6% RDC
               400
                                                                                     0.8
               300
 Energy [mJ]




                                                                       Latency [s]
                                                                                     0.6
               200
                                                                                     0.4
               100
                                                                                     0.2

                0
                                                                                      0
                          1         2      3    4                                           1      2     3     4
                                 Number of hops                                                 Number of hops


Matthias Kovatsch – ETH Zürich                      A Low-Power CoAP for Contiki                                      11
4 hops
                                                                                                                        2 hops
    Transmitting Large Data                                                                                             1 hop

              70

              65
                              2      3         4    5    6                            1.8
                                                                                                  Bursts avoid
              60
                                                                                      1.6       steps in latency
              55
                                                                                      1.4
              50

              45                                                                      1.2
Energy [mJ]




                                                                        Latency [s]
              40
                                                                                      1.0
              35

              30                         Steps become                                 0.8

              25                         less noticable
                                                                                      0.6
              20

              15                                                                      0.4

              10
                                                                                      0.2
              5

              0                                                                        0
                   0          128        256       384    512                               0        128    256    384           512

                               Payload [Bytes]                                                        Payload [Bytes]
    Matthias Kovatsch – ETH Zürich                       A Low-Power CoAP for Contiki                                                  12
Transmitting Large Data                                                                     Radio on
                                                                                          D Data frame
                             Number of frames sent depends on
                            link quality, not number of fragments                         A ACK frame


         Sender                       D    D    D        D A D                  D   D A



    Receiver                                             D A                        D A


                   Channel check               Transmission detected



Matthias Kovatsch – ETH Zürich                   A Low-Power CoAP for Contiki                            13
Separate Responses

 Client                          Server                          Client                  Server

                  Request                                                      Request
                                                                                 ACK
                     Retry
                                          Request                                                 Request
                                          processing                                              processing
                     Retry
                      …                     Benchmark
                                            and switch
                Response                   automatically                       Response
                                                                                 ACK



Matthias Kovatsch – ETH Zürich                  A Low-Power CoAP for Contiki                               14
Without
                                                                                                     With
Separate Responses over 4 Hops

                                     Savings marginal for CoAP’s default parameters
                        150

                        125
          Energy [mJ]




                        100

                        75                                                              Retransmissions after
                                                                                         2-3, 4-6, 8-12, and
                        50                                                                 16-24 seconds
                        25

                                 0       5       10              15                20   25
                                         Server processing time [s]


Matthias Kovatsch – ETH Zürich                      A Low-Power CoAP for Contiki                                15
Conclusion

 Internet of Things stack
           Isolated layers with different goals work together
           Layered architecture lowers complexity
           Optimize for single fragments
           No need to optimize payload size once fragmented


 CoAP
        Draft 07 implementation for Contiki
        Block size most important parameter for memory-constrained devices:
         Exponential sizes too coarse-grained




Matthias Kovatsch – ETH Zürich       A Low-Power CoAP for Contiki        16
Future Work

 Extend «Erbium» CoAP
        Blocking resource handler for UART
        Hierarchical resources / URI-Path handling
        Improve observer handling (only one buffer)


 Study RESTful approach
        Long-term deployment with smart appliances
        Separate application logic from device firmware
         and combine with «Californium»-based App Server



 https://github.com/mkovatsc/Californium

Matthias Kovatsch – ETH Zürich        A Low-Power CoAP for Contiki   17
THANK YOU

Questions?




Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki   18
Blockwise Transfers

Automatic or controlled by handler
   RESOURCE(handle, METHODs, URI-Path, Web Linking info);
     Resource handler

   handle_handler(void* request, void* response,
                  uint8_t *buffer, uint16_t preferred_size,
                  int32_t *offset);


            Unaware: fill buffer up to                       Chunk-aware: use offset and
            REST_MAX_CHUNK_SIZE                              fill buffer up to preferred_size
                                                         (update offset and set to -1 when finished)



Matthias Kovatsch – ETH Zürich           A Low-Power CoAP for Contiki                              19
Observing Resources

Post-handler registers observers automatically
   PERIODIC_RESOURCE(handle, METHODs, URI-Path, info, period);
     Additional periodic handler

   EVENT_RESOURCE(handle, METHODs, URI-Path, info);
     Additional event handler

   int handle_event_handler(resource_t *r) {
     ...
     REST.notify_subscribers(r->url, CON/NON, seqno, buf, len);
   }
                          Every x-th is CON to resolve orphans

Matthias Kovatsch – ETH Zürich   A Low-Power CoAP for Contiki   20
«Erbium» REST Engine

 Manipulate messages with REST API
        REST.set_header_etag(response, etag_buf, etag_len);
        REST.get_query_variable(request, name, value_buffer);


 Link implementation
           coap-03
           coap-06
           coap-07
           …
           HTTP (not yet implemented for Erbium)




Matthias Kovatsch – ETH Zürich      A Low-Power CoAP for Contiki   21

More Related Content

What's hot

NFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrail
NFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrailNFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrail
NFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrail
ozkan01
 

What's hot (20)

IoT Coap
IoT Coap IoT Coap
IoT Coap
 
Connecting Things to the Web using Programmable Low-power WiFi Modules
Connecting Things to the Web using Programmable Low-power WiFi ModulesConnecting Things to the Web using Programmable Low-power WiFi Modules
Connecting Things to the Web using Programmable Low-power WiFi Modules
 
JavaZone 2016 : MQTT and CoAP for the Java Developer
JavaZone 2016 : MQTT and CoAP for the Java DeveloperJavaZone 2016 : MQTT and CoAP for the Java Developer
JavaZone 2016 : MQTT and CoAP for the Java Developer
 
ARM CoAP Tutorial
ARM CoAP TutorialARM CoAP Tutorial
ARM CoAP Tutorial
 
PLNOG16: Data center interconnect dla opornych, Krzysztof Mazepa
PLNOG16: Data center interconnect dla opornych, Krzysztof MazepaPLNOG16: Data center interconnect dla opornych, Krzysztof Mazepa
PLNOG16: Data center interconnect dla opornych, Krzysztof Mazepa
 
22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...
22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...
22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...
 
PLNOG16: Coping with Growing Demands – Developing the Network to New Bandwidt...
PLNOG16: Coping with Growing Demands – Developing the Network to New Bandwidt...PLNOG16: Coping with Growing Demands – Developing the Network to New Bandwidt...
PLNOG16: Coping with Growing Demands – Developing the Network to New Bandwidt...
 
MQTT and CoAP
MQTT and CoAPMQTT and CoAP
MQTT and CoAP
 
CoAP protocol -Internet of Things(iot)
CoAP protocol -Internet of Things(iot)CoAP protocol -Internet of Things(iot)
CoAP protocol -Internet of Things(iot)
 
NFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrail
NFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrailNFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrail
NFV SDN Summit March 2014 D3 03 bruno_rijsman NFV with OpenContrail
 
6lowpan
6lowpan 6lowpan
6lowpan
 
The constrained application protocol (CoAP)
The constrained application protocol (CoAP)The constrained application protocol (CoAP)
The constrained application protocol (CoAP)
 
On the migration of a large scale network from i pv4 to ipv6 environment
On the migration of a large scale network from i pv4 to ipv6 environmentOn the migration of a large scale network from i pv4 to ipv6 environment
On the migration of a large scale network from i pv4 to ipv6 environment
 
Implementation of isp mpls backbone network on i pv6 using 6 pe routers main PPT
Implementation of isp mpls backbone network on i pv6 using 6 pe routers main PPTImplementation of isp mpls backbone network on i pv6 using 6 pe routers main PPT
Implementation of isp mpls backbone network on i pv6 using 6 pe routers main PPT
 
Kubernetes OpenContrail Meetup
Kubernetes OpenContrail MeetupKubernetes OpenContrail Meetup
Kubernetes OpenContrail Meetup
 
The constrained application protocol (coap) part 2
The constrained application protocol (coap)  part 2The constrained application protocol (coap)  part 2
The constrained application protocol (coap) part 2
 
Contrail Deep-dive - Cloud Network Services at Scale
Contrail Deep-dive - Cloud Network Services at ScaleContrail Deep-dive - Cloud Network Services at Scale
Contrail Deep-dive - Cloud Network Services at Scale
 
OpenStack MeetUp - OpenContrail Presentation
OpenStack MeetUp - OpenContrail PresentationOpenStack MeetUp - OpenContrail Presentation
OpenStack MeetUp - OpenContrail Presentation
 
Tungsten Fabric Overview
Tungsten Fabric OverviewTungsten Fabric Overview
Tungsten Fabric Overview
 
PLNOG16: Netflix Open Connect is the Netflix proprietary CDN, Nina Bargisen
PLNOG16: Netflix Open Connect is the Netflix proprietary CDN, Nina BargisenPLNOG16: Netflix Open Connect is the Netflix proprietary CDN, Nina Bargisen
PLNOG16: Netflix Open Connect is the Netflix proprietary CDN, Nina Bargisen
 

Viewers also liked

Physical Mashups in the Web-Home
Physical Mashups in the Web-HomePhysical Mashups in the Web-Home
Physical Mashups in the Web-Home
Dominique Guinard
 
IPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorialIPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorial
adamdunkels
 
Presentation2
Presentation2Presentation2
Presentation2
newham5-6
 
Iv mostra cultural - 2010
Iv   mostra cultural - 2010Iv   mostra cultural - 2010
Iv mostra cultural - 2010
cepmaio
 
La magia de la globoflexia.1
La magia de la globoflexia.1La magia de la globoflexia.1
La magia de la globoflexia.1
rosemere12
 

Viewers also liked (20)

Physical Mashups in the Web-Home
Physical Mashups in the Web-HomePhysical Mashups in the Web-Home
Physical Mashups in the Web-Home
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
Switch to Python 3…now…immediately
Switch to Python 3…now…immediatelySwitch to Python 3…now…immediately
Switch to Python 3…now…immediately
 
XMPP Technical Overview + Jingle Protocol Study
XMPP Technical Overview + Jingle Protocol StudyXMPP Technical Overview + Jingle Protocol Study
XMPP Technical Overview + Jingle Protocol Study
 
IPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorialIPSN 2009 Contiki / uIP tutorial
IPSN 2009 Contiki / uIP tutorial
 
Contiki introduction I.
Contiki introduction I.Contiki introduction I.
Contiki introduction I.
 
The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPP
 
What is XMPP Protocol
What is XMPP ProtocolWhat is XMPP Protocol
What is XMPP Protocol
 
XMPP 101
XMPP 101XMPP 101
XMPP 101
 
XMPP In Real Time
XMPP In Real TimeXMPP In Real Time
XMPP In Real Time
 
Building day 2 upload Building the Internet of Things with Thingsquare and ...
Building day 2   upload Building the Internet of Things with Thingsquare and ...Building day 2   upload Building the Internet of Things with Thingsquare and ...
Building day 2 upload Building the Internet of Things with Thingsquare and ...
 
ContikiMAC : Radio Duty Cycling Protocol
ContikiMAC : Radio Duty Cycling ProtocolContikiMAC : Radio Duty Cycling Protocol
ContikiMAC : Radio Duty Cycling Protocol
 
Network configuration
Network configurationNetwork configuration
Network configuration
 
Presentation2
Presentation2Presentation2
Presentation2
 
Top500 Slides for June 2014
Top500 Slides for June 2014Top500 Slides for June 2014
Top500 Slides for June 2014
 
IPAR 2011 Corporate Presentation
IPAR 2011 Corporate PresentationIPAR 2011 Corporate Presentation
IPAR 2011 Corporate Presentation
 
Clase 3
Clase 3Clase 3
Clase 3
 
World tech es
World tech esWorld tech es
World tech es
 
Iv mostra cultural - 2010
Iv   mostra cultural - 2010Iv   mostra cultural - 2010
Iv mostra cultural - 2010
 
La magia de la globoflexia.1
La magia de la globoflexia.1La magia de la globoflexia.1
La magia de la globoflexia.1
 

Similar to A Low-Power CoAP for Contiki

Energy Efficient Fragment Recovery Techniques for Low-power and Lossy Networks
Energy Efficient Fragment Recovery Techniques for Low-power and Lossy NetworksEnergy Efficient Fragment Recovery Techniques for Low-power and Lossy Networks
Energy Efficient Fragment Recovery Techniques for Low-power and Lossy Networks
Ahmed Ayadi
 
A novel pause count backoff algorithm for channel access
A novel pause count backoff algorithm for channel accessA novel pause count backoff algorithm for channel access
A novel pause count backoff algorithm for channel access
ambitlick
 
Computer network (5)
Computer network (5)Computer network (5)
Computer network (5)
NYversity
 

Similar to A Low-Power CoAP for Contiki (20)

Timing Analysis of a Linux-Based CAN-to-CAN Gateway
Timing Analysis of a Linux-Based CAN-to-CAN GatewayTiming Analysis of a Linux-Based CAN-to-CAN Gateway
Timing Analysis of a Linux-Based CAN-to-CAN Gateway
 
Hybrid Swtiching dyk04
Hybrid Swtiching dyk04Hybrid Swtiching dyk04
Hybrid Swtiching dyk04
 
ARM LPC2300/LPC2400 TCP/IP Stack Porting
ARM LPC2300/LPC2400 TCP/IP Stack PortingARM LPC2300/LPC2400 TCP/IP Stack Porting
ARM LPC2300/LPC2400 TCP/IP Stack Porting
 
MARC ONERA Toulouse2012 Altreonic
MARC ONERA Toulouse2012 AltreonicMARC ONERA Toulouse2012 Altreonic
MARC ONERA Toulouse2012 Altreonic
 
Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3
 
Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3
 
Timothy J Cash Career Portfolio
Timothy J Cash Career PortfolioTimothy J Cash Career Portfolio
Timothy J Cash Career Portfolio
 
Pushing the limits of CAN - Scheduling frames with offsets provides a major p...
Pushing the limits of CAN - Scheduling frames with offsets provides a major p...Pushing the limits of CAN - Scheduling frames with offsets provides a major p...
Pushing the limits of CAN - Scheduling frames with offsets provides a major p...
 
Energy Efficient Fragment Recovery Techniques for Low-power and Lossy Networks
Energy Efficient Fragment Recovery Techniques for Low-power and Lossy NetworksEnergy Efficient Fragment Recovery Techniques for Low-power and Lossy Networks
Energy Efficient Fragment Recovery Techniques for Low-power and Lossy Networks
 
IoT Day 2013 - Madrid
IoT Day 2013 - MadridIoT Day 2013 - Madrid
IoT Day 2013 - Madrid
 
Circuit Emulation for Bulk Transfers in Distributed Storage and Clouds
Circuit Emulation for Bulk Transfers in Distributed Storage and CloudsCircuit Emulation for Bulk Transfers in Distributed Storage and Clouds
Circuit Emulation for Bulk Transfers in Distributed Storage and Clouds
 
A novel pause count backoff algorithm for channel access
A novel pause count backoff algorithm for channel accessA novel pause count backoff algorithm for channel access
A novel pause count backoff algorithm for channel access
 
QsNetIII Adaptively Routed Network For HPC
QsNetIII Adaptively Routed Network For HPCQsNetIII Adaptively Routed Network For HPC
QsNetIII Adaptively Routed Network For HPC
 
Thesis Presentation on Renewal theory based 802.15.6 latest.pptx
Thesis Presentation on Renewal theory based 802.15.6 latest.pptxThesis Presentation on Renewal theory based 802.15.6 latest.pptx
Thesis Presentation on Renewal theory based 802.15.6 latest.pptx
 
TLS in manet
TLS in manetTLS in manet
TLS in manet
 
P2P-Next: Future Internet Media Delivery to CE Devices
P2P-Next: Future Internet Media Delivery to CE DevicesP2P-Next: Future Internet Media Delivery to CE Devices
P2P-Next: Future Internet Media Delivery to CE Devices
 
Ijciet 10 02_067
Ijciet 10 02_067Ijciet 10 02_067
Ijciet 10 02_067
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6
 
Computer network (5)
Computer network (5)Computer network (5)
Computer network (5)
 
6Tisch telecom_bretagne_2016
6Tisch telecom_bretagne_20166Tisch telecom_bretagne_2016
6Tisch telecom_bretagne_2016
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

A Low-Power CoAP for Contiki

  • 1. A Low-Power CoAP for Contiki Matthias Kovatsch, Simon Duquennoy, and Adam Dunkels kovatsch@inf.ethz.ch simonduq@sics.se adam@sics.se Monday, 17 Oct 2011
  • 2. Internet of Things Protocol Stack Layer Protocol Application CoAP / REST Engine (Erbium) Transport UDP Network IPv6 / RPL Adaption 6LoWPAN MAC CSMA / link-layer bursts Radio Duty Cycling ContikiMAC Physical IEEE 802.15.4 Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 2
  • 3. ContikiMAC Radio on D Data frame A ACK frame Sender D D D D A Receiver D A Channel check Transmission detected Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 3
  • 4. Link-layer Bursts Radio on D Data frame A ACK frame Sender D D D D A D A D A D A Receiver D A D A D A D A Channel check Transmission detected Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 4
  • 5. Constrained Application Protocol (CoAP)  RESTful Web services for networked embedded devices  Idealized architectural style of the Web  HTTP for the Internet of Things coap://sky2/ coap://sky1/ coap://sky3/ Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 5
  • 6. «Erbium» CoAP for Contiki  Implements draft-ietf-core-coap-07  Available in the Contiki repository on SourceForge Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 6
  • 7. «Erbium» CoAP  Reliable UDP transport  Observing resources  Blockwise transfers  Resource discovery  Separate responses  Blocking client requests Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 7
  • 8. «Erbium» REST Engine CoRE Link Format title="Hello world"; rt="TemperatureC";  Resource abstraction RESOURCE(handle, METHODs, URI-Path, Web Linking info);  Resource handler PERIODIC_RESOURCE(handle, METHODs, URI-Path, info, period);  Additional periodic handler EVENT_RESOURCE(handle, METHODs, URI-Path, info);  Additional event handler Observable Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 8
  • 9. «Erbium» Memory Footprint ROM [kB] RAM [kB] CoAP REST Engine total 8.5 1.5 Measured stack usage – 0.1 REST Engine 0.7 0 CoAP-07 base 4.5 0 CoAP-07 server 1.9 0.3 CoAP-07 transport 0.4 0.9 CoAP-07 observing 0.9 0.2 CoAP-07 separate 0.1 0 Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 9
  • 10. Experimental Set-up 4 hops Energy data over USB 100 Requests each 3 hops Laptop with Static routing border router 1 hop 2 hops Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 10
  • 11. No duty cycling ContikiMAC Energy vs Latency for 64B Payload 8 Hz channel check rate 1.0 0.6% RDC 400 0.8 300 Energy [mJ] Latency [s] 0.6 200 0.4 100 0.2 0 0 1 2 3 4 1 2 3 4 Number of hops Number of hops Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 11
  • 12. 4 hops 2 hops Transmitting Large Data 1 hop 70 65 2 3 4 5 6 1.8 Bursts avoid 60 1.6 steps in latency 55 1.4 50 45 1.2 Energy [mJ] Latency [s] 40 1.0 35 30 Steps become 0.8 25 less noticable 0.6 20 15 0.4 10 0.2 5 0 0 0 128 256 384 512 0 128 256 384 512 Payload [Bytes] Payload [Bytes] Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 12
  • 13. Transmitting Large Data Radio on D Data frame Number of frames sent depends on link quality, not number of fragments A ACK frame Sender D D D D A D D D A Receiver D A D A Channel check Transmission detected Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 13
  • 14. Separate Responses Client Server Client Server Request Request ACK Retry Request Request processing processing Retry … Benchmark and switch Response automatically Response ACK Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 14
  • 15. Without With Separate Responses over 4 Hops Savings marginal for CoAP’s default parameters 150 125 Energy [mJ] 100 75 Retransmissions after 2-3, 4-6, 8-12, and 50 16-24 seconds 25 0 5 10 15 20 25 Server processing time [s] Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 15
  • 16. Conclusion  Internet of Things stack  Isolated layers with different goals work together  Layered architecture lowers complexity  Optimize for single fragments  No need to optimize payload size once fragmented  CoAP  Draft 07 implementation for Contiki  Block size most important parameter for memory-constrained devices: Exponential sizes too coarse-grained Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 16
  • 17. Future Work  Extend «Erbium» CoAP  Blocking resource handler for UART  Hierarchical resources / URI-Path handling  Improve observer handling (only one buffer)  Study RESTful approach  Long-term deployment with smart appliances  Separate application logic from device firmware and combine with «Californium»-based App Server https://github.com/mkovatsc/Californium Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 17
  • 18. THANK YOU Questions? Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 18
  • 19. Blockwise Transfers Automatic or controlled by handler RESOURCE(handle, METHODs, URI-Path, Web Linking info);  Resource handler handle_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset); Unaware: fill buffer up to Chunk-aware: use offset and REST_MAX_CHUNK_SIZE fill buffer up to preferred_size (update offset and set to -1 when finished) Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 19
  • 20. Observing Resources Post-handler registers observers automatically PERIODIC_RESOURCE(handle, METHODs, URI-Path, info, period);  Additional periodic handler EVENT_RESOURCE(handle, METHODs, URI-Path, info);  Additional event handler int handle_event_handler(resource_t *r) { ... REST.notify_subscribers(r->url, CON/NON, seqno, buf, len); } Every x-th is CON to resolve orphans Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 20
  • 21. «Erbium» REST Engine  Manipulate messages with REST API  REST.set_header_etag(response, etag_buf, etag_len);  REST.get_query_variable(request, name, value_buffer);  Link implementation  coap-03  coap-06  coap-07  …  HTTP (not yet implemented for Erbium) Matthias Kovatsch – ETH Zürich A Low-Power CoAP for Contiki 21