Introduction to Distributed Systems

9 downloads 5536 Views 216KB Size Report
Objectives. Study conceptual and practical aspects of distributed systems. ○. Client-server model. ○. Distributed protocols. ○. Synchronous. ○. Asynchronous.
What is a distributed system? Set of software components Running in separate address spaces Communicating through a network Collaborating to a common goal

! 

Introduction to Distributed Systems

!  !  ! 

Fabienne Boyer, LIG, [email protected]

A distributed system is one that stops you from getting any work done when a machine you’ve never heard of crashes. Leslie Lamport

Fabienne Boyer, Distributed Programming

Examples of distributed systems

What is a distributed system? Computer 1

Computer 2

! 

Computer n

Component

1

2



Information sharing " 

! 

Component

2

Collecticiels

Component

" 

n

"  " 

! 

Distributed Games

Wikipedia

Teleconference Cooperative edition Workflow (BPM)

! 

Naming Servers " 

! 

Network File Servers " 

! 

Real-time systems " 

! 

Communication system

Fabienne Boyer, Distributed Programming

Printing Servers

E-commerce

Fabienne Boyer, Distributed Programming

4

Expected properties of distributed systems

Objectives of the course Study conceptual and practical aspects of distributed systems

Expected properties !  ! 

We will characterize a distributed system by !  Its properties !  Its architecture !  Its distributed protocol !  Its programming artefact !  Its execution model Fabienne Boyer, Distributed Programming

! 

AFS, NFS

Business " 

3

Flying control systems

DNS

!  ! 

Availability Scalability Manageability Security

Main issues !  !  !  ! 

Asynchronism Dynamicity Heterogeneity Size

5 Fabienne Boyer, Distributed Programming

6

1

Characterization of distributed systems

Architecture of distributed systems

Distributed Programming Model

What software components (processes) form the system How are they connected What are their roles

!  ! 

Distributed Protocols

Architecture

Programming Artefacts

Execution Model

Client-Server

Synchronous

Message

Thread

Multi-Tiers

Asynchronous

Procedure

Process



Object

Event

Peer-to-Peer …

! 

C2 C1

Service

C4

Agent …

C3

Fabienne Boyer, Distributed Programming

7

Client-Server architecture ! 

Fabienne Boyer, Distributed Programming

8

Client-Server architecture

•  General client-server distributed architecture

A client uses some services provided by a server

"  The server provides a service "  A client may request that service

•  The client and the server are usually hosted by two distinct machines

Client

Server

machine 1

machine 2

1. request client

2. processing

3. response

server

communication link Fabienne Boyer, Distributed Programming

9

Client-Server architecture ! 

"  " 

! 

Sent by the client to the server Specifies the requested service (a server may provide several services) Contains parameters of the requested service

" 

! 

3 main aspects: Interface + Behavior + QoS

! 

The interface defines the format of the information exchanged between a service provider and its client "  " 

Response message " 

! 

Sent by the server to the client Results of service execution, or error message

! 

Example: session types (state charts)

The QoS defines non-functional aspects " 

11

IDL (Interface Definition Language) Examples: IDL Corba, Java interfaces, …

The behavior drives the exchanges between a service provider and its client " 

Fabienne Boyer, Distributed Programming

10

Client-Server Contract

Request message " 

Fabienne Boyer, Distributed Programming

Atomicity, reliability (MTBF), execution time, price, security, ..

Fabienne Boyer, Distributed Programming

12

2

Multi-tiers architecture ! 

Peer-to-peer architecture

The multi-Tiers client-server architecture allows to parallelize client requests

! 

Software components play the role of both clients and servers

Client

Server

Client

Server

Client

Server

Client

Server

Fabienne Boyer, Distributed Programming

13

Distributed Programming Model

Fabienne Boyer, Distributed Programming

What kind of information is exchanged " 

The distributed programming model mainly determines

"  " 

!  !  !  !  ! 

" 

What information is exchanged, From who to who, How it is exchanged, When it is exchanged How it is managed at sending and receiving times

" 

! 

" 

! 

"  " 

Distributed protocol

" 

" 

" 

16

Distributed protocol

Blocking o  When the client sends a request, it waits until the server replies to its request Non-blocking o  A client does not wait for the result, it will be notified of (using client callbacks) Synchronous o  When the client (resp. server) sends a request (resp. a reply), the server (resp. client) should be running Asynchronous o  When the client (resp. server) sends a request (resp. a reply), the server (resp. client) may not be running

Fabienne Boyer, Distributed Programming

Synchronous (either blocking or non-blocking) Asynchronous (generally non-blocking) + Order, + reliability,+ atomicity

Fabienne Boyer, Distributed Programming

"  " 

Direct (process to process) Indirect (exchanges go through a shared area)

With what protocol " 

15

Data Request (procedure call, object invocation) Code Object Agent / Thread

From who to who " 

Fabienne Boyer, Distributed Programming

14

Distributed Programming Model ! 

! 

Client

17

Ordered (or not) o 

Requests are delivered to the server in the order they are sent to the client

" 

Reliable (or not)

" 

Atomic (or not)

o 

o 

No request lost A request is either entirely executed at the server side, or not at all

Fabienne Boyer, Distributed Programming

18

3

Distributed programming model ! 

Distributed programming model

Remote procedure call

! 

Computer 1

Computer 2

Remote method invocation Computer 1

Computer 2

2. procedure execution Execution entity (process 1)

2. method execution

Execution entity (process 2)

Execution entity (VM1)

1. request 3. Response

1. request 3. Response

Communication system

Fabienne Boyer, Distributed Programming

19

Distributed programming model ! 

Fabienne Boyer, Distributed Programming

! 

Computer 2

Execution entity 1

Execution entity 2

Communication system 20

Distributed programming model

Non-blocking procedure call or method invocation Computer 1

Execution entity (VM2)

Event sending Computer 1

2. Procedure execution or method invocation

Computer 2 2. Callback

Execution entity 1

1. request

Execution entity 2

1. event Communication system

Fabienne Boyer, Distributed Programming

Communication system 21

Distributed programming model ! 

Fabienne Boyer, Distributed Programming

Distributed programming model ! 

Agents Computer 1

Message queuing Computer 1

Computer 2

Computer 2

Agent

Agent

execution

execution Execution entity 1

22

Execution entity 2

Execution entity (process 1)

Execution entity (process 2)

Message-oriented middleware (e.g. JMS)

agent M4

Communication system Fabienne Boyer, Distributed Programming

put message M3 put a message 23

Fabienne Boyer, Distributed Programming

M3

M2

M1

Communication system

get a message 24

4

Service-oriented distributed programming

Distributed programming model ! 

Distributed services

Computer 2 ! 

Base for service-oriented frameworks A client specifies a required service A server specifies a provided service "  Static and/or dynamic matching between clients and servers A client does not have to identify a server, only a service "  " 

Execution entity 2

Computer 1

Execution entity 1

! 

Provide service

Service orientation A service is a contractually defined behavior that can be implemented and provided by any component for use by any component, based solely on the contract.

Invoke Service

Bieber el. al., Service oriented programming, http://www.openwings.org/

Fabienne Boyer, Distributed Programming

Fabienne Boyer, Distributed Programming

Distributed systems core layers

Planning

! 

Séance

Cours

TD / TP

1

Introduction & Message-based distributed systems

TCP Sockets

2

Asynchronous message-based distributed systems

TCP Sockets

3

Asynchronous message-based distributed systems

Java NIO

4

Object-based distributed systems

Java NIO

5

Object-based distributed systems

Java RMI

6

Asynchronous object-based distributed systems

Java RMI Distribution projet Mobile agents

RMI (Remote Method Invocations)

7

..

Travail projet Mobile agents

Object-oriented programming Data heterogeneity managed by the JVM

8

Web protocols

AAA

9

Service-oriented distributed systems

Servlets

10

Evaluation projet Mobile agents

Jini

Sockets (TCP, UDP) o  o  o 

! 

Low-level protocol (based on messages) Allows for application-specific optimizations Data heterogeneity often managed by the application

RPC (Remote procedure calls) o  o 

! 

26

o  o 

Procedural programming Data heterogeneity managed by the application

Fabienne Boyer, Distributed Programming

27

Fabienne Boyer, Distributed Programming

References

28

Distributed programming model ! 

! 

Chris Britton, Peter Bye. IT Architectures and Middleware: Strategies for Building Large, Integrated Systems (2nd Edition). Addison-Wesley, 2004.

! 

George Coulouris, Jean Dollimore, Tim Kindberg. Distributed Systems: Concepts and Design (4th Edition). Addison Wesley, 2005.

! 

Arno Puder, Kay Römer, Frank Pilhofer. Distributed Systems Architecture: A Middleware Approach. Morgan Kaufmann, 2005.

! 

Andrew S. Tanenbaum, Maarten van Steen. Distributed Systems: Principles and Paradigms (2nd Edition). Prentice Hall, 2006.

Shared distributed objects Computer 1

Computer 2

Execution entity 1

Execution entity 2

Invoke object Shared objects store Fabienne Boyer, Distributed Programming

29

Fabienne Boyer, Distributed Programming

5