12
1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh Melvin/Dr. Michael Schukat Room 406/402 Ext 3716/2031 [email protected] [email protected] See Web resources Course Structure 2 hrs lectures / week for both semesters – Wed 9-11 IT304 Semester 1 Structured and unstructured labs Dr. Hugh Melvin, Discipline of IT, NUI,G 2 Assignments – Lab based work Technical Reports – Linux/Windows based Course Structure Content updated Course development in realtime ! Subject to change Lecture notes on web in advance of lectures A t Dr. Hugh Melvin, Discipline of IT, NUI,G 3 Assessment Exam + Assignments Typically 70/30 split Site Visit ? Moneypoint (ESB) / Shannon ATC / Aer Lingus

CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

  • Upload
    vuque

  • View
    231

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

1

CT420 Realtime Systems

Dr. Hugh Melvin, Discipline of IT, NUI,G 1

Dr. Hugh Melvin/Dr. Michael SchukatRoom 406/402 Ext 3716/2031

[email protected]@nuigalway.ie

See Web resources

Course Structure

• 2 hrs lectures / week for both semesters– Wed 9-11 IT304 Semester 1

• Structured and unstructured labs

Dr. Hugh Melvin, Discipline of IT, NUI,G 2

• Assignments– Lab based work

• Technical Reports

– Linux/Windows based

Course Structure• Content updated

– Course development in realtime ! Subject to change

• Lecture notes on web in advance of lectures

A t

Dr. Hugh Melvin, Discipline of IT, NUI,G 3

• Assessment– Exam + Assignments

• Typically 70/30 split

• Site Visit ?– Moneypoint (ESB) / Shannon ATC / Aer Lingus

Page 2: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

2

Main Textbooks

• Real-Time Systems , Krisha & Shin, McGraw Hill

• Real-Time Systems Design & Analysis, Laplante, Wiley

• Programming for the Real World POSIX.4,

Dr. Hugh Melvin, Discipline of IT, NUI,G 4

Programming for the Real World POSIX.4, Gallmeister, O Reilly

• Advanced Unix Programming, Rochkind, Addison Wesley

• Real-Time Systems & Programming Languages, Burns & Wellings, Pearson

Course Outline

• Classification of RTS• Time Synchronisation for RTS• Soft RTS

– Multimedia & Networks

Dr. Hugh Melvin, Discipline of IT, NUI,G 5

• Scheduling for RTS• Memory Management for RTS• RT Programming Languages• RTOS & POSIX.4 RT • Fault Tolerance for RTS

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

Dr. Hugh Melvin, Discipline of IT, NUI,G 6

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

Page 3: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

3

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

Hard RTS

I/O

CPU

I/O

CPU

I/O I/O

CPU CPU

Bin

ary

Fie

ld I

nput

sB

inar

y O

utpu

tsA

nalo

gue

Inpu

tsA

nalo

gue

Out

puts

Bin

ary

Fie

ld I

nput

sB

inar

y O

utpu

tsA

nalo

gue

Inpu

tsA

nalo

gue

Out

puts

Bin

ary

Fie

ld I

nput

sB

inar

y O

utpu

tsA

nalo

gue

Inpu

tsA

nalo

gue

Out

puts

I/O

CPU

AS101 AS133AS112 AS131AS017AS013

Boiler BMSTurbine

I/O

CPU

R30

CPU

I/O

MEC-RTData Storage Unit

VDU 1

VDU 2

VDU S\E’sOffice

VDU Prog. Room

Tape DriveStorage Unit

Operators Keyboard 1

Operators Keyboard 2

S\E’s Keyboard 1

Programmers Keyboard

Annunciator

Printer 1

Printer 2

Printer Prog. Room

CS 275 B B 0Bus 1

HW Analog Inputs

HW Binary Inputs

Bus Coupler

Dr. Hugh Melvin, Discipline of IT, NUI,G 8Teleperm ME System Overview

VAXMaintenance Management

System

I/O

CPU

I/O

CPU

AS231Unit Alarms System

PG750Maintenance

Computer

OS254OperationsComputer

Turbine Boiler

VDU 1 VDU 1

VDU 2

VDU 3

Operator’sKeyboard

MEC-RTData Storage Unit

Programmers VDU & Keyboard

VDU 2

VDU 3

Operator’sKeyboard

MEC-RTData Storage Unit

Programming Room Printer

Fault Log Printer

Con

trol

Roo

m

Control R

oom

LPA0

LPA1

Local Printer

VDU 1

VDU 2

Operator’sKeyboard

5 1/4”FDDStorage Unit

Alarms Printer

Annunciator

I/O

CPU

Local T

erminals

CS 275 Bus Bus 0

S\E’s VDU & Keyboard

12:45:01 23:01:97

Master Clock

Remote OperatorStation

OIS Server IBM NetFinity 5510

Bus ABus B

BusCoupler

U/I

CS275Bus 0

Synogate Interfaceto CS275

CS275Bus 1

U/I

Bus ABus B

BusCoupler

U/I

CS275Bus 0

Synogate Interfaceto CS275

CS275Bus 1

U/I

Bus ABus B

BusCoupler

U/I

CS275Bus 0

Synogate Interfaceto CS275

CS275Bus 1

U/I

Unit 1 Unit 2 Unit 3

Dr. Hugh Melvin, Discipline of IT, NUI,G 9Control Room Unit 3

Operator Station

IBM NetFinity 5510

Control Room Unit 1 Operator Station

Control Room Unit 2 Operator Station

Station LAN

MP002

GatewayR30 Room Gateway

Communications Room

MP001

Page 4: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

4

Burner Management System

CPU 2CPU 1 CPU 3

N8 N8

U/I U/I

Bus ABus B

CS275

Dr. Hugh Melvin, Discipline of IT, NUI,G 10

.. .. ........

2 out of 3

Non-Redundant Control Circuits

Double RedundantSafety Circuits Triple Redundant Safety Circuits

Other Hard RTS

• Fly-by-wire control systems

• Robotics

• Medical Devices

Dr. Hugh Melvin, Discipline of IT, NUI,G 11

• ABS / Airbag Protection Systems

Boeing 777

Dr. Hugh Melvin, Discipline of IT, NUI,G 12

Page 5: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

5

Soft RTS: Multimedia

Dr. Hugh Melvin, Discipline of IT, NUI,G 13

Firm RTS

• Somewhere in the middle ?– Eg. Private IP Network governed by SLA

(Service Level Agreement)• SLA specifies jitter/delay/loss/availability

Dr. Hugh Melvin, Discipline of IT, NUI,G 14

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 / Cameras etc…

Time Synchronisation for RTS• Time of Day and Timing

– Two distinct issues

• Both often critical for RTS– Synchronising 2v3 systems (timing)– Precise data logging for distributed system (time)

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

gg g y ( )– Skew problems in POTS / VoIP / IPTV

• Clock Terminology– Accuracy , Stability, Offset, Skew, Drift

• Synchronisation Algorithms– Network Time Protocol (NTP)

• Limitations of conventional OS Timing• Timer granularity & Time Services

Page 6: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

6

Time & Timing

• Time– UTC– Evolved from Greenwich

Mean Time GMT– Time Synchronisation

Dr. Hugh Melvin, Discipline of IT, NUI,G 16

Time Synchronisation• How closely 2 clocks

agree on Time of Day

• Timing– Relates to frequency– Timing Synchronisation

• How closely 2 entities operate at same frequency

Greenwich• Home of Time & the

Prime Meridian• Longitude 0 & GMT

agreed in 1884– GMT driven by

expansion of railways

Dr. Hugh Melvin, Discipline of IT, NUI,G 17

p yand need for national/international consistency

• “Timeball” rises and falls at 13.00 hrs– Then site of London

docks– In service since 1833

Greenwich

Dr. Hugh Melvin, Discipline of IT, NUI,G 18

Page 7: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

7

Dr. Hugh Melvin, Discipline of IT, NUI,G 19

Soft RTS: MM and Networks

Real Time Communications– Best Effort Internet default service

– Recent QoS Initiatives to differentiate between traffic streams

Dr. Hugh Melvin, Discipline of IT, NUI,G 20

between traffic streams• Eg. Voice over IP

– Requires M2E delay typically < 150 msec

– Can cope with small degree of packet loss

» Soft RTS

– How can delay/loss reqds be met?

• See ITU G.1010

Mouth-to-Ear Delays

Dr. Hugh Melvin, Discipline of IT, NUI,G 21

Page 8: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

8

Real Time Communications• LAN based developments

– Switched Networks (Embedded RTOS)• Also Fast/Gigabit Ethernet : Overprovisioning?• What Andy giveth, Bill taketh away !

– New difficulties for wireless environment • Access Protocols CSMA

Dr. Hugh Melvin, Discipline of IT, NUI,G 22

• WAN based developments– IntServ– DiffServ – MPLS : Layer 2.5

• Also development of RTP/RTCP/RTSP Protocols to support packet based MM traffic

Real Time Communications

• Endpoint Issues– Increased complexity in terminals

– OS / Driver / Application Software / Hardware issues

Dr. Hugh Melvin, Discipline of IT, NUI,G 23

issues • Increased delays due to complex and/or poorly

written s/w

• Hardware Issues – eg. skew = lack of synchronisation (timing)

Dr. Hugh Melvin, Discipline of IT, NUI,G 24

Page 9: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

9

Clock Skew : Buffer Issues

Dr. Hugh Melvin, Discipline of IT, NUI,G 25

Audio-System Clock Skew

Dr. Hugh Melvin, Discipline of IT, NUI,G 26

RT Programming Languages– Consider the following Fortran Loop statement

DO 100 I=1,5<block of text>

100 Continue

– but the following is also validDO 100 I=1 5

Dr. Hugh Melvin, Discipline of IT, NUI,G 27

DO 100 I=1.5<block of text>

100 Continue

– Fortran interpreted DO 100 I as a previously undeclared float variable assigned value 1.5 NASA mishap

– Ada is most recognised RT Prog. Lang.• Boeing 777 control written in Ada

Page 10: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

10

RTOS

• Windows / Unix / Linux – Designed for time sharing of resources rather than meeting

hard deadlines– Designed for good average performance– Not suited to Hard RTS typically

• Can be used after careful design considerations

Dr. Hugh Melvin, Discipline of IT, NUI,G 28

– Examples• M’pt : User Interface provided by Linux/Win 2000

» BUT not core control system

• Shannon ATC– Unix powers main Thales ATC systems

– More suited to Soft RT functionality – POSIX.4 improves RT performance of some OS

RTOS• 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– Can better meet RTS requirements

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

q• Different design to conventional OS• Scheduling/Process priorities are key issues

– VxWorks, QNX, Lynx, RTLinux,

– Cyclic Executive approach still widely used • Software runs ‘bare’ on hardware• No OS !

– Used a lot with Soft RTS and some hard RTS• Mobile phone OS: Symbian is market leader

Fault Tolerant TechniquesKey Characteristic of Hard RTS1. Fault-tolerance via Redundancy

• Full/Partial Fault Tolerance

2. Graceful degradation– Eg.1: Citreon CX

• Common hydraulic system for Steering, Brakes and Suspension• Order of failure??

Dr. Hugh Melvin, Discipline of IT, NUI,G 30

• Order of failure??– Eg. 2: Power Plant

• Faulty sensor Alarm Overload AS station switch to manualbut 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

Many Hard RTS combine all 3 techniques

Page 11: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

11

Citreon CX

Dr. Hugh Melvin, Discipline of IT, NUI,G 31

Fault Tolerant Techniques

• Redundancy– Hardware Redundancy

• Voting schemes

– Software Redundancy• Code developed by different teams

Oft bi d ith h d d d

Dr. Hugh Melvin, Discipline of IT, NUI,G 32

• Often combined with hardware redundancy

– 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

Fault Tolerant Techniques: Airbus

• 3 Main Flight Controllers

• 2 Backup Flight Controllers

Dr. Hugh Melvin, Discipline of IT, NUI,G 33

• Software developed by different teams and on different platforms

• Seamless transfer

Page 12: CT420 Realtime Systems - Information Technology - …ww2.it.nuigalway.ie/staff/h_melvin/realtime/intro...1 CT420 Realtime Systems Dr. Hugh Melvin, Discipline of IT, NUI,G 1 Dr. Hugh

12

Fault Tolerant Techniques

CPU 1 CPU 2 CPU 3

2-out-of-3 2-out-of-32-out-of-3ZV1 ZV2 ZV3

DB-In DB-In DB-InDB-Out DB-Out DB-Out

Uni

t

Dr. Hugh Melvin, Discipline of IT, NUI,G 34

2-out-of-3 2-out-of-3 2-out-of-3

2-ou

t-of

-3

Inputs Outputs

Extension Units

EAVn

ZV1 ZV2 ZV3

Cen

tral

I/

O L

evel

RAMEPROM

1

RAMEPROM

2

RAMEPROM

3

Course Outline

• Case Study Approach

• Assessment– Assignment Possibilities

Ti S h i ti

Dr. Hugh Melvin, Discipline of IT, NUI,G 35

• Time Synchronisation

• Timing Services (Windows versus Linux)

• Internet Multimedia

• Scheduling

• Ada tutorial

• POSIX RT Features

Resources

• Various text books

• Research papers

• Websites

• Details will be posted on course website

Dr. Hugh Melvin, Discipline of IT, NUI,G 36

Details will be posted on course website

• Possible site visits ?– ESB Moneypoint

– Shannon ATC

– Aer Lingus facility