chapter 1 introduction 1 introduction chapter 1

54
Chapter 1 Introduction 1 Introduction Chapter 1

Post on 20-Dec-2015

317 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 1

Introduction

Chapter 1

Page 2: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 2

Examples of Distributed Systems DNS

o Hierarchical distributed database WWW

o Origin servers and web cacheso Distributed database

Cray T3Eo 2048 tightly coupled homogeneous

processorso Distributed/parallel computing

Condor/RESo Loosely coupled heterogeneous workstationso Parallel/distributed computing

Page 3: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 3

Other Distributed Systems Email Electronic banking Airline reservation system Peer-to-peer networks Etc., etc., etc.

Page 4: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 4

Computer Revolution Processing power

o 50 years ago, $100M for 1 instr/seco Today, $1K for 107 instructions/sec

Price/perform. improvement of 1012

o If cars had followed same path as computers…

o “…a Rolls Royce would now cost 1 dollar and get a billion miles per gallon”

o And it would “explode once a year, killing everyone inside”

Page 5: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 5

Computer Revolution High speed networks

o 30 years ago, networks were unknowno Today, Gigabit networks and the

Internet Before networks, centralized

systems Today, distributed systems

o Computers in many locations work as one

Page 6: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 6

What is a Distributed System?

According to your textbooko “A collection of independent computers

that appears to its users as a single coherent system”

Two parts to definitiono Hardware machines are autonomouso Software machines appear as one

system• Implies that communication hidden from user• Implies that organization hidden from user

Page 7: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 7

What is a Distributed System?

According to dict.die.neto A collection of (probably heterogeneous)

automata whose distribution is transparent to the user so that the system appears as one local machine

o This is in contrast to a network, where the user is aware that there are several machines, and their location, storage replication, load balancing and functionality is not transparent

Crucial point is transparency

Page 8: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 8

How to Implement a Dist. System?

A distributed system is a collection of independent computers…

…that acts like a single system How to accomplish this? Middleware

o Make distributed system as transparent as possible

Page 9: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 9

Role of Middleware

Distributed system as middleware Middleware extends over multiple

machines

Page 10: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 10

Goals For a distributed system to be

worthwhile authors believe it shouldo Easily connect users to resourceso Hide fact that resources are

distributedo Be openo Be scalable

First 2 of these about transparency Transparent, open, scalable

Page 11: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 11

TransparencyTransparency Description

AccessHide different data representations, how resources accessed

Location Hide where a resource is located

Migration Hide that a resource may move to another location

Relocation Hide that a resource may be moved while in use

Replication Hide that a resource is replicated

Concurrency Hide that a resource may be shared by several users

Failure Hide failure and recovery of a resource

PersistenceHide whether a (software) resource is in memory or on disk

Transparent system “acts” like one computer Various aspects of transparency listed above

Page 12: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 12

Degree of Transparency Cannot hide physical limitations

o Time it takes to send packet May be a tradeoff between

transparency and performanceo What to do if Web request times out?o Keeping replicated data current

Page 13: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 13

Openness Open == standards-based Provides

o Interoperabilityo Portability

Ideally, flexible, i.e., extensible But many useful systems follow

the “American standard”o Do whatever you want

Page 14: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 14

Scalability

Concept Example

Centralized services A single server for all users

Centralized data A single on-line telephone book

Centralized algorithmsDoing routing based on complete information

Scalability issues/limitations

Page 15: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 15

Scalability Authors believe centralized is bad

o Centralized server is source of congestion, single point of failure

o Centralized data leads to congestion, lots of traffic

o Centralized algorithm must collect all info and process it (e.g., routing algs)

Google? Napster?

Page 16: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 16

Scalability Decentralized algorithms

o No machine has complete system state

o Decisions based on local infoo Failure of one machine does not kill

entire algorithmo No assumption of global clock

Examples?

Page 17: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 17

Geographic Scalability Big difference between LAN and WAN LANs have synchronous communication

o Client can “block” until server responds On LAN, global time may be possible (to

within a few milliseconds) WAN unreliable, point-to-point WAN has different admin domains

o A security nightmare

Page 18: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 18

Scaling Techniques Scaling problems due to limited

capacity of networks and servers Three possible solutions

o Hide latencies do something useful while waiting (asynchronous comm.)

o Distribution DNS, for exampleo Replication allows for load

balancing Replication creates consistency

issues

Page 19: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 19

Scaling Techniques

Server or client check form as it’s filled out? Having client do more, as in (b), may reduce

latency (but may cause security problems)

Page 20: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 20

Scaling Techniques

DNS name space divided into zones Goto server in Z1 to find server Z2 and so on Like a binary search for correct server

Page 21: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 21

Hardware Issues For our purposes, 2 kinds of

machines Multiprocessor

o Different processors share same memory

Multicomputero Each processor has it’s own memory

Each of these could use either bus or switched architecture

Page 22: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 22

Hardware Issues

multiprocessor multicomputer

Page 23: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 23

Multiprocessors

A bus-based multiprocessor Cache coherence is an issue

Page 24: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 24

Multiprocessors

a) A crossbar switchb) Omega switching network

Page 25: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 25

Homogeneous Multicomputer

Grid Hypercube

Page 26: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 26

Software Concepts

DOS Distributed Operating Systems NOS Network Operating Systems Middleware self-explanatory

System Description Main Goal

DOSTightly-coupled operating system for multi-processors and homogeneous multicomputers

Hide and manage hardware resources

NOSLoosely-coupled operating system for heterogeneous multicomputers (LAN and WAN)

Offer local services to remote clients

MiddlewareAdditional layer atop of NOS implementing general-purpose services

Provide distribution transparency

Page 27: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 27

Uniprocessor OSs

Separate apps from OS code via microkernel

Page 28: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 28

Multiprocessor OSs

How to protect count from concurrent access?

monitor Counter {

private:

int count = 0;

public:

int value() { return count;}

void incr () { count = count + 1;}

void decr() { count = count – 1;}

}

Page 29: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 29

Multiprocessor OSs

Protect count from concurrent accesso Using blocking

monitor Counter {

private:

int count = 0;

int blocked_procs = 0;

condition unblocked;

public:

int value () { return count;}

void incr () {

if (blocked_procs == 0)

count = count + 1;

else

signal (unblocked);

}

void decr() {

if (count ==0) {

blocked_procs = blocked_procs + 1;

wait (unblocked);

blocked_procs = blocked_procs – 1;

}

else

count = count – 1;

}

}

Page 30: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 30

Multicomputer OSs

Multicomputer OS

Page 31: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 31

Multicomputer OSs

???

Page 32: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 32

Multicomputer OSs

Huh?

Synchronization point Send bufferReliable comm. guaranteed?

Block sender until buffer not full Yes Not necessary

Block sender until message sent No Not necessary

Block sender until message received No Necessary

Block sender until message delivered No Necessary

Page 33: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 33

Programming Issues Programming multicomputers

much harder than multiprocessors Why?

o Message passingo Buffering, blocking, reliable comm.,

etc. One option is to emulate shared

memory on multicomputero Large “virtual” address space

Page 34: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 34

Distributed Shared Memory

a) Pages of address space distributed among 4 machines

b) After CPU 1 references pg 10

c) If page 10 read only and replication used

Page 35: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 35

Distributed Shared Memory

False sharing of page between two processeso Two independent processors share same page

Page 36: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 36

Network OS

Network OSo Each processor has its own OS

Page 37: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 37

Network OS

Clients and server in a network OS Global shared file system

Page 38: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 38

Distributed System Distributed OS not a distributed

system by our definition Network OS not a distributed

system by our definition What we need is middleware…

Page 39: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 39

Positioning Middleware

A distributed system as middlewareo Individual node managed by local OSo Middleware hides heterogeneity of underlying systems

Page 40: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 40

Middleware and Openness

Open middleware-based system Middleware layer should

o Use the same protocolso Provide same interfaces to apps

Page 41: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 41

Comparison of Systems

Middleware rocks!

Item

Distributed OSNetwork OS

Middleware-based OSMultiproc. Multicomp.

Degree of transparency Very High High Low High

Same OS on all nodes Yes Yes No No

Number of copies of OS 1 N N N

Basis for communication

Shared memory

Messages Files Model specific

Resource managementGlobal, central

Global, distributed

Per node Per node

Scalability No Moderately Yes Varies

Openness Closed Closed Open Open

Page 42: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 42

Middleware Services Main goal is access transparency

o Hides low level message passing Naming

o Like yellow pages or URL Persistence

o For example, a distributed file system Distributed transactions

o Read and writes are atomic Security

Page 43: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 43

Client Server Model Read this section

Page 44: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 44

Clients and Servers

Interaction between client and server

Page 45: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 45

Example Client and Server

header.h o Used by

client o And by

server

Page 46: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 46

Example Client and Server

A sample server

Page 47: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 47

Example Client and Server

Client using server to copy a file

Page 48: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 48

Processing Level

Internet search engine as 3 layers

Page 49: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 49

Multitiered Architectures

Alternative client-server organizations

Page 50: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 50

Multitiered Architectures

A server acting as client

Page 51: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 51

Modern Architectures

Horizontal distribution of Web service

Page 52: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 52

Summary Distributed system

o Autonomous computers that operate together as a single coherent system

Potential advantageso Can integrate systemso Scales well, if properly designed

Potential disadvantageso Complexityo Degraded performanceo Security

Page 53: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 53

Summary Different types of dist systems Distributed OS

o For tightly coupled systemo Can’t integrate different systems

Network OSo For heterogeneous systemo No single system view

Page 54: Chapter 1  Introduction 1 Introduction Chapter 1

Chapter 1 Introduction 54

Summary Middleware systems based on

o Remote procedure callso Distributed objects, files, documentso Vertical organizationo Horizontal organization