Top Banner
CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems
30

CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

CS 501: Software EngineeringFall 2000

Lecture 15

System Architecture II

Distributed and Real Time Systems

Page 2: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Administration

Assignment 2: Requirements

• Grades -- presentation, report, individual• Comments at presentation• Comments from teaching assistant

Assignment 3: Design

Page 3: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Comments on Requirements Report

Audience

• Client and design team• Will be updated over time

Content

• Level of detail -- will be used to validate the implementation• Requirements, not design• Precise, but not legalistic

Page 4: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Sequence Diagram: Notation

BookBorrower

libMem: LibraryMember

theCopy:Copy

theBook:Book

borrow(theCopy)okToBorrow

borrowborrow

dotted line shows object

lifetime

rectangle shows focus

of control

Page 5: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Sequence Diagram: Branching

BookBorrower

libMem: LibraryMember

theCopy:Copy

theBook:Book

1:borrow(theCopy)2:okToBorrow

[ok]3:borrow4:borrow

branch

[not ok]3:noborrow

Page 6: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: Distributed Database

two copies of the same data

Page 7: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Distributed Data and Replication

Distributed Data

Data is held on several computer systems. A transaction may need to assemble data from several sources.

Replication

Several copies of the data are held in different locations.

Mirror: Complete data set is replicated

Cache: Dynamic set of data is replicated (e.g., most recently used)

With replicated data, the biggest problem is consistency.

Page 8: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: Broadcast Search

User interfaceserverUser

Databases

Page 9: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: UseNet

Page 10: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Stateless Protocol v. Stateful

Stateless protocol

Example: http

Open connectionSend message Return replyClose connection

State in http must be sent with every message (e.g., as parameter string or in a cookie)

Page 11: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Stateless Protocol v. Stateful

Stateful (session) protocol

Example: Z39.50Open connectionBegin sessionInteractive sessionEnd sessionClose connection

Server remembers the results of previous transactions (e.g., authentication, partial results) until session is closed.

Page 12: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Firewall

Public network

Private network

Firewall

A firewall is a computer at the junction of two network segments that:

• Inspects every packet that attempts to cross the boundary

• Rejects any packet that does not satisfy certain criteria, e.g.,

an incoming request to open a TCP connectionan unknown packet type

Page 13: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

The Domain Name System

.edu server

cornell.edu server

cs.cornell.edu server

First attempt to resolve www.cs.cornell.edu

1

2

3

Page 14: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Discussion of the First Attempt

Problems?

Page 15: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

The Domain Name System

.edu server

cornell.edu server

cs.cornell.edu server

Better method

3

1

almaden.ibm.comcornell.eduece.cmu.eduibm.comacm.org.edu

2

Localcache

local DNS server

Page 16: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Real Time System

A real time system is a software system whose correct functioning depends upon the results produced and the time at which they are produced.

• A soft real time system is degraded if the results are not produced within required time constraints

• A hard real time system fails if the results are not produced within required time constraints

Page 17: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: Web Server

http messagedaemon

spawned processesTCP port 80

The daemon listens at port 80.

When a message arrives it:spawns a processes to handle the messagereturns to listening at port 80

Page 18: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Embedded Systems

Software and hardware are combined to provide an integrated unit, usually dedicated to a specific task:

• Digital telephone

• Automobile engine control

• GPS

• Scientific instruments

The software may be embedded in the device in a manner that can not be altered after manufacture.

Page 19: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: Autonomous Land Vehicle

Sensors

GPS

Sonar

Laser

Signal processing

Model Control signals

Steer

Throttle

Controls

Page 20: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Other Applications

Response critical

• Network router

• Telephone switch

• Seat bag controller

Shared systems

• Multi-user data processing

• Time sharing

Page 21: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Techniques

• Special purpose hardware

• Multi-threading and multi-tasking

• Parallel processing

=> digital signal processing

• Interrupts

=> levels and priorities

Page 22: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Multi-Threading

Several similar threads operating concurrently:

• Re-entrant code -- separation of pure code from data for each thread

• Testing -- single thread and multi thread

May be real time (e.g., telephone switch) or non-time critical

Page 23: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Real Time Executive

Schedules and dispatches tasks in a real time system

• Real time clock

• Interrupt handler

• Scheduler

• Resource manager

• Dispatcher

Must be extremely reliable

Page 24: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Timing

Timing mechanisms

• Synchronous (clocked) -- periodic stimuli

• Asynchronous -- wait for next signal

Example: Communications protocols may be synchronous or asynchronous

Page 25: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Hardware v. Software

Design of embedded systems requires close understanding of hardware characteristics

• Special purpose hardware requires special tools and expertise.

• Some functions may be implemented in either hardware of software (e.g., floating point unit)

• Design requires separation of functions

Distinction between hardware and software may be blurred.

Page 26: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: Dartmouth Time Shared System

Communications processor

Communications processor

Centralprocessor

Centralprocessor

Centralprocessor

I/OMulitplexor

master processor

Page 27: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Software Considerations

Resource considerations may dictate software design and implementation:

• Low level language (e.g., C) where programmer has close link to machine

• Inter-process communication may be too slow (e.g., C fork).

• May implement special buffering, etc., to control timings

Page 28: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Example: CD Controller

Input block Output

block

12

345

67

Circular buffer

Page 29: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Continuous Operation

Many systems must operate continuously

• Software update while operating

• Hardware monitoring and repair

• Alternative power supplies, networks, etc.

• Remote operation

These functions must be designed into the fundamental architecture.

Page 30: CS 501: Software Engineering Fall 2000 Lecture 15 System Architecture II Distributed and Real Time Systems.

Routers and Other Network Computing

• Interoperation with third party devices

• Support for several versions of protocols

• Restart after total failure

• Defensive programming -- must survive

=> erroneous or malicious messages

=> extreme loads

• Time outs, dropped packets, etc.

• Evolution of network systems