CPS Merged Merged Final
CPS Merged Merged Final
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
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.
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
CSI** ZG528
Types of Real-Time Scheduling
11
Periodic task model
n A task = (C, T)
o C: worst case execution time/computing time (C<=T!)
o T: period (D=T)
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
CSI** ZG528
CPU utilization
16
Scheduling Algorithms
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
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 (-)
21
Rate Monotonic Scheduling:
task model
• Assume a set of periodic tasks: (Ci,Ti)
n Di=Ti
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
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
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 (+)
28
EDF vs RM
• In practice, industrial systems heavily favor RM over
EDF. Why?
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
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
• 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
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
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
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 2 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 3 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 4 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 5 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 6 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
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)
Base station
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
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
What are motes?
Ref:http://www.eecs.berkeley.edu/~culler/eecs194/labs/lab1/telosb.JPG
¢ Further Reading
l http://firebug.sourceforge.net/gps_tests.htm
Introduction to Wireless Sensor
16
Networks
Hardware Setup Overview
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
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
GPS approaches
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
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
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
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
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.
F-35 Lightning II
Optical Track.
… are more Interconnected
• Command-and-control
network – real-time
integration of vehicles,
people, command.
• Geotagging: useful or
scary?
CSI** ZG528
What is CPS?
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
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
http://addi-data.com/cps-cyber-physical-systems/
CPS Difference from software and
embedded systems
• Where CPS Differs from Embedded Systems
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
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
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
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.
29
Reliable CPS: not so much!
• In 2007, 12 F-22s were
going from Hawaii to
Japan.
F-22 Raptor
Reliable CPS: not so much!
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…
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.
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
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:
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
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
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
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 2 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 3 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 4 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 5 System
CSI** ZG528
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
IoT Level 6 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