Transcript Slide 1

Realtime Systems
Dr.Hugh Melvin
Room 406 Ext 3716
[email protected]
See Web resources
Dr. Hugh Melvin, Dept. of IT, NUI,G
1
Main Textbooks
• Real-Time Systems , Krisha & Shin,
McGraw Hill
• Real-Time Systems Design & Analysis.
Laplante, Wiley
• Programming for the Real World POSIX.4,
Gallmeister, O Reilly
• Real-Time Systems & Programming
Languages, Burns & Wellings, Pearson
Dr. Hugh Melvin, Dept. of IT, NUI,G
4
Course Outline
•
•
•
•
•
•
•
•
Classification of RTS
Time Synchronisation for RTS
Scheduling for RTS
RT Programming Languages
POSIX.4 RT Extensions
RTOS
Fault Tolerance for RTS
Soft RTS
– Multimedia & Networks
Dr. Hugh Melvin, Dept. of IT, NUI,G
5
RTS
• Definition of RTS?
– Difficult due to the extent and scope of RTS
– System where a substantial fraction of the
design effort goes into making sure that
deadlines are met (Krishna/Shin)
• Classification of RTS?
– Hard – Firm – Soft
• Differ by the consequences of missed deadlines
Dr. Hugh Melvin, Dept. of IT, NUI,G
6
Dr. Hugh Melvin, Dept. of IT, NUI,G
7
Hard RTS
Boiler
Turbine
R30
Operators Keyboard 1
VDU 2
Binary Field Inputs
Binary Outputs
Analogue Inputs
Analogue Outputs
Binary Field Inputs
Binary Outputs
Analogue Inputs
Analogue Outputs
Binary Field Inputs
Binary Outputs
Analogue Inputs
Analogue Outputs
VDU 1
BMS
Operators Keyboard 2
VDU S\E’s
Office
S\E’s Keyboard 1
VDU
Prog. Room
AS101
AS112
AS013
AS017
AS131
AS133
I/O
I/O
I/O
I/O
I/O
I/O
Programmers Keyboard
HW Analog Inputs
Annunciator
I/O
HW Binary Inputs
Printer 1
Tape Drive
Storage Unit
CPU
CPU
CPU
CPU
CPU
Printer 2
CPU
CPU
Printer Prog. Room
MEC-RT
Data Storage Unit
Bus Coupler
Bus 1
Bus 0
CS 275 Bus
VDU 1
VDU 1
VDU 1
VDU 2
Alarms Printer
Local Printer
VDU 2
VDU 2
VDU 3
VDU 3
CPU
Annunciator
PG750
AS231
Maintenance
Computer
Unit Alarms System
Operator’s
Keyboard
Operator’s
Keyboard
Fault Log Printer
Operator’s
Keyboard
CPU
I/O
I/O
I/O
Turbine
Boiler
Local Terminals
5 1/4”FDD
Storage Unit
CPU
Control Room
12:45:01
23:01:97
Control Room
Master Clock
LPA0
MEC-RT
S\E’s VDU &
Keyboard
Data Storage Unit
LPA1
OS254
MEC-RT
Data Storage Unit
Programming Room Printer
Operations
Computer
ME System
Dr. Hugh Teleperm
Melvin, Dept.
of IT, Overview
NUI,G
Programmers VDU & Keyboard
VAX
Maintenance Management
System
8
Unit 2
Unit 1
CS275
Bus 1
Bus A
Bus B
CS275
Bus 1
CS275
Bus 0
Bus A
Bus B
Bus
Coupler
U/I
U/I
Unit 3
CS275
Bus 0
Bus A
Bus B
Bus
Coupler
U/I
U/I
Synogate Interface
to CS275
Synogate Interface
to CS275
Remote Operator
Station
CS275
Bus 1
CS275
Bus 0
Bus
Coupler
U/I
U/I
Synogate Interface
to CS275
OIS Server
IBM NetFinity 5510
MP001
Gateway
R30 Room
Gateway
Communications Room
Station LAN
MP002
Control Room Unit 1
Operator Station
Control Room Unit 2
Operator Station
Dr. Hugh Melvin, Dept. of IT, NUI,G
Control Room Unit 3
Operator Station
9
Burner Management System
Bus A
Bus B
CS275
CPU 1
..
..
U/I
U/I
N8
N8
CPU 2
..
CPU 3
..
..
..
2 out of 3
Non-Redundant
Control Circuits
Double Redundant
Safety Circuits
Dr. Hugh Melvin, Dept. of IT, NUI,G
Triple Redundant Safety Circuits
10
Other Hard RTS
•
•
•
•
Fly-by-wire control systems
Robotics
Medical Devices
ABS / Airbag Protection
Dr. Hugh Melvin, Dept. of IT, NUI,G
11
Soft RTS: Multimedia
Dr. Hugh Melvin, Dept. of IT, NUI,G
12
Firm RTS
• Somewhere in the middle ?
– Eg. Private IP Network governed by SLA
(Service Level Agreement)
• SLA specifies jitter/delay/loss/availability
– 99.999% Availability
• Lack of adherence results in :
– Poor customer satisfaction
– Penalties imposed on provider
– Consumer Devices
• Mobile Phone Technology / Cameras etc…
Dr. Hugh Melvin, Dept. of IT, NUI,G
13
Time Synchronisation for RTS
• Particularly critical for RTS
– Synchronising 2v3 systems
– Precise data logging for distributed control system
• Clock Terminology
– Accuracy , Reliability, Skew, Drift
• Synchronisation Algorithms
– Network Time Protocol (NTP)
• Limitations of conventional OS Timing
• Timer granularity & Time Services
Dr. Hugh Melvin, Dept. of IT, NUI,G
14
Dr. Hugh Melvin, Dept. of IT, NUI,G
15
RT Programming Languages
– Consider the following Fortran Loop statement
DO 100 I=1,5
<block of text>
100 Continue
– but the following is also valid
DO 100 I=1.5
<block of text>
100 Continue
– Fortran interpreted DO 100 I as a previously
undeclared variable assigned value 1.5  NASA
mishap #1
– Ada is most recognised RT Prog. Lang.
• Boeing 777 control written in Ada
Dr. Hugh Melvin, Dept. of IT, NUI,G
16
Boeing 777
Dr. Hugh Melvin, Dept. of IT, NUI,G
17
RTOS
Realtime Operating Systems
– Windows / Unix / Linux
•
•
•
Designed for time sharing of resources rather than meeting
hard deadlines
Designed for good average performance
 not used in Hard RTS typically
– ..but have improved Soft RT functionality
– Hard RTS
•
Good Average performance is of little use
– At 35000 ft when cabin pressure is lost
–
–
When a Power station at full output is suddenly disconnected from the
National Grid
RTOS : VxWorks, QNX, Lynx, RTLinux
Dr. Hugh Melvin, Dept. of IT, NUI,G
18
Fault Tolerant Techniques
Key Characteristic of Hard RTS
1. Full/Partial Fault Tolerance
–
Achieved mainly through redundancy
2. Graceful degradation
–
Eg.1: Citreon CX
•
•
–
Common hydraulic system for Steering, Brakes and Suspension
Order of failure??
Eg. 2: Power Plant
•
Faulty sensor  Alarm Overload  AS station switch to manual
but holds its state and will still respond to safety events/manual
control
3. Failsafe operation
•
Eg. Power Plant: Steam inlet valves spring loaded to shut on
loss of power
Dr. Hugh Melvin, Dept. of IT, NUI,G
19
Citreon CX
Dr. Hugh Melvin, Dept. of IT, NUI,G
20
Fault Tolerant Techniques
• Redundancy
– Hardware Redundancy
• Voting schemes
– Software Redundancy
• Eg. Code developed by different teams
– Time Redundancy
• Build in time slack or roll back
– Information Redundancy
• Error Detection + Correction
• Note: TCP-IP based Error Detection via CRC relies on Time
Redundancy for TCP traffic. Not acceptable for UDP based
MM traffic
Dr. Hugh Melvin, Dept. of IT, NUI,G
21
Fault Tolerant Techniques: Airbus
• 3 Main Flight
Controllers
• 2 Backup Flight
Controllers
• Software developed
by different teams
and on different
platforms
• Seamless transfer
• ..See video !
Dr. Hugh Melvin, Dept. of IT, NUI,G
22
Fault Tolerant Techniques
CPU 1
DB-Out
DB-In
DB-In
2-out-of-3
CPU 3
DB-Out
DB-Out
DB-In
2-out-of-3
2-out-of-3
ZV3
ZV2
2-out-of-3
ZV1
2-out-of-3
ZV2
2-out-of-3
ZV3
RAM
EPROM
1
RAM
EPROM
2
RAM
EPROM
3
2-out-of-3
Central Unit
ZV1
I/O Level
CPU 2
EAVn
Extension Units
Inputs
Dr. Hugh Melvin, Dept. of IT, NUI,G
Outputs
23
Soft RTS: MM and Networks
Real Time Communications
– Best Effort Internet default service
– Recent QoS Initiatives to differentiate
between traffic streams
• Eg. Voice over IP
– Requires M2E delay of < 150 msec
– Can tolerate higher delays if echo cancellation used
– Can cope with small degree of packet loss
» More Relaxed definition of RTS
• See ITU G.1010
Dr. Hugh Melvin, Dept. of IT, NUI,G
24
Mouth-to-Ear Delays
Dr. Hugh Melvin, Dept. of IT, NUI,G
25
Real Time Communications
• LAN based developments
– Switched Networks (Embedded RTOS)
• Also Fast/Gigabit Ethernet : Overprovisioning?
– New difficulties for wireless environment
• Access Protocols CSMA
• WAN based developments
– IntServ
– DiffServ
– MPLS : Layer 2.5
• Also development of RTP/RTCP/RTSP Protocols
for MM traffic
Dr. Hugh Melvin, Dept. of IT, NUI,G
26
Real Time Communications
• Endpoint Issues
– Increased complexity in terminals
– OS / Driver / Application Software / Hardware
issues
• Hardware: Skew Issues = lack of synchronisation
• Other options
– Token Based Networks
• Moneypoint Token Bus IEEE 802.4
Dr. Hugh Melvin, Dept. of IT, NUI,G
27
CS 275 Bus: IEEE 802.4
U/IA
U/IB
U/IB
U/IB
125
N16
R30
U/IA
U/IA
U/IB
103
N8
AS220E
102
N8
AS220E
101
N8
AS220E
U/IA
U/IA
U/IB
123
N-UHR
M-Clock
U/IA
141
NAT-24
Synogate
U/IA
127
N-BK
Bus 1
126
N-BK
Bus 0
U/IB
U/IA
U/IB
U/IA
U/IB
104
N8
AS220E
105
N8
AS220E
U/IB
U/IA
121
N16
OS254
U/IA
U/IB
160
NS5NAT
PG750
U/IB
106
N8
AS220E
U/IB
112
N8
AS220E
U/IA
U/IA
U/IB
133
N8
AS EHF
Dr. Hugh Melvin, Dept. of IT, NUI,G
U/IA
U/IB
107
N8
AS220E
U/IB
111
N8
AS220E
U/IA
U/IA
U/IB
132
N8
AS EHF
U/IA
U/IB
108
N8
AS220E
U/IB
110
N8
AS220E
U/IA
U/IA
U/IB
131
N8
AS EHF
U/IA
U/IB
109
N8
AS220E
U/IA
U/IB
128
N8
AS231
28
Dr. Hugh Melvin, Dept. of IT, NUI,G
29
Clock Skew : Buffer Issues
Dr. Hugh Melvin, Dept. of IT, NUI,G
30
Audio-System Clock Skew
Dr. Hugh Melvin, Dept. of IT, NUI,G
31