Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke

Description:

Title: PowerPoint Presentation Author: DalTech - Faculty of Computer Science Last modified by: DalTech - Faculty of Computer Science Created Date – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 41
Provided by: DalTechF1
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke


1
Introduction to Distributed Systems Slides
for CSCI 3171 Lectures E. W. Grundke

2
References
  • A. Tanenbaum and M. van Steen (TvS)
  • Distributed Systems Principles and Paradigms
  • Prentice-Hall 2002
  • G. Coulouris, J. Dollimore and T. Kindberg (CDK)
  • Distributed System Concepts and Design
  • Addison-Wesley 2001
  • Acknowledgment Some slides from
  • TvS http//www.prenhall.com/divisions/esm/app/aut
    hor_tanenbaum/custom/dist_sys_1e/
  • CDK http//www.cdk3.net/ig/beida/index.html

3
What is a Distributed System?
  • A collection of independent computers that
    appears to its users as a single coherent system.
  • Examples
  • Distributed object-based systems (CORBA,
    DCOM)Distributed file systems (NFS)etc.

TvS 1.2
4
Heterogeneity
  • Applies to all of the following
  • networks
  • Internet protocols mask the differences between
    networks
  • computer hardware
  • e.g. data types such as integers can be
    represented differently
  • operating systems
  • e.g. the API to IP differs from one OS to another
  • programming languages
  • data structures (arrays, records) can be
    represented differently
  • implementations by different developers
  • they need agreed standards so as to be able to
    interwork

CDK Ch. 1.4
5
Transparency in a Distributed System
Transparency Description
Access Hide differences in data representation and how a resource is 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 to another location while in use
Replication Hide that a resource may be shared by several competitive users
Concurrency Hide that a resource may be shared by several competitive users
Failure Hide the failure and recovery of a resource
Persistence Hide whether a (software) resource is in memory or on disk
Different forms of transparency in a distributed
system.
TvS 1.4
6
Layered Protocols IP
  • Layers, interfaces, and protocols in the OSI
    model.

7
Layered Protocols OSI
  • Layers, interfaces, and protocols in the OSI
    model.

2-1
TvS 2.2
8
Middleware Protocols
2-5
  • An adapted reference model for networked
    communication.

TvS 2.6
9
Middleware
  • A software layer that
  • masks the heterogeneity of systems
  • provides a convenient programming abstraction
  • provides protocols for providing general-purpose
    services to more specific applications, eg.
  • authentication protocols
  • authorization protocols
  • distributed commit protocols
  • distributed locking protocols
  • high-level communication protocols
  • remote procedure calls (RPC)
  • remote method invocation (RMI)

10
Middleware
  • General structure of a distributed system as
    middleware.

1-22
TvS 1.24
11
Middleware and Openness
1.23
  • In an open middleware-based distributed system,
    the protocols used by each middleware layer
    should be the same, as well as the interfaces
    they offer to applications.

TvS 1.25
12
Middleware programming models
  • Remote Calls
  • remote Procedure Calls (RPC)
  • distributed objects and Remote Method Invocation
    (RMI)
  • eg. Java RMI
  • Common Object Request Broker Architecture (CORBA)
  • cross-language RMI
  • Other programming models
  • remote event notification
  • remote SQL access
  • distributed transaction processing

CDK Ch 1
13
External Data Representation
  • See Coulouris, Dollimore and Kindberg (CDK), Sec.
    4.3

14
Motivation
  • Data in running programsNot just primitives,
    but arrays, pointers, lists, trees, etc.
  • In general complex graphs of interconnected
    structures or objects
  • Data being transmitted
  • Sequential! Pointers make no sense.
    Structures must be flattened.
  • All the heterogeneities must be masked! (endian,
    binary formats, etc.)

CDK 4.3
15
Motivation
  • Data in running programsNot just primitives,
    but arrays, pointers, lists, trees, etc.
  • In general complex graphs of interconnected
    structures or objects
  • Data being transmitted
  • Sequential! Pointers make no sense.
    Structures must be flattened.
  • All the heterogeneities must be masked! (endian,
    binary formats, etc.)

CDK 4.3
16
What is an External Data Representation?
  • An agreed standard for the representation of
    data structures and primitive values.
  • Internal to external marshalling
  • External to internal unmarshalling
  • Examples
  • CORBAs Common Data Representation (CDR)Java
    Object SerializationSun XDR (RFC 1832)

17
CORBA CDR
  • Defined in CORBA 2.0 in 1998
  • Primitive types
  • Standard data types, both big/little endian,
    conversion by the receiver.
  • Constructed types
  • sequence, string, array, struct, enumerated,
    union
  • (not objects)
  • Data types are not specified in the external
    format receiver is assumed to have access to
    the definition (via IDL).
  • (unlike Java Object Serialization!)

CDK 4.3
18
  • CORBA CDR
  • only defined in CORBA 2.0 in 1998, before that,
    each implementation of CORBA had an external data
    representation, but they could not generally work
    with one another. That is
  • the heterogeneity of hardware was masked
  • but not the heterogeneity due to different
    programmers (until CORBA 2)
  • CORBA CDR represents simple and constructed data
    types (sequence, string, array, struct, enum and
    union)
  • note that it does not deal with objects
  • it requires an IDL specification of data to be
    serialised

CDK 4.3
19
CORBA CDR Example
Index in sequence 4 bytes wide
Notes of bytes
0-3 5 Length of string
4-7 Smit Smith
8-11 h____
12-15 6 Length of string
16-19 Lond London
20-23 on__
24-27 1934 Unsigned long
  • The flattened form represents a Person struct
    with valueSmith, London, 1934

CDK 4.3
20
Remote Procedure Calls (RPC)

21
What is RPC?
  • Call a procedure (function, subroutine, method,
    )
  • in a program
  • running on a remote machine,
  • while hiding communication details from the
    programmer.
  • Note Think C, not java! We deal with objects
    later!

22
Conventional Procedure Call
  1. Parameter passing in a local procedure call the
    stack before the call to read
  2. The stack while the called procedure is active

TvS 2.7
23
Parameter Passing Techniques
  • Call-by-value
  • Call-by-reference
  • Call-by-copy/restore

24
Client and Server Stubs
  • Principle of RPC between a client and server
    program.

TvS 2.8
25
Steps of a Remote Procedure Call
  1. Client procedure calls client stub in normal way
  2. Client stub builds message, calls local OS
  3. Client's OS sends message to remote OS
  4. Remote OS gives message to server stub
  5. Server stub unpacks parameters, calls server
  6. Server does work, returns result to the stub
  7. Server stub packs it in message, calls local OS
  8. Server's OS sends message to client's OS
  9. Client's OS gives message to client stub
  10. Stub unpacks result, returns to client

TvS 2.9
26
Passing Value Parameters
  • Steps involved in doing remote computation
    through RPC

2-8
TvS 2.10
27
Passing Value ParametersData Representation
Issues
  1. Original message on the Pentium
  2. The message after receipt on the SPARC
  3. The message after being inverted. The little
    numbers in boxes indicate the address of each
    byteBUT This is not usually a problem with
    strings! (E.W.G.)

TvS 2.11
28
Parameter Specification and Stub Generation
  1. A procedure
  2. The corresponding message.

TvS 2.12
29
Passing Reference Parameters
  • Reference variables (pointers)pointers to
    arrayspointers to structures (objects without
    methods)
  • What if the structure contains other pointers?
  • The server may need a whole graph of
    structures!
  • Parameter marshalling
  • Interface Definition Language (IDL)
  • Specifies types, constants, procedures and
    parameter data types,compiled into client and
    server stubs.

30
Asynchronous RPC
2-12
  1. The interconnection between client and server in
    a traditional RPC
  2. The interaction using asynchronous RPC

TvS 2.14
31
Asynchronous RPCDeferred Synchronous RPC
  • A client and server interacting through two
    asynchronous RPCs

TvS 2.15
32
Distributed Computing Environment (DCE)
  • A middleware system
  • Developed by The Open Group (previously OSF)
  • Includes
  • distributed file servicedirectory
    servicesecurity servicedistributed time service
  • Adopted by Microsoft for distributed computing

33
DCE Binding a Client to a Server

2-15
TvS 2.17
34
Remote Method Invocation (RMI)

35
What is RMI?
  • RPC to a method in an object on another machine.
  • Note Now think Java!

36
Object OrientationRemote Method Invocation
(RMI)
  • An object encapsulates
  • State (fields or instance variables)
  • Methods (often described by an interface)
  • Distributed object
  • An interface known locally may describe an
    object on another machine.

37
Distributed Objects
  • Common organization of a remote object with
    client-side proxy.

2-16
TvS 2.18
38
Binding a Client to an Object
Distr_object obj_ref //Declare a systemwide
object referenceobj_ref // Initialize the
reference to a distributed objectobj_ref-gt
do_something() // Implicitly bind and invoke a
method (a) Distr_object objPref //Declare a
systemwide object referenceLocal_object
obj_ptr //Declare a pointer to local
objectsobj_ref //Initialize the reference
to a distributed objectobj_ptr
bind(obj_ref) //Explicitly bind and obtain a
pointer to the local proxyobj_ptr -gt
do_something() //Invoke a method on the local
proxy (b)
  1. An example with implicit binding using only
    global references
  2. An example with explicit binding using global and
    local references

TvS 2.19
39
Parameter Passing
  • The situation when passing an object by reference
    or by value.

2-18
TvS 2.20
40
The DCE Distributed-Object Model
  1. Distributed dynamic objects in DCE.
  2. Distributed named objects

TvS 2.21
Write a Comment
User Comments (0)
About PowerShow.com