• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Importance of APIs in the Internet of Things
 

Importance of APIs in the Internet of Things

on

  • 1,106 views

How to design an API for devices - when there's millions of them. Comparing the networking industry with web APIs. ...

How to design an API for devices - when there's millions of them. Comparing the networking industry with web APIs.

Presented by Jacob Ideskog from Twobo Technologies at Nordic APIs in Trondheim, June 11 - 2013

Statistics

Views

Total Views
1,106
Views on SlideShare
612
Embed Views
494

Actions

Likes
4
Downloads
0
Comments
0

3 Embeds 494

http://nordicapis.com 483
http://newsblur.com 10
http://localhost 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Importance of APIs in the Internet of Things Importance of APIs in the Internet of Things Presentation Transcript

    • Importance of APIs in the Internet of ThingsFrom Network APIs to the next big thingJacob Ideskog, Solution Architect@jacobideskogCopyright © 2013 Twobo Technologies AB. All rights reserved
    • Agenda History – this has happened before… The network industry REST Devices – services or APIs?Copyright © 2013 Twobo Technologies AB. All rights reserved.
    • Disruptive trendsCloudComputingSocialNetworksBigDataCopyright © 2013 Twobo Technologies AB. All rights reserved.Mobile
    • The Web, networking and the Internet of thingsCopyright © 2013 Twobo Technologies ABFreeWeb APIsTheNetworkingIndustryDevice APIsrpc/rmi
    • The Networking IdustryFrom SNMP to NETCONFCopyright © 2013 Twobo Technologies ABFreeWeb APIsTheNetworkingIndustryDevice APIsrpc/rmi
    • Virtualization - a game changer Moving a server from U.S.A. to India With maintained state What happened to the network?Copyright © 2012 - 2013 Twobo Technologies AB
    • Virtualization Not a new problem Just a new focus Solutions popped upCopyright © 2012 - 2013 Twobo Technologies ABvSwitchOpenFlowJSON REST
    • History again Let’s take one step back further The networking industry had this talk 10 year ago RFC 3535 Content: How does the industry Automate networkmanagement? SNMP has failed• CLI scripting• Proprietary drivers• Error handlingCopyright © 2012 - 2013 Twobo Technologies ABRFC 3535RFC 3535
    • History again The outcome of RFC 3535 NETCONF – RFC 6241 Two types of data with clear separation• Operational Data• Configurational Data Transactions• Implied Validation of input data• Ability to compare, even between devices Ease of use Backup / RestoreCopyright © 2013 Twobo Technologies AB. All rights reserved
    • NETCONF Configuration Pre-provisioning Operational Data RPCs / Actions All modelled in YANG (rfc6020)Copyright © 2013 Twobo Technologies AB. All rights reservedConfigurationOperational stateAction(eg. reboot){ interfaces interface eth0 ip 10.0.0.1 }{ interfaces interface eth0 rx_faults }
    • Web APIsI.e. RESTful APIsCopyright © 2013 Twobo Technologies AB. All rights reservedFreeWeb APIsTheNetworkingIndustryDevice APIsrpc/rmi
    • Web APIs Today: The most commonly used API architecture is REST REST: No uniform standard NOT A PROTOCOLCopyright © 2013 Twobo Technologies AB. All rights reserved
    • Resource or serviceCopyright © 2013 Twobo Technologies AB. All rights reserved http://martinfowler.com/articles/richardsonMaturityModel.htmlLevel 0: The Swamp of POXLevel 1: ResourceLevel 2: HTTP VerbsLevel 3: Hypermedia ControlsGlory of Rest
    • Level 0 Swamp of POXCopyright © 2013 Twobo Technologies AB. All rights reservedCopyright © 2013 Twobo Technologies AB. Allrights reservedPOST <getBook>POST <deleteUser><book ...<ok .../apiXML RPC all over again
    • Level 1 ResourcesURIsBut still XML messages as operationsCopyright © 2013 Twobo Technologies AB. Allrights reservedPOST <getBook>POST <deleteUser><book ...<ok .../books/2/users/24
    • Level 2 HTTP VerbsUtilizes the semantics of HTTPCopyright © 2013 Twobo Technologies AB. All rights reservedGET - Read a resourceHEAD – Read metadata about resourceOPTIONS – Read what operations are availablePOST – Add a new resource, or run operationPUT – Replace existing resource completelyDELETE – Remove resource(PATCH – Update existing resource in place)GET ?pagesize=A4DELETE200 OK <book ...201 No Content/books/2/users/32
    • Level 3 The Glory of REST HATEOAS Hypermedia As The Engine Of Application State Or simply: Hypermedia Let the Media Type tell you what to do Hyperlink, hyperlink hyperlinkCopyright © 2013 Twobo Technologies AB. All rights reserved
    • ExampleCopyright © 2013 Twobo Technologies AB. All rights reservedcurl –v http://localhost/stuff<stuff xmlns:tt=http://example.com/rest tt:rel=”/stuff"><more-stuff tt:rel="/stuff/more-stuff"/><other-stuff tt:=”/stuff/other-stuff"/><data><entry>Interesting 1</entry><entry>Interesting 2</entry></stuff>curl –v http://localhost/stuff/more-stuff<more-stuff xmlns:tt=http://example.com/rest tt:rel=”/stuff/more-stuff"><things tt:rel="/stuff/more-stuff/things"/></more-stuff>
    • Ring a bell?Copyright © 2013 Twobo Technologies AB. All rights reservedcurl –v http://localhost/v2/stuff<html><div id=“stuff”><a href=“/stuff/more-stuff”/><a href=“/stuff/other-stuff/><ol id=“data”><li id=“entry1”>Interesting 1</li><li id=“entry2”>Interesting 2</li></ol><form action=“/stuff” ><input type=“text” name=“value” /></form></div></html>
    • Device APIs But a device isn’t an APP What you are designing isn’t a user interface A system can contain Thousands / Millions / Billons of devices The device may be placed in odd locations Must be replaceableCopyright © 2013 Twobo Technologies AB. All rights reserved
    • Device APIsLetting your deviceBECOME an APICopyright © 2013 Twobo Technologies AB. All rights reservedFreeWeb APIsTheNetworkingIndustryDevice APIsrpc/rmi
    • Services High level abstractions Not directly map able to a single deviceCopyright © 2013 Twobo Technologies AB. All rights reservedSERVICEFuel optimizationSERVICEHealth assistanceSERVICEPlant wateringsystemCAR GPSStop lightsTurbo injectorThermometerCalendarMedicine dosageWeather servicesGarden sensorsWater tap
    • ServicesCopyright © 2013 Twobo Technologies AB. All rights reserved“Network Service Participation”
    • Example: Networks Network wide transactions All or nothing Setup VPN All participating Routersmust be updated ACIDCopyright © 2013 Twobo Technologies AB. All rights reservedTail-f:NCSCisco Juniper ALU CompassCustomer orders newVPN in Web PortalController calculates changesand updates relevant devicesIf one device fails to update configall of them roll back
    • An API for ThingsRequirements:1. Must be consumed by machines2. Replaceable Dump all settings Restore in other device3. RobustCopyright © 2013 Twobo Technologies AB. All rights reserved
    • An API for ThingsRequirements:1. Must be consumed by machinesCopyright © 2013 Twobo Technologies AB. All rights reservedResource basedLevel 2,5Clear separationof Configurationaland OperationaldataWhat you need is a DataModel => Think of it like a Site Map with meta-data about each sub-page
    • An API for ThingsCopyright © 2013 Twobo Technologies AB. All rights reservedRequirements:2. Replaceable Dump all settings Restore in other deviceDefined by data-modelNo side-effects ofconfiguration in otherconfiguration
    • An API for ThingsCopyright © 2013 Twobo Technologies AB. All rights reservedRequirements:3. Robust All or nothing No unexpected statesTransactionsCannot rely onordering of incomingdata
    • An API for ThingsMake sure your device can participate in theservices that will be the Internet of Things!Copyright © 2013 Twobo Technologies AB. All rights reserved
    • Summary The game-changers Learning for Networking (NETCONF) REST but not necessarily Hypermedia Devices are volatile!Copyright © 2013 Twobo Technologies AB. All rights reserved
    • Questions & Thanks@2botech@jacobideskogwww.2botech.comCopyright © 2013 Twobo Technologies AB.
    • Copyright © 2013 Twobo Technologies AB. All rights reserved