SlideShare a Scribd company logo
Software update for IoT
the current state of play
Chris Simmonds
OpenIoT Summit 2016
Software update for IoT 1 Copyright © 2011-2016, 2net Ltd
License
These slides are available under a Creative Commons Attribution-ShareAlike 3.0
license. You can read the full text of the license here
http://creativecommons.org/licenses/by-sa/3.0/legalcode
You are free to
• copy, distribute, display, and perform the work
• make derivative works
• make commercial use of the work
Under the following conditions
• Attribution: you must give the original author credit
• Share Alike: if you alter, transform, or build upon this work, you may distribute
the resulting work only under a license identical to this one (i.e. include this
page exactly as it is)
• For any reuse or distribution, you must make clear to others the license terms of
this work
Software update for IoT 2 Copyright © 2011-2016, 2net Ltd
About Chris Simmonds
• Consultant and trainer
• Author of Mastering Embedded Linux
Programming
• Working with embedded Linux since 1999
• Android since 2009
• Speaker at many conferences and
workshops
"Looking after the Inner Penguin" blog at http://2net.co.uk/
https://uk.linkedin.com/in/chrisdsimmonds/
https://google.com/+chrissimmonds
Software update for IoT 3 Copyright © 2011-2016, 2net Ltd
Overview
• Software update 101
• Update clients
• OTA update
• OTA implementations
Software update for IoT 4 Copyright © 2011-2016, 2net Ltd
What could possibly go wrong?
• Mirai: a recent > 600 Gbps
DDoS attack
• Very simple: looks for open
Telnet ports and logs on using
default, well-known, name
and password
• Prime target: Dahua IP CCTV
cameras
Details on PenTestPartners:
https://www.pentestpartners.com/blog/
optimising-mirai-a-better-iot-ddos-botnet
Software update for IoT 5 Copyright © 2011-2016, 2net Ltd
Problems
Problem 1
• Embedded software is non-trivial (=> has bugs!)
• Devices are often connected to the Internet
• Allowing intruders to exploit the bugs remotely
Problem 2
• We would like to deploy new features, improve
performance, etc.
Conclusion
• We need a software update mechanism
Software update for IoT 6 Copyright © 2011-2016, 2net Ltd
Requirements for SW update
• Secure, to prevent the device from being hijacked
• Robust, so that an update does not render the device
unusable
• Atomic, meaning that an update must be installed
completely or not at all
• Fail-safe, so that there is a fall-back mode if all else
fails
• Preserve persistent state
Software update for IoT 7 Copyright © 2011-2016, 2net Ltd
What to update?
Frequency
Ease of update
Bootloader
Kernel
Root file system
System applications
Software update for IoT 8 Copyright © 2011-2016, 2net Ltd
Update granularity
• File:
• not an option: hard to achieve atomicity over a group
of file updates
• Package:
• apt-get update works fine for servers but not for
devices
• Container:
• neat idea, so long as you have containerised
applications
• Image:
• the most common option: fairy easy to implement and
verify
Software update for IoT 9 Copyright © 2011-2016, 2net Ltd
Device update != server update
• Server
• Secure environment, no power outage, no network
outage
• If update fails, human intervention is possible
• Device:
• Intermittent power and network mean update quite
likely to be interrupted
• Failed update may be difficult (and expensive) to
resolve
Software update for IoT 10 Copyright © 2011-2016, 2net Ltd
Options for image update
Symmetric A/B
(Android after
Nougat)
Bootloader User
data
Boot
flag
OS Copy 1
OS Copy 2
Bootloader
Main OS
Recovery OS
User
data
Boot
flag
Asymmetric
normal/recovery
(Android before
Nougat)
Software update for IoT 11 Copyright © 2011-2016, 2net Ltd
Statelessness
• Image update of a filesystem implies no state is
stored in that filesystem
• See my talk about read-only rootfs
http://www.slideshare.net/chrissimmonds/
readonly-rootfs-theory-and-practice
Software update for IoT 12 Copyright © 2011-2016, 2net Ltd
Update agent
• Update agent is the code on the device that manages
the update
• Tasks
• Receive update from local storage (e.g. USB) or from
remote server
• Apply the update
• Toggle boot flag
Software update for IoT 13 Copyright © 2011-2016, 2net Ltd
swupdate
• Image-based update client
• License: GPLv2
• Code https://github.com/sbabic/swupdate
• Documentation
http://sbabic.github.io/swupdate/index.html
Software update for IoT 14 Copyright © 2011-2016, 2net Ltd
swupdate features
• Symmetric and asymmetric update
• Bootloader support: U-Boot
• Volume formats: MTD, UBI, MBR and UEFI partitions
• Yocto Project layer: meta-swupdate
• Remote/streaming using curl (http/https/ssh/ftp)
• integrated REST client connector to hawkBit
• Signed images
Software update for IoT 15 Copyright © 2011-2016, 2net Ltd
RAUC - Robust Auto-Update Controller
• Image-based update client
• License: LGPLv2.1
• Source Code: https://github.com/jluebbe/rauc
• Documentation: https://rauc.readthedocs.org/
Software update for IoT 16 Copyright © 2011-2016, 2net Ltd
RAUC features
• Symmetric and asymmetric update
• Bootloader support: grub, barebox
• Volume formats: MTD, UBI, MBR and UEFI partitions
• Build systems: Yocto Project (meta-ptx), PTXDist
• Remote/streaming using curl (http/https/ssh/ftp)
• Cryptographic verification using OpenSSL
(signatures based on x.509 certificates)
Software update for IoT 17 Copyright © 2011-2016, 2net Ltd
OTA update
• Solutions so far are mostly suitable for
• Local update (man with a USB thumb drive)
• User initiated/attended remote update
• Local or attended remote update does not scale
• Hence, OTA (Over The Air) update
• Updates pushed from central server
• Update is automatic (or semi-automatic as with
Android/IoS)
Software update for IoT 18 Copyright © 2011-2016, 2net Ltd
OTA update components
Device software
build system
Firmware
images
Sign with
authentication
key
Update
server
Device
Update
agent
Software update for IoT 19 Copyright © 2011-2016, 2net Ltd
Complexities of OTA update
• Authentication (is this update legit?)
• Security (am I receiving what you are sending?)
• Roll-back (if update fails to boot, switch to previous
version)
• Scale (roll out to large populations)
• Monitoring (keeping track of status of the population
of devices)
Software update for IoT 20 Copyright © 2011-2016, 2net Ltd
Roll-back
• Boot limit count
• Feature of bootloader (e.g U-Boot)
• Increment count in bootloader
• Reset after successful boot
• If reboot with count > 0, bootloader knows boot failed
and loads alternate rootfs
• Hardware watchdog
• If hang in early boot, watchdog times out and resets
CPU
• Bootloader checks reset reason
• If watchdog, loads alternate rootfs
Software update for IoT 21 Copyright © 2011-2016, 2net Ltd
Mender.io
• OTA update server and client
• Full system image update
• Licenses: Server and Client: Apache 2
• Code (client):
https://github.com/mendersoftware/mender
• Documentation: https://docs.mender.io
Software update for IoT 22 Copyright © 2011-2016, 2net Ltd
Mender.io features
• Symmetric A/B image update client
• Bootloader support: U-Boot
• Volume formats: MBR and UEFI partitions
• Update commit and roll-back
• Build system: Yocto Project (meta-mender)
• Remote features: deployment server, build artifact
management, device management console
Software update for IoT 23 Copyright © 2011-2016, 2net Ltd
Resin.io
• OTA update server and client
• Container (Docker) based updates
• Licenses: Client: Apache2; Server: proprietary
• Code (client):
https://github.com/resin-os/meta-resin
• Documentation:
https://docs.resin.io/introduction
Software update for IoT 24 Copyright © 2011-2016, 2net Ltd
resin.io features
• Symetric A/B rootfs for core OS ("Resinhup")
• Applications packaged into Docker containers
• Build integration: Yocto Project (meta-resin)
• Docker images can be preloaded into YP build
• Remote features: deployment server, integration with
git
Software update for IoT 25 Copyright © 2011-2016, 2net Ltd
Brillo
• Brillo is cut-down Android for IoT
• License: Apache 2.0
• Android OTA update client
• Symmetric and asymmetric image update
• Licenses: Client: Apache2; Server: proprietary
• Code (client): https://android.googlesource.com
• Documentation:
https://developers.google.com/brillo
Software update for IoT 26 Copyright © 2011-2016, 2net Ltd
Conclusion
• Software update is a hot topic
• Open source solutions described in this presentation:
• Stand-alone update clients
• swupdaed
• RAUC
• End-to-end solutions
• mender.io
• resin.io
This and other topics associated with building robust embedded
systems are coverred in my training courses
http://www.2net.co.uk/training.html
Software update for IoT 27 Copyright © 2011-2016, 2net Ltd

More Related Content

What's hot (20)

PDF
Process Scheduler and Balancer in Linux Kernel
Haifeng Li
 
PDF
KubeVirt 101
VirtualTech Japan Inc.
 
PDF
Reducing the boot time of Linux devices
Chris Simmonds
 
PDF
Docker praktyczne podstawy
Sages
 
PDF
[D35] インメモリーデータベース徹底比較 by Komori
Insight Technology, Inc.
 
PPTX
UEFIによるELFバイナリの起動
uchan_nos
 
PDF
Qemu Introduction
Chiawei Wang
 
PDF
ELFの動的リンク
7shi
 
PDF
Pacemaker 操作方法メモ
Masayuki Ozawa
 
PDF
Making Linux do Hard Real-time
National Cheng Kung University
 
PDF
プロセスとコンテキストスイッチ
Kazuki Onishi
 
PDF
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Chris Simmonds
 
ODP
Linux Internals - Kernel/Core
Shay Cohen
 
PDF
Linux boot process – explained
LinuxConcept
 
PDF
OpenStackトラブルシューティング入門
VirtualTech Japan Inc.
 
PDF
SREcon 2016 Performance Checklists for SREs
Brendan Gregg
 
PDF
Android Storage - Vold
William Lee
 
PDF
How to Choose a Software Update Mechanism for Embedded Linux Devices
Leon Anavi
 
PDF
痛い目にあってわかる HAクラスタのありがたさ
Takatoshi Matsuo
 
PDF
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Linaro
 
Process Scheduler and Balancer in Linux Kernel
Haifeng Li
 
Reducing the boot time of Linux devices
Chris Simmonds
 
Docker praktyczne podstawy
Sages
 
[D35] インメモリーデータベース徹底比較 by Komori
Insight Technology, Inc.
 
UEFIによるELFバイナリの起動
uchan_nos
 
Qemu Introduction
Chiawei Wang
 
ELFの動的リンク
7shi
 
Pacemaker 操作方法メモ
Masayuki Ozawa
 
Making Linux do Hard Real-time
National Cheng Kung University
 
プロセスとコンテキストスイッチ
Kazuki Onishi
 
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Chris Simmonds
 
Linux Internals - Kernel/Core
Shay Cohen
 
Linux boot process – explained
LinuxConcept
 
OpenStackトラブルシューティング入門
VirtualTech Japan Inc.
 
SREcon 2016 Performance Checklists for SREs
Brendan Gregg
 
Android Storage - Vold
William Lee
 
How to Choose a Software Update Mechanism for Embedded Linux Devices
Leon Anavi
 
痛い目にあってわかる HAクラスタのありがたさ
Takatoshi Matsuo
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Linaro
 

Viewers also liked (19)

PDF
Software update for IoT Embedded World 2017
Chris Simmonds
 
PDF
Quick and Easy Device Drivers for Embedded Linux Using UIO
Chris Simmonds
 
PDF
Android beyond the smartphone
Chris Simmonds
 
PDF
Booting Android: bootloaders, fastboot and boot images
Chris Simmonds
 
PDF
A timeline for embedded Linux
Chris Simmonds
 
PPTX
自称IQ診断 --- いわゆる頭の体操
HPCシステムズ株式会社
 
PDF
The end of embedded Linux (as we know it)
Chris Simmonds
 
PPTX
HPCで使えそうなFPGA搭載AWS F1 インスタンス_20161218
HPCシステムズ株式会社
 
PDF
Userspace drivers-2016
Chris Simmonds
 
PDF
FPGAX2016 ドキュンなFPGA
Hiroki Nakahara
 
PDF
Tensor flow usergroup 2016 (公開版)
Hiroki Nakahara
 
PPTX
HPC で使えそうな FPGA 搭載 AWS F1 インスタンス 20170127
HPCシステムズ株式会社
 
PPTX
Introducing resinOS: An Operating System Tailored for Containers and Built fo...
Balena
 
DOCX
Anemia de doenças crônicas
Rafael Chechin
 
PPTX
20161120_HPCでFPGAを使ってみたい_fpgastartup
HPCシステムズ株式会社
 
PDF
電波望遠鏡用の分光器をAltera SDK for OpenCL使ってサクッと作ってみた
Hiroki Nakahara
 
PPT
In out system
Agnas Jasmine
 
PDF
Using IO Visor to Secure Microservices Running on CloudFoundry [OpenStack Sum...
IO Visor Project
 
PDF
Portland Science Hack Day: Open Source Hardware
Drew Fustini
 
Software update for IoT Embedded World 2017
Chris Simmonds
 
Quick and Easy Device Drivers for Embedded Linux Using UIO
Chris Simmonds
 
Android beyond the smartphone
Chris Simmonds
 
Booting Android: bootloaders, fastboot and boot images
Chris Simmonds
 
A timeline for embedded Linux
Chris Simmonds
 
自称IQ診断 --- いわゆる頭の体操
HPCシステムズ株式会社
 
The end of embedded Linux (as we know it)
Chris Simmonds
 
HPCで使えそうなFPGA搭載AWS F1 インスタンス_20161218
HPCシステムズ株式会社
 
Userspace drivers-2016
Chris Simmonds
 
FPGAX2016 ドキュンなFPGA
Hiroki Nakahara
 
Tensor flow usergroup 2016 (公開版)
Hiroki Nakahara
 
HPC で使えそうな FPGA 搭載 AWS F1 インスタンス 20170127
HPCシステムズ株式会社
 
Introducing resinOS: An Operating System Tailored for Containers and Built fo...
Balena
 
Anemia de doenças crônicas
Rafael Chechin
 
20161120_HPCでFPGAを使ってみたい_fpgastartup
HPCシステムズ株式会社
 
電波望遠鏡用の分光器をAltera SDK for OpenCL使ってサクッと作ってみた
Hiroki Nakahara
 
In out system
Agnas Jasmine
 
Using IO Visor to Secure Microservices Running on CloudFoundry [OpenStack Sum...
IO Visor Project
 
Portland Science Hack Day: Open Source Hardware
Drew Fustini
 
Ad

Similar to Software update for IoT: the current state of play (20)

DOC
Srikanth_PILLI_CV_latest
Srikanth Pilli
 
PDF
Migrate from WS2003 to WS2008 or WS2012 in One Step
AppZero Inc
 
PPTX
The Role of Standards in IoT Security
Hannes Tschofenig
 
PDF
Kubernetes Robotics Edge Cluster System
Tomoya Fujita
 
PDF
Mender: The open-source software update solution
Mender.io
 
PDF
Why the yocto project for my io t project elc_edinburgh_2018
Mender.io
 
PDF
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
XP Conference India
 
PPTX
Software update for embedded systems
SZ Lin
 
PDF
Mender; the open-source software update solution
Mender.io
 
PPTX
Volunteer Computing using BOINC
Pooyan Mehrparvar
 
PDF
Lick my Lollipop
Tamara Momčilović
 
PDF
What’s New in UniVerse 11.2
Rocket Software
 
PDF
HKG18-212 - Trusted Firmware M: Introduction
Linaro
 
PDF
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
ICS
 
PPTX
Migrating to Windows 7 or 8 with Lenovo's Deployment Optimization Solutions
Lenovo Business
 
PPSX
Eminence team
Vivin NL
 
PDF
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 1
Qualcomm Developer Network
 
PPTX
Multi-OS Engine Technology Overview
Karthiyayini Chinnaswamy
 
PPTX
Approach-to-Security-applications-running-from-different-HW-platforms-Daniel-...
AAnt87
 
PDF
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
AswathRangaraj1
 
Srikanth_PILLI_CV_latest
Srikanth Pilli
 
Migrate from WS2003 to WS2008 or WS2012 in One Step
AppZero Inc
 
The Role of Standards in IoT Security
Hannes Tschofenig
 
Kubernetes Robotics Edge Cluster System
Tomoya Fujita
 
Mender: The open-source software update solution
Mender.io
 
Why the yocto project for my io t project elc_edinburgh_2018
Mender.io
 
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
XP Conference India
 
Software update for embedded systems
SZ Lin
 
Mender; the open-source software update solution
Mender.io
 
Volunteer Computing using BOINC
Pooyan Mehrparvar
 
Lick my Lollipop
Tamara Momčilović
 
What’s New in UniVerse 11.2
Rocket Software
 
HKG18-212 - Trusted Firmware M: Introduction
Linaro
 
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
ICS
 
Migrating to Windows 7 or 8 with Lenovo's Deployment Optimization Solutions
Lenovo Business
 
Eminence team
Vivin NL
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 1
Qualcomm Developer Network
 
Multi-OS Engine Technology Overview
Karthiyayini Chinnaswamy
 
Approach-to-Security-applications-running-from-different-HW-platforms-Daniel-...
AAnt87
 
Zephyr Introduction - Nordic Webinar - Sept. 24.pdf
AswathRangaraj1
 
Ad

More from Chris Simmonds (9)

PDF
Debugging embedded devices using GDB
Chris Simmonds
 
PDF
Running Android on the Raspberry Pi: Android Pie meets Raspberry Pi
Chris Simmonds
 
PDF
Android rpi-csimmonds-fosdem-2019
Chris Simmonds
 
PDF
Reducing boot time in embedded Linux
Chris Simmonds
 
PDF
Linux power management: are you doing it right?
Chris Simmonds
 
PDF
Embedded Android: Android beyond the smartphone
Chris Simmonds
 
PDF
10 ways hardware engineers can make software integration easier
Chris Simmonds
 
PDF
Tuning Android for low RAM
Chris Simmonds
 
PDF
The Android graphics path, in depth
Chris Simmonds
 
Debugging embedded devices using GDB
Chris Simmonds
 
Running Android on the Raspberry Pi: Android Pie meets Raspberry Pi
Chris Simmonds
 
Android rpi-csimmonds-fosdem-2019
Chris Simmonds
 
Reducing boot time in embedded Linux
Chris Simmonds
 
Linux power management: are you doing it right?
Chris Simmonds
 
Embedded Android: Android beyond the smartphone
Chris Simmonds
 
10 ways hardware engineers can make software integration easier
Chris Simmonds
 
Tuning Android for low RAM
Chris Simmonds
 
The Android graphics path, in depth
Chris Simmonds
 

Recently uploaded (20)

PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 

Software update for IoT: the current state of play

  • 1. Software update for IoT the current state of play Chris Simmonds OpenIoT Summit 2016 Software update for IoT 1 Copyright © 2011-2016, 2net Ltd
  • 2. License These slides are available under a Creative Commons Attribution-ShareAlike 3.0 license. You can read the full text of the license here http://creativecommons.org/licenses/by-sa/3.0/legalcode You are free to • copy, distribute, display, and perform the work • make derivative works • make commercial use of the work Under the following conditions • Attribution: you must give the original author credit • Share Alike: if you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one (i.e. include this page exactly as it is) • For any reuse or distribution, you must make clear to others the license terms of this work Software update for IoT 2 Copyright © 2011-2016, 2net Ltd
  • 3. About Chris Simmonds • Consultant and trainer • Author of Mastering Embedded Linux Programming • Working with embedded Linux since 1999 • Android since 2009 • Speaker at many conferences and workshops "Looking after the Inner Penguin" blog at http://2net.co.uk/ https://uk.linkedin.com/in/chrisdsimmonds/ https://google.com/+chrissimmonds Software update for IoT 3 Copyright © 2011-2016, 2net Ltd
  • 4. Overview • Software update 101 • Update clients • OTA update • OTA implementations Software update for IoT 4 Copyright © 2011-2016, 2net Ltd
  • 5. What could possibly go wrong? • Mirai: a recent > 600 Gbps DDoS attack • Very simple: looks for open Telnet ports and logs on using default, well-known, name and password • Prime target: Dahua IP CCTV cameras Details on PenTestPartners: https://www.pentestpartners.com/blog/ optimising-mirai-a-better-iot-ddos-botnet Software update for IoT 5 Copyright © 2011-2016, 2net Ltd
  • 6. Problems Problem 1 • Embedded software is non-trivial (=> has bugs!) • Devices are often connected to the Internet • Allowing intruders to exploit the bugs remotely Problem 2 • We would like to deploy new features, improve performance, etc. Conclusion • We need a software update mechanism Software update for IoT 6 Copyright © 2011-2016, 2net Ltd
  • 7. Requirements for SW update • Secure, to prevent the device from being hijacked • Robust, so that an update does not render the device unusable • Atomic, meaning that an update must be installed completely or not at all • Fail-safe, so that there is a fall-back mode if all else fails • Preserve persistent state Software update for IoT 7 Copyright © 2011-2016, 2net Ltd
  • 8. What to update? Frequency Ease of update Bootloader Kernel Root file system System applications Software update for IoT 8 Copyright © 2011-2016, 2net Ltd
  • 9. Update granularity • File: • not an option: hard to achieve atomicity over a group of file updates • Package: • apt-get update works fine for servers but not for devices • Container: • neat idea, so long as you have containerised applications • Image: • the most common option: fairy easy to implement and verify Software update for IoT 9 Copyright © 2011-2016, 2net Ltd
  • 10. Device update != server update • Server • Secure environment, no power outage, no network outage • If update fails, human intervention is possible • Device: • Intermittent power and network mean update quite likely to be interrupted • Failed update may be difficult (and expensive) to resolve Software update for IoT 10 Copyright © 2011-2016, 2net Ltd
  • 11. Options for image update Symmetric A/B (Android after Nougat) Bootloader User data Boot flag OS Copy 1 OS Copy 2 Bootloader Main OS Recovery OS User data Boot flag Asymmetric normal/recovery (Android before Nougat) Software update for IoT 11 Copyright © 2011-2016, 2net Ltd
  • 12. Statelessness • Image update of a filesystem implies no state is stored in that filesystem • See my talk about read-only rootfs http://www.slideshare.net/chrissimmonds/ readonly-rootfs-theory-and-practice Software update for IoT 12 Copyright © 2011-2016, 2net Ltd
  • 13. Update agent • Update agent is the code on the device that manages the update • Tasks • Receive update from local storage (e.g. USB) or from remote server • Apply the update • Toggle boot flag Software update for IoT 13 Copyright © 2011-2016, 2net Ltd
  • 14. swupdate • Image-based update client • License: GPLv2 • Code https://github.com/sbabic/swupdate • Documentation http://sbabic.github.io/swupdate/index.html Software update for IoT 14 Copyright © 2011-2016, 2net Ltd
  • 15. swupdate features • Symmetric and asymmetric update • Bootloader support: U-Boot • Volume formats: MTD, UBI, MBR and UEFI partitions • Yocto Project layer: meta-swupdate • Remote/streaming using curl (http/https/ssh/ftp) • integrated REST client connector to hawkBit • Signed images Software update for IoT 15 Copyright © 2011-2016, 2net Ltd
  • 16. RAUC - Robust Auto-Update Controller • Image-based update client • License: LGPLv2.1 • Source Code: https://github.com/jluebbe/rauc • Documentation: https://rauc.readthedocs.org/ Software update for IoT 16 Copyright © 2011-2016, 2net Ltd
  • 17. RAUC features • Symmetric and asymmetric update • Bootloader support: grub, barebox • Volume formats: MTD, UBI, MBR and UEFI partitions • Build systems: Yocto Project (meta-ptx), PTXDist • Remote/streaming using curl (http/https/ssh/ftp) • Cryptographic verification using OpenSSL (signatures based on x.509 certificates) Software update for IoT 17 Copyright © 2011-2016, 2net Ltd
  • 18. OTA update • Solutions so far are mostly suitable for • Local update (man with a USB thumb drive) • User initiated/attended remote update • Local or attended remote update does not scale • Hence, OTA (Over The Air) update • Updates pushed from central server • Update is automatic (or semi-automatic as with Android/IoS) Software update for IoT 18 Copyright © 2011-2016, 2net Ltd
  • 19. OTA update components Device software build system Firmware images Sign with authentication key Update server Device Update agent Software update for IoT 19 Copyright © 2011-2016, 2net Ltd
  • 20. Complexities of OTA update • Authentication (is this update legit?) • Security (am I receiving what you are sending?) • Roll-back (if update fails to boot, switch to previous version) • Scale (roll out to large populations) • Monitoring (keeping track of status of the population of devices) Software update for IoT 20 Copyright © 2011-2016, 2net Ltd
  • 21. Roll-back • Boot limit count • Feature of bootloader (e.g U-Boot) • Increment count in bootloader • Reset after successful boot • If reboot with count > 0, bootloader knows boot failed and loads alternate rootfs • Hardware watchdog • If hang in early boot, watchdog times out and resets CPU • Bootloader checks reset reason • If watchdog, loads alternate rootfs Software update for IoT 21 Copyright © 2011-2016, 2net Ltd
  • 22. Mender.io • OTA update server and client • Full system image update • Licenses: Server and Client: Apache 2 • Code (client): https://github.com/mendersoftware/mender • Documentation: https://docs.mender.io Software update for IoT 22 Copyright © 2011-2016, 2net Ltd
  • 23. Mender.io features • Symmetric A/B image update client • Bootloader support: U-Boot • Volume formats: MBR and UEFI partitions • Update commit and roll-back • Build system: Yocto Project (meta-mender) • Remote features: deployment server, build artifact management, device management console Software update for IoT 23 Copyright © 2011-2016, 2net Ltd
  • 24. Resin.io • OTA update server and client • Container (Docker) based updates • Licenses: Client: Apache2; Server: proprietary • Code (client): https://github.com/resin-os/meta-resin • Documentation: https://docs.resin.io/introduction Software update for IoT 24 Copyright © 2011-2016, 2net Ltd
  • 25. resin.io features • Symetric A/B rootfs for core OS ("Resinhup") • Applications packaged into Docker containers • Build integration: Yocto Project (meta-resin) • Docker images can be preloaded into YP build • Remote features: deployment server, integration with git Software update for IoT 25 Copyright © 2011-2016, 2net Ltd
  • 26. Brillo • Brillo is cut-down Android for IoT • License: Apache 2.0 • Android OTA update client • Symmetric and asymmetric image update • Licenses: Client: Apache2; Server: proprietary • Code (client): https://android.googlesource.com • Documentation: https://developers.google.com/brillo Software update for IoT 26 Copyright © 2011-2016, 2net Ltd
  • 27. Conclusion • Software update is a hot topic • Open source solutions described in this presentation: • Stand-alone update clients • swupdaed • RAUC • End-to-end solutions • mender.io • resin.io This and other topics associated with building robust embedded systems are coverred in my training courses http://www.2net.co.uk/training.html Software update for IoT 27 Copyright © 2011-2016, 2net Ltd