3 Pages

lecture15

Course: CSE 30264, Fall 2009
School: Oakland University
Rating:
 
 
 
 
 

Word Count: 1195

Document Preview

Procedure Remote Call Outline Concept of RPC SunRPC Spring 2009 CSE30264 1 RPC Timeline Client Server Requ est Blocked Blocked Computing Reply Blocked Spring 2009 CSE30264 2 RPC There exists a way for processes to represent a task: procedure/function. main() func(12); func() return 5; func(12); func() main() return 5; Client Server Spring 2009 CSE30264 3 1 RPC main() stub(12); stub Request Reply...

Register Now

Unformatted Document Excerpt

Coursehero >> Michigan >> Oakland University >> CSE 30264

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Procedure Remote Call Outline Concept of RPC SunRPC Spring 2009 CSE30264 1 RPC Timeline Client Server Requ est Blocked Blocked Computing Reply Blocked Spring 2009 CSE30264 2 RPC There exists a way for processes to represent a task: procedure/function. main() func(12); func() return 5; func(12); func() main() return 5; Client Server Spring 2009 CSE30264 3 1 RPC main() stub(12); stub Request Reply return 5; Client skeleton func(12); func() return 5; Server Spring 2009 CSE30264 4 Stubs Stub is a function with the same interface as func(); it converts the function call into a network response and a network response into a function return. Skeleton converts requests into function calls and function returns into network replies. RPC System: used to generate both stub and skeleton (automatically). Spring 2009 CSE30264 5 SunRPC Widely used Remote Procedure Call system: Sun Microsystems, implemented in most Unix systems NFS distributed file system is based on Sun RPC Designed to call remote C procedures. Platform-independent. Spring 2009 CSE30264 6 2 SunRPC Header Format XID (transaction id) Server does not remember last XID it serviced Problem if client retransmits request while reply is in transit 0 XID MsgType = CALL (a) RPCVersion = 2 Program Version Procedure Credentials (variable) Verifier (variable) Data (b) 31 0 XID MsgType = REPLY Status = ACCEPTED Data 31 Spring 2009 CSE30264 7 RPC One computer can be server for multiple procedures: server may host several programs (identified by program number) each program may have several subsequent versions (version number) each version may contain one or more procedures (procedure number) Program numbers are 32-bit hexadecimal values (0x21212100) As user, you can choose any program number between 0x20000000 and 0x3FFFFFFF, but they have to be unique (not several programs with same number on same machine) Version and procedure numbers are integers (1,2,...) (prog, vers, proc) Spring 2009 CSE30264 8 Sun RPC Program Numbers FROM 0x00000000 0x20000000 0x40000000 0x60000000 0x80000000 0xa0000000 0xc0000000 0xe0000000 TO 0x1fffffff 0x3fffffff 0x5fffffff 0x7fffffff 0x9fffffff 0xbfffffff 0xdfffffff 0xffffffff VALUES ASSIGNED BY Sun Microsystems, Inc. System manager at a users site Transient (temporary) Reserved Reserved Reserved Reserved Reserved Spring 2009 CSE30264 9 3 Sun RPC Program Numbers NAME portmap rstatd rusersd nfs ypserv mountd dbxd ypbind ... Spring 2009 NUMBER 100000 100001 100002 100003 100004 100005 100006 100007 DESCRIPTION port mapper rstat, rup, perfmeter remote users network file system yp (NIS) mount, showmount DMXprog (debugger) NIS binder CSE30264 10 Writing an RPC Program client.c add_clnt.c add.h add.x add_xdr.c add_scv.c serverproc.c add_xdr.o add_svc.o serverproc.o server client.o add_clnt.o client You obtain a client & server You write these files Spring 2009 rpcgen generates these files You compile every C file 11 CSE30264 Example Step 1: Write a specification file (add.x) struct add_in { /* Arguments of procedure */ long arg1; long arg2; }; typedef long add_out; /* Return value */ program ADD_PROG { version ADD_VERS { add_out ADD_PROC(add_in) = 1 /* Procedure# = 1 */ } = 1; /* Version# = 1 */ } = 0x3434000; /* Program# = 0x3434000 */ Spring 2009 CSE30264 12 4 Example Contains specifications of: add_in (arguments) typedef add_out (return values) program ADD_PROG (0x3434000) 1 version ADD_VERS (1) 1 procedure ADD_PROC (1) Your procedures can only take ONE input argument and return ONE output return value (use structures for more): more readable (structure entries should have meaningful names) Spring 2009 CSE30264 13 Example Step 2: generate stubs rpcgen add.x add.h contains declarations: #define ADD_PROG 0x34340000 /* Program nb */ #define ADD_VERS 1 /* Version nb */ #define ADD_PROC 1 /* Procedure nb */ add_out * add_proc_1 (add_in *, CLIENT *); add_out * add_proc_1_svc (add_in *, struct svc_req *); add_proc_1 is the stub (called client) by add_proc_1_svc is the actual procedure that you will write and run at the server Spring 2009 CSE30264 14 Example add_clnt.c: implementation of add_proc_1 add_svc.c: contains program which calls your procedure add_proc_1_svc when request received add_xdr.c: marshall/unmarshall routines Spring 2009 CSE30264 15 5 Example Step 3: write server procedure: serverproc.c #include add.h add_out *add_proc_1_svc(add_in *in, struct svc_req *rqstp) { static add_out out; out = in->arg1 + in->arg2; return(&out); } rqstp contains some information about the requester (IP address, etc.) Spring 2009 CSE30264 16 Example Step 4: compile the server Need to compile together your procedure, the (generated) server program, the (generated) marshall/unmarshall procedures and the nsl library (contains the RPC runtime). $ gcc -c serverproc.c $ gcc -c add_svc.c $ gcc -c add_xdr.c $ gcc -o server serverproc.o add_svc.o add_xdr.o -lnsl To start the server: ./server Spring 2009 CSE30264 17 Example Step 5: write a client program client.c #include add.h int main(int argc, char **argv) { CLIENT *cl; add_in in; add_out *out; if (argc!=4) {printf(Usage:...\n); return 1;} cl = clnt_create(argv[1], ADD_PROG, ADD_VERS, tcp); in.arg1 = atol(argv[2]); in.arg2 = atol(argv[3]); out = add_proc_1(&in, cl); if (out == NULL) {printf(Error: %s\n, clnt_sperror(cl, argv[1])); } else { printf{We received the result: %ld\n, * out); } clnt_destroy(cl); return 0; } Spring 2009 CSE30264 18 6 Example Create a client structure with clnt_create #include <rpc/rpc.h> CLIENT *clnt_create(char *host, u_long prog, u_long vers, char *proto); host: name of server machine prog, vers: program/version number proto: transport protocol (tcp or udp) You can call add_proc_1 to send the RPC When finished, destroy client structure (client structure can be used multiple times without being destroyed and recreated). Spring 2009 CSE30264 19 Example Step 6: compile the client $ gcc -c client.c $ gcc -c add_clnt.c $ gcc -c add_xdr.c $ gcc -o client client.o add_clnt.o add_xdr.o -lnsl Spring 2009 CSE30264 20 Example Step 7: try it out start your server: ./server send a request: ./client machine.cse.nd.edu 8 34 We received the result: 42 Spring 2009 CSE30264 21 7 Mutual Exclusion Sun RPC: at most one remote procedure in a remote program can be invoked at a given time. Automatic mutual exclusion among...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Cal Poly - CS - 623
Problem Definition Lecture 11: Data Synchronization Techniques for Mobile Devices Dimitre Trendafilov 2003 Modified by T. Suel 2004 CS623, 4/20/2004Given two versions of a data set on different machines, say an outdated and a curren
Cal Poly - CS - 614
CS614COMPUTER ARCHITECTURE IISYLLABUSFALL 20061. Professor : Haldun HadimiogluRoom : 114 LC (718) 260-3101 Fax : (718) 260-3609 haldun@photon.poly.edu http:/cis.poly.edu/haldun2. Prerequisite : CS613 Computer Architecture I. Operating syste
Oakland University - MGT - 240
FunctionRelative AddressingMGT 240 Excel Fact Sheet DescriptionExampleAbsolute Cell Addressing Mixed Cell Addressing Conditional formatting =MIN(range) =MAX(range) =AVERAGE(range) =COUNT(range) =COUNTA(range) =COUNTIF(range, criteria) =SUM(ran
St. Leo - ACC - 202
Chapter 6 Cost Allocation and Activity-Based CostingE4. Star might want to encourage department managers to evaluate security services. When security costs are allocated, departments have an incentive to voice concerns about the cost of security ser
Creighton - JAD - 62470
Lecture Notes III Chapter 16 Fiscal and Monetary PolicyPrinciples of Macroeconomics-If we are in a recession, we know the economy will eventually return to the natural rate of output on its own. But why wait? In the long-run we are all dead! Jo
Creighton - NGR - 39382
THL 201: READING THE OLD TESTAMENT CHECKLIST Instructions: In an effort to enhance maximum communication and understanding between students and professor, please work through each of the following items on your own, indicating your completion of, or
Creighton - PHA - 402
Due Wednesday 04/03 at 12 NoonThis is a formal letter responding to a physician's request for specific information. Each team must investigate the question posed. You may wish to assign various reference sources to each team member for starters. The
Cal Poly - CS - 6903
Lecture 4: Symmetric Key EncryptionCS6903: Modern Cryptography Spring 2009 Nitesh SaxenaLets use the board, please take notes2/20/2009Lecture 1 - Introduction21DES Data Encryption StandardEncrypts by series of substitution and transpos
Creighton - ATS - 572
ATS 572 HW20 Name: _ 1. Virga is falling out of the base of a cumulus cloud. At the base of the cloud, assume that there is initially no vertical velocity, but the evaporation of the virga will result in a downdraft.
Creighton - HW - 572
ATS 572 HW20 Name: _ 1. Virga is falling out of the base of a cumulus cloud. At the base of the cloud, assume that there is initially no vertical velocity, but the evaporation of the virga will result in a downdraft.
St. Leo - ACC - 302
EXERCISES1721. Wages Expense. Employees Income Taxes Payable ($28,348 0.17). FICA Taxes Payable ($28,348 0.0765). Union Dues Payable.. Cash. To record weekly payroll. Payroll Tax Expense. FICA Taxes Payable.. State Unemployment Taxes Payable ($28,
St. Leo - SLU - 101
Election FOCUSApril 14, 2004U.S. Department of StateISSUE 1 NO 8Inside This Issue: Overview: Women Voters in the 2004 Election . . . . page 1 Campaign Highlight: Interview with Kay J. Maxwell . . . . . . . . page 3 The History of the Women
Ball State - MATH - 165
Calculus 1Spring Semester 2009Course MATHS 165 Section 3 Instructor Dr. Hanspeter FischerMT RF 2:002:50 pmRB 118Contact Office: RB 426 Phone: 285-8680 E-mail: fischer@math.bsu.edu (please use MATHS 165 as subject line) http:/www.cs.bsu.edu/~
Ball State - MATH - 445
Chapter 2Notation. Recall that F(R3 ) denotes the set of all dierentiable real-valued functions f : R3 R and V(R3 ) denotes the set of all dierentiable vector elds on R3 . 2.1 7. This is what you are supposed to show here: given u Tp (Rn ) with |u
East Los Angeles College - ST - 903
ST 903I. D. No.0127212 0300045 0402292 0403867 0408413 0417187 0431334 0432581 0558153 0558443 0633983 0650399 0721287 0721695 0724799 0735108 0750485 0750837 0752047 0752105 0752186 0752569 0752675 0752716 0752780 0752816 0752873 0752902 0753158 0
Oakland University - AME - 20241
AME 21241 Laboratory 3: Beam Bending and Strain Transformation IntroductionBeams are structural elements used to carry loads transverse to their length. They carry loads by bending. They are used in many engineering designs such as buildings, cars,
St. Leo - ACC - 302
EXERCISES1220. During the construction period, the expenditures will be charged as follows:Land Building Land ImprovementsPurchase. $390,000 Land survey. 5,200 Fees for search of title for land. 600 Building permit. 3,500 Temporary quarters for c
St. Leo - ACC - 302
EXERCISES1623. Type of Difference (a) Temporary (b) Temporary (c) Nondeductible (d) Temporary (e) Temporary (f) Nontaxable 1624. Pretax financial income. $ 3,100,000 Permanent differences: Add: Life insurance premium. $ 95,000 Less: Municipal bond i
St. Leo - ACC - 202
Chapter 4 Cost-Volume-Profit Analysis SolutionsEXERCISESE1. With high fixed costs, a business is quite risky. This follows because if sales fail to meet expectations, the company may have a large loss. Paul may be able to make rent a variable expe
Creighton - ATS - 572
ATS 572 HW20 Name: _ 1. Virga is falling out of the base of a cumulus cloud. At the base of the cloud, assume that there is initially no vertical velocity, but the evaporation of the virga will result in a downdraft.
Creighton - HW - 572
ATS 572 HW20 Name: _ 1. Virga is falling out of the base of a cumulus cloud. At the base of the cloud, assume that there is initially no vertical velocity, but the evaporation of the virga will result in a downdraft.
Cal Poly - MA - 614
Karush-Kuhn-Tucker Theorem We seek first order conditions for local optimality for the following formulation of nonlinear programming:(1)Minimize f ( x) Subject to h( x) = 0 g ( x) 0where x is a vector in En, h maps into Ek, and g maps into Em
Allan Hancock College - HSC - 3542
Syllabus topic: Friends, recreation and pastimesSample task 4 This is a Part B task. (10 marks) A new shopping centre has just opened near your house. You have spent the day there with a friend. Write a diary entry about your day. Write approximat
Allan Hancock College - HSC - 3539
Syllabus topic: Family life, home and neighbourhoodSample task 4 This is a Part B task. (10 marks) You are home staying in Japan. Write an email to your Japanese teacher in Australia about your life in Japan. Write approximately 200-250ji in Japan
Oakland University - MATH - 60440
Math 60440 Midterm Exam March 20, 2009 The Honor Code is in effect for this examination. All work is to be your own. You may use any material in the handouts on the web site. You may consult any books or internet material you can find. The only
Creighton - CHM - 203
1 B. A Linear Combination of Atomic Orbitals: H2 Mathematically, atomic orbitals are combined through something called a linear combination. I promised wed do this without math, so lets try and get a feel for what this is conceptually. Consider the s
Creighton - JJM - 33444
Natural Law, Natural Rhetoric, and Rhetorical PerversionsJeffrey J. MaciejewskiAbstract. Observers, including the Catholic Church, have consistently demonstrated a keen ability to identify instances of rhetoric, such as advertising, that are dista
Creighton - JJM - 33444
Natural Law as an Ethic for Postmodern RhetoricJeffrey MaciejewskiVOLUME 3 Natural Law as an Ethic for Postmodern RhetoricJeffrey Maciejewski, Creighton University, United States of America
Creighton - JJM - 33444
Justice as a Nexus of Natural Law and RhetoricJeffrey J. MaciejewskiIntroduction Only recently have we begun to build a bridge connecting natural law philosophy and rhetoric.1 At the outset one might ask: Why do they need to be connected in the rs
Cal Poly - CS - 2204
CS2204 DIGITAL LOGIC &amp; STATE MACHINE DESIGNDIGITAL SYSTEM DESIGN EXAMPLESPRING 2009A Vending Machine ControllerWe will design a vending machine controller as a digital system by using the finite state machine (FSM) technique. The design is done
Oakland University - MATH - 60440
LONG EXACT SEQUENCESMATH 60440 LAURENCE R. TAYLORSPRING, 2009Contents 1. 2. 3. 4. 5. 6. 7. The sequence for a subspace Some ubiquitous definitions Long exact sequence of homology groups Naturality Homotopy invariance An example Homological algebr
Oakland University - MATH - 60440
SOME HOMOLOGICAL ALGEBRAMATH 60440 LAURENCE R. TAYLORSPRING, 2009Contents 1. The tensor product 2. Chain complexes and the tensor product 3. Derived functors of the tensor product 4. Some algebra of chain complexes 4.1. The algebraic mapping cone
Oakland University - MATH - 60440
THEORETICAL CALCULATIONSMATH 60440 LAURENCE R. TAYLORSPRING, 2009Contents 1. An excision theorem 2. The Mayer-Vietoris sequence 1 21. An excision theorem We begin with a lemma. Lemma 1.1. Let (X, A) be a pair of spaces and suppose B A. Let U =
Ball State - CS - 689
Goal of Research To derive conclusions from a body of data and discover what was previously unknown tools are needed to facilitate this goal there are many kinds of tools because of the varied nature of the types of research, but there is a genera
Indiana State - CS - 477
Databases IlluminatedChapter 13 Databases and the InternetDatabases and the WWW WWW is a loosely organized information resource Many websites use static linked HTML files can become inconsistent and outdated Many organizations provide dynamic
Indiana State - FIN - 370
Chapter 1 An Overview of Financial ManagementANSWERS TO BEGINNING-OF-CHAPTER QUESTIONS1-1The primary goal is shareholder wealth maximization, which translates to stock price maximization. That, in turn, means maximizing the PV of future free cas
Indiana State - ASTRO - 360
MeteoritesThis meteorite, a basalt lava rock nearly indistinguishable from many Earth rocks, provided the first strong proof that meteorites could come from Mars. Originally weighing nearly 8 kilograms (17.6 pounds), it was collected in 1979 in the
Indiana State - PH - 101
MotionMeasuring Motion Speed Average Speed = distance covered / time takenv = d/t metric unit of speed: m/s English unit of speed: ft/s Constant speed: moving equal distances in equal time periods an object covering 5 feet each second has
Ball State - HIST - 405
James Thurston HIST 405 Dr. Stephan December 4, 2006 CRITICAL REVIEW: LARSON'S INTERNAL IMPROVEMENT Although much has been written about American internal improvements of the early nineteenth century, historian John Lauritz Larson's Internal Improvem
Indiana State - ASTRO - 360
Sheet1 1. a 2. c 3. a 4. e 5. a 6. b 7. b 8. b 9. c 10. c 11. b 12. a 13. d 14. a 15. c 16. e 17. b 18. e 19. b 20. c 21. a 22. a 23. a 24. d 25. c 26. d 27. c 28. d 29. a 30. b 31. b 32. e 33. e 34. d 35. a 36. b 37. b 38. b 39. a 40. cPage 1
Oakland University - CBE - 40443
UNIVERSITY OF NOTRE DAMEC H E M I C A L A N D B I O M OL E C U L A R E N G I N E E R I N G 40 4 4 3 S E P A R A TI O N P R OC E S S E S HOMEWORK 2 ASSIGNED: SEPTEMBER 2, 2005 DUE: SEPTEMBER 9, 2005Please follow the homework solution guidelines lis
Oakland University - CBE - 40443
Indiana State - CHEM - 371
Indiana State - CHEM - 421
Chem 421L/521L Experiment 4EXPERIMENT 4 THE DETERMINATION OF TRACE ELEMENTS IN HAIR BY INDUCTIVELY COUPLED PLASMA MASS SPECTROMETRYAdditional Resources: Principles of Instrumental Analysis 6th edition, by D. A. Skoog, F. J. Holler, S. R. Crouch
Creighton - CHM - 446
C. The Probability of Observing a State: Pj Let us return to the problem at hand. We are trying to find the probability of observing a given quantum state (say, Ej) in a system selected from a canonical ensemble. To state the same goal another way, w
Creighton - CHM - 446
CHM 446 Statistical Mechanics. Exam II. Thursday, Sep. 30, 2004. There are five questions on the exam, each worth 20 points. Choose FOUR and complete them for a total of 80 points. (If you do more than four, I will choose one at random to not grade.)
Creighton - CHM - 446
VI. The Relation to the Combined Law of Thermodynamics To bring nonmechanical variables like temperature and entropy into the discussion, we combine the above considerations with thermodynamics. By virtue of the first postulate, we can associate our
Creighton - CHM - 446
CHM 446: Statistical Mechanics. Exam IV. Tuesday, Nov. 23, 2004. There are five questions on the exam, each worth 20 points. Choose FOUR and complete them for a total of 80 points. (If you do more than four, I will choose one at random to not grade.)
Creighton - CHM - 446
CHM 446: Statistical Mechanics. Exam V. Thursday, Dec. 16, 2004. There are five questions on the exam, each worth 20 points. Choose FOUR and complete them for a total of 80 points. (If you do more than four, I will choose one at random to not grade.)
Creighton - BIO - 481
EXPLOITATION interactionsbiophagy - feeding on living organisms predation - prey is captured and consumed parasitism - &quot;host&quot; is fed upon, but usually not killed parasitoid - insect parasite that lays eggs on host; larvae feed on and eventually kill
Creighton - BIO - 341
Echinacea angustifolia DC - purple cone flowerThe coneflowers are in the aster family (Asteraceae), having the same large central disk with numerous tiny flowers arrayed in a pleasing symmetrical pattern. The big difference is that the disk swells
Concordia Canada - COMP - 6411
COMP 6411 Comparative Programming Languages Winter 2009Instructor: Office: Email: Tel: Fax: Course: Lectures: Office Hours:Peter Grogono EV 3.111 grogono@cse.concordia.ca 848 2424 ext 3012 848 2830 COMP 6411/4 Section EE Wednesdays, 17:45 20:15
Oakland University - CSE - 30151
Deterministic push-down automataWhen we talk about deterministic push-down automata (DPDA), our definition will be different from that of finite automata, but the idea remains the same: at any point of execution we shouldn't have more than one choic
Oakland University - CSE - 571
Chapter 22: CommunicationPhil SnowbergerChapter 22: Communication p.1/17Overview Speech acts Parts of communication Syntactic analysis (Parsing) Augmented grammars Semantic interpretation Ambiguity and disambiguationChapter 22: Communic
Oakland University - CSE - 40833
Fundamentals8/31/07Why parallel algorithms? There are many computationally intensive problems we want to solve in a reasonable amount of time Current sequential computing is limited by hardware and often insufficientBasics The running time of
Cal Poly - MA - 2132
Polytechnic UniversityMA 2132 MIDTERMPrint Name: Signature: ID #: Instructor/Section:April 7, 2006Directions: You have 90 minutes to answer the following questions. You must show all your work as neatly and clearly as possible and indicate the
Cal Poly - MA - 2132
Polytechnic UniversityMA 2132 MIDTERMPrint Name: Signature: ID #: Instructor/Section: Andy TsangJanuary 9th, 2007Directions: You have 90 minutes to answer the following questions. You must show all your work as neatly and clearly as possible an
Cal Poly - MA - 2132
Polytechnic University MA 2132 Worksheet 2Print Name: Signature: ID #: Instructor: Problem 1 2 3 4 5 6 7 Total Possible 15 15 15 15 15 15 10 100 PointsDate:Your signature: (1) Find the general solution of the equation. If an initial condition is
Oakland University - CBE - 40485
Oakland University - FIN - 34600
SAMPLE EXAM ANSWERS Finance 34600 Investment TheoryMULTIPLE CHOICE: 1. B top down 2. A 9.03% 3. B price-weighted index 4. D ignored 5. D 25% 6. D seasoned offer 7. A $3,100 The sale proceeds equal $11,500. You place an additional $6,325 in
Wilfrid Laurier - ENCM - 369
ENCM 369 Winter 2006 Mid-Session Test Problem 3 Answers Part a. To encode a jal instruction, the assembler would need the address of the target instruction, but that address wont be known until the linker combines all the text segments from the objec