Realtime Systems Dr Hugh Melvin Room 406 Ext

  • Slides: 29
Download presentation
Realtime Systems Dr. Hugh Melvin Room 406 Ext 3716 hugh. melvin@nuigalway. ie See Web

Realtime Systems Dr. Hugh Melvin Room 406 Ext 3716 hugh. melvin@nuigalway. ie See Web resources Dr. Hugh Melvin, Dept. of IT, NUI, G 1

Main Textbooks • Real-Time Systems , Krisha & Shin, Mc. Graw Hill • Real-Time

Main Textbooks • Real-Time Systems , Krisha & Shin, Mc. Graw 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

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 • 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

Dr. Hugh Melvin, Dept. of IT, NUI, G 7

Hard RTS Boiler Turbine R 30 Operators Keyboard 1 VDU 2 Binary Field Inputs

Hard RTS Boiler Turbine R 30 Operators Keyboard 1 VDU 2 Binary Field Inputs Binary Outputs Analogue Inputs Analogue Outputs VDU 1 BMS Operators Keyboard 2 VDU SE’s Office SE’s Keyboard 1 VDU Prog. Room AS 101 AS 112 AS 013 AS 017 AS 131 AS 133 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 Printer 2 CPU Printer Prog. Room MEC-RT Data Storage Unit Bus Coupler Bus 1 Bus 0 CS 275 Bus VDU 1 CPU VDU 2 Local Printer I/O Operator’s Keyboard Alarms Printer PG 750 AS 231 Unit Alarms System VDU 2 VDU 3 CPU I/O MEC-RT Data Storage Unit Programming Room Printer I/O Turbine Boiler LPA 0 MEC-RT SE’s VDU & Keyboard CPU Operator’s Keyboard Fault Log Printer Annunciator Maintenance Computer VDU 1 Data Storage Unit OS 254 Operations Computer ME System Dr. Hugh Teleperm Melvin, Dept. of IT, Overview NUI, G Local Terminals 5 1/4”FDD Storage Unit VDU 1 Control Room 12: 45: 01 23: 01: 97 Control Room Master Clock Programmers VDU & Keyboard LPA 1 VAX Maintenance Management System 8

Unit 2 Unit 1 CS 275 Bus 1 Bus A Bus B CS 275

Unit 2 Unit 1 CS 275 Bus 1 Bus A Bus B CS 275 Bus 1 CS 275 Bus 0 U/I CS 275 Bus 0 Bus A Bus B Bus Coupler Synogate Interface to CS 275 Unit 3 Bus A Bus B Bus Coupler U/I Synogate Interface to CS 275 Remote Operator Station CS 275 Bus 1 CS 275 Bus 0 Bus Coupler U/I Synogate Interface to CS 275 OIS Server IBM Net. Finity 5510 MP 001 Gateway R 30 Room Gateway Communications Room Station LAN MP 002 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 CS 275 CPU 1 . . U/I

Burner Management System Bus A Bus B CS 275 CPU 1 . . U/I N 8 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

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

Soft RTS: Multimedia Dr. Hugh Melvin, Dept. of IT, NUI, G 12

Firm RTS • Somewhere in the middle ? – Eg. Private IP Network governed

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 2 v 3

Time Synchronisation for RTS • Particularly critical for RTS – Synchronising 2 v 3 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

Dr. Hugh Melvin, Dept. of IT, NUI, G 15

RT Programming Languages – Consider the following Fortran Loop statement DO 100 I=1, 5

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

Boeing 777 Dr. Hugh Melvin, Dept. of IT, NUI, G 17

RTOS Realtime Operating Systems – Windows / Unix / Linux • • • Designed

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 : Vx. Works, 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

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

Citreon CX Dr. Hugh Melvin, Dept. of IT, NUI, G 20

Fault Tolerant Techniques • Redundancy – Hardware Redundancy • Voting schemes – Software Redundancy

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

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 2 -out-of-3 ZV 1 Central Unit CPU

Fault Tolerant Techniques CPU 1 DB-Out DB-In 2 -out-of-3 ZV 1 Central Unit CPU 2 DB-Out 2 -out-of-3 ZV 2 2 -out-of-3 ZV 1 2 -out-of-3 DB-Out DB-In 2 -out-of-3 ZV 3 2 -out-of-3 ZV 2 RAM EPROM 1 I/O Level CPU 3 2 -out-of-3 ZV 3 RAM EPROM 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

Soft RTS: MM and Networks Real Time Communications – Best Effort Internet default service – Recent Qo. S Initiatives to differentiate between traffic streams • Eg. Voice over IP – Requires M 2 E 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

Mouth-to-Ear Delays Dr. Hugh Melvin, Dept. of IT, NUI, G 25

Real Time Communications • LAN based developments – Switched Networks (Embedded RTOS) • Also

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 – Int. Serv – Diff. Serv – 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 /

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 125 N 16 R 30 U/IA

CS 275 Bus: IEEE 802. 4 U/IA U/IB 125 N 16 R 30 U/IA U/IB 103 N 8 AS 220 E 102 N 8 AS 220 E 101 N 8 AS 220 E 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 104 N 8 AS 220 E 105 N 8 AS 220 E U/IB U/IA 121 N 16 OS 254 U/IA U/IB 160 NS 5 NAT PG 750 U/IB 106 N 8 AS 220 E U/IB 112 N 8 AS 220 E U/IA U/IB 133 N 8 AS EHF Dr. Hugh Melvin, Dept. of IT, NUI, G U/IA U/IB 107 N 8 AS 220 E U/IB 111 N 8 AS 220 E U/IA U/IB 132 N 8 AS EHF U/IA U/IB 108 N 8 AS 220 E U/IB 110 N 8 AS 220 E U/IA U/IB 131 N 8 AS EHF U/IA U/IB 109 N 8 AS 220 E U/IA U/IB 128 N 8 AS 231 28

Dr. Hugh Melvin, Dept. of IT, NUI, G 29

Dr. Hugh Melvin, Dept. of IT, NUI, G 29

Clock Skew : Buffer Issues Dr. Hugh Melvin, Dept. of IT, NUI, G 30

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

Audio-System Clock Skew Dr. Hugh Melvin, Dept. of IT, NUI, G 31