0% found this document useful (0 votes)
81 views171 pages

CPS Merged Merged Final

Uploaded by

deepak kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views171 pages

CPS Merged Merged Final

Uploaded by

deepak kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 171

CSI** ZG528

Cyber-Physical Systems (Lecture 2)

Slide credits: Rodolfo Pellizzoni, Edward A. Lee and

Sanjit A. Seshia, Wang Yi


BITS Pilani Rajesh Kumar
Pilani | Dubai | Goa | Hyderabad

CSI** ZG528
Agenda
• CPS – enabling technologies
• Real time systems [Most of the lecture]
• Embedded systems
• Embedded systems hardware
• Processor, memory, clock
• Modelling using Uppaal

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CPS – Enabling
Technologies
Enabling technology – technology developed for a wide
range of purposes, and are required to implement CPSs
• Real time and embedded systems
• Communication technologies
• Sensors and actuators
• WSNs
• Human-machine interfaces
• Distributed/cloud computing
• Big data analytics, high performance computing,
Security
• Web services
• Semantic search engines

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
What is Special about Real
Time Systems (1/2)

More
reliable Developing software
Safer; for real time systems
operate in needs low level
More potentially
common hostile manipulation
environmen
ts
Real Time Can do great harm, if
Systems
it fails
Timeliness/
Performanc
Reaction
e constrains
times
No luxury of reboot!!
Schedulabili
ty

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


What is Special about Real
Time Systems (2/2)
• Real time systems vary in size, cost, performance
sensitivity
• Characteristics of real time systems
• Timeliness
• Performance
• Schedulability
• Reliability, Maintainability, Availability
• Safety
• Security
• Efficiency
• Challenges in development of real time systems
• Memory constraints
• Use of cross compiler tools
• Simulation environments may not be 100% accurate
• May need to write software for hardware that does not yet exist

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Response time requirements
for real-time applications

response
time
1s
Fire alarm
100 ms Medical
Process diagnosis
control
10 ms Robot systems
controllers and
1 ms Speech industrial
and Telemetry
control automation
100 µs audio
Network
systems control
10 µs Flight
1 µs simulation

1 ns
applications
Real-Time Systems
• The correctness of the system depends not only
on the logical result of the computation but also
on the time at which the results are produced.
• A correct value at the wrong time is a fault.

• Processes attempt to control or react to events


that take place in the outside world
• These events occur in “real time” and tasks must
be able to keep up with them
• Processes are associated with timing constraints
(deadlines)
7
Real Time Definitions
u Reactive:
Computations occur in response to external events
• Periodic events (e.g., rotating machinery and control loops)
– Most embedded computation is periodic
• Aperiodic events (e.g., button closures)
– Often they can be “faked” as periodic (e.g., sample buttons at 10 Hz)

u Real Time
• Real time means that correctness of result depends on both functional
correctness and time that the result is delivered
• Too slow is usually a problem
• Too fast sometimes is a problem

8
Real Time Scheduling

Priorities
Read
Read
y
Ready
Read
y
Ready Run y
Queue
Scheduler
Wait
Wait
Wait
Wait
Queue
Run Scheduler admin

Process / Proc. 1 Proc. 2 Proc. 3 ...


tasks Prio. High Prio. Med. Prio. High ...
instances State ready State ready State ready ...

Scheduling Techniques and Analysis version: 0


August 21, 2020
3 Gerrit Muller PSRTscheduling
Scheduling decision
• Assignment
• Ordering
• Timing

Done at design time or run time

CSI** ZG528
Types of Real-Time Scheduling

u Dynamic vs. Static


• Fully static scheduler
• Static order scheduler
• Static assignment scheduler
• Fully Dynamic scheduler
u Preemptive permits one task to preempt another one of lower priority

11
Periodic task model
n A task = (C, T)
o C: worst case execution time/computing time (C<=T!)
o T: period (D=T)

n A task set: (Ci,Ti)


o All tasks are independent
o The periods of tasks start at 0 simultaneously

12
System Modeling in RT Scheduling
– Tasks are the schedulable unit of the system.
– A task is characterized by timing constraints and resource
requirements.
– Periodic task (T)
– processing time
– deadline
– period
Flavors Of Real Time
u Soft real time
• Utility degrades with distance from deadline
u Hard real time
• System fails if deadline window is missed
u Firm real time
• Result has no utility outside deadline window, but system can withstand a few
missed results

14
Flavors Of Real Time
• Fixed priority
• Dynamic priority

a. Preemptive priority-based scheduler


b. Non-preemptive priority-based scheduler

CSI** ZG528
CPU utilization

n C/T is the CPU utilization of a task


n U=Σ Ci/Ti is the CPU utilization of a task set
n Note that the CPU utilization is a measure on how busy the
processor could be during the shortest repeating cycle:
T1*T2*...*Tn
o U>1 (overload): some task will fail to meet its deadline no matter
what algorithms you use!
o U<=1: it will depend on the scheduling algorithms
n If U=1 and the CPU is kept busy (non idle algorithms e.g. EDF),
all deadlines will be met

16
Scheduling Algorithms

n Static Cyclic Scheduling (SCS)


n Earliest Deadline First (EDF)
n Rate Monotonic Scheduling (RMS)
n Deadline Monotonic Scheduling (DMS)

17
Earliest Deadline First (EDF)

n Task model
o a set of independent periodic tasks

n EDF:
o Whenever a new task arrive, sort the ready queue so that the
task closest to the end of its period assigned the highest priority
o Preempt the running task if it is not placed in the first of the
queue
in the last sorting
n FACT 1: EDF is optimal
o EDF can schedule the task set if any one else can
n FACT 2 (Scedulability test):
o Σ Ci/Ti <= 1 iff the task set is schedulable
18
Example: the Car Controller

Activities of a car control system. Let


1. C= worst case execution time
2. T= (sampling) period
3. D= deadline
n Speed measurment: C=4ms, T=20ms, D=20ms
n ABS control: C=10ms,T=40ms, D=40ms
n Fuel injection: C=40ms,T=80ms, D=80ms
n Other software with soft deadlines e.g audio, air condition etc

19
The car controller:
time table constructed with EDF
800
4
76 Soft RT tasks speed
ABS
14

FUEL-4
FUEL-1 20
64
speed
speed A feasible Schedule!
24

FUEL-3
60 Fuel-2
ABS
speed
54 40
44 8
EDF: + and –
n Note that this is just the simple EDF algorithm; it works for all
types of tasks: periodic or non periodic
o It is simple and works nicely in theory (+)
o Simple schedulability test: U <= 1 (+)
o Optimal (+)
o Best CPU utilization (+)
n Difficult to implement in practice. It is not very often adopted
due to the dynamic priority-assignment (expensive to sort the
ready queue on-line), which has nothing to do with the periods
of tasks. Note that Any task could get the highest priority (-)
n Non stable: if any task instance fails to meet its deadline, the
system is not predictable, any instance of any task may fail (-)

We use periods to assign static priorities: RMS

21
Rate Monotonic Scheduling:
task model
• Assume a set of periodic tasks: (Ci,Ti)
n Di=Ti

n Tasks are always released at the start of their periods

n Tasks are independent

22
RMS: fixed/static-priority
scheduling
n Rate Monotonic Fixed-Priority Assignment:
o Tasks with smaller periods get higher priorities
n Run-Time Scheduling:
o Preemptive highest priority first

n FACT: RMS is optimal in the sense:


o If a task set is schedulable with any fixed-priority
scheduling algorithm, it is also schedulable with RMS

23
Example
{(20,100),(40,150),(100,350)} Pr(T1)=1, Pr(T2)=2, Pr(T3)=3

T1 20 20 20 20
0 100 200 300

T2 40 40 40
0 150 300

T3 40 30 10 20
0 350

24
Example
n Task set: T1=(2,5), T2=(4,7)
n U = 2/5 + 4/7= 34/35 ~ 0.97 (schedulable?)
n RMS priority assignment: Pr(T1)=1, Pr(T2)=2

0 2 5 10 15 35
Missing the deadline!

0 2 5 7 14 35

25
RMS: schedulability test
n U<1 doesn’t imply ’schedulable’ with RMS
o OBS: the previous example is schedulable by EDF, not RMS

n Idea: utilization bound


o Given a task set S, find X(S) such that U<= X(S) if and only
if S is schedulable by RMS (necessary and sufficient test)
o Note that the bound X(S) for EDF is 1

26
RMS: Summary
n Task model:
o priodic, independent, D=T, and a task= (Ci,Ti)
n Fixed-priority assignment:
o smaller periods = higher priorities
n Run time scheduling: Preemptive HPF
n Precise/exact schedulability test exists

27
RMS: + and –
n Simple to understand (and remember!) (+)
n Easy to implement (static/fixed priority assignment)(+)
n Stable: though some of the lower priority tasks fail to meet
deadlines, others may meet deadlines (+)

n ”lower” CPU utilization (-)


n Requires D=T (-)
n Only deal with independent tasks (-)
n Non-precise schedulability analysis (-)
n But these are not really disadvantages;they can be fixed (+++)
• o We can solve all these problems except “lower”
utilization

28
EDF vs RM
• In practice, industrial systems heavily favor RM over
EDF. Why?

• For most task sets, RM has better utilization bound


than log 2.
– There are more complex, necessary analysis.
– If task periods are harmonic (every period is an integer
divisor of any larger period), then Ub = 1. This happens
often in practice.
• RM is easier to implement in systems with limited
number of priority levels.
• RM is more transparent – easier to understand what is
going on if something goes wrong (ex: overload).
– I.e. if a task executes for longer than its prescribed worst-
case time, higher priority tasks will be left untouched.
29
Embedded Systems

• Embedded systems are computing systems with tightly coupled


hardware and software integration.
• Designed to perform dedicated function
• Embedded means that the system is a integral part of a larger
system
• Multiple embedded systems can co-exist in a single system.
• General purpose processor are typically not aware of the
applications, but an embedded processor is application-aware.
• Hardware and software co-design: hardware and software for the
embedded system are developed in parallel.
• Cross-platform development: Both embedded system and its
application use the cross-platform development method.
• Software is developed on one platform but runs on another.

Source: http://cse.buffalo.edu
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Real-time Embedded
Systems

RTS
EMB

Railway monitoring and scheduling : RTS


Cell phone: EMB
Heart pacemaker: RTSEMB
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Characteristics of
Embedded Systems
• Designed to perform specific tasks
• Not always stand-alone devices
• Typically designed to meet real-time constraints
• Resource limited
• Performance intensive
• Power limitations
• Minimal or no UI
• High reliability
• Portable systems – cost reduction
• Capable of a self-reset in case of data loss or corruption
• Reprogrammability
• Different requirements for processing, storage, power etc.
• Commercial features – final cost, time to market, lifetime, volume

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Examples of Embedded
Devices

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Classification of Embedded
Systems

Source: http://er.yuvayana.org/classification-of-embedded-system-with-details/
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Classification of Embedded
Systems
• Standalone Embedded Systems
• Do not require a host system
• Example: Mp3 players, digital cameras, microwave ovens
• Real Time Embedded Systems
• Time-constrained embedded systems
• Example?
• Networked Embedded Systems
• Access resources via wired or wireless network connection
• Example: Home automation system
• Mobile Embedded Systems
• Used in portable embedded devics
• Example: Mp3 players, digital cameras etc., but with resource
constraints

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Classification of Embedded
Systems
• Small scale embedded systems
• Usually use 8 bit or 16 bit microcontrollers
• Minimum hardware and software
• Typically battery-powered
• Medium scale embedded systems
• Use either one or a few 16 bit or 32 bit microcontrollers
• More complex hardware and software as compared to small
scale embedded systems
• Sophisticated embedded systems
• Most complex of the three classifications mentioned

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Embedded Systems
Hardware
• Microcontroller based systems
• A microcontroller is essentially a CPU, or processor with
integrated memory or peripheral devices
• All housed on a single IC or a microchip
• As fewer external components are needed, embedded systems
using microcontrollers tend to be more widely used
• Microprocessor based systems
• Microprocessors contain a CPU but use external chips for
memory and peripheral interfaces
• Require more devices on the board, but allow more expansion
and selection of exact peripherals
• Tends to be used for the larger embedded systems
• MCU or MPU?
• Depends on the application requirements

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Components of Embedded
Systems
• Processor
• Main part of an embedded system
• Could be a generic microprocessor or microcontroller programmed to perform the
specific tasks
• 32-bit or 64 bit – refers to how many bits of data it can process internally at a time
• Memory
• RAM, ROM, Cache
• System Clock
• Precise timing information for all processes running on the system
• How fast the processor can process the data
• Speed of 2GHz è process data internally 2 billion times a second (every
clock cycle)
• 32-bit processor running at 2GHz è can process 32 bits of data
simultaneously, 2 billion times a second!
• Instruction set
• Defines the type of work that a processor can carry out
• Defined in binary
• Peripherals

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Memory Types

• Why is memory important


• Range of applications
• Power consumption of memory selection (during active
and standby modes of operation)
• Form factor
• Cost

• Types of memory
• Registers, cache memory,
main memory
• Volatile, non-volatile
• Embedded MTP NVM,
Embedded OTP NVM
Ref: https://www.synopsys.com/designware-ip/technical-bulletin/memory-options.html
CSI** ZG528
https://www.synopsys.com/designware-ip/technical-bulletin/advantages-of-mtv.html
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Cache
• Store portions of instructions and data of the main memory
for faster access
• Cache hit or miss
• Ensures that the CPU has the next bit of data, should be
already loaded into it by the time the CPU goes looking for
it
• Multiple levels of cache – L1, L2..(L1 smaller than L2, L2
smaller than L3 and so on) to improve timing
• In the event of a miss: a block of data is fetched from main
memory and stored in cache

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Clocks
• Every programmable hardware requires a clock source
(oscillator)
• RC oscillators, Crystal oscillators, Ceramic resonators
• Cost, startup time, precision, stability
• Clocks govern the speed at which the processor
executes instructions, bus operations, the baud rate of
serial-communication signals
• Significance of clocking
• IoT devices need to be synchronized to a common notion of
time
• Lack of stability in clock - frequent resynchronization of network
leading to increased energy consumption
• Selection of clocking schemes have an impact on the overall
power consumption of the system

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Types of Processor
Architectures
• CISC
• Have a full set of instruction set intended to provide needed
capabilities in the most efficient way
• Supports diverse set of operations
• Goal - complete a task in as few lines of assembly as possible
• Intended to simplify compilers (for HLL)
• May result in slower performance due to the complexity of
instructions
• RISC
• Full set reduced to most frequently used instructions – more
work done in shorter time for most applications
• Can increase the overall speed of the processor due to the
simplicity of instructions
• Other classifications
• Scalar, super scalar etc.

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Thank you

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CSI** ZG528

Cyber-Physical Systems

CS4.0
BITS Pilani
Pilani | Dubai | Goa | Hyderabad

CSI** ZG528
Agenda
• Internet of Things – Introduction
• IoT Enabling Technologies
• IoT Levels

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Ecosystem
• Sensor nodes
• LANs
• Aggregators, routers, gateways
• WAN
• Cloud
• Data analytics
• Security

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Internet of Things
• IoT vs M2M
• M2M
• Autonomous devices communicating directly to another
autonomous device, without human intervention
• Need not have any inherent services or topologies
• May communicate over non-IP based channels also (serial port)
• IoT
• May incorporate some M2M modules
• Presence of an edge device (gateway)
• Has a method of tying into the internet fabric

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies

• IOT defined as “Dynamic global internetwork with self configuring


capabilities; of devices, mechanical and digital machines, objects,
animals, people that have unique identities, physical attributes,
virtual personalities – seamlessly integrated to transfer information
associated with users and environments over the network without
human interference.” Kranenburg 2008

• IoT systems collect data, add context to create information, create


knowledge from that info by organizing and structuring it and take
specific actions to achieve specific objectives

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(1) Sensors
• Measures parameters, collects data
• Sensors vs sensor nodes
• Sensing devices
• Temperature
• Thermocouples, Resistance Temperature Detectors, Thermistors,
• Photoelectric sensors, PIR sensors, LiDAR (Light Detecting and Ranging)
• MEMS (Micro-electromechanical systems) sensors
• Gyroscopes, accelerometers, microphones, pressure sensors
• Sensor fusion
• Combining several kinds of sensor data to reveal more about context than a
single sensor can provide
• Eg: A single thermal sensor would not know what is causing a temp change. But
when combined with PIR motion detection and light intensity, conclude that there
are many people, and take an action (such as increasing the air circulation) in a
building
• Some parameters to consider while choosing a sensor
• Range, Cost, Power consumption

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(1) Sensors
• Use standard IO interface and communication systems (low speed
interfaces such as I2C, SPI, UART; high speed interfaces such as
MIPI, USB, PCI-Express; wireless interfaces such as Zigbee,
802.11)
• Example
• TI Sensor Tag CC2650

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(2) Communication & Networking Protocols
• Exchange of data between end devices, central node (server)
and other entities in the end-to-end system

• Layer 2, Layer 3 and application layer protocols designed for


meeting the various needs of an IoT system
• Eg: ZigBee, 802.15.4, 802.11 variants, Wireless adhoc routing
protocols, NB-IoT

• Some questions to think about:


• Why wouldn’t TCP as is work well with IoT systems, such as those
in WSNs?
• Why cannot routing protocols like BGP or OSPF be deployed for
IoT systems, such as those in WSNs?
• Why do we need special Layer 2 protocols for IoT systems?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(2) Communication & Networking Protocols
• Communication models
• Client-server, peer-to-peer, publisher-subscriber
Client-Server

Publisher-Subscriber
Point-to-point

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(3) Wireless sensor networks
• A WSN consists of a number of end–nodes that collect and
route data towards a coordinator/base station
• The base station also acts as a gateway that connects to the
internet
• Examples
• Forest fire monitoring system
• Environmental monitoring system
• Surveillance systems
• Smart grids

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(4) Cloud computing
• Ability to provision and use: resources, development
environments and software applications, on a pay-per-use
model
• Ability for users to provision computing and storage resources
(IaaS)
• Ability to develop and deploy applications in the cloud using
development tools, APIs, software libraries and services
provided by the cloud service provider (PaaS)
• Platform independent and can be accessed from various client
devices such as workstations, laptop, tablet, smart phones etc.
running different OS (SaaS)
• Virtualization

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(5) Big data analytics
• Big data – large sets of
data which pose
challenges in storing,
managing and analyzing
• Data cleaning, pre-
processing, processing
and visualization
• Characteristics of big data
– volume, velocity and
variety

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(6) Semantic search engines
• Uses searcher’s intent, context of search, location, variation of
words etc to generat more relevant results
• Objective - addresses the heterogeneity and non-
interoperability in the IoT world
• Eg: Measuring system
• Has to have measurement data
• Also, the data stream of such a system needs to carry information
such as which sensor sent the data, where did it measure the data
and what kind of data is it
• Need interfaces and common ontologies to enrich data from
different data sources – this allows for linking different data sets
with each other
• To achieve this is the task of semantic technologies
• Web of Things (WoT), SWoT
• HW: Read http://www.dataversity.net/semantics-for-the-
connected-world-thingworx-goes-live/
• HW: Read https://www.ptc.com/en/products/iot
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(7) Web services
• HTTP + REST
• WebSockets
• Traditional web applications
• For each client, the server uses multiple TCP connections: one for sending information
to the client and a new one for each incoming message.
• High overhead because each client-to-server message has an HTTP header
• Client has to maintain a mapping between outgoing connections and incoming
connections to track replies
• Provides a single TCP connection for bidirectional traffic
• Handshake and data transfer
• https://tools.ietf.org/html/rfc6455
HTTP+REST WebSockets
Stateless Stateful
Unidirectional – Request always from the client to server and response from server to client Bidirectional – message exchange
Request-response Full duplex
TCP connection for every request-response pair Single TCP connection
Header overhead for every request-response; hence not suitable for RT communication Only initial handshake
Scaling easy as no state information maintained web services serve as a link between IoT Scaling cumbersome
devices, application, database, and analysis
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Levels of IoT Systems

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 1 System

• Single node/device that


performs sensing and/or
actuation, stores data,
performs analysis and hosts
the application
• What type of applications
would use Level 1 system?
• Example?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 2 System

• A single node performs


sensing /actuation and local
analysis
• Data is stored in cloud and
application is usually cloud-
based
• What type of applications
would use a Level 2
system?
• Example?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 3 System

• Has a single node


• Data is stored and analysed
in the cloud
• Applications are cloud
based
• What type of applications
use Level 3 system?
• Example?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 4 System

• Has multiple nodes that perform local analysis


• Data is stored in the cloud and applications are cloud based
• Contains local and cloud-based observer nodes which can
subscribe to and receive information collected in the cloud from IOT
devices
• Observer nodes can process information and use it for various
applications, however observer nodes do not perform any control
functions
• What type of applications use Level 4 System?
• Example? Source: Warsaw University of Technology

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 5 System

• Has multiple end nodes and one coordinator node


• End nodes perform sensing and/or actuation
• Coordinator node collects data from the end nodes and sends to
the cloud
• Data is stored and analysed in the cloud
• Application is cloud-based
• What type of applications use Level 5 systems?
• Example?
Source: Warsaw University of Technology

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 6 System

• Has multiple independent end nodes that perform sensing and/or


actuation and send data to the cloud
• Data is stored in the cloud, application is cloud based
• Analytics is cloud based – result stored in cloud, and visualized with
cloud – based applications
• There is a centralized cloud based controller that is aware of the
status of all the end notes and sends control commands to the
nodes
• What type of applications use Level 6 systems?
• Example?
Source: Warsaw University of Technology

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Thank you

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CSI** ZG528

Cyber-Physical Systems

CS3.0
BITS Pilani Rajesh Kumar
Pilani | Dubai | Goa | Hyderabad
2022

CSI** ZG528
Agenda
• Introduction
• Wireless sensor node architecture
• Advantages of WSNs
• Challenges in WSNs
• Key Characteristics of WSNs Used in CPS Designs
• Deployment
• Localization
• Coverage
• Data gathering
• Communication

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Wireless Sensor Networks
• What are wireless sensor networks
• Draws on contributions from signal processing, networking
& protocols, databases & information management,
distributed algorithms, embedded systems etc
• Key terms/concepts:
• Sensor
• Sensor node
• Network topology
• Routing
• Data centric
• In-network
• Collaborative processing
• ..and many more

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Wireless Sensor Networks (WSNs)

• A sensor network is a wireless network that consists of


thousands of very small nodes called sensors.

Base station

Figure 1: Architecture of wireless sensor networks


4
Wireless Sensor Networks (cont.)

• WSN Sensors are equipped with sensing, limited


computation, and wireless communication capabilities.

Figure 2: Typical hardware components of a sensor node in wireless sensor networks


5
Comparison with ad hoc
networks
– Wireless sensor networks mainly use broadcast
communication while ad hoc networks use
point-to-point communication.
– Unlike ad hoc networks wireless sensor
networks are limited by sensors limited power,
energy and computational capability.
– Sensor nodes may not have global ID because
of the large amount of overhead and large
number of sensors.
Introduction to Wireless Sensor
6
Networks
WSN Example (1/3) –
Environmental Monitoring

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
WSN Example (2/3) – Forest
Fire Monitoring

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
WSN Example (3/3) - Asset
Tracking

Ref: https://www.semtech.com/uploads/technology/LoRa/app-briefs/Semtech_SupChain_AssetTracking-Airport_AppBrief-FINAL.pdf
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Wireless Sensor Node
Architecture

Examples of popular sensor


node platforms
• MicaZ, Telos
• Others:
Rene,Mica,Mica2,Mica2Dot,
TelosB, iMote iMote2 MPR2400 MicaZ mote

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
What are motes?

Motes mainly consist of three parts:-


• Mote basically consists of a low cost and
power computer.
• The computer monitors one or more sensors.
Sensors may be for temperature, light, sound,
position, acceleration, vibration, stress, weight,
pressure, humidity, etc.
• The computer connects to the outside world
with a radio link.

Introduction to Wireless Sensor


11
Networks
Mica 2 Motes
• These motes sold by Crossbow were
originally developed at the University
of California Berkeley.
• The MICA2 motes are based on the
ATmega128L AVR microprocessor.
The motes run using TinyOS as the
operating system. MICA 2 MOTE

• Mica2 mote is one of the most Ref:http://www.xbow.com/Products/Product


popular and commercially available _pdf_files/Wireless_pdf/MICA2_Datasheet.
sensors which are marketed by pdf
CrossBow technologies.

Introduction to Wireless Sensor


12
Networks
Telosb Motes

• Telosb motes have USB programming capability


• An IEEE 802.15.4 compliant, high data rate radio
with integrated antenna, a low-power MCU
• There are also equipped with extended memory
and an optional sensor suite

Introduction to Wireless Sensor


13
Networks
TELOSB MOTE

Ref:http://www.eecs.berkeley.edu/~culler/eecs194/labs/lab1/telosb.JPG

Introduction to Wireless Sensor


14
Networks
One Example Sensor Board - MTS310

Introduction to Wireless Sensor


15
Networks
One More Example of Sensor
Board - MTS400/420
• Besides the functions of MTS 300, it mainly
adds GPS functionality

¢ Further Reading
l http://firebug.sourceforge.net/gps_tests.htm
Introduction to Wireless Sensor
16
Networks
Hardware Setup Overview

Introduction to Wireless Sensor


17
Networks
Discussion:
Advantages and Challenges in WSNs

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Design Challenges

• Heterogeneity
– The devices deployed maybe of various types and
need to collaborate with each other.
• Distributed Processing
– The algorithms need to be centralized as the
processing is carried out on different nodes.
• Low Bandwidth Communication
– The data should be transferred efficiently between
sensors

Introduction to Wireless Sensor


19
Networks
Continued..

• Large Scale Coordination


– The sensors need to coordinate with each other to
produce required results.
• Utilization of Sensors
– The sensors should be utilized in a ways that
produce the maximum performance and use less
energy.
• Real Time Computation
– The computation should be done quickly as new
data is always being generated.

Introduction to Wireless Sensor


20
Networks
Cooperation/Noncooperation

CSI** ZG528
Cooperation/Noncooperation

CSI** ZG528
Operational Challenges of
Wireless Sensor Networks
• Energy Efficiency (Topology management)
• Limited storage and computation
• Low bandwidth and high error rates
• Errors are common
– Wireless communication
– Noisy measurements
– Node failure are expected Scalability to a large number
of sensor nodes
• Survivability in harsh environments (Dumb nodes)
• Experiments are time- and space-intensive
• Security
• Unattended behavior (Selfto Wireless
Introduction organization)
Sensor
23
Networks
A topology framework

CSI** ZG528
• Data exchange in WSN is fundamentally different than in
other wireless networks
– WSNs are data-centric networks
• The interest is in “what is the data?” rather
than “where is the data?”
– E.g., WSNs focus on attributes (e.g., temperature, velocity)
• WSNs must efficiently respond to
application/user queries asking for data
• => WSNs require different routing protocols then MANETs
– Routing protocols for WSNs must be application-data-
specific
Wireless Sensor Networks

• Challenges in design of (application-data-specific) routing protocols


for WSNs
1) No unique node ID to be used for routing
• Which is typical in traditional wired/wireless networks
• Bec. (#1) routing to/from a specific node is not required in data-
centric WSNs
– Recall: It does not matter “where is the data?”
• Bec. (#2) with the large # of nodes in WSNs, ID would be large
– ID might be larger than amount of actual data being xmitted

2) Nodes often send aggregated data, not raw data


• Adjacent nodes may have similar data, so aggregation cuts
traffic
3) Routing protocols must be application-specific and data-
centric
• Bec. WSNs are application-specific and data-centric
– E.g., WSN may require protocol customized to very efficient
delivery of data on a single attribute (e.g., temperature)
» Could be very inefficient for delivery of data on other single
attribute, or delivery of multi-attribute data

4) Minimizing energy consumption


Key Characteristics of
WSNs Used in CPS Designs
Fixed sensor deployment approaches

Deployment Mobile sensor deployment approaches

Mobile robot deployment approaches

GPS approaches

Localization Range-based approaches

Fundamental sensor Range-free approaches


characteristics in CPS Barrier coverage schemes
designs Coverage
Sweep coverage schemes

Efficient relay routing


Data Gathering
Mobile data gathering

Contention-based protocols
Communication
Reservation-based protocols

Ref: Chih-Yu Lin, Sherali Zeadally, Tzung-Shi Chen,and Chih-Yung Chang, Enabling Cyber Physical Systems withWireless Sensor
Networking Technologies, doi:10.1155/2012/489794
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(1) Deployment
• Why is deployment important
(i) Ensure the monitoring quality of the ROI (ii) Ensure network connectivity
• Fixed
• Manual
• Random
• Eg: sensor nodes dropped by a drone/aircraft etc.
• Redundant node problem
• Solution: techniques to make redundant nodes enter sleep mode to save energy
• Sensor states – sensing, relaying, sleeping, dead
• Enough no: of sensors to maintain network connectivity
• Mobile
• Applications where the monitoring region might be too dangerous for people
to reach
• Eg: military, ecological monitoring, volcanic eruption monitoring
• Uses the mobility of sensor nodes to guarantee the monitoring quality and
network connectivity
• Each mobile sensor calculates their next target location based on the information
about the coverage holes; move towards the calculated target location to heal the
hole
• Clustering and peer-to-peer approaches [not specific to mobile deployments]
Ref: Chih-Yu Lin, Sherali Zeadally, Tzung-Shi Chen,and Chih-Yung Chang, Enabling Cyber Physical Systems withWireless Sensor
Networking Technologies, doi:10.1155/2012/489794 CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(1) Deployment

Clustering in WSNs

• Mobile robot deployments


• Suitable for CPS applications where the monitoring region is dangerous and
unreachable
• Robot explores the environment and deploys a fixed sensor at the target location
from time to time
• Easier to implement than the mobile sensor – well designed deployment algorithm
• Issues - eliminating the negative impact of obstacles such as walls/buildings

Ref: Chih-Yu Lin, Sherali Zeadally, Tzung-Shi Chen,and Chih-Yung Chang, Enabling Cyber Physical Systems withWireless Sensor
Networking Technologies, doi:10.1155/2012/489794 CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(2) Localization (1/4)
• Localization
• To determine the position of a node in a WSN
• Position with respect to some absolute or relative frame of reference
• Fundamental to how the WSN performs at executing its functions
• Localization techniques
1. GPS
2. Non-Collaborative
• Each sensor node is located based on measurements between the node
and reference nodes
3. Collaborative
• Measurements among sensor nodes are exploited
• Every sensor node can act as pseudo-reference node to other sensor
nodes
• This may provide opportunities to improve geometric conditioning and to
mitigate adverse multipath and NLOS effects Ref: Chih-Yu Lin, Sherali Zeadally, Tzung-Shi Chen,and Chih-Yung Chang, Enabling
Cyber Physical Systems withWireless Sensor

CSI** ZG528 Networking Technologies, doi:10.1155/2012/489794

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


(2) Localization (2/4)
4. Range based localization schemes (Co-operative Localization &
Tracking)
• AOA-based systems
• TOA-Based systems
• RSSI-based systems
• TDoA-based systems

5. Range-Free Localization Scheme


• Relies on fixed or mobile anchors deployed in a monitoring region

6. Device-Free Passive Localization and Tracking


• IR based systems, UWB based systems, Narrowband based systems

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(3) Localization (3/4)

• Challenges in localization
• Sources of uncertainties in location sensing
• Multipath, no-line-of-sight (NLOS)/blockage, interference,
noise, system/hardware incapability, ...
• Localization-denied environments
• Indoor/in-building, and other multipath environments.
• Also depends on application-specific accuracy
requirements
• Individual sensor nodes have limited sensing,
computing, and communication capacities

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(3) Coverage (1/2)
• Related to deployment pattern, sensing range of devices
• Non-fixed sensor deployment categories – Full, Barrier, Sweep
coverage
• Full coverage
• The whole area must be covered with the sensing range of sensors,
eg: military applications
• How to find out full coverage area (eg: Voronoi diagram)
• Barrier coverage
• Places the sensor node at the centre of a circle; when an object
passes through the area which was surrounded, it will be detected by
the sensor node
• Sweep coverage
• The area we want to monitor has a very important POI
• Sensor nodes may have the ability to move towards POI
• Multiple POIs may lead to TSP

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(3) Coverage (2/2)
Full coverages in WSN
Barrier coverages in WSN

Various types of barrier coverage in wireless sensor


networks (WSNs): (a) Weak barrier coverage. (b)
Strong barrier coverage. (c) Hybrid barrier coverage.
(d) Barrier coverage in directional sensor networks
(DSNs).

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(4) Data Gathering
• Systematic collection of sensed data from multiple
sensors to be eventually transmitted to the base station
for processing
• Energy considerations
• Efficient relay routing
• Sensed data from the environment is forwarded to the data sink
via multihop relays among sensors
• Clustering
• Mobile data gathering
• A mobile data collector can move around the sensing field and
collects data from the source nodes through short-range
communications
• Reduces energy consumption of routing all the sensed data to
the data sink

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
(5) Communication
• Design considerations for communication protocols
• Energy efficiency
• Latency
• Fairness
• Bandwidth utilization
• Contention-based MAC protocols
• Simpler to implement - only need local time synchronization
• Do not need to have the knowledge of network topology,
reducing the communication overheads
• Low performance under heavy traffic load because of collisions
• 802.11 – CSMA, CSMA/CA, Random backoff
• S-MAC, T-MAC, B-MAC, WiseMAC
• Reservation-based MAC protocols

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Thank you

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Backup: Vineyard Example

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Backup: Collaboration in
Sensing & Processing
• Collaboration of distributed nodes in sensing and
processing
• Sensing
• Provide large-scale sensing coverage
• Achieve superior sensing capabilities
• This is achieved by exploiting various diversity gains, multiple
sensing modalities, redundancy in high-density networks, and
many other advantageous system and environmental conditions
• Processing
• Share the processing load among nodes to minimize energy
consumption at each node
• Achieve substantially higher processing capacity in the aggregate
than any node can offer individually

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CSI** ZG528

Cyber-Physical Systems

Lecture 1-2

(slide credits: Anita, Rodolfo)


BITS Pilani Rajesh Kumar
Pilani | Dubai | Goa | Hyderabad

CSI** ZG528
Agenda

• Course introduction
• What is CPS
• Applications of CPS
• Features of CPS
• Demo (Uppaal SMC)
• CPS – different perspectives

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Evaluation Scheme
• Mid-sem exam [Closed book]: 30%
• Compre [Open book]: 45%
• Assignment [Project]: 20%
• Quiz: 5%

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Additional Information
• Teaching methodology
• Instructor supplied materials for reference
• Labs – Arduino/Raspberry Pi or UPPAAL SMC
• Assignment/Project
• Elearn portal: https://elearn.bits-pilani.ac.in
• Evaluation guidelines
• If a student is unable to appear for the regular exam due to
genuine exigencies, he/she should follow the procedure to
apply for the make-up exam which will be made available on
the elearn portal
• The make-up exams will be conducted only at selected exam
centres on the dates to be announced later

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Cyber-Physical Systems -
Introduction

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Embedded Systems
• Embedded system: computing systems designed for a
specific purpose.
• Embedded systems are everywhere!

6
Embedded systems are getting more complex
• Modern high-end cars have over
one hundred processors.
• Increasing number of sensors,
actuators, smart control, GUI..
• Intelligent data fusion.

Helmet Mounted Display System

F-35 Lightning II

Optical Track.
… are more Interconnected
• Command-and-control
network – real-time
integration of vehicles,
people, command.
• Geotagging: useful or
scary?

• Many other examples


– Power Grid
+ – Medical systems
– Transportation
– Etc.
8
Definition
What are Cyber Physical Systems?
• Cyber – computation,
communication, and control that are
discrete, logical, and switched
• Physical – natural and human-
made systems governed by the laws
of physics and operating in
continuous time
• Cyber-Physical Systems
– systems in which the cyber and
physical systems are tightly integrated
at all scales and levels Change from
cyber merely appliquéd on physical
• Change from physical with off-the-
shelf commodity “computing as parts”
mindset
• Change from ad hoc to grounded,
assured development

CSI** ZG528
What is CPS?

• Definition from NIST


• Cyber-Physical Systems or "smart" systems are co-engineered
interacting networks of physical and computational
components. These systems will provide the foundation of our
critical infrastructure, form the basis of emerging and future
smart services, and improve our quality of life in many areas.
• Components
• Communication & networks, physical devices, computational
capabilities, software systems
• Links the physical world with the virtual world of
information processing

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
EVOLUTION OF CPS
• Two types of computing systems
• Desktops, servers, PCs, and
notebooks
• Embedded

• The next frontier


• Mainframe computing (60’s-70’s)
• Large computers to execute
big data processing
applications
• Desktop computing & Internet
(80’s-90’s)
• One computer at every desk to
do business/personal activities
• Embedded computing (21st
Century)
https://www.slideserve.com/emily-
• “Invisible” part of the jenkins/ict-1-smart-cyber-physical-s-ystems-
in-h2020
environment
• Transformation of industry
CSI** ZG528
EVOLUTION OF CPS

• Relationship between the physical and cyber systems

CSI** ZG528
http://www.lexer.co.jp/en/product/iot https://medium.com/@charlesxie/building-a-cyber-physical-
system-to-simplify-iot-app-development-f3579b7916dc
Challenges of Working in a
Multidisciplinary Area
Small Computer

Connected
Network Industrial
System

Advance Robot
d
Manufact
uring
CSI** ZG528
CPS Difference from software
and embedded systems
• Where CPS Differs from General-Purpose Software Systems?
Software Systems Problem:
• Software systems are sets of interacting sequences of state
transformations with the end objective of transforming data

The CPS problem:


• CPS has the end objective of orchestrating physical processes.
Timeliness, safety, reliability, security, privacy, and adaptability all
take on a different character

http://addi-data.com/cps-cyber-physical-systems/
CPS Difference from software and
embedded systems
• Where CPS Differs from Embedded Systems

The embedded systems problem:


• Embedded software is software on
small computers. The technical
problem is one of optimization (coping
with limited resources)

The CPS problem:


• Computation and networking integrated
with physical processes. The technical
problem is managing time and
concurrency in networked
computational systems
CSI** ZG528
CPS Difference from software
and embedded systems
• Traditional Embedded Systems vs. Cyber physical System
Networked
Typicall Embedded
y Systems
Stand-
alone
Information Cyber
processing Traditional Integrations Intelligence-
Focus on of physical
systems Embedded constraine on-the-cloud
embedded into Information System not
enclosing
Systems d devices Processing constrained
products
(CPU, and Focus on
Focus on Real Memory) Physical Sensing
time Response Process based
and Reliability Analytics and
(Instruct-Act) Business
Intelligence

From Embedded ……… Towards CPS

CSI** ZG528
CPS – the next evolution
• Cyber-physical systems: integration of computation with
physical processes.
• Still build on top of embedded computing systems.
• Interaction with the physical environment is promoted to
a “first class citizen”.
• Promotes interaction and integration of subsystems
– Classic safety-critical embedded systems: black
boxes
– CPS: white-boxes, open protocols
• Main goals:
– Co-design the cyber and physical part of the system
– Engineer a “system of systems”
17
CPS vs. IoT: Motion Activated
Light
CPS
IoT Scope of Research
OUT
s INs Actuat
Sensors Communicat Aggregator Computation Decision
ion (Fusion) (e-utility) (Software) ors
IN Channel Model OU
s (Network) of Ts
Motion
Physical Interaction
Logical Interaction

Framework Schema: Phys-Log-Log-Log-Log-Phys


Testbed: Experiment, Measurement and Assurance
Challenges: Interoperability, Composition and Composition Types,
Trustworthiness, etc.
18
Examples -- CPS
• Ice cream vending machines
• Plants informing farmers that they need water
• Blinking caps for medicine bottles
• Fitness bands
• Tweeting plant, body sensors, driverless cars, personalized social
networking – all of these are extremely diverse applications, but are
categorized under a common technology:
• M2M technology
• Ubiqutous computing (UBICOMP)
• Embedded computing systems
• Pervasive computing systems
• Silent intelligence
• Industrial internet (if it is an industrial application)
• More commonly, all these applications together are called as IoT
• Focus in IOT - configuration, control, and networking via the internet, day to
day ‘things’ that are not usually associated with the internet
• Eg: Thermostats, utility meters, Bluetooth connected headset, irrigation pumps, sensors and
control circuits for a car’s power train or chassis

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
More Applications..

• Smart Homes
• Improving efficiency and safety in homes and offices, for
example by monitoring and controlling heat and humidity.
• Health monitoring
• Supporting elderly people living alone, for example by detecting
problems (such as illness or accidents) and raising the alarm
automatically, using non-intrusive wearable sensors or
detectors installed in the house.
• Precision agriculture
• Optimizing crop yield and reducing pesticide/fertilizer use, by
using CPSs to identify and deliver them only where they are
needed.
• Livestock monitoring
• Monitoring health and wellbeing of livestock and raising
automatic warnings of illnesses or injuries

Ref: http://www.cpse-labs.eu/cps.php CSI** ZG528


BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Applications of CPS
• Transportation
• Automotive systems; avionics and aerospace; elevators,
escalators, and moving sidewalks; railroads; traffic
management
• Monitoring and tracking shipments intelligently for optimal
logistics and stock control
• Manufacturing systems
• Robotic machinery, embedded vision, or any computer-
controlled actuation
• Infrastructure
• Disaster recovery, environmental monitoring, water distribution
optimization
• Military
Ref: http://www.cpse-labs.eu/cps.php CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Example: Digital factory

https://www.researchgate.net/figure/Application-Scenarios-of-cyber-
https://www.sciencedirect.com/science/article/pii/
physical-systems-describing-the-information-flow-and_fig2_329466954
S209580991830612X

CSI** ZG528
Other related terms

• Internet of Things (IoT)


• Industrial Internet
• "Smart" x (e.g., Cars, Buildings, Homes, Manufacturing,
Hospitals, Appliances, Smart Cities, Smart Grid)

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CPS – Different
Perspectives
• Conceptual perspective
• Entities acting as providers and/or consumers of data related to the
physical world. The focus is on data and information rather than
point–to–point communications (so network architectures need to be
content-centric)
• System perspective
• Dynamic distributed network system, with thousands of devices
(sensors, actuators); scalability
• Service perspective
• Integrate the functionalities and/or resources provided by smart
objects into services
• Architectures and methods for virtualization of objects by creating
standardized representation of smart objects in the digital domain and
methods to seamlessly integrate the resources/services of smart
objects into value added services for end users
• User perspective
• CPS will enable a large amount of new always responsive services
that shall answer to user’s needs and support them in everyday
activities
Ref: “Internet of things: Vision, applications and research challenges”, D Miorandi, S Sicari, F D Pellegrini, I Chlamtac
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CPS – Key Features

• Device heterogeneity
• Scalability
• Energy optimized solutions
• Self-organizing capabilities
• Localization and tracking capabilities
• Semantic interoperability and Data Management
• Security

References:
Daniele Miorandi, Sabrina Sicari, Francesco De Pellegrini, Imrich Chlamtac; Internet of things: Vision,
applications and research challenges
Pallavi Sethi, Smruti R. Sarangi; Internet of Things: Architectures, Protocols, and Applications (doi:
10.1155/2017/9324035)
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CPS Requirements
1. Safety
– All such systems interact with the environment.
– System failure can have catastrophic consequences.
– System correctness depends on both logical results
and the time at which results are produced (real-time).
2. Performance
– Safety is number#1 requirement, but we still need to
achieve sufficient performance.
– Many systems are resource constrained (in either
weight, power, cost, etc.)
3. Interoperability
– Individual subsystems connected by open protocols.
– Security can be an issue.
26
CPS as multidisciplinary approach
• Within ECE, CPS design requires competences in…
– Computer Architecture
– CAD & Embedded Design
– Software Engineering
– Control
– Formal Verification
– Real-Time Analysis
• … plus whatever engineering field(s) are related to the
design of the plant/actuator.
• Problem: all such field and subfields have very different
design & development conventions.
• Perhaps we need a new science of CPS design?

27
CPS Challenges – Design Abstractions
• We could argue that the biggest design challenge is in abstractions –
the entire ECE design is a stack-based process.

• Unfortunately, most such


abstractions do not directly
encapsulate characteristics
of the environment such as:
– Concurrency
– Criticality
– Timing
• It is very hard to predict if
the cyber part will meet the
requirements of the (from Prof. Edward Lee)
physical part! 28
Current Design Flow
• The picture below exemplifies a typical design flow for an avionic
subsystem.
• Analysis is required to verify that requirements are met.
• Analysis can only be performed after implementation.
• Recipe for disaster!

29
Reliable CPS: not so much!
• In 2007, 12 F-22s were
going from Hawaii to
Japan.

• After crossing the IDL, all


12 experienced multiple
crashes.
– No navigation
– No fuel subsystems
– Limited communications
– Rebooting didn’t help

• F-22 has 1.7 million lines of


code.

F-22 Raptor
Reliable CPS: not so much!

• Mercedes Class A failed


the moose test in 1997.

• Sensors on roof detect


Mercedes Class A W168 overturn and automatically
open door.

• What happens if a thief


jumps on the car roof?
CPS Challenges - Safety
• Safety is hard to guarantee in interconnected and interdependent
systems.
1. Do not trust communication channels.
– Ex: medical plug-and-play initiative is looking to interconnect
medical devices using wireless technology.
– Problem: what happens if somebody jams the signal?
– Each subsystem must be independently safe.
2. Do not trust the users.
– Users are an (unfortunate) part of the systems.
– Users are very error prone: over 90% of avionic accidents are
caused by flight crew/controllers.
– System must be protected against user mistakes

32
CPS Challenges - Safety
3. Do not trust lower-criticality subsystems.
– Medical pacemaker composed of multiple subsystems.
– Life-critical functionalities: base pacing, wiring, battery
– Non-critical functionalities: adaptive pacing, logging, programming,
RF communication.
– Protect life-critical subsystem.
Pacemaker

33
Verification & Certification
• How do we ensure safety?
1. Formal Verification
– Build a model of the systems.
– Prove (mathematically) that the system satisfies some safety
property.
– Problem#1: can we model the whole system?
– Problem#2: model is not implementation.
2. Certification
– Usually a process-based mechanism: show that you have
performed all process step according to some standard (ex:
DO178a/b/c, IEC 61508).
– Typically includes extensive testing.
– Very expensive.

34
CPS Challenges - Integration
• Putting the system together is much more challenging that
implementing the individual subsystems.
• Quiz (avionic systems): can you guess what % of $ goes in
implementation vs debugging?
• Individual productivity for
safety-critical code is Implementation
reported as 6 lines/day!
– F22: 1.7 million lines / 6 = 20%
776 man-years
– Perhaps the US$66.7billion 80%
program cost is not a
surprise… Debugging &
Verification
• Clearly the design process
must be improved… Avionic Development Cost

35
CPS Challenges - Timing Predictability
• The biggest architectural challenge.
• The lowest abstraction layer (transistors) is
pretty deterministic – we know how to compute
exact timings.
• However, higher levels lose all concept of timing.
– Deep pipelining, caches, out-of-order and
speculative execution…
– Thread models, locking, interrupts…

• This is fine for general purpose computing, but


not for CPS – the physical system uses real
time!
(by Prof. Edward Lee)

36
CPS Challenges - Timing Predictability
• We need to ensure that computation always
finishes within guarantee time windows -> We
are interested in worst-case performance, not
average performance!

• Timing predictability
– The time that the system requires to perform
an operation should exhibit little variation
– Such time should be easy to compute
– It should not be affected by other parallel
operations in the system.

(by Prof. Edward Lee)

37
Real-Time and Composability
• System correctness depends on:
– Logical correctness: system produces correct results.
– Temporal correctness: system produces results at the right time.
• Timing (real-time) analysis = verify temporal correctness.
• Ideally, we want composable analysis
– Verify each subsystem in isolation
– Then verify that their interaction is correct
• Unfortunately, this is very hard in practice…
• Main issue: hardware and software resources shared among multiple
subsystems.

38
Ex: Memory and Composability Issues
• Consider a dual-core system where last-level cache is shared among the
cores.
• We run two virtual machines, each on one core. VM#A is safety critical,
VM#B is not.
• If VM#B suffers a cache miss, it can replace a cache line of VM#A in last-
level cache
– Result: VM#B delays VM#A.
– Criticality-inversion: the safety of VM#A depends on VM#B
• Plenty of other examples in modern architecture!
– Main memory
– I/O data transfers
– Interrupts
– Etc.

39
CPS Challenges - Security

• Interconnected systems are also open to attacks.


• Security can become a significant concern!
– Integrity & availability are often more important than
confidentiality, but not always.
• Recent examples:
– Stuxnet
– Predator UAV hacking

40
What the course is about
• Focus#1: provide an understanding of the challenges in CPS design
– CPS as an interdisciplinary field
– Specialize in one aspect, but understand the big picture
• Focus#2: provide an understanding of the state-of-the-art solutions
in architectures for CPS systems.
• In particular we will focus on:
– Predictable computer architectures (largest portion of the course)
– Related Operating System support
– Timing analysis techniques

41
What the course is about
• If you are doing research in any of the (general fields) of:
– Computer architecture
– Operating systems
the course will provide you with an appreciation of the
specific techniques required for safety-critical
embedded systems.
• If you are doing research in control systems, the course will
provide you with an appreciation of “what sits behind” and
why the various parts of the system should be co-designed.
• If you are specifically interested in safety-critical embedded
systems, the course will provide an overview of the state-
of-the-art in the field of embedded architectures and what is
to come next.
42
What we are not going to cover
• We will not cover in details:

• Control theory: while modeling the physical part of the system is


integral to CPS design, this is not a course on control.

• Embedded software design: We are interested in sw/hw


interactions.

• Networking: CPS are usually networked systems, but we will


focus on node-level architecture.

43
Demo & Discussion – Train gate
system

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Thank you

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CSI** ZG528

Cyber-Physical Systems

CS4.0
BITS Pilani
Pilani | Dubai | Goa | Hyderabad

CSI** ZG528
Agenda
• Internet of Things – Introduction
• IoT Enabling Technologies
• IoT Levels

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Ecosystem
• Sensor nodes
• LANs
• Aggregators, routers, gateways
• WAN
• Cloud
• Data analytics
• Security

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Internet of Things
• IoT vs M2M
• M2M
• Autonomous devices communicating directly to another
autonomous device, without human intervention
• Need not have any inherent services or topologies
• May communicate over non-IP based channels also (serial port)
• IoT
• May incorporate some M2M modules
• Presence of an edge device (gateway)
• Has a method of tying into the internet fabric

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies

• IOT defined as “Dynamic global internetwork with self configuring


capabilities; of devices, mechanical and digital machines, objects,
animals, people that have unique identities, physical attributes,
virtual personalities – seamlessly integrated to transfer information
associated with users and environments over the network without
human interference.” Kranenburg 2008

• IoT systems collect data, add context to create information, create


knowledge from that info by organizing and structuring it and take
specific actions to achieve specific objectives

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(1) Sensors
• Measures parameters, collects data
• Sensors vs sensor nodes
• Sensing devices
• Temperature
• Thermocouples, Resistance Temperature Detectors, Thermistors,
• Photoelectric sensors, PIR sensors, LiDAR (Light Detecting and Ranging)
• MEMS (Micro-electromechanical systems) sensors
• Gyroscopes, accelerometers, microphones, pressure sensors
• Sensor fusion
• Combining several kinds of sensor data to reveal more about context than a
single sensor can provide
• Eg: A single thermal sensor would not know what is causing a temp change. But
when combined with PIR motion detection and light intensity, conclude that there
are many people, and take an action (such as increasing the air circulation) in a
building
• Some parameters to consider while choosing a sensor
• Range, Cost, Power consumption
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(1) Sensors
• Use standard IO interface and communication systems (low speed
interfaces such as I2C, SPI, UART; high speed interfaces such as
MIPI, USB, PCI-Express; wireless interfaces such as Zigbee,
802.11)
• Example
• TI Sensor Tag CC2650

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(2) Communication & Networking Protocols
• Exchange of data between end devices, central node (server)
and other entities in the end-to-end system

• Layer 2, Layer 3 and application layer protocols designed for


meeting the various needs of an IoT system
• Eg: ZigBee, 802.15.4, 802.11 variants, Wireless adhoc routing
protocols, NB-IoT

• Some questions to think about:


• Why wouldn’t TCP as is work well with IoT systems, such as those
in WSNs?
• Why cannot routing protocols like BGP or OSPF be deployed for
IoT systems, such as those in WSNs?
• Why do we need special Layer 2 protocols for IoT systems?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(2) Communication & Networking Protocols
• Communication models
• Client-server, peer-to-peer, publisher-subscriber
Client-Server

Publisher-Subscriber
Point-to-point

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(3) Wireless sensor networks
• A WSN consists of a number of end–nodes that collect and
route data towards a coordinator/base station
• The base station also acts as a gateway that connects to the
internet
• Examples
• Forest fire monitoring system
• Environmental monitoring system
• Surveillance systems
• Smart grids

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(4) Cloud computing
• Ability to provision and use: resources, development
environments and software applications, on a pay-per-use
model
• Ability for users to provision computing and storage resources
(IaaS)
• Ability to develop and deploy applications in the cloud using
development tools, APIs, software libraries and services
provided by the cloud service provider (PaaS)
• Platform independent and can be accessed from various client
devices such as workstations, laptop, tablet, smart phones etc.
running different OS (SaaS)
• Virtualization

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(5) Big data analytics
• Big data – large sets of
data which pose
challenges in storing,
managing and analyzing
• Data cleaning, pre-
processing, processing
and visualization
• Characteristics of big data
– volume, velocity and
variety

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(6) Semantic search engines
• Uses searcher’s intent, context of search, location, variation of
words etc to generat more relevant results
• Objective - addresses the heterogeneity and non-
interoperability in the IoT world
• Eg: Measuring system
• Has to have measurement data
• Also, the data stream of such a system needs to carry information
such as which sensor sent the data, where did it measure the data
and what kind of data is it
• Need interfaces and common ontologies to enrich data from
different data sources – this allows for linking different data sets
with each other
• To achieve this is the task of semantic technologies
• Web of Things (WoT), SWoT
• HW: Read http://www.dataversity.net/semantics-for-the-
connected-world-thingworx-goes-live/
• HW: Read https://www.ptc.com/en/products/iot
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Enabling Technologies
(7) Web services
• HTTP + REST
• WebSockets
• Traditional web applications
• For each client, the server uses multiple TCP connections: one for sending information
to the client and a new one for each incoming message.
• High overhead because each client-to-server message has an HTTP header
• Client has to maintain a mapping between outgoing connections and incoming
connections to track replies
• Provides a single TCP connection for bidirectional traffic
• Handshake and data transfer
• https://tools.ietf.org/html/rfc6455
HTTP+REST WebSockets
Stateless Stateful
Unidirectional – Request always from the client to server and response from server to client Bidirectional – message exchange
Request-response Full duplex
TCP connection for every request-response pair Single TCP connection
Header overhead for every request-response; hence not suitable for RT communication Only initial handshake
Scaling easy as no state information maintained web services serve as a link between IoT Scaling cumbersome
devices, application, database, and analysis
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Levels of IoT Systems

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 1 System

• Single node/device that


performs sensing and/or
actuation, stores data,
performs analysis and hosts
the application
• What type of applications
would use Level 1 system?
• Example?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 2 System

• A single node performs


sensing /actuation and local
analysis
• Data is stored in cloud and
application is usually cloud-
based
• What type of applications
would use a Level 2
system?
• Example?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 3 System

• Has a single node


• Data is stored and analysed
in the cloud
• Applications are cloud
based
• What type of applications
use Level 3 system?
• Example?

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 4 System

• Has multiple nodes that perform local analysis


• Data is stored in the cloud and applications are cloud based
• Contains local and cloud-based observer nodes which can
subscribe to and receive information collected in the cloud from IOT
devices
• Observer nodes can process information and use it for various
applications, however observer nodes do not perform any control
functions
• What type of applications use Level 4 System?
• Example? Source: Warsaw University of Technology

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 5 System

• Has multiple end nodes and one coordinator node


• End nodes perform sensing and/or actuation
• Coordinator node collects data from the end nodes and sends to
the cloud
• Data is stored and analysed in the cloud
• Application is cloud-based
• What type of applications use Level 5 systems?
• Example?
Source: Warsaw University of Technology

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 6 System

• Has multiple independent end nodes that perform sensing and/or


actuation and send data to the cloud
• Data is stored in the cloud, application is cloud based
• Analytics is cloud based – result stored in cloud, and visualized with
cloud – based applications
• There is a centralized cloud based controller that is aware of the
status of all the end notes and sends control commands to the
nodes
• What type of applications use Level 6 systems?
• Example?
Source: Warsaw University of Technology

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Thank you

CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956

You might also like