Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore E Lesson 5 635

E Lesson 5 635

Published by Teamlease Edtech Ltd (Amita Chitroda), 2020-10-24 03:48:19

Description: E Lesson 5 635

Search

Read the Text Version

IDOL Institute of Distance and Online Learning ENHANCE YOUR QUALIFICATION, ADVANCE YOUR CAREER.

M.C.A 2 All right are reserved with CU-IDOL PARALLEL AND DISTRIBUTED COMPUTING Course Code: MCA635 Semester: Third SLM Unit : 5 E-Lesson: 5 www.cuidol.in Unit-5 (MCA 635)

Communication 33 OBJECTIVES INTRODUCTION Student will be able to : In this unit we are going to learn about the Describe layered protocols communication models in Distributed Computing . Elaborate remote procedure call Under this unit you will also understand the Able to discuss Remote Object Invocation communication protocols. Explain message and stream oriented communication This Unit will also make us to understand Remote object invocation. www.cuidol.in Unit-5 (MCA 635) INASllTITriUgThEt aOrFeDreISsTeArNveCdE AwNitDh OCNUL-IIDNOE LLEARNING

TOPICS TO BE COVERED 4  Introduction  Layered Protocols  Remote Procedure Call  RMI (Remote Method Invocation)  Message Oriented Communication  Stream Oriented Communication www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

INTRODUCTION 5 • RPC uses the client-server model. The requesting program is a client and the service • providing program is the server. Like a regular or local procedure call, an RPC is a synchronous • operation requiring the requesting program to be suspended until the results of the remote • procedure are returned. However, the use of lightweight processes or threads that share the same • address space allows multiple RPCs to be performed concurrently. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Layered Protocols 6 • Network Protocols are a set of rules governing exchange of information in an easy, reliable • and secure way. Before we discuss the most common protocols used to transmit and receive data • over a network, we need to understand how a network is logically organized or designed. The • most popular model used to establish open communication between two systems is the Open • Systems Interface (OSI) model proposed by ISO. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

OSI Model 7 • OSI stands for Open System Interconnection is a reference model that describes how • information from a software application in one computer moves through a physical • medium to the software application in another computer. • OSI consists of seven layers, and each layer performs a particular network function. • OSI model was developed by the International Organization for Standardization (ISO) in • 1984, and it is now considered as an architectural model for the inter-computer communications. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

OSI Model 8 • OSI model divides the whole task into seven smaller and manageable tasks. Each layer is assigned a particular task. • Each layer is self-contained, so that task assigned to each layer can be performed independently. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Characteristics of OSI Model 9 • The OSI model is divided into two layers: upper layers and lower layers. • The upper layer of the OSI model mainly deals with the application related issues, and they are implemented only in the software. The application layer is closest to the end user. Both the end user and the application layer interact with the software applications. • An upper layer refers to the layer just above another layer. • The lower layer of the OSI model deals with the data transport issues. The data link layer • and the physical layer are implemented in hardware and software. The physical layer is the lowest layer of the OSI model and is closest to the physical medium. The physical layer is mainly responsible for placing the information on the physical medium. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Characteristics of OSI model 10 www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Functions of OSI Layers 11 • There are the seven OSI layers. Each layer has different functions. A list of seven layers are given below: • 1. Physical Layer • 2. Data-Link Layer • 3. Network Layer • 4. Transport Layer • 5. Session Layer • 6. Presentation Layer • 7. Application Layer www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Functions of OSI Layers 12 www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Remote Procedure Call 13 • RPC (Remote Procedure Call) helps in client communication with server. RPC is a process of calling a method from a class however, in this process only difference is that the class is located on a server but not actually the part of client program. • There is a problem with RPC, as JavaScript runs in web browser and the RPC call from browser it hangs browser until the response is received. • To avoid the browser hanging, GWT RPC call is made “Asynchronous” and the browser does not hang while waiting for the response. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

RPC Message Procedure 14 • When program statements that use RPC framework are compiled into an executable program,a stub is included in the compiled code that acts as the representative of the remote procedure code. • When the program is run and the procedure call is issued, the stub receives the request and forwards it to a client runtime program in the local computer. • The client runtime program has the knowledge of how to address the remote computer and server application and sends the message across the network that requests the remote procedure. • Similarly, the server includes a runtime program and stub that interface with the remote procedure itself. Response-request protocols are returned the same way.. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Remote Message 15 Invocation (RMI) • The RMI (Remote Method Invocation) is an API that provides a mechanism to create • distributed application in java. The RMI allows an object to invoke methods on an object running in another JVM. • The RMI provides remote communication between the applications using two objects stub and skeleton. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Understanding Stub and 16 Skeleton • RMI uses stub and skeleton object for communication with the remote object. • A remote object is an object whose method can be invoked from another JVM. Let's understand the stub and skeleton objects: www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Understanding Stub and Skeleton 17 • stub • The stub is an object, acts as a gateway for the client side. All the outgoing requests are routed through it. It resides at the client side and represents the remote object. When the caller invokes method on the stub object, it does the following tasks: 1. It initiates a connection with remote Virtual Machine (JVM), 2. It writes and transmits (marshals) the parameters to the remote Virtual Machine (JVM), 3. It waits for the result 4. It reads (unmarshals) the return value or exception, and 5. It finally, returns the value to the caller. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Understanding Stub and 18 Skeleton • skeleton • The skeleton is an object, acts as a gateway for the server side object. All the incoming • requests are routed through it. When the skeleton receives the incoming request, it does the • following tasks: • 1. It reads the parameter for the remote method • 2. It invokes the method on the actual remote object, and • 3. It writes and transmits (marshals) the result to the caller. • In the Java 2 SDK, an stub protocol was introduced that eliminates the need for skeletons. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Understanding Stub and 19 Skeleton www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Message Oriented 20 Communication • Synchronous versus asynchronous communications • Message-Queuing System • Message Brokers • Example: IBM MQSeries www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Synchronous Communication 21 • Some observations: Client/Server computing is generally based on a model of synchronous • communication: • Client and server have to be active at the time of communication • Client issues request and blocks until it receives reply • Drawbacks of synchronous communication: • Client cannot do any other work while waiting for reply • Failures have to be dealt with immediately (the client is waiting) • In many cases the model is simply not appropriate (mail, news) www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Asynchronous Communication: 22 Messaging • Message-oriented middleware: Aims at high-level asynchronous communication: • Processes send each other messages, which are queued • Sender need not wait for immediate reply, but can do other things • Middleware often ensures fault tolerance. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Communication/Message-Oriented 23 Communication www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Persistent vs. Transient 24 Communication • Persistent communication: A message is stored at a communication server as long as it takes to deliver it at the receiver. • Transient communication: A message is discarded by a communication server as soon as it cannot be delivered at the next server, or at the receiver. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Message Combinations 25 www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Stream-oriented Communication 26 1. Support for continuous media. 2. Streams in distributed systems 3. Stream management www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Stream 27 Definition A (continuous) data stream is a connection-oriented communication facility that supports isochronous data transmission. Some common stream characteristics: 1. Streams are unidirectional 2. There is generally a single source, and one or more sinks 3. Often, either the sink and/or source is a wrapper around hardware (e.g., camera, CDdevice, TV monitor) 4. Simple stream: a single flow of data, e.g., audio or video 5. Complex stream: multiple data flows, e.g., stereo audio or combination audio/video. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

28 www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

Stream Oriented Communication 29 • Continuous Media • Observation • All communication facilities discussed so far are essentially based on a discrete, that is timeindependent • exchange of information • Continuous Media • Characterized by the fact that values are time dependent: • (a) Audio • (b) Video • (c) Animations • (d) Sensor data (temperature, pressure, etc.) www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

30 www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

MULTIPLE CHOICE QUESTIONS 31 1. Remote Procedure Calls are used ____________. (a) for communication between two processes remotely different from each other on the same system (b) for communication between two processes on the same system (c) for communication between two processes on separate systems (d) none of the mentioned 2. To differentiate the many network services a system supports ____________ are used. (a) Variables (b) Sockets (c) Ports (d) Service names 3. RPC provides a(an) ____________ on the client side, a separate one for each remote procedure. (a) stub (b) identifier (c) name (d) process identifier Answers: 1. (c) 2. (c) 3.(a) All right are reserved with CU-IDOL www.cuidol.in Unit-5 (MCA 635)

MULTIPLE CHOICE QUESTIONS 32 4. What is stub? (a) transmits the message to the server where the server side stub receives the message and invokes procedure on the server side (b) packs the parameters into a form transmittable over the network (c) locates the port on the server (d) all of the mentioned 5. To resolve the problem of data representation on different systems RPCs define ____________. (a) machine dependent representation of data (b) machine representation of data (c) machine-independent representation of data (d) none of the mentioned 6. What is the full form of RMI? (a) Remote Memory Installation (b) Remote Memory Invocation (c) Remote Method Installation (d) Remote Method Invocation Answers: 4.(d) 5. (c ) 6.(d) www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

MULTIPLE CHOICE QUESTIONS 33 7. The remote method invocation ____________. (a) allows a process to invoke memory on a remote object (b) allows a thread to invoke a method on a remote object (c) allows a thread to invoke memory on a remote object (d) allows a process to invoke a method on a remote object 8. A process that is based on IPC mechanism which executes on different systems and can communicate with other processes using message based communication, is called ____________. (a) Local Procedure Call (b) Inter Process Communication (c) Remote Procedure Call (d) Remote Machine Invocation Answers: 7. (b) 8.(c ) www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

SUMMARY 34 •Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network's details. • A procedure call is also sometimes known as a function call or a subroutine call. •RPC uses the client-server model. •The RMI (Remote Method Invocation) is an API that provides a mechanism to create distributed application in java. •The RMI allows an object to invoke methods on an object running in another JVM. •The RMI provides remote communication between the applications using two objects stub and skeleton. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

FREQUENTLY ASKED QUESTIONS 35 Q1. What is remote procedure call (RPC)? Explain Client Stub in remote procedure call. Ans: Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network's details. For further details please refer to SLM unit 5. Q2. Describe Remote Method Invocation. Ans: The RMI (Remote Method Invocation) is an API that provides a mechanism to create distributed application in java. For further details please refer to SLM unit 5. Q3. Explain the difference between remote procedure call and local calls. Ans: For further details please refer to SLM unit 5. www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

REFERENCES 36  M.R. Bhujade, “Parallel Computing”, 2nd edition, New Age International Publishers 2009.  Andrew S. Tanenbaum and Maarten Van Steen, “Distributed Systems: Principles and Paradigms, 2nd edition, Pearson Education, Inc., 2007, ISBN: 0-13-239227-5.  George Coulouris, Jean Dollimore, Tim Kindberg, “Distributed Systems: Concepts and Design” (4th Edition), Addison Wesley/Pearson Education. Pradeep K Sinha, “Distributed Operating Systems: Concepts and design”, IEEE computer society press www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL

37 THANK YOU www.cuidol.in Unit-5 (MCA 635) All right are reserved with CU-IDOL


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook