remote procedure calls

19
CSIT 220 (Blum) 1 Remote Procedure Calls Based on Chapter 38 in Computer Networks and Internets, Comer

Upload: allene

Post on 07-Jan-2016

44 views

Category:

Documents


0 download

DESCRIPTION

Remote Procedure Calls. Based on Chapter 38 in Computer Networks and Internets, Comer. Procedure. A procedure (a.k.a. a method, a subroutine or a function) is a part of a program that performs a well-defined task. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Remote Procedure Calls

CSIT 220 (Blum) 1

Remote Procedure Calls

Based on Chapter 38 in Computer Networks and Internets, Comer

Page 2: Remote Procedure Calls

CSIT 220 (Blum) 2

Procedure

• A procedure (a.k.a. a method, a subroutine or a function) is a part of a program that performs a well-defined task.

• Procedures are used to break a complex problem down into more manageable pieces (divide and conquer).

• Also a well-chosen procedure may be used repeatedly (re-use).

Page 3: Remote Procedure Calls

CSIT 220 (Blum) 3

Procedural Control Flow

• When the action defined by a procedure is required, it is called.

• The “control” of the program is passed to the procedure.

• Typically, while the procedure is performing its task, the program waits. When the procedure is done, control is passed back to whatever portion of the program called it.

Page 4: Remote Procedure Calls

CSIT 220 (Blum) 4

Procedural call tree (Fig. 38.1)

Page 5: Remote Procedure Calls

CSIT 220 (Blum) 5

Remote Procedural Call

• The idea of a remote procedural call (RPC) is that

1. If an application is “distributed” then the procedure called may be executed on another machine.

2. To whatever extent possible, the details of connecting to the other machine should be “hidden” from the programmer.

Page 6: Remote Procedure Calls

CSIT 220 (Blum) 6

Distributed procedural call tree (Fig. 38.2)

Page 7: Remote Procedure Calls

CSIT 220 (Blum) 7

Synchronous • When the procedure is local, control is passed to

it. When the procedure is remote something similar must happen.

• The calling of the remote procedure starts a communication session. The response (return value) is returned in the same session.

• The interaction between the two programs is said to be synchronous when the calling routine is suspended or blocked until it receives an answer.

• If the calling procedure does not have to wait, it’s called asynchronous.

Page 8: Remote Procedure Calls

CSIT 220 (Blum) 8

RPC

• By using RPC, an application programmer could avoid the tedious programming details required to make a connection between the calling program (client) and the remotely executed subroutine (server) and could focus on the application almost as if it were executed entirely locally.

Page 9: Remote Procedure Calls

CSIT 220 (Blum) 9

Stub• The connection in a RPC is facilitated by using stubs. • Suppose one had a purely local version of the program,

one replaces the local procedure with a stub, which serves as its substitute.

• When the stub receives the control, it turns control over to another program (client runtime program) that takes responsibility for connecting to the remote procedure.

• When completed, any return values and control are passed back to the stub and ultimately the program that called the stub.

Page 10: Remote Procedure Calls

CSIT 220 (Blum) 10

Stubs (Fig 38.3)

Page 11: Remote Procedure Calls

CSIT 220 (Blum) 11

Server Stubs and Communication Proxy

• The remote procedure also has a stub that stands in for the calling program.

• Like the client, the server has a runtime program that manages its side of the stub-to-stub interaction.

• The calls to handle the pass and the response are developed by using a communication proxy.– A proxy is the set of instructions needed to handle the

communication requirements.

Page 12: Remote Procedure Calls

CSIT 220 (Blum) 12

Middleware• Middleware is the code that allows two

applications to communicate.• It can be used to extend an application to a

distributed system.• Middleware programming has shifted from the

procedural paradigm to the object-oriented paradigm. The design uses objects and the set of operations which are performed on the objects (called the methods).

Page 13: Remote Procedure Calls

CSIT 220 (Blum) 13

.NET

• The latest Microsoft platform • The ambition of .NET is to seamlessly mesh

applications and the internet– “The network is the computer”

• .NET depends on four Internet standards: – HTTP – XML – SOAP – UDDI

Page 14: Remote Procedure Calls

CSIT 220 (Blum) 14

.NET

• There are four main principles of .NET from the perspective of the user: – It erases the boundaries between applications and the

Internet.

– Software will be rented as a hosted service over the Internet instead of purchased on a store shelf.

– Users will have access to their information on the Internet from any device, anytime, anywhere.

– There will be new ways to interact with application data, such as speech and handwriting recognition.

Page 15: Remote Procedure Calls

CSIT 220 (Blum) 15

SOAP

• Simple Object Access Protocol (SOAP) is a way for a program running in one kind of operating system (such as Windows 2000) to communicate with a program in the same or another kind of an operating system (such as Linux) by using the World Wide Web's Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML) as the mechanisms for information exchange.

Page 16: Remote Procedure Calls

CSIT 220 (Blum) 16

SOAP • SOAP specifies how to encode an HTTP header and

an XML file so that a program in one computer can call a program in another computer and pass it information. It also specifies how the called program can respond.

• An advantage of SOAP is that program calls are much more likely to get through firewall servers that screen out requests other than those for known applications (through the designated port mechanism). – HTTP requests are usually allowed through firewalls.

Page 17: Remote Procedure Calls

CSIT 220 (Blum) 17

UDDI

• Universal Description, Discovery, and Integration is an XML-based registry for businesses worldwide to list themselves on the Internet.

• Its ultimate goal is to make for efficient online transactions by enabling companies to find one another on the Web and make their systems interoperable for e-commerce. UDDI is often compared to a telephone book's white, yellow, and green pages. – A resource for brokers

Page 18: Remote Procedure Calls

CSIT 220 (Blum) 18

UDDI Listings

• White pages are for when you know the name of what you want.

• Yellow pages are for when you know the type of service you want but don’t know the name.

• Green pages provide details about code: its purpose, its interface, its cost, etc.

Page 19: Remote Procedure Calls

CSIT 220 (Blum) 19

Other References

• http://www.webopedia.com

• http://www.whatis.com