Iot Lesson1

download Iot Lesson1

of 38

Transcript of Iot Lesson1

  • 7/24/2019 Iot Lesson1

    1/38

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

    Internet of Things

    ProgrammingAndrea Acquaviva

    Lesson 1

  • 7/24/2019 Iot Lesson1

    2/38

    Course introduction

    Organization 40 h classes

    20 h labs (5 labs)

    Video recordings

    Classes

    Lab intro (not the whole lab)

    Exam Written text (multiple choice): 10/30

    Project discussion (slides + code): 20/30

    Project discussion date is flexible (no time constraints, even in anothersession, but raspberry kit must be returned within 3 months from theend of the course, unless you use yours)

    Code + slides (draft) must be sent to TA at least 2 days before

    discussion

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    3/38

    Projects

    Two types of projects: Proposed by TA

    Proposed by students

    Project team

    members: 1-3

    team building: autonomous

    1 raspberry kit for each team

    Project selection

    TA Projects proposals presented on Oct 30

    TA Projects allocation by Nov 5

    Student projects proposals by Nov 5

    Student projects acceptance by Nov 12

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    4/38

    Course purpose

    To learn how to program embedded devices (things)connected to the internet

    How to get data from sensors and give commands to

    actuators

    How to communicate with other devices

    How to write applications to collect data from devices

    What is different from standard PC programming?

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    5/38

    Course purpose

    Programming IoT devices includes:

    Sensors/actuator interfacing

    Web oriented programming (ok, this is like PCs) but protocols

    and APIs are different

    Lightweight, QoS oriented, low-power

    Using specific communication paradigm and protocols (e.g.

    publish/subscribe)

    Using middleware services

    Programming for a constrained HW

    So, which instruments you need to learn?

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    6/38

    Course contents

    Classes

    Introduction to OOP

    OO/Web programming with Python

    Other Web programming approaches(Java, Javascript, AJAX, PHP)

    XML, JSON formats

    IoT devices and smart objects

    Architectures, sensors, actuators

    Communication protocols: 802.15.4,

    Zigbee, 6LowPAN, Internet 0, IPSO

    Constraints: power, real-time, reliability

    Programming distributed objects using

    web services Web services and microservices

    RestFULL, SOAP, WSDL

    Middleware programming

    Middlewares for IoT

    Service and resource orientedarchitectures

    IoT network programming

    Publish/subscribe paradigm

    M2M protocols: MQTT, CoAP

    Resource constrained programming

    OS for smart objects

    Event driven programming

    Real time and security aspects

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    7/38

    Course contents

    Labs

    1. Python programming

    Basics, OOP

    2. Web programming I

    Web services, cherry py, static pages

    3.

    Web programming II Web services, cherry py, dynamic

    pages, REST+JSON

    4. Raspberry PI I

    Intro + sensors

    5. RaspberryPI II

    Web services + sensors6. RaspberryPI III

    Web services + MQTT

    4&516%$$7 8, 9/#%: ; < =* (/$% >8? @AB 4!9

    CD 9/$% 8/E%$F*: 0G&" 8$%+,/*5 9/#%:5

    B:&(H (&5%I JAB KLLBM 9,($/ MN &"# &1O%$

    9*:P"&P/"&: 8/E%$ &1O%$ < QR ;! ?SI T?

    U,V "&"/I ;WX9O$ YN9.I TOG%$"%O (&6:%

    >/$% !49Z@X M1%%# [XX 9Y\ K/ (/$%5 ]

    4!9 @ AB LM ^,"*D

    0I Y 5%"5/$ 4%:&7

    4&516%$$7 1,;

    _ (&5%

  • 7/24/2019 Iot Lesson1

    8/38

    Seminars

    IREN (Italian DSO) will demonstrate District Heatingmanagement system (sensors + data in the CLOUD) for

    smart city applications

    Reply (consulting company) will demonstrate their IoTsolutions

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    9/38

    THE INTERNET OF THINGSSCENARIO

    Introduction

  • 7/24/2019 Iot Lesson1

    10/38

    IoT concept

    US National Intelligence Council (NIC) considers Internet of Things

    as one of the 6 Disruptive Civil Technologies

    (April 2008)

    IEEE ranks IoT #1 in the list of Top Trends for 2013 (Winter 2012): !The IoT promises to be the most disruptive technological

    revolution since the advent of the World Wide Web. Projections

    indicate that up to 100 billion uniquely identifiable objects will be

    connected to the Internet by 2020!

    @X!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    11/38

    Tentative definition

    IoT is!

    Things having identities and virtual personalities operating

    in smart spaces using intelligent interfaces to connect and

    communicate within social, environmental, and usercontexts

    @@!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    12/38

    A more practical one

    According to Wikipedia, IoT refers to the interconnection of uniquely

    identifiable embedded computing-like devices within the

    existingInternetinfrastructure.

    Typically, IoT is expected to offer advanced connectivity of devices,systems, and services that goes beyond

    machine-to-machine communications (M2M)and covers a variety of

    protocols, domains, and applications.

    The interconnection of these embedded devices (including

    smart objects), is expected to usher in automation in nearly all fields,

    while also enabling advanced applications like aSmart Grid.

    @;!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    13/38

    What is IoT then?

    !"# %&'#(' )* !"+&,- .)&.'- #/#(0 120 .)&-34#( )56#.'- 2&1

    +&13-'(+27 #83+94#&' )&') '"# ':)(;< #&257+&, +&*)(42=)& ,2'"#(+&,

    2&1 42&2,#4#&' )* '"#-# 1#/+.#- /+2 -)>:2(# +& )(1#( ') +&.(#2-#

    #?.+#&.0< #&257# : -#(/+.#-< )( 2."+#/# )'"#( "#27'"< -2*#'0< )(

    #&/+()&4#&'27 5#@'-A`S%+,"a!5GO/"

    S%+," !5GO/"I & B$,P5G O%(G"/:/2,5O ,"

    @[[[ E&5 TD%(*P+% N,$%(O/$ &O 9.0b5

    !*O/%"O%$I &" 4c.N $%5%&$(G

    (/"5/$P*3

    U,$%# O&:H /" 7/*O*6%

    d>/*$O%57e 4/6%$O/ f&F&:/"I M0 3,($/%:%(O$/",(5g

  • 7/24/2019 Iot Lesson1

    14/38

    The Digital Explosion

    20

    13

    44

    Zettabytes

    50 Billion

    B C#D250'#- E BFBGH+,250'#-

    d>/*$O%57e 4/6%$O/ f&F&:/"I M0 3,($/%:%(O$/",(5g

  • 7/24/2019 Iot Lesson1

    15/38

    By 2020 the Internet traffic will

    shift dramatically! Most of the IP traffic will originate from other than personal

    computers (PCs). Wi-Fi traffic will exceed wired traffic and Full HDvideo will generate more traffic than standard video.

    According to a report issued by Cisco, the number of connecteddevices (i.e. through IPv6 and evolution) will grow to some 50 billiondevices by 2020. The internet traffic will get close to 44 Zettabytes(i.e. 10^21 bytes)!

  • 7/24/2019 Iot Lesson1

    16/38

    Things?

    Things, in the IoT, can refer to a wide variety of devices

    such as heart monitoring implants,

    bio-chiptransponders

    on farm animals, automobiles with built-in sensors, or field

    operation devices that assist fire-fighters in search andrescue.

    Current market examples include

    smart thermostat

    systems

    and washer/dryers that utilize WiFi for remote monitoring.

    @C!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    17/38

    New Things to Augment Life

    Smart CarReduce emissions

    Increase safety

    Save fuel

    Smart City

    Reduce traffic congestion

    Better use of resources

    Improve security

    Smart Me Wellness

    Help to lead healthier lives

    Optimize sports performance

    Early warning of illness

    Smart Home

    Make entertainment more

    interactive and immersive

    Increase comfort

    Save energy

    Smart Me Healthcare

    Empower patients

    Help physicians monitor and

    diagnose remotely

    Smart Industrial

    & Smart Services

    Productivity gains

    Efficiency, agility, water and

    food.

    d>/*$O%57e 4/6%$O/ f&F&:/"I M0 3,($/%:%(O$/",(5g

  • 7/24/2019 Iot Lesson1

    18/38

    Making Things Smarter

    It used to tell youthe time

    And how youare doing

    It used to remind

    you of someone

    close to your heart

    Nowit reminds

    you to take care

    of your heart

    They used to keep

    your feet warm

    Nowthey help you keep you

    and your feet fit

    They used to help you

    see clearly

    Nowthey help you

    to see more

    Nowit tellsyou what to do

    And exactly

    what you

    doing

    d>/*$O%57e 4/6%$O/ f&F&:/"I M0 3,($/%:%(O$/",(5g

  • 7/24/2019 Iot Lesson1

    19/38

    The Internet of Things Opportunity

    New Things to

    augment lifeExisting Things

    augmented

    d>/*$O%57e 4/6%$O/ f&F&:/"I M0 3,($/%:%(O$/",(5g

  • 7/24/2019 Iot Lesson1

    20/38

    Internet of Every Things scenario

    d>/*$O%57e 4/6%$O/ f&F&:/"I M0 3,($/%:%(O$/",(5g

    Smart Home

    Remote

    Monitoring

    Smart Systems are pervasive, converging

    through Internet of Every Things!

    Smart

    Street Lighting

    Power Plant

    Renewable Energy

    Fab automation

    Plug-in Hybrid Electric Vehicle

    Home and Building

    Automation

    Smart Metering

  • 7/24/2019 Iot Lesson1

    21/38

    IoT Services

    ;@

  • 7/24/2019 Iot Lesson1

    22/38

    Enabling Technologies and

    Issues

    Key technologies: Sensors/Actuators

    Low power, autonomic, pervasive, ubiquitous computing

    Communication protocols (REST, CoAP, MQTT)

    Microservices and Middlewares

    Data Analytics Engines -> in the CLOUD

    Apps (iOS, Android, Web)

    Key issues: Interoperability

    Security/trust and privacy

    Low resources (=> revisit protocols and algorithms

    implemented in Internet and Web) Scalability

    ;;!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    23/38

    Communication Technologies for IoT

    1.

    Bluetooth2. Zigbee

    3. Z-Wave

    4. NFC (Near-Field Communication)

    5.

    RFID

    6. WiFi

    7. 2G/3G/LTE

    8.

    Wibro/Mobile WiMax9. PLC (Power Line Communication)

    10.Ethernet

    11.What else?

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    24/38

    Web services & IoT

    A smart object system implemented with web services.

    Temperature sensors post temperature data to a buildingautomation server

    The building automation server configures a radiator based on

    the temperature data

    ;]

    h9^

    iMLK

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    25/38

    Publish/Subscribe Pattern

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2 ;Q

  • 7/24/2019 Iot Lesson1

    26/38

    Publish/Subscribe: QoS

    ;C!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    27/38

    The Concept of Micro-services

    Micro-service architecture:

    the system is decomposed into a collection of independent and specialized serviceseach of which exhibits its own interface to access to other services of the system

    Each service can be managed independently for deploy / start / stop operations.

    ;Z!"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    28/38

    Terminologies similar to IoT

    1. USN (Ubiquitous Sensor Networks)

    2. M2M (Machine-to-Machine)

    3. IoE (Internet of Everything) Ciscos favorite term

    4.

    Cloud of Things

    5. Web of Things

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    29/38

    Introductory Videos

    Intel IoT -- What Does The Internet of Things Mean?

    http://www.youtube.com/watch?v=Q3ur8wzzhBU

    Cisco - How the Internet of Things Will Change Everything--

    Including Ourselves

    http://www.youtube.com/watch?v=B_hjAfPJeRA

    IBM Internet of Things

    http://www.youtube.com/watch?v=df9xAZZ-8zg

    Dr. John Barrett at TEDxCIT The Internet of Things

    http://www.youtube.com/watch?v=QaTIt1C5R-M

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

    I t t f Thi 3 P i t f

  • 7/24/2019 Iot Lesson1

    30/38

    !" $%&'() *% +," - .'/01%*( 2*%3'(45 67 89:;:< 9=>=?9>:6

    Internet of Things: 3 Points of

    View?

    M1,3%5e L6j%(O5 O$&(H&6:% ," 51&(%

    &"# P3%

    Kc>e K%&$ c,%:# >/33*",(&P/"I

    1$/O/(/:5 6&5%# /" 4c.N

    U.M8e U,$%:%55 ,#%"PV(&P/" &"#

    5%"5,"2 1:&k/$3I & 4c.N

    l$,/

  • 7/24/2019 Iot Lesson1

    31/38

    The Network Issue

    Key issue: object2object communication

    First approach: develop specific communication protocols

    adapted to each type of things and type of applications

    need for standardization

    which compatibility with Internet?

    Second approach: (re-)use IP integrate IP and IEEE 802.15.4 (6LoWPAN) (IP for Smart Objects

    (IPSO) Alliance) make IP lighter (Internet )

    Third approach: (re-use) 802.15.4

    enrich 802.15.4 (Zigbee)

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    32/38

    The Network Issue

    From host2host to object2object

    TCP is not adapted

    Designed for long-lasting connections while objects (like tags orsensors) exchange small pieces of data => handshake + congestioncontrol/retransmit/recovery + flow control + buffering procedures toocomplex

    Very heterogeneous networks and traffic

    Scalability?

    Quality of service?

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    33/38

    The Identification issue

    Ultimate goal: unique/universal ID for naming and addressing

    individual objects i.e., to attach an egoto each object, condition

    to develop ego-centric applications

    Naming is difficult!

    IP is limited, not good for mobility

    IPv6 comes to the rescue (10^38 addresses) but still lacks mobility,

    moreover, imposes overhead limiting payload (e.g. 21-46 bytes for

    6LowPAN)

    More efficient naming schemes are needed e.g. through ONS: Object Name

    Service

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    34/38

    Security and Privacy (1/2)

    A definitive threat for privacy!

    A security nightmare!

    Security

    IoT = a kind of unsupervisedmobile/pervasive grids whose end-components are resource limitedtiny objects = a security nightmare

    Physical attacks

    Man in the Middle attacks

    Cryptographic techniques tooCPU-intensive for low energyobjects

    Etc!

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    35/38

    Security and Privacy (2/2)

    Privacy

    Your life can will be traced => possible monitoring, mining,

    analysis

    Connection possible with Linked Open Data => worsen the

    threats

    Open air connections => possibility of eavesdropping

    Not only your digital life but also your analogical life

    You cannot even know what is sensed about you, when it issensed, etc. Sensors do not ask for permission (cf. video

    surveillance)

    No forget option -> once data are on the Internet they cannot

    be (easily) deleted

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    36/38

    Example Application:

    Smart Buildings

    oC

    .

    -

    -

    .

    ,

    .

    .

    ,

    ,

    .

    .,

    ,

    . :

    ;

    ;

    . ,

    ;

    .

    ,

    .

    .

    .

    ,

    0G% OG,"2 G%$% ,5 OG% 1/E%$ 1:*2 OG&O 6%(/3%5 & p53&$O 1:*2q

    N&O& &$% 1$/(%55%# ," OG% >^L?N &"# +,5*&:,\%# ," !r4 /$ Rr4

    OG$/*2G (/"O%DO &E&$% O%(G"/:/2,%5 /" & 3/6,:% #%+,(%

    !"#$

    "#$&'(#"

    )*+

    "#$&'(#"

    +,-#$

    "#$&'(#"

    .$/"01#$ 2

    !"#$%&' )"$"*

    +#$"* )"$"*

    ,#- )"$"*

    ./"0$*%0 )"$"*

    .$/"01#$ '

    !"#$%&' )"$"*

    ,#- )"$"*

    ./"0$*%0 )"$"*

    .$/"01#$ 3

    !"#$%&' )"$"*

    +#$"* )"$"*

    ./"0$*%0 )"$"*

    40'56'37

    (/3(#3,$8,/$

    9:;

  • 7/24/2019 Iot Lesson1

    37/38

    IoT as enabling technology for..

    Ambient intelligence and context aware applications

    User interacting with an interactive environment providingpersonalized services

    Applications adapts their selves to the environment

    https://www.youtube.com/watch?v=ITjsb22-EwQ

    !"#$%& !()*&+,+& - ./0 1$/2$&33,"2

  • 7/24/2019 Iot Lesson1

    38/38

    Summary

    IoT is an incoming revolution, enabling a world of new applications

    New communication paradigms are needed (i.e. publish/subscribe)

    Programming IoT requires specific skills (web-network-object oriented,

    resource constrained programming) In this course we will study the main paradigm of IoT programming

    using Python, similar concepts can be implemented in Java and otherscripting languages

    !"#$%& !()*&+,+& ./0 1$/2$&33,"2