Distributed Computing Paradigms L2

Embed Size (px)

Citation preview

  • 8/8/2019 Distributed Computing Paradigms L2

    1/26

    Distributed ComputingParadigms

    Lecture-2

  • 8/8/2019 Distributed Computing Paradigms L2

    2/26

    Distributed App. Paradigms

    high

    object space

    network services, object request broker, mobile agent

    remote procedure call , remote method invocation

    client-server

    message passing

    low

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    3/26

    The Message Passing Paradigm

    Message passing is the most fundamental paradigm for distributed

    a lications.

    A process sends a message representing a request. The message is delivered to a receiver, which processes the request,

    and sends a message in response.

    In turn, the reply may trigger a further request, which leads to asubsequent reply, and so forth. -

    Process AProcess B

    a message

    IT636 - Distributed Computing: Fundamentals and Applications

    Message passing

  • 8/8/2019 Distributed Computing Paradigms L2

    4/26

    The Message Passing Paradigm - 2

    The basic operations required to support the,

    receive.

    For connection-oriented communication, theoperations connect and disconnect are also

    required.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    5/26

    The Client-Server Paradigm

    Perhaps the best known paradigm for network applications,the client-server model assi ns as mmetric roles to two

    collaborating processes. One process, the server, plays the role of a service provider

    . ,the client, issues specific requests to the server and awaits itsresponse.

    service requesta client process

    a server process

    a serviceServer host

    Client host

    ...

    IT636 - Distributed Computing: Fundamentals and Applications

    The Client-Server Paradigm, conceptual

  • 8/8/2019 Distributed Computing Paradigms L2

    6/26

    The Client-Server Paradigm - 2

    Simple in concept, the client-server model provides anefficient abstraction for the deliver of network services.

    Operations required include those for a server process tolisten and to accept requests, and for a client process to issue

    .

    By assigning asymmetric roles to the two sides, event

    synchronization is simplified: the server process waits for, .

    Many Internet services are client-server applications. Theseservices are often known by the protocol that the application

    . ,FTP, DNS, finger, gopher, etc.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    7/26

    The Peer-to-Peer Architecture

    In system architecture and networks, peer-to-peer

    services are direct exchanged between computersystems.

    exchange of information, processing cycles, cache

    storage, and disk storage for files.. n suc an arc tecture, computers t at ave

    traditionally been used solely as clientscommunicate directly among themselves and can

    act as both clients and servers, assuming whateverrole is most efficient for the network.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    8/26

    The Peer-to-Peer Distributed Computing

    In the peer-to-peer paradigm, the participating processes playe ual roles with e uivalent ca abilities and res onsibilities

    (hence the term peer). Each participant may issue arequest to another participant and receive a response.

    process 1

    request

    response

    request

    response

    process 2

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    9/26

    Peer-to-Peer distributed computing

    Whereas the client-server paradigm is an ideal model for acentralized network service the eer-to- eer aradi m is

    more appropriate for applications such as instant messaging,peer-to-peer file transfers, video conferencing, andcollaborative work. It is also possible for an application to bebased on both the client-server model and the peer-to-peermodel.

    A well-known example of a peer-to-peer file transfer service isNapster.comor similar sites which allow files (primarily audiofiles) to be transmitted among computers on the Internet. It

    makes use of a server for directory in addition to the peer-to-peer computing.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    10/26

    Peer-to-Peer distributed computing

    The peer-to-peer paradigm can be implemented with facilitiesusing any tool that provide message-passing, or with ahigher-level tool such as one that supports the point-to-point

    model of the Message System paradigm.

    For web applications, the web agentis a protocol promoted bye e u c rus rgan za on or peer-

    to-peer interprocess communication

    Project JXTA is a set of open, generalized peer-to-peer,

    PDA, PC to server) on the network to communicate andcollaborate. JXTA is short for Juxtapose, as in side by side. Itis a recognition that peer to peer is juxtapose to client server

    or Web based computing -- what is considered today'straditional computing model.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    11/26

    The Message System Paradigm

    The Message System or Message-Oriented Middleware (MOM)

    paradigm is an elaboration of the basic message-passing paradigm.

    In this paradigm, a message system serves as an intermediaryamong separate, independent processes.

    The message system acts as a switch for messages, through which

    processes exchange messages asynchronously, in a decoupled

    manner.

    A sender deposits a message with the message system, whichorwar s o a message queue assoc a e w eac rece ver.

    Once a message is sent, the sender is free to move on to other

    tasks.receivers

    ...message system sender

    IT636 - Distributed Computing: Fundamentals and Applications

    ...

  • 8/8/2019 Distributed Computing Paradigms L2

    12/26

    Two subtypes of Message models

    The Point-To-Point Message Model

    ,

    the sender to the receivers message queue. Unlike thebasic message passing model, the middleware provides a

    ,receiving to be decoupled. Via the middleware, a senderdeposits a message in the message queue of the receivingrocess. A receiving rocess extracts the messages from its

    message queue, and handles each one accordingly.

    Compared to the basic message-passing model, thisaradi m rovides the additional abstraction for

    asynchronous operations. To achieve the same effect withbasic message-passing, a developer will have to make use ofthreads or child processes.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    13/26

    Publish/Subscribe Message Model

    In this model, each message is associated with a specificto ic or event. A lications interested in he occurrence

    of a specific event may subscribe to messages for thatevent. When the awaited event occurs, the processpublishes a message announcing the event or topic. Themiddleware message system distributes the message toall its subscribers.

    The ublish/subscribe message model offers a owerfulabstraction for multicasting or group communication.The publishoperation allows a process to multicast to agroup of processes, and the subscribeoperation allows

    a process to listen for such multicast.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    14/26

    Toolkits for the Message-System

    The MOM paradigm has had a long history in.

    Message Queue Services (MQS) have been inuse since the 1980s.

    The IBM MQ*Series is an example of such a

    facility. Other existing support for this paradigm are

    Microsofts Message Queue (MSQ),

    Javas Messa e Service

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    15/26

    Remote Procedure Call

    As applications grew increasingly complex, it becamedesirable to have a paradigm which allows distributedsoftware to be programmed in a manner similar to

    conventional applications which run on a singleprocessor.

    e emo e roce ure a mo e prov es sucan abstraction. Using this model, interprocess

    communications proceed as procedure, or function,calls which are familiar to a lication ro rammers.

    A remote procedure call involves two independentprocesses, which may reside on separate machines. Aprocess, A, wishing to make a request to another

    process, B, issues a procedure call to B, passing with thecall a list of argument values. As in the case of localprocedure calls, a remote procedure call triggers a

    IT636 - Distributed Computing: Fundamentals and Applications

    At the completion of the procedure, process Breturns a

    value to process A.

  • 8/8/2019 Distributed Computing Paradigms L2

    16/26

    Remote Procedure Call - 2

    Process A Process B

    proc1(arg1, arg2)

    proc arg

    proc arg ,arg ,arg

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    17/26

    Remote Procedure Call - 3

    RPC allows programmers to build network applicationsusing a programming construct similar to the localprocedure call, providing a convenient abstraction for

    both interprocess communication and eventsynchronization.

    nce s n ro uc on n e ear y s, e emo eProcedure Call model has been widely in use in networkapplications.

    Calls.

    The Open Network Computing Remote Procedure Call,evolved from the RPC API ori inated from Sun

    Microsystems in the early 1980s. The Open Group Distributed Computing Environment

    (DCE) RPC.

    IT636 - Distributed Computing: Fundamentals and Applications

    Both APIs provide a tool, rpcgen, for transforming

    remote procedure calls to local procedure calls to thestub.

  • 8/8/2019 Distributed Computing Paradigms L2

    18/26

    The Distributed Objects Paradigms

    The idea of applying object orientation to distributeda lications is a natural extension of ob ect-oriented

    software development. Applications access objects distributed over a network.

    ,which an application obtains access to services.

    Object-oriented paradigms include: Remote method invocation (RMI)

    Network services

    Ob ect re uest broker

    Object spaces

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    19/26

    Remote Method Invocation (RMI)

    Remote method invocation is the object-oriented.

    In this model, a process invokes the methods in anob ect, which ma reside in a remote host.

    As with RPC, arguments may be passed with the

    invocation.

    method1

    Process 1

    Process 2

    remote method invocation

    method2

    a remote object

    IT636 - Distributed Computing: Fundamentals and Applications

    The Remote Method Call Paradigm

  • 8/8/2019 Distributed Computing Paradigms L2

    20/26

    The Network Services Paradigm

    In this paradigm, service providers register themselves withdirector servers on a network. A rocess desirin aparticular service contacts the directory server at run time,and, if the service is available, will be provided a reference tothe service. Using the reference, the process interacts withthe service.

    This paradigm is essentially an extension of the remote

    method call aradigm. The difference is that service objectsare registered with a global directory service, allowing them tobe look up and accessed by service requestors on afederated network. Directory service

    Javas Jini

    service object

    IT636 - Distributed Computing: Fundamentals and ApplicationsService requestor

  • 8/8/2019 Distributed Computing Paradigms L2

    21/26

    Object Request broker Paradigm

    In the object broker paradigm , an application issuesre uests to an ob ect re uest broker ORB whichdirects the request to an appropriate object that providesthe desired service.

    invocation model in its support for remote object access.The difference is that the object request broker in this

    aradigm functions as a middleware which allows anapplication, as an object requestor, to potentially accessmultiple remote (or local) objects.

    The re uest broker ma also function as an mediator for

    heterogeneous objects, allowing interactions amongobjects implemented using different APIs and /or runningon different platforms. Ob ect

    IT636 - Distributed Computing: Fundamentals and Applications

    Requestorec

    Object Request Broker

  • 8/8/2019 Distributed Computing Paradigms L2

    22/26

    Object Request broker Paradigm - 2

    This paradigm is the basis of the Object

    Request Broker Architecture) architecture. Tool kits based on the architecture include:

    Inprises Visibroker

    Javas Interface Development Language (Java IDL) , ,

    Inc.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    23/26

    The Object Space Paradigm

    Perhaps the most abstract of the object-,

    assumes the existence of logical entities knownas object spaces.

    The participants of an application converge in acommon object space.

    object space, and requesters who subscribe tothe space access the entries. providerrequestor

    requestor

    read

    writeread

    IT636 - Distributed Computing: Fundamentals and ApplicationsAn Object Space

  • 8/8/2019 Distributed Computing Paradigms L2

    24/26

    The Object Space Paradigm - 2

    paradigms, the object space paradigm provides a virtualspace or meeting room among provides and requesters

    the detail involved in resource or object lookup neededin paradigms such as remote method invocation, object

    re uest broker, or network services.

    Current facilities based on this paradigm includeJavaSpaces

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    25/26

    Component-based Technologies

    Component-based technologies such as , , ,

    and Enterprise Java Bean are also based ondistributed-object paradigms, as componentsare essentially specialized, packaged objectsdesigned to interact with each other through

    standardized interfaces.

    In addition, application servers, popular forenterprise applications, are middleware

    ac es w c prov e access o o ec s orcomponents.

    IT636 - Distributed Computing: Fundamentals and Applications

  • 8/8/2019 Distributed Computing Paradigms L2

    26/26

    The Mobile Agent Paradigm

    A mobile agent is a transportable program or object.

    ,

    host. The agent travels from host to host according to an

    .

    At each stop, the agent accesses the necessary

    resources or services, and performs the necessary tasks.Host 2

    Host 1

    Host 3

    agent

    IT636 - Distributed Computing: Fundamentals and Applications

    Host 4