introduction to distributed systems -...
TRANSCRIPT
Introduction to Distributed Systems
Fabienne Boyer, LIG, [email protected]
Fabienne Boyer, Distributed Programming 2
What is a distributed system?
l Set of software components l Running in separate address spaces l Communicating through a network l Collaborating to a common goal
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 3
What is a distributed system?
Component
1
Computer 1
Component
2
Computer 2
Communication system
Component
n
Computer n
…
Fabienne Boyer, Distributed Programming 4
Examples of distributed systems
l Information sharing Ø Wikipedia
l Collecticiels Ø Teleconference Ø Cooperative edition Ø Workflow (BPM)
l Real-time systems Ø Flying control systems
l Business Ø E-commerce
l Distributed Games
l Naming Servers Ø DNS
l Network File Servers Ø AFS, NFS
l Printing Servers
Fabienne Boyer, Distributed Programming 5
Objectives of the course
Study conceptual and practical aspects of distributed systems
We will characterize a distributed system by l Its properties l Its architecture l Its distributed protocol l Its programming artefact l Its execution model
Fabienne Boyer, Distributed Programming 6
Expected properties of distributed systems
Expected properties
l Availability l Scalability l Manageability l Security
Main issues
l Asynchronism l Dynamicity l Heterogeneity l Size
Fabienne Boyer, Distributed Programming 7
Characterization of distributed systems
Distributed Protocols
Synchronous
Asynchronous
…
Programming Artefacts
Message
Procedure
Object
Service
Agent
…
Execution Model
Thread
Process
Event
Architecture
Client-Server
Multi-Tiers Peer-to-Peer
…
Distributed Programming Model
Fabienne Boyer, Distributed Programming 8
Architecture of distributed systems
l What software components (processes) form the system l How are they connected l What are their roles
C1 C2
C4
C3
Fabienne Boyer, Distributed Programming 9
Client-Server architecture
l A client uses some services provided by a server
Client Server
Fabienne Boyer, Distributed Programming 10
Client-Server architecture • General client-server distributed architecture Ø 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
communication link
1. request
3. response
2. processing
Fabienne Boyer, Distributed Programming 11
Client-Server architecture
l Request message
Ø Sent by the client to the server Ø Specifies the requested service (a server may provide several
services) Ø Contains parameters of the requested service
l Response message
Ø Sent by the server to the client Ø Results of service execution, or error message
Fabienne Boyer, Distributed Programming 12
Client-Server Contract l 3 main aspects: Interface + Behavior + QoS
l The interface defines the format of the information exchanged between a service provider and its client Ø IDL (Interface Definition Language) Ø Examples: IDL Corba, Java interfaces, …
l The behavior drives the exchanges between a service provider and its client Ø Example: session types (state charts)
l The QoS defines non-functional aspects Ø Atomicity, reliability (MTBF), execution time, price, security, ..
Fabienne Boyer, Distributed Programming 13
Multi-tiers architecture
l The multi-Tiers client-server architecture allows to parallelize client requests
Client Server
Server
Server
Server
Fabienne Boyer, Distributed Programming 14
Peer-to-peer architecture
l Software components play the role of both clients and servers
Client
Client
Client
Client
Fabienne Boyer, Distributed Programming 15
Distributed Programming Model
l The distributed programming model mainly determines
l What information is exchanged, l From who to who, l How it is exchanged, l When it is exchanged l How it is managed at sending and receiving times
Fabienne Boyer, Distributed Programming 16
Distributed Programming Model l What kind of information is exchanged
Ø Data Ø Request (procedure call, object invocation) Ø Code Ø Object Ø Agent / Thread
l From who to who Ø Direct (process to process) Ø Indirect (exchanges go through a shared area)
l With what protocol Ø Synchronous (either blocking or non-blocking) Ø Asynchronous (generally non-blocking) Ø + Order, + reliability,+ atomicity
Fabienne Boyer, Distributed Programming 17
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 18
Distributed protocol
Ø Ordered (or not) o Requests are delivered to the server in the order they are sent to the
client
Ø Reliable (or not) o No request lost
Ø Atomic (or not) o A request is either entirely executed at the server side, or not at all
Fabienne Boyer, Distributed Programming 19
Distributed programming model l Remote procedure call
Execution entity
(process 1)
Computer 1
Execution entity
(process 2)
Computer 2
Communication system
1. request
3. Response
2. procedure execution
Fabienne Boyer, Distributed Programming 20
Distributed programming model l Remote method invocation
Execution entity (VM1)
Computer 1
Execution entity (VM2)
Computer 2
Communication system
1. request
3. Response
2. method execution
Fabienne Boyer, Distributed Programming 21
Distributed programming model l Non-blocking procedure call or method invocation
Execution entity 1
Computer 1
Execution entity 2
Computer 2
Communication system
1. request
2. Procedure execution or
method invocation
Fabienne Boyer, Distributed Programming 22
Distributed programming model l Event sending
Execution entity 1
Computer 1
Execution entity 2
Computer 2
Communication system
1. event
2. Callback
Fabienne Boyer, Distributed Programming 23
Distributed programming model l Agents
Execution entity 1
Computer 1
Execution entity 2
Computer 2
Communication system
agent
Agent
execution Agent
execution
Fabienne Boyer, Distributed Programming 24
Distributed programming model l Message queuing
Execution entity
(process 1)
Computer 1
Execution entity
(process 2)
Computer 2
Communication system put message M3
M2 M1 M3 M2 M1
get a message
M4 M3 M2 M1
put a message
Message-oriented middleware (e.g. JMS)
Fabienne Boyer, Distributed Programming
Distributed programming model l Distributed services
Execution entity 1
Computer 1 Execution
entity 2
Computer 2
Provide service
Invoke Service
Fabienne Boyer, Distributed Programming 26
Service-oriented distributed programming
l 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
l 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.
Bieber el. al., Service oriented programming, http://www.openwings.org/
Fabienne Boyer, Distributed Programming 27
Distributed systems core layers l Sockets (TCP, UDP)
o Low-level protocol (based on messages) o Allows for application-specific optimizations o Data heterogeneity often managed by the application
l RPC (Remote procedure calls)
o Procedural programming o Data heterogeneity managed by the application
l RMI (Remote Method Invocations) o Object-oriented programming o Data heterogeneity managed by the JVM
Fabienne Boyer, Distributed Programming 28
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
7 .. Travail projet Mobile agents
8 Web protocols
AAA
9 Service-oriented distributed systems Servlets
10 Evaluation projet Mobile agents
Jini
Fabienne Boyer, Distributed Programming 29
References l Chris Britton, Peter Bye. IT Architectures and Middleware: Strategies for
Building Large, Integrated Systems (2nd Edition). Addison-Wesley, 2004.
l George Coulouris, Jean Dollimore, Tim Kindberg. Distributed Systems: Concepts and Design (4th Edition). Addison Wesley, 2005.
l Arno Puder, Kay Römer, Frank Pilhofer. Distributed Systems Architecture: A Middleware Approach. Morgan Kaufmann, 2005.
l Andrew S. Tanenbaum, Maarten van Steen. Distributed Systems: Principles and Paradigms (2nd Edition). Prentice Hall, 2006.
Fabienne Boyer, Distributed Programming
Distributed programming model l Shared distributed objects
Execution entity 1
Computer 1
Execution entity 2
Computer 2
Shared objects store
Invoke object