devnet-1163data in motion apis
TRANSCRIPT
Create a Hello World with Data in Motion
David A. Maluf, Ph.D.
DEVNET-1163
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID 3
• Introduction
• Paradigm Shift At the Edge
• Examples and Use Cases
• Programming Data in Motion
• Create a Hello World Now
• Q & A
Agenda
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Introduction
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Data in Motion and IoT• The Internet of Things (IoT) is a computing concept that describes a future
where everyday physical objects will be connected to the Internet and be able to identify themselves to other devices.
• Cisco Data in Motion (DMo) is a software technology that provides data management and first-order analysis at the edge.
• Cisco Data in Motion provides mechanisms to capture data and control flows within the network translating data into information and ultimately into knowledge for use by higher order applications within a system.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Paradigm Shift with Edge Intelligence
Unified Platform
Network Compute Storage
CLOUD CLOUDEDGE
STORE ANALYZE ACT NOTIFY
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Examples and Use Cases
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Railway Systems
Fear of Derailment
Underutilized Equipment
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Railway Systems
Immediate Response to Equipment Failure
Real-time Health Status of Trains
35% REPLACEBEARINGS
CAR 07
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Oil Pipelines
Poor Leak Detection
Limitations in Network Connectivity
Costly Maintenance and Management
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Oil Pipelines
Proactive Leak Detection
Predictive ManagementS6 | C026 Pressure
Drop
5000kPa
ACTION REQUIRED
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
EN
ER
GY
US
E
HIGH
LOW
MONDAY FRIDAYTHURSDAYTUESDAY WEDNESDAY
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
EN
ER
GY
US
E
HIGH
LOW
20-30% Energy Cost Savings
MONDAY FRIDAYTHURSDAYTUESDAY WEDNESDAY
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Programming Data in Motion
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Data In Motion Model (details)• Context: Sandbox for an
application with separate URP allowing for the creation and interaction of multiple data analysis operations.
• Dynamic Data Definitions (aka D3): A set of patterns, rules, and actions for a specific analysis task. Multiple D3s may exist within a single context and reference each other for compound or recursive analysis.
Context
D3 D3 D3
D3 D3 D3
D3
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
The D3 Model (details)• Dynamic Data Definition involve the
relationship of three simple concepts
• Pattern• Condition• Action
D3
Pattern
Protocol Patterns
Condition
Content (aka Payload)
Parameters – Output of Operations
Action
Event (Condition Met)
Call Another D3 within Context
Send to Dynamic Data Stream
Dynamic Data Request
Timer
Call Another D3 within Context
Send to Dynamic Data Stream
Dynamic Data Request
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
The D3 Model (details)• Dynamic Data Definition involve the
relationship of three simple concepts• Pattern• Condition• Action
• Ultimately this breaks down into:• Meta information• Network definition • Application to monitor• Action(s) to take
D3
Meta (1)
D3_Id, Context_ID, Processing Method (Timer, Cache)
Network (01)
Filterby: (protocol {tcp/ip, UDP} Source/Dest IP, Source/Dest Port (multiple ANDed)
Decode: (variable A=first 8 Bits, var B=next 16 bits, etc….)
Application (01)
Filterby:
Protocol: http
Field: content-type:json, etc.
Content
Example: variable Temperature>56
Action (>1)
Type: Primitive
payload
Header
Type: Procedure
FetchData
Gpsupdate()
syslog
Type: Timed
FetchData
Gpsupdate()
syslog
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
The D3 Model (details)
Sensors
CloudDataCenter
D3
Meta (1)
D3_Id, Context_ID, Processing Method (Timer, Cache)
Network (01)
Filterby: (protocol {tcp/ip, UDP} Source/Dest IP, Source/Dest Port (multiple ANDed)
Decode: (variable A=first 8 Bits, var B=next 16 bits, etc….)
Application (01)
Filterby:
Protocol: http
Field: content-type:json, etc.
Content
Example: variable Temperature>56
Action (>1)
Type: Primitive
payload
Header
Type: Procedure
FetchData
Gpsupdate()
syslog
Type: Timed
FetchData
Gpsupdate()
syslog
{JSON : {Rules can express:
Predicates and FiltersData / Information conversionSummarizationPattern MatchingCategorization & ClassificationEvent Trigger analysisNotifications }}
• Putting it Together
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
www.slideshare.net/kartben/whats-new-at-eclipse-iot-eclipsecon-2014
Data in Motion API as an Open Source Project• Krikkit initiative originates from Cisco
Data in Motion project
Promotion of Data in Motion products and Data in Motion proliferation across industry
Maintain Leadership in industry for IoT efforts IoT does not have many Standards and Open
Source is way to accelerate IoT innovations with Cisco products
Krikkit is the public API for Data in Motion
»http://eclipse.org/proposals/technology.krikkit/
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Create Hello World with Data in Motion
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Login To DMo
Login PagePoint your browser to the IP address unique to your workstation
http://[your unique IP]:8000
Requires an IP address of the DMo instance, the port number, a context and the associated password:
IP: 127.0.0.1 Port: 443Context Name: dmolabContext Password: dmo123
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Clean StartAn Empty ContextWe need to make sure there are no pre-existing rules.
A Programmed Context
if your screen looks similar to the screen below, please click the Trash Can Icon and Delete rules.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Create a Timer Rule
Polling a SensorMost Real life sensors are Asynchronous, as a result, we need to create a timer rule that will poll the sensors to retreive the Data.
A timer rule is a process that runs periodically (units in millseconds and above) and estabishes a connection to the sensor.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Verifying the Timer Rule
The JSON Payloadif you want to see what the resulting JSON code would look like, you can press the 'see JSON' button.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Create an Event Rule
Turn LED ONNow that we have Setup a Timer Rule and we are polling the Sensors for Data.
We will need to create an Event Rule to apply a filter to the data coming back from the sensor and take action depending on the data value.
• Filter Data• Turn LED OFF [output Port0] when light Sensor
[input Port1] is Dimmed [Value < 100]
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Create another Event Rule
Turn LED OFFNow that we have turned the LED ON when Dimming the light on the sensor, we would like to turn the LED back off when the Light Sensor is lit
• Filter Data• Turn LED OFF [output Port0] when light Sensor
[input Port1] is not Dimmed [Value > 100]
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID
Bonus Lab• Setup a Rule that will turn the LED ON when Pressing on the Pressure Sensor
[Pressure Threshold > 10]
• Setup another Rule that will turn the LED OFF when depressing the Pressure Sensor [Pressure Threshold < 10]
• Useful Information
• LED is on [Output Port 1]
• LED value 0 Turns OFF
• LED value 1 Turns ON
• Pressure Sensor is on [Input Port 1]
Thank you
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID 33