23
Linux+Zephyr: IoT made easy

Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Linux+Zephyr:IoTmadeeasy

Page 2: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

IoTExplodesEverywhere

❑ “Sensorsandactuatorsembeddedinphysicalobjectsandlinkedthroughwiredandwirelessnetworks,oftenusingthesameInternetProtocol(IP)thatconnectstheInternet”-DefinitionbyMcKinsey.

❑ Soundsjustlikeembeddedstuffwe’vebeendoingfordecades!Sowhatchanged?

❑ Nowthere’sabigmarketandtheworldisjust‘ready’.

❑ Unfortunatelythere’snostandard(andprobablywillnotbeoneformanydecades),fragmentationisrunningamok.

Page 3: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

LinuxIoT

❑ AroundformanyyearsandbeendoingIoTthingswithitbeforeithadacoolname.

❑ AllprotocolshavetheirreferenceimplementationonLinux(AllJoyn,MQTT,Weave,XMPP,etc)

❑ UnfortunatelyLinuxhasgottenquitelarge

❑ Minimumkernelforembeddedtarget>4MBcompressed

❑ RequiresafewhundredsofGBofflashforageneralpurposeinstall.

❑ Notsuitableforverysmalldevices

Page 4: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Priceiseverything

❑ IfwecouldrunLinuxoneverythingyouwouldn’tbeinthispresentation!

❑ Linuxissecure(hasyearsofscrutinyandprofessionalsecuritypeoplegoaftereverycommitwithafinetoothcomb).

❑ Linuxhasthefullnetworkingstackrequired.

❑ LinuxhastheI/Ocapabilities(everysensor/actuatordriver)

❑ Unfortunatelyyoucan’trunLinuxon$0.5part.

Page 5: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Priceiseverything(cont)

❑ RunIoTona$0.5part(ideally,wecoulddowith$1)

❑ Thisisthesweet-spotformanyapplications

❑ Puta$50deviceoffpremisesandgetlostorstollen,youmightgetabitupset->endupnotbuyingit.

❑ Puta$1deviceoffpremisesandgetlostorstollen->meh.

❑ TurnsoutthatweneedanOSforourcheapdevicesthatisleanerthanLinux.

❑ Manyoptions!

Page 6: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

RTOSselection

❑ Abigselectionofchoices,thebigcontenders

❑ FreeRTOS

❑ mbedOS

❑ NuttX

❑ magenta(LK)

❑ None

❑ Zephyr

Page 7: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

FreeRTOS

❑ DualLicense-GPLv2withlinkingexceptionorcommercial

❑ SparseAPI-themostRTOSofoldofthemost

❑ Nocommunitydevelopmentforthecore(separate)

❑ Preemptivethreadmodel,optionalMPUprotection

❑ Networkingisanadd-on-nohighlevelframeworks

❑ Suitedforpeoplemovingonfrombaremetal

Page 8: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

mbedOS

❑ Apache2,6LoWPanunderpermissivebinarylicense(etc).

❑ Newmbed5RTOS(CMSIS-RTOS-RTX)

❑ Communityinvolvementminimal(ARMfocused).

❑ MINAReventbasedAPI

❑ Completestandardsupport(twodifferentIPstacks)

❑ TiedtothembedOScloudAPI

❑ Mosteasytogetstarted,butnotveryopensourceIMO.

Page 9: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

NuttX

❑ BSD3clause

❑ MostLinuxAPIofthemall.

❑ Hasalargecommunitybut80%isMr.Nutthimself

❑ QuitePOSIXcompatible-easiertoportLinuxstuff

❑ IPstackbutnotmuchelseIoTrelated

❑ Largerthantheotheroptions,mostLinuxlike.

Page 10: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

magenta(partoffuchsia)

❑ MITlicense

❑ Littlekernel-UsedonAndroidbootloaders.

❑ Justintroduced,communityisdubious

❑ Limitedprioritynumber,standardprimitives.

❑ Networkingstack-couldn’tfigurethisout:)

❑ Googleproject-significantinfantmortality

Page 11: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

None(isalwaysanoption)

❑ N/A

❑ N/A

❑ N/A

❑ N/A

❑ N/A

❑ Onlyforthehardcore

Page 12: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Zephyr

❑ Apache2(networkstackApache2)

❑ AdequateRTOSAPI(andnano/microoption)

❑ UnderLinuxFoundation-trueopensource

❑ Networkingstack-IPstack+IoToptions(CoAP)+BLE

❑ Linuxkconfigbuildsystem,feelsrightathome.

❑ Ourselection.

Page 13: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

IoTonZephyr.

❑ CoAP,BLE,contiki+tinydtls

❑ Canbeverysmall(smallestnanokernelexampleat8K)

❑ PortingofIoTlibrariespossible

❑ Youcanaccomplishquitealot.

❑ WhataboutLinux?Wheredoesitfitin?

Page 14: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

IoTonZephyr(problems)

❑ Security-yourIoTdevicehaskeysandpasswords,howdoyouhandleitbeingstolenbyamaliciousparty?

❑ Convenience-Howeasycanyouupdatethesoftwareonthedevices?Youmighthavedozenonyourpremises.

❑ FutureProofing-Notenoughroominnon-volatilestorageforeveryIoTprotocol.Whathappensifthecompanygoesoutofbusiness?Youhavetochangeallthelightbulbs/securitysystem/etcinsuchacase?

❑ Warringtribes-iPhonevsAndroid-itshouldworkwithmyotherdevicestoo.

Page 15: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Solution:LinuxGateway

❑ LinuxgatewayandslaveZephyrIoTdevices.

❑ LinuxcanrunallIoTprotocols(andwithenoughRAMatthesametime)

❑ Futureproof-Linuxiseasilyupdated,sincepointtodoso.

❑ SoftwareontheIoTdevices?ShoulditbeanIoTstack?Dowestillneedtoupdates/wontheIoTdevices?

Page 16: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Intermission:CheapIoT(1)

❑ CheapMCUwithonchipperipherals

❑ ARMMcore/PIC/ARM/x86/AVR

❑ GPIOs

❑ PWM

❑ Serial

❑ I2C

❑ SPI

❑ Networking(IEEE802.15orZigBeeorWiFi)…

Page 17: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Intermission:CheapIoT(2)

❑ Analogglue

❑ SensorsonI2C/SPIbus

❑ Verypricesensitive

❑ Speedsareusuallylow

❑ Powerbudgetissmall

❑ Lessismore

Page 18: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

WhatiftherewasnoIoT(1)

❑ LinuxhasfullI/OcapabilitiesforIoT

❑ Problemisthatthesensorsareremote

❑ WhatifwegotridoftheheavyweightIoTprotocols?

❑ Zephyrdevicesaresimplyperipherals

❑ S/WloadonZephyrdevicesisthesameforthesameSoCnomatterwhatdifferentkindofsensor/IoTdeviceitis

❑ LinuxkernelinterfacesmeanalltheIoTapplicationareinsulatedfromtheunderlyingdevicedetails.

Page 19: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

WhatiftherewasnoIoT(2)

❑ Significantlessattacksurfacewithsecurityproblems:

❑ Thedevicesonlycontainenoughkeystoconnectwiththegatewayandhavenovaluableinformation

❑ Thereismuchlesssoftwareonthedevice

❑ Bothendscanbesecuredeitherwithpre-programmedkeysorusingasmart-phoneapplicationoninstalltime.

❑ Thedevicesarebasicallydisposable.

Page 20: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Implementation(bare)

❑ DirectlyaccesstheSoCresources

❑ Registers

❑ Busses

❑ +Nosoftwarebesidesnetworkingandconfiguration

❑ -Performancemightbeimpacted

❑ -Morepowerrequired(tradeoff)

Page 21: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Implementation(classdrivers)

❑ Thinclasslayer

❑ GPIOclassforinstance

❑ Classesforeverykindofperipheral

❑ -MoreS/Wcomparedtobarebones

❑ +Betterperformance

❑ +Lesspowerrequired

Page 22: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Status

❑ Unfortunatelynodemoyet!

❑ TestbedisabeagleboneandanIntelGalileo

❑ KerneldriverprovidesremoteGPIOsnow,I2C,SPItocome

❑ Kerneldriversusesauser-spacehelpertobridgetothedeviceoverBLE.

❑ Pre-configuredkeyswithDTLS

❑ WIP,hopetohaveademoatELC.

Page 23: Linux+Zephyr: IoT made easy · Linux is secure (has years of scrutiny and professional security people go after every commit with a fine tooth comb). Linux has the full networking

Thankyou!

Questions?