DOC PREVIEW
UCSD CSE 120 - Remote Procedure Call And Network File System

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1CSE 120CSE 120Principles of Operating Principles of Operating SystemsSystemsSystemsSystemsWinter 2007Winter 2007Lecture 14: Remote Procedure CallLecture 14: Remote Procedure CallAnd Network File SystemAnd Network File SystemAnd Network File SystemAnd Network File SystemKeith Marzullo and Geoffrey M. VoelkerKeith Marzullo and Geoffrey M. VoelkerWhy is RPC Interesting?Why is RPC Interesting?z Remote Procedure Call (RPC) is the most common means for remote communicationz It is used both by operating systems and applications NFS is implemented as a set of RPCs DCOM, CORBA, Java RMI, etc., are all basically just RPCz Someday (soon?) you will most likely have to write an application that uses remote communication (or you already have)Y ill t lik l f f RPC f th t t© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 2You will most likely use some form of RPC for that remote communication So it’s good to know how all this RPC stuff works» More “debunking the magic”2Clients and ServersClients and Serversz The prevalent model for structuring distributed computation is the client/server paradigmcomputation is the client/server paradigmz A server is a program (or collection of programs) that provide a service (file server, name service, etc.) The server may exist on one or more nodes Often the node is called the server, too, which is confusingz A client is a program that uses the serviceA client firstbindsto the server (locates it and establishes a© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 3A client first bindsto the server (locates it and establishes a connection to it) A client then sends requests, with data, to perform actions, and the servers sends responses, also with dataMessagesMessagesz Initially with network programming, programmers hand-codedmessages to send requests and responsescoded messages to send requests and responsesz Hand-coding messages gets tiresome Need to worry about message formats Have to pack and unpack data from messages Servers have to decode and dispatch messages to handlers Messages are often asynchronouszMessages are not a very natural programming model© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 4zMessages are not a very natural programming model Could encapsulate messaging into a library Just invoke library routines to send a message Which leads us to RPC…3Procedure CallsProcedure Callsz Procedure calls are a more natural way to communicateEvery language supports themEvery language supports them Semantics are well-defined and understood Natural for programmers to usez Idea: Have servers export a set of procedures that can be called by client programs Similar to module interfaces, class definitions, etc.zClients just do a procedure call as it they were directly© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 5zClients just do a procedure call as it they were directly linked with the server Under the covers, the procedure call is converted into a message exchange with the serverRemote Procedure CallsRemote Procedure Callsz So, we would like to use procedure call as a model for distributed (remote) communicationdistributed (remote) communicationz Lots of issues How do we make this invisible to the programmer? What are the semantics of parameter passing? How do we bind (locate, connect to) servers? How do we support heterogeneity (OS, arch, language)?How do we make it perform well?© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 6How do we make it perform well?4RPC ModelRPC Modelz A server defines the server’s interface using an interface definition language(IDL)gg() The IDL specifies the names, parameters, and types for all client-callable server proceduresz A stub compiler reads the IDL and produces two stub procedures for each server procedure (client and server) The server programmer implements the server procedures and links them with the server-side stubs© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 7The client programmer implements the client program and links it with the client-side stubs The stubs are responsible for managing all details of the remote communication between client and serverRPC StubsRPC Stubsz A client-side stub is a procedure that looks to the client as if it were a callable server procedureas if it were a callable server procedurez A server-side stub looks to the server as if a client called itz The client program thinks it is calling the server In fact, it’s calling the client stubz The server program thinks it is called by the clientI f t it’ ll d b th t b© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 8In fact, it’s called by the server stubz The stubs send messages to each other to make the RPC happen “transparently”5RPC ExampleRPC ExampleServer Interface:int Add(int x, int y);Client Program:…sum = server->Add(3,4);…Server Program:int Add(int x, int, y) {return x + y;}© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 9z If the server were just a library, then Add would just be a procedure callRPC Example: CallRPC Example: CallClient Program:sum = server->Add(3,4);Server Program:int Add(int x, int, y) {}su se edd(3, );tdd(t, t,y){}Client Stub:Int Add(int x, int y) {Alloc message buffer;Mark as “Add” call;Store x, y into buffer;Send message;Server Stub:Add_Stub(Message) {Remove x, y from bufferr = Add(x, y);}© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 10Send message;}RPC Runtime:Send message to server;RPC Runtime:Receive message;Dispatch, call Add_Stub;6RPC Example: ReturnRPC Example: ReturnClient Program:sum = server->Add(3,4);Server Program:int Add(int x, int, y) {}sum serverAdd(3,4);int Add(int x, int, y) {}Client Stub:Int Add(int x, int y) {Create, send message;Remove r from reply;return r;}Server Stub:Add_Stub(Message) {Remove x, y from bufferr = Add(x, y);Store r in buffer;}© 2007 Keith Marzullo and Geoffrey M. VoelkerCSE 120 – Lecture 14 – Remote Procedure Call 11}RPC Runtime:Return reply to stub;}RPC Runtime:Send reply to client;RPC MarshallingRPC Marshallingz


View Full Document

UCSD CSE 120 - Remote Procedure Call And Network File System

Documents in this Course
Threads

Threads

14 pages

Deadlocks

Deadlocks

19 pages

Processes

Processes

14 pages

Paging

Paging

13 pages

Processes

Processes

18 pages

Threads

Threads

29 pages

Security

Security

16 pages

Paging

Paging

13 pages

Processes

Processes

32 pages

Lecture 2

Lecture 2

13 pages

Paging

Paging

8 pages

Threads

Threads

14 pages

Paging

Paging

13 pages

Paging

Paging

26 pages

Paging

Paging

13 pages

Lecture

Lecture

13 pages

Processes

Processes

14 pages

Paging

Paging

13 pages

Security

Security

17 pages

Threads

Threads

15 pages

Processes

Processes

34 pages

Structure

Structure

10 pages

Lecture 3

Lecture 3

13 pages

Lecture 1

Lecture 1

28 pages

Threads

Threads

15 pages

Paging

Paging

30 pages

Load more
Download Remote Procedure Call And Network File System
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Remote Procedure Call And Network File System and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Remote Procedure Call And Network File System 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?