comparison of aws, azure, and oracle device modelsazure+oracle... · outline this presentaon takes...

34
Comparison of AWS, Azure, and Oracle Device Models W3C Web of Things Open Day 26.3.2018, Prague [email protected]

Upload: others

Post on 07-Sep-2019

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

ComparisonofAWS,Azure,andOracleDeviceModelsW3CWebofThingsOpenDay

26.3.2018,[email protected]

Page 2: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

OutlineThispresentaJontakesafocusedviewonthedeviceconceptsintheIoTcloudplaNormsofAmazon(AWSDeviceShadows),MicrosoQ(AzureIoTHub)andOracle(IoTCloudService).Thedevicemodelforeachcloudserviceisstructuredinthefollowingway:•  HighLevelConcept•  DeviceDescripJon•  DeviceModel•  ProperJes•  AcJons•  Events•  SerializaJonformat•  CommunicaJonProtocols,MessagesandFormats,API,SecurityAcompleteoverviewofthesecloudplaNormsisbeyondthescopeofthispresentaJon–thestrikeoutsecJonsareintenJonallyleQout.

Page 3: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

TerminologyThingorDevice

AphysicalorlogicalenJtythatismanagedbyanIoTCloudService

DeviceDescripJon(aka.ThingDescripJon)AserializedrepresentaJonofaDevice

DeviceModel(aka.DeviceTemplatesorThingTypes)Ablueprintthatdescribesthestructureandinterfaceofagroupofdevices

ProperJes,aka.AVributesorResourcesApartofthedevicethatcontainsstateinformaJonandmaychangeoverJme

Events(aka.MessagesorAlerts)

AnoJficaJonmechanismbetweentheDeviceandtheIoTCloudService

Page 4: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

MICROSOFTAZUREIOTHUBDEVICETWINS

Page 5: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

MicrosoQAzureIoTHub-DeviceTwinsReferences

•  ThefollowingisderivedfrompublicinformaJonavailableat:

•  hVps://docs.microsoQ.com/en-us/azure/iot-hub/iot-hub-node-node-getstarted

•  hVps://docs.microsoQ.com/en-us/azure/iot-hub/iot-hub-devguide-query-language

•  hVps://github.com/MicrosoQDocs/azure-docs/blob/master/arJcles/iot-hub/iot-hub-devguide-device-twins.md

Page 6: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

MicrosoQAzureIoTHub-DeviceTwinsHighLevelSummary

•  MicrosoQ'sdevicetwinisanabstracJonofadevicestateusing(desiredandreported)properJesandasetoftags,containingmetadatavalues.

•  AcJonsandeventsarenotpartofthemodel,butarehandledbyapplicaJoncode.AcJonscancontainmulJpleparametersandtakeobjectsasparameters.

•  MessagesareratherlightweightandthecontentcanbeselectedbytheapplicaJondowntopropertylevel.TheformatofthemessagesisdefinedbyapplicaJonsonly.

•  Thedevicetwinmodeldoesnotdefinea"template"oramechanismtoaggregatemulJpledevicesintoacombineddevicemodel.

Page 7: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

MicrosoQAzureIoTHubDeviceTwins

Source:MicrosoQ

Page 8: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Devicetwin•  AdevicetwinisaJSONdocumentthatincludes:•  Tags:AsecJonwherethesoluJonback-endhasaccessto.Theyarenotvisibletodeviceapps.

•  Proper<es:UsedtosynchronizedeviceconfiguraJonorcondiJons.

•  AllpropertyvaluescanbeofthefollowingJSONtypes:boolean,number,string,object.Arraysarenotallowed.

Page 9: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

ProperJes3kindsofproperJes:•  Desiredproper<es:CanbesetbythesoluJonbackendandread

bythedeviceapp.TheappcanalsoreceivenoJficaJonsofchanges.

•  Reportedproper<es:ThedeviceappcansetreportedproperJes,andthesoluJonbackendcanreadandquerythem.

•  Deviceiden<typroper<es:TherootofthedevicetwinJSONdocumentcontainstheread-onlyproperJesfromthecorrespondingdeviceidenJtystoredintheidenJtyregistry.

Page 10: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

AcJonsAcJonsdonotcorrespondtoaformaldescripJonintheJSONdocument,butaremodeledviaposJngofapayloadtoa"method"endpoint.AnacJoncantakeanarbitrarynumberofparameters.

Page 11: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

EventsThereisnodedicatedeventmechanism.Eventscanbemodeledbyusingdevice-to-cloudmessages,whicharebeingsentunderapplicaJoncontrol.TheeventpayloadformatisnotspecifiedintheJSONdocument.

Page 12: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

SerializaJonformat{"deviceId":"myDeviceId","etag":"AAAAAAAAAAc=","status":"enabled","statusUpdateTime":"0001-01-01T00:00:00","connecJonState":"Disconnected", "lastActivityTime": "0001-01-01T00:00:00","cloudToDeviceMessageCount":0,"authenJcaJonType":"sas","x509Thumbprint":{"primaryThumbprint":null,"secondaryThumbprint":null},"version":2,"tags":{"locaJon":{"region":"US","plant":"Redmond43"}},"properJes":{"desired":{"telemetryConfig":{"configId":"db00ebf5-eeeb-42be-86a1-458cccb69e57","sendFrequencyInSecs":300},"$metadata":{

...},"$version":4},"reported":{"connecJvity":{"type":"cellular"},"telemetryConfig":{"configId":"db00ebf5-eeeb-42be-86a1-458cccb69e57","sendFrequencyInSecs":300,"status":"Success"},"$metadata":{...},"$version":7}}}

Page 13: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

AWSDEVICESHADOWS

Page 14: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

References•  ThefollowingisderivedfrompublicinformaJonavailableat:

•  hVps://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html

•  hVps://docs.aws.amazon.com/iot/latest/developerguide/aws-iot-how-it-works.html

•  hVps://docs.aws.amazon.com/iot/latest/developerguide/iot-sdks.html

•  hVps://docs.aws.amazon.com/iot/latest/apireference/API_OperaJons.html

Page 15: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

HighLevelConcept•  AWSIoTDeviceShadowsenableInternet-connected

devicestoconnecttotheAWSCloudandletapplicaJonsinthecloudinteractwithInternet-connecteddevices.

•  DevicesreporttheirstatebypublishingmessagesinJSONformatonMQTTtopics.EachMQTTtopichasahierarchicalnamethatidenJfiesthedevicewhosestateisbeingupdated.WhenamessageispublishedonanMQTTtopic,themessageissenttotheAWSIoTMQTTmessagebroker,whichisresponsibleforsendingallmessagespublishedonanMQTTtopictoallclientssubscribedtothattopic.

Page 16: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Thing–DeviceModelAWSIoTprovidesaregistrytomanagethings.AthingisarepresentaJonofaspecificdeviceorlogicalenJty:aphysicaldeviceorsensororalogicalenJtylikeaninstanceofanapplicaJon.InformaJonaboutathingisstoredintheregistryasJSONdata.Hereisanexamplething:{ "version": 3,"thingName":"MyLightBulb","defaultClientId":"MyLightBulb","thingTypeName":"LightBulb", "attributes": { "model": "123", "wattage": "75" }}

ThingsareidenJfiedbyaname.ThingscanhaveaVributes,whicharename-valuepairsthatcanbeusedtostoreinformaJonaboutthething,suchasitsserialnumberormanufacturer.

Page 17: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Thingtypes(Templates)ThingtypesThingtypesstoredescripJonandconfiguraJoninformaJonthatiscommonforallthingsassociatedwiththesamethingtype.Thissimplifiesthemanagementofallthings.ThinggroupsAllowtomanageseveralthingsatonce.Groupscanalsocontaingroups—youcanbuildahierarchyofgroups.

Page 18: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

AVributes/Resources/ProperJes•  hVps://docs.aws.amazon.com/iot/latest/apireference/API_ThingAVribute.html

•  EachaVributevalueinJSONobjectscanhaveamaximumlengthof800bytes.

•  ThespecificaJonissilentaboutthesupportedaVributetypes,theexamplescontainonlysimpletypes.

•  HowevertherulesengineissupporJngallJSONtypesincludingarraysandobjects.

Page 19: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

AcJons•  AcJonsdonotcorrespondtoaformaldescripJonintheJSONdocument,butaremodeledviaposJngofapayloadtoa"method"endpoint.

•  AnacJoncantakeanarbitrarynumberofparameters.

Page 20: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Events•  Thereisnodedicatedeventmechanism.Eventscanbemodeledbyusingdevice-to-cloudmessages,whicharesentunderapplicaJoncontrol.

•  TheyarenotpartoftheJSONdocument.

Page 21: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

SerializaJonformat{"deviceId":"myDeviceId","etag":"AAAAAAAAAAc=","status":"enabled","statusUpdateTime":"0001-01-01T00:00:00","connectionState":"Disconnected","lastActivityTime":"0001-01-01T00:00:00","cloudToDeviceMessageCount":0,"authenticationType":"sas","x509Thumbprint":{"primaryThumbprint":null,"secondaryThumbprint":null},"version":2,"tags":{"location":{"region":"US","plant":"Redmond43"}},"properties":{"desired":{"telemetryConfig":{"configId":"db00ebf5-eeeb-42be-86a1-458cccb69e57","sendFrequencyInSecs":300},"$metadata":{

...},"$version":4},"reported":{"connectivity":{"type":"cellular"},"telemetryConfig":{"configId":"db00ebf5-eeeb-42be-86a1-458cccb69e57","sendFrequencyInSecs":300,"status":"Success"},"$metadata":{...},"$version":7}}}

Page 22: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

ORACLEDEVICEMODEL

Page 23: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

ReferencesThefollowingisderivedfrompublicinformaJonavailableat:•  hVps://docs.oracle.com/en/cloud/paas/iot-cloud/iotgs/toc.htm•  hVps://docs.oracle.com/en/cloud/paas/iot-cloud/iotrq/index.html•  hVp://www.oracle.com/technetwork/indexes/downloads/iot-client-

libraries-2705514.html •  hVps://docs.oracle.com/en/cloud/paas/iot-cloud/develop/developing-device-

soQware-using-client-soQware-libraries1.html•  hVp://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/iot/

IoT%20Quick%20Start%20JavaScript/IoTQuickStartJavaScript.html

Page 24: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

HighLevelSummary•  TheOracleIoTCloudServiceplaNormmanagesdevicesandcorrespondingmessages

andevents.Atthecoreoftheserviceisthedevicemodel.•  Oracle’sdevicemodelisablueprintfordefiningdevices.Itcanbeusedtocreatedevice

instancesandsimulaJonswithouthavingaphysicaldeviceavailable.•  Thiscansignificantlyhelptovalidatethedevicemodel,beforeactuallybuildinga

device.•  SeparaJngtheblueprintfromthedeviceinstanceisusefultobuildaggregateddevices,

whichincorporatemulJpledevicemodels.•  Adeviceinstanceiscreatedbyregisteringadevice,whichimplementsoneormore

devicemodels,withtheIoTcloudservice.•  DevicemodelsanddevicedescripJonsaremanagedbytheIoTCloudService.Theycan

beexportedandimportedinaplainJSONformat,whichissimilartothe“WoTTD”format.

•  AsimpleWoT-TD-DMconverterisavailable.

Page 25: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

DeviceModel•  Adevicemodelisacommonblueprint,thatcanbeappliedtomulJpledevices.

•  Itcontainsmetadata,aVributes,acJons,formatsandlinks.

•  DevicemodelsareuniquelyidenJfiablevia“urn”•  AdevicecanimplementmulJpledevicemodelssimultaneously.

Page 26: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

AVributes•  AVributescanhavethefollowingtypes:number,integer,numberwithrange,integerwithrange,string,boolean,date&Jme,uri.

•  ComplexaVributes(arrays,objects)areintenJonallynotincluded,sincetheintegraJonwithexisJngback-endservices(e.g.AnalyJcs)requiressimpletypes.

•  AVributescanbereadonly.

Page 27: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

AcJons•  AcJonsaretriggeredbysendingapayloadtothecorrespondingendpoint.

•  AcJonscancontainonlyasingleparameter.•  ThereasonforthisapparentlimitaJonistoenableverylightweightimplementaJons.

•  IfcomplexparameterswereneededtheycouldbeencapsulatedinaJSON-string.

Page 28: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Formats•  Formatsdefinethepayloadstructureformessages.

•  FormatsareuniquelyidenJfiablevia“urn”.•  Formatsareeitherregular“data”messagesor“alert”messagesthataresentunderapplicaJoncontrol.

•  Thepayloadofthealertmessageisdefinedinthe“formats”secJon.

Page 29: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

DevicemodelserializaJonformat{"urn":"urn:com:oracle:iot:device:humidity_sensor","name":"HumiditySensor","description":"Devicemodelforsensorthatmeasureshumidity.","attributes":[{"name":"humidity","description":"Measureshumiditybetween0%and100%","type":"INTEGER","range":"0,100"},{"name":"maxThreshold","description":"Maximumhumiditythreshold","type":"INTEGER","range":"60,100","writable":true,"defaultValue":80}],"actions":[{"alias":"","description":"","name":“normalizeThreshold"}],

"formats":[{"urn":"urn:com:oracle:iot:device:humidity_sensor:too_humid","name":"tooHumidAlert","description":"Samplealertwhenhumidityreachesthemaximumhumiditythreshold","type":"ALERT","value":{"fields":[{"name":"humidity","type":"INTEGER","optional":false}]}}]}

Page 30: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

TypicalIoTCSdeploymentscenarioIoT

CloudService

IoT

Gateway

DeviceModel

DeviceModel

MQTTDevice

CoAPDevice

Proprietaryprotocol(messages/alerts)

Apps Apps

OracleIoTClientLibrary

IoTServerRESTAPI

Apps Apps

Page 31: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Node-wotGateway

OracleIoT

CloudService

Node-wot+OracleIoTCloudServiceIntegraJon

DeviceModel

RESTAPI

OracleProtocol(REST/JSON)

IOTCSPlaNorm

Java/Weblogic Node.Js

ManualmappingorautomaJctranslaJon

GWexposesthings

Apps Apps

ThingDescripJon

OracleIoTClientLibrary

Gateway

Apps Apps

GWconsumesthings

Page 32: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

3IntegraJonpointsGWconsumesdevicesexposedbyIoTCS(fromothervendors)-RequirestheGWtousetheRESTAPIoftheIoTcloudserviceIoTCSconsumesdevicesconnectedtonode-wotgateway-RequiresintegraJonoftheOracleIoTClientlibraryintotheGWMappingofthingdescrip<ontodevicemodel-  Thismappingcouldbedonemanuallyinthefirststep-  NoimplementaJoneffort

Page 33: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

SUMMARY

Page 34: Comparison of AWS, Azure, and Oracle Device ModelsAzure+Oracle... · Outline This presentaon takes a focused view on the device concepts in the IoT cloud plaorms of Amazon (AWS Device

Summary+Conclusion•  The3IoTserverplaNormssharemanycommonaliJesbetweentheir

devicemodels.Howevertherearesignificantdifferences.•  AWSandAzureonlydefineadatamodel,noacJonsandevents.•  NoneoftheserializaJonformatsareinterchangeable.•  Noneoftheformatsdefinesaprotocolbinding.•  Adevicemanufacturer,whowantstoaddresstheseplaNorms,hasto

createcodefor3differentenvironments.ThismayexceedthehardwarecapabiliJesonverysmalldevices.

AunifieddevicemodelwillsimplifytheintegraJontasksacrossdifferentplaNormsandwillaccelerateIoTmarketadopJon.