Vous êtes sur la page 1sur 58

Module: OBJETS CONNECTES ET SYSTEMES

INTELLIGENTS
EM: Objets Connectés (Connecetd Devices)
Pr Atman JBARI
Electrical Engineering Department, ENSAM, Rabat
Email: atman.jbari@ensam.um5.ac.ma
Resp:

IoT 1
Identification: M55A-1 : Objets connectés IOT

❑ Objectifs:
• Décrire les concepts liés à l’internet des objets et aux objets connectés et découvrir
leur mise en pratique
• Mettre en ouvre un projet sur les objets connectés relativement à un service.
• Définir un système intelligent et toutes ses composantes.
• Programmer des algorithmes de fonctions intelligentes d’un système.
❑ Volume horaire:
Cours: 8h; TD: 6h; TP: 8h; AP: 2h; Evaluation: 2h
❑ Evaluation:
Note du module n = 0.5 x n1+ 0.5 x n2;
ni = 0.25 x nCCi + 0.15 x nAPi + 0.2 x nTPi + 0.4 x nExi
❑ Evaluation:
La note minimale Mod: 12/20; La note minimale EM: 06/20.

IoT 2
References

✓ Book: « Internet-of-Things (IoT) Systems Architectures, Algorithms,


Methodologie », Dimitrios Serpanos , Marilyn Wolf, s. ISBN 978-3-319-
69714-7 ISBN 978-3-319-69715-4 (eBook). Springer International Publishing
AG 2018.
✓ Lombardi, M.; Pascale, F.;Santaniello, D. Internet of Things: A General
Overview between Architectures, Protocols and Applications. Information
2021, 12, 87. https://doi.org/10.3390/info12020087.
✓ Rosilah Hassan , Faizan Qamar , Mohammad Kamrul Hasan , Azana Hafizah
Mohd Aman, and Amjed Sid Ahmed, Internet of Things and Its Applications:
A Comprehensive Survey, Symmetry 2020, 12, 1674.
✓ Wi-Fi: Overview of the 802.11 Physical Layer and Transmitter
Measurements, www.tektronix.com/wifi
✓ Chapter 1, Introduction to IoT, Book website: http://www.internet-of-
things-book.com Bahga& Madisetti, © 2015
✓ A Gentle Introduction to IoT Protocols: MQTT, CoAP, HTTP & WebSockets;
Antonio Almeida and Jaime González-Arintero ; June 14, 2017

IoT 3
Outline:

I. Definitions and IoT Architecture

II. IoT Device Models and Technology

III. IoT Communication Protocols:


I. HTTP

II. Message Queuing Telemetry Transport (MQTT)


III. WebSockets

IV. IoT Communication Technlogies:


Wifi , BlueTootch, ZigBee, RFID (Radio Frequency Identification)

V. IoT Labs

IoT 4
Définitions

❑Objet connecté: Objet physique possédant une adresse IP


qui se connecte pour recevoir et envoyer des données via un
réseau de communication.
❑Internet des Objets (IoT):
✓Un ensemble d’objets disposant de capteurs et échangeant
de l’information via un réseau.
✓un réseau de réseaux qui permet, via des systèmes
d’identification électronique normalisés et sans fil,
d’identifier et de communiquer numériquement avec des
objets physiques afin de pouvoir mesurer et échanger des
données entre les mondes physiques et virtuels.

IoT 5
Definition of IoT

✓The Internet of Things (IoT) paradigm refers to a system of


devices, interconnected with each other, equipped with
computational capacity (smart objects), identifiable and enabled
to transfer data over a network, without a required human
interaction.
✓A dynamic global network infrastructure with self-configuring
capabilities based on standard and interoperable communication
protocols where physical and virtual "things" have identities,
physical attributes, and virtual personalities and use intelligent
interfaces, and are seamlessly integrated into the information
network, often communicate data associated with users and their
environments.
✓The internet of things (IoT) constitutes a network of embedded
devices that incorporate sensors and communication functions.

IoT 6
IoT Architecture

Edge has devices ; Cloud has servers


IoT 7
Applications

Source: https://iot-analytics.com/top-10-iot-applications-in-2020/
IoT 8
IoT − Sensors

IoT − Environmental Monitoring

Commercial Energy

IoT − Healthcare Applications

The ClearProbe portable connected


ultrasound device
IoT 9
IoT − Education Applications

IoT − Transportation Applications

Embedded RFID chips in ID cards to


track the presence of students.

This smart road sign receives data and modifications to


better inform drivers and prevent congestion or accidents
IoT 10
Characteristics of IoT

✓Dynamic & Self-Adapting


✓ Self-Configuring
✓ Interoperable Communication Protocols
✓ Unique Identity
✓ Integrated into Information Network

IoT 11
Physical Design of IoT

• The "Things" in IoT usually refers to IoT devices which


have unique identities and can perform remote sensing,
actuating and monitoring capabilities.
• IoT devices can:
• Exchange data with other connected devices and applications
(directly or indirectly), or
• Collect data from other devices and process the data locally or
• Send the data to centralized servers or cloud-based application
back-ends for processing the data, or
• Perform some tasks locally and other tasks within the IoT
infrastructure, based on temporal and space constraints

IoT 12
Organization of an IoT system

IoT 13
Organization of an IoT system

• The plant or environment is the physical system with which the IoT
system interacts. We will use these two terms interchangeably.
• A set of devices form the leaves of the network. A node may include
sensors and/ or actuators, processors, and memory. Each node has a
network interface. A node may or may not run the Internet Protocol.
• Hubs provide first-level connectivity between the nodes and the rest of
the network. Hubs are typically run IP.
• Fog processors perform operations on local sets of nodes and hubs.
Keeping some servers nearer the nodes reduces latency. However, fog
devices may not have as much compute power as cloud servers. Fog
devices also introduce system management issues.
• Cloud servers provide computational services for the IoT system.
Databases store data and computational results. The cloud may provide
a variety of services that mediate between nodes and users.

IoT 14
Internet of Things (IoT) architecture

IoT 15
Edge Computing-based architecture

Edge Computing is a horizontal architecture


that provides:
✓ Distributed computing,
✓ Data storage,
✓ and Control capabilities.
Benefits: Minimizes latency, Allows for
bandwidth saving, Solves some security
issues

IoT 16
High level Cloud-IoT 3-tier architecture

IoT 17
Most Common IoT Architectures

• Perception: the physical layer of


objects and groups all the features;

• Network: the communication layer


responsible for the transmission of
data to the application layer through
various technologies and protocols;

• Application: the application layer in


which the software offering a specific
service is actually implemented.

IoT 18
Application Layer

• Includes all the software necessary to offer a specific service.


• The data from the previous levels are stored, aggregated, filtered, and
processed, and databases, analysis software, etc., are used.
• Cloud computing, where services such as storage or data processing are
provided from a set of pre-existing resources, configurable and remotely
available in the form of distributed architecture;
• Edge computing, where data processing is partially distributed on the
peripheral nodes of the network to increase the performance of IoT
systems.
• IoT Platforms: Amazon AWS, Microsoft Azure, Xively, Firefox WebThings
Gateway, etc.

IoT 19
Middleware Architecture

• Acts as a connection between applications, data, and users.


• Advantages are:
• 1. Support on various applications;
• 2. Runs on various operating systems and platforms;
• 3. Distributed computing and the interaction of services among
heterogeneous networks, devices, and applications;
• 4. Support standard protocols;
• 5. Provides standard interfaces, providing portability and standard
protocols to enable interoperability, and making middleware play an
important role in standardization;
• 6. Provides a stable high-level interface for applications.

IoT 20
Cloud-Based Architectures

• The large amount of data generated by objects is stored, processed and presented to the
user through services made available form the cloud.
• Examples: Amazon Web Services AWS by Amazon, Azure by Microsoft, Xively by Google,
etc.
• AWS Components:
✓ The Device Gateway: intermediary between the connected devices and the cloud services
through the Message Queue Telemetry Transport (MTTQ) protocol.

✓ The Registry: responsible for assigning a unique ID to each connected device, storing
metadata about connected devices in order to track them.

✓ The Rules Engine: The Rules Engine processes incoming messages and distributes them to
other devices or cloud services

✓ The Device Shadow: virtual representations of physical objects. These representations are
persistent and stored in the cloud to be accessed at any time (even when the device is
offline) by cloud services or other devices.

IoT 21
Server-based architecture

✓ the various devices are connected


to a gateway server that manages
the devices’ connection to the
Internet.
✓ the devices are not directly
accessible and only look at the
Internet through the gateway.

IoT 22
IoT Design

• IoT systems are designed with two management


architectures, including time-based and event-driven
architectures.
• The event-driven architecture consists of sensors
transmitting data when activity is sensed, the same as when
an alarm is activated once a gate is opened.
• For the time-based architecture, the components of the
system transmit data continuously at a specified interval of
time.

IoT 23
Duty Cycle and Power Consumption

• The duty cycle model is widely used to analyze IoT devices.


• The model assumes periodic activation of the device. The duty cycle is
the percentage of time for which the device is on:

Lower duty cycles mean lower energy consumption. We can change the duty
cycle through a combination of changes to the operating time O and the period T.
IoT 24
Duty Cycle and Power Consumption

The on-state power consumption of the device Pon:


✓ Zero leakage:

✓ With leakage power of Poff, the average power consumption


over the duty cycle is:

✓ Duty cycle:

This model carries several implications for the design of IoT devices: the
device must be good at idling at low power; it should provide low energy
and time to shut down and to turn back on.
IoT 25
Duty Cycle and Power Consumption

• Communication power is a large fraction of the total power


consumption of many IoT devices.

• Many IoT devices transmit small amounts of data during the on


portion of their duty cycle. In this scenario, the overhead
associated with setting up a communication is a significant part of
the total communication power;

• Many communication systems are designed for connection-


oriented service that allows setup costs to be amortized over a
longer communication.

IoT 26
IV. IoT Communication
and Protocols
HTTP, MQTT, WebSockets.

IoT 27
OSI Model

▪ OSI: Open Systems


Interconnection Reference
Model
▪ The OSI model is a layered
model that describes how
information moves from an
application program running on
one networked computer to an
application program running on
another networked computer

IoT 28
IoT Protocols
• Link Layer
• 802.3 – Ethernet
• 802.11 – WiFi
• 802.16 – WiMax
• 802.15.4 – LR-WPAN
• 2G/3G/4G
• Network/Internet Layer
IPv4; IPv6; 6LoWPAN
• Transport Layer
TCP; UDP
• Application Layer
HTTP; CoAP; WebSocket
MQTT; XMPP; DDS;
AMQP

IoT 29
Communication / Transport layer

IoT 30
Communication Technologies

IoT 31
Communication Technologies

IoT 32
Generic block diagram of an IoT Device

• An IoT device may consist of


several interfaces for
connections to other
devices, both wired and
wireless.
• I/O interfaces for sensors
• Interfaces for Internet
connectivity
• Memory and storage
interfaces
• Audio/video interfaces.

IoT 33
Logical Design of IoT

• Logical design of an IoT system refers to an abstract representation of


the entities and processes without going into the low-level specifics
of the implementation.
• An IoT system comprises of a number of functional blocks that
provide the system the capabilities for identification, sensing,
actuation,communication, and management.

IoT 34
Request-Response communication model

• Request-Response is a communication model in which the client


sends requests to the server and the server responds to the
requests.
• When the server receives a request, it decides how to respond,
fetches the data, retrieves resource representations, prepares the
response, and then sends the response to the client.

IoT 35
Publish-Subscribe communication model

• Publish-Subscribe is a communication model that involves publishers, brokers and


consumers.
• Publishers are the source of data. Publishers send the data to the topics which are
managed by the broker. Publishers are not aware of the consumers.
• Consumers subscribe to the topics which are managed by the broker.
• When the broker receives data for a topic from the publisher, it sends the data to
all the subscribed consumers.

IoT 36
The publish/subscribe model

IoT 37
The publish/subscribe model

• A publish/subscribe protocol requires less coupling between the client


and server.
• The server, known as a publisher, classifies messages into categories:
Clients subscribe to the categories of interest to them.
Publish/subscribe systems are typically mediated by brokers which
receive published messages from publishers and send them to
subscribers.
• Messages may be organized by topic; all message of a given topic are
distributed by the brokers to the subscribers for that topic. The broker
knows the identities of subscribers but the publisher does not. Brokers
may interact with each other using a bridge protocol.
• A bridge allows indirect publication of messages, with a message going
from the publisher to a first broker, then to a second broker, and finally
to subscribers who are not connected to the first broker.
• Examples: Data Distribution Service (DDS), Real-Time Publish/Subscribe
Protocol (RTPS).

IoT 38
Push-Pull communication model

• Push-Pull is a communication model in which the data producers push


the data to queues and the consumers pull the data from the queues.
Producers do not need to be aware of the consumers.
• Queues help in decoupling the messaging between the producers and
consumers.
• Queues also act as a buffer which helps in situations when there is a
mismatch between the rate at which the producers push data and the
rate rate at which the consumers pull data.

IoT 39
Exclusive Pair communication model

• Exclusive Pair is a
bidirectional, fully duplex
communication model that
uses a persistent
connection between the
client and server.
• Once the connection is
setup it remains open until
the client sends a request
to close the connection.
• Client and server can send
messages to each other
after connection setup.

IoT 40
Web Application ?

HTTP
FTP URL (Uniform Resource Locator)
WebSocket https://sites.google.com/view/atmjbari/home

IoT 41
Web Application ?

IoT 42
HTTP

• HTTP stands for hypertext


transfer protocol and is used to
transfer data across the Web.
• HTTP is an asymetric request-
response client-server protocol.
• HTTP is an application layer
protocol
• Retrieves documents on behalf
of a browser application
program
• HTTP specifies actions to be
taken upon receipt of certain
messages.

IoT 43
HTTP Protocol

✓ HTTP assumes messages can be exchanged directly


between HTTP client and HTTP server.
✓In fact, HTTP client and server are processes running in two
different machines across the Internet.
✓HTTP uses the reliable stream transfer service provided by
TCP.

IoT 44
HTTP vs URL

• http is the transfer protocol that transfer the resource (web


page,image,video etc) from the server to the client.
• URL (uniform resource Locator) is used for web pages. It is
an example of a URI (uniform resource indicator).

IoT 45
HTTP Responses and Response Codes

• Each request has a response. The Response consists of a


• STATUS code And Description
• 1 or more optional headers
• Optional Body message can be many lines including binary
data
• Response Status codes are split into 5 groups each group
has a meaning and a three digit code.
• 1xx – Informational
• 2xx – Successful
• 3xx -Multiple Choice
• 4xx– Client Error
• 5xx -Server Erro

IoT 46
Request Response Example

IoT 47
Request Types, Methods or Verbs

• The HTTP protocol now support 8 request types, also


called methods or verbs in the documentation,they are:

• GET – Requesting resource from server


• POST – submitting a resource to a server (e.g. file uploads)
• PUT -As POST but replaces a resource
• DELETE-Delete a resource from a server
• HEAD – As GET but only return headers and not content
• OPTIONS -Get the options for the resource
• PATCH -Apply modifications to a resource
• TRACE -Performs message loop-back

IoT 48
HTTP: RESTful Hypothetical Light Switch

api.example.com/turnoff
Cell Phone Server

api.example.com/shoulditurnoff

No
Should I Process
turn off? Response

Yes
Turn off

WiFi Switch
IoT 49
GET vs POST

• Features of GET
• It is very easy to bookmark data using GET method.
• The length restriction of GET method is limited.
• You can use this method only to retrieve data from the address bar
in the browser.
• This method enables you to easily store the data.
• Features of POST
• POST method request gets input from the request body and query
string.
• Data passed using the POST method will not visible in query
parameters in browser URL.
• parameters of POST methods are not saved in browser history.
• There is no restriction in sending the length of data.
• It helps you to securely pass sensitive and confidential information
like login details to server.

IoT 50
GET , POST: Examples

• GET Method Example


• GET/RegisterStudent.asp?user=value1&pass=value2
• POST Method Example
• POST/RegisterStudent.asp HTTP/1.1
• Host: www.um5.ac.ma
• user=value1&pass=value2

IoT 51
MQTT : Publish/Subscribe

Channels/topics in MQTT work like file paths:

IoT 52
MQTT : Publish/Subscribe

• Clients connect to a “Broker”


• Clients subscribe to topics eg,
• client.subscribe(‘toggleLight/1’)
• client.subscribe(‘toggleLight/2’)
• client.subscribe(‘toggleLight/3’)
• Clients can publish messages to topics:
• client.publish(‘toggleLight/1’, ‘toggle’);
• client.publish(‘toggleLight/2’, ‘toggle’);
• All clients receive all messages published to topics they
subscribe to
• Messages can be anything
• Text
• Images
• etc

IoT 53
MQTT Hypothetical Light Switch

Cell Phone Broker


client.publish(‘lightSwitch/1’, ‘toggle’)

‘toggle’

Toggle Switch
WiFi Switch
IoT 54
MQTT : Quality of Service

QoS can be 0, 1, or 2:
• QoS0 (At most once): The least reliable mode but also the
fastest. The publication is sent but confirmation is not
received.
• QoS1 (At least once): Ensures that the message is delivered
at least once, but duplicates may be received.
• QoS2 (Exactly once): The most reliable mode while the most
bandwidth-consuming. Duplicates are controlled to ensure
that the message is delivered only once.

IoT 55
MQTT CODES

IoT 56
WebSockets

• WebSockets allow both the server and the client to push


messages at any time without any relation to a previous
request. One notable advantage of using WebSockets is,
almost every browser support WebSockets.
• WebSocket solves a few issues with HTTP:
• Bi-directional protocol — either client/server can send a message to
the other party (In HTTP, the request is always initiated by the client
and the response is processed by the server — making HTTP a uni-
directional protocol)
• Full-duplex communication — client and server can talk to each
other independently at the same time.
• Single TCP connection — After upgrading the HTTP connection in
the beginning, client and server communicate over that same TCP
connection throughout the lifecycle of WebSocket connection.

IoT 57
WebSockets

IoT 58

Vous aimerez peut-être aussi