SlideShare a Scribd company logo
1 of 27
Mrs S G Bavachkar ATS,SBGI Miraj
Communication
1
Mrs S G Bavachkar ATS,SBGI Miraj
Introduction
 Remote procedure Call (RPC)
Hiding most of the intricacies of message passing
client-server applications
2
Remote Procedure Calls (RPC)
• Avoid explicit message exchange between processes
• Basic idea is to allow a process on a machine to call
procedures on a remote machine
– Make a remote procedure possibly look like a local one
Mrs S G Bavachkar ATS,SBGI
Miraj
3
Conventional Procedure Call
Figure 4-5. (a) Parameter passing in a local procedure call: the
stack before the call to read. (b) The stack while the called
procedure is active.
a) Parameter passing in a local procedure call: the
stack before the call to read(fd,buf,bytes)
b) The stack while the called procedure is active
Mrs S G Bavachkar ATS,SBGI Miraj
4
Mrs S G Bavachkar ATS,SBGI Miraj
Client and Server Stubs
Figure 4-6. Principle of RPC between a client and server program.
5
Remote Procedure Calls
Mrs S G Bavachkar ATS,SBGI Miraj
Remote procedure call (RPC) abstracts procedure calls
between processes on networked systems.
❒ Stubs – client-side proxy for the actual procedure on the
server.
❒ The client-side stub locates the server and Marshalls the
parameters.
❒ The server-side stub receives this message, unpacks the
marshalled parameters, and performs the procedure on the
server.
6
Mrs S G Bavachkar ATS,SBGI Miraj
Passing Value Parameters (1)
Figure 4-7. The steps involved in a doing a
remote computation through RPC. 7
Passing Value Parameters
a) Original message on the Pentium (little-endian)
b) The message after receipt on the SPARC (big-endian)
Note: the little numbers in boxes indicate the address of each byte
Mrs S G Bavachkar ATS,SBGI
Miraj
8
Passing Value Parameters
a) Original message on the Pentium (little-endian)
b) The message after receipt on the SPARC (big-endian)
c) The message after being inverted (integer 5, string: “LLIJ”)
Note: the little numbers in boxes indicate the address of each byte
Mrs S G Bavachkar ATS,SBGI
Miraj
9
Passing reference parameters
– What is Call By Value and Call By Refernce?
– Example: call foo(int, int * ) or read(fd, buf, nbytes)
– Call by copy/restore
– The dreaded “pointer problem”
• Linked list
• Complex graph
a
b
a’
b’
foo(a, &b ) Call foo(a, &b’ )
Copy value a and contents of loc b
into a’ and loc b’
Return Copy contents of loc b’ into b
Machine A
Machine B
Mrs S G Bavachkar ATS,SBGI
Miraj
10
Marshalling
Values must cross the network
Machine formats differ
– Integer byte order
• Little-endian or big-endian
– Floating point format
• IEEE 754 or not
Marshalling − transferring data structure used in remote
procedure call from one address space to another.
Define a “network format”, for example following XDR
(eXternal Data Representation) standard
http://www.ietf.org/rfc/rfc1832.txt
Mrs S G Bavachkar ATS,SBGI
Miraj
11
RPC: The basic mechanism
Client
routines
Client stub
RPC
runtime
Network
routines
Source: R. Stevens, Unix Network Programming (IPC)
Vol 2, 1998
Server
routines
Server
stub
RPC
runtime
Network
routines
Process
kernel
Process
kernel
Client process Server process 1. Client calls a local procedure on the
client stub
2. The client stub acts as a proxy and
marshalls the call and the args.
3. The client stub send this to the
remote system (via TCP/UDP)
4. The server stub unmarshalls the call
and args from the client
5. The server stub calls the actual
procedure on the server
6. The server stub marshalls the
reply and sends it back to the client
1
2
3
4
5
6
Mrs S G Bavachkar ATS,SBGI
Miraj
12
Mrs S G Bavachkar ATS,SBGI Miraj
Remote Procedure Calls (1)
A remote procedure call occurs in the following
steps:
1. The client procedure calls the client stub in the normal
way.
2. The client stub builds a message and calls the local
operating system.
3. The client’s OS sends the message to the remote OS.
4. The remote OS gives the message to the server stub.
5. The server stub unpacks the parameters and calls the
server.
Continued …
13
Mrs S G Bavachkar ATS,SBGI Miraj
Remote Procedure Calls (2)
A remote procedure call occurs in the following
steps (continued):
6. The server does the work and returns the result to the
stub.
7. The server stub packs it in a message and calls its local
OS.
8. The server’s OS sends the message to the client’s OS.
9. The client’s OS gives the message to the client stub.
10. The stub unpacks the result and returns to the client.
14
Asynchronous RPC
As in conventional procedure calls, when a client calls a remote
procedure, the client will block until a reply is returned. This strict
request-reply behaviour is unnecessary when there is no result to
return, and only leads to blocking the client while it could have
proceeded and have done useful work just after requesting the
remote procedure to be called.
RPC systems may provide facilities for what are called
asynchronous RPCs, by which a client immediately continues after
issuing the RPC request. With asynchronous RPCs, the server
immediately sends a reply back to the client the moment the RPC
request is received, after which it calls the requested procedure. The
reply acts as an acknowledgement to the client that the server is
going to process the RPC. The client will continue without further
blocking as soon as it has received the server’s acknowledgement
Mrs S G Bavachkar ATS,SBGI
Miraj
15
Mrs S G Bavachkar ATS,SBGI Miraj
Traditional RPC (1)
Figure 4-10. (a) The interaction between client and
server in a traditional RPC. 16
Mrs S G Bavachkar ATS,SBGI Miraj
Asynchronous RPC (2)
Figure 4-10. (b) The interaction using asynchronous RPC.
17
Mrs S G Bavachkar ATS,SBGI Miraj
• communication between the client and server through
two asynchronous RPCs
• The client first calls the server to hand over a list of host
names that should be looked up, and continues when the
server has acknowledged the receipt of that list. The
second call is done by the server, who calls the client to
hand over the addresses it found. Combining two
asynchronous RPCs is sometimes also referred to as a
deferred synchronous RPC
18
Mrs S G Bavachkar ATS,SBGI Miraj
Asynchronous RPC (3)
Figure 4-11. A client and server interacting through
two asynchronous RPCs. 19
Mrs S G Bavachkar ATS,SBGI Miraj
DCE RPC
 Distributed Computing Environment (DCE) developed by
Open Software Foundation (OSF)
 DCE is a true middleware system in that it is designed to
execute as a layer of abstraction between existing (network)
operating systems and distributed applications. Initially
designed for UNIX
 There are a number of services that form part of DCE itself.
The distributed file service is a worldwide file system that
provides a transparent way of accessing any file in the
system in the same way.
 The directory service is used to keep track of the location of
all resources in the system. These resources include
machines, printers, servers, data, and much more.
20
Mrs S G Bavachkar ATS,SBGI Miraj
 The security service allows resources of all
kinds to be protected, so access can be
restricted to authorized persons
 The distributed time service is a service that
attempts to keep clocks on the different
machines globally synchronized
 Goals of DCE RPC
 First and foremost, the RPC system makes it
possible for a client to access a remote service
by simply calling a local procedure
 To start with, the RPC system can automatically
locate the correct server, and subsequently set
up the communication between client and server
software (generally called binding).
21
Mrs S G Bavachkar ATS,SBGI Miraj
 Finally, the RPC system can automatically handle data type
conversions between the client and the server, even if they run
on different architectures and have a different byte ordering.
Writing a Client and a Server
22
Mrs S G Bavachkar ATS,SBGI Miraj
Writing a Client
and a Server (1)
Figure 4-12. The steps in writing a client and
a server in DCE RPC. 23
Mrs S G Bavachkar ATS,SBGI Miraj
Writing a Client and a Server (2)
 The header file contains the unique identifier, type
definitions, constant definitions, and function prototypes. It
should be included (using #include) in both the client and
server code. The client stub contains the actual
procedures that the client program will call.
 The client stub also handles unpacking the reply and
returning values to the client.
 The server stub contains the procedures called by the
runtime system on the server machine when an incoming
message arrives. These, in turn, call the actual server
procedures that do the work.
 The next step is for the application writer to write the client
and server code. Both of these are then compiled, as are
the two stub procedures 24
Mrs S G Bavachkar ATS,SBGI Miraj
Binding a Client to a Server (1)
• Registration of a server makes it possible for
a client to locate the server and bind to it.
• Server location is done in two steps:
1. Locate the server’s machine.
2. Locate the server on that machine.
25
Mrs S G Bavachkar ATS,SBGI Miraj
Binding Client to Server (DCE RPC)
 Server asks operating system for an end point (port)
 Register the endpoint with DCE daemon that records in the end
table
 Server register with directory server with its network address and
its name (program name)
 Now Client pass the name to directory server and find the server
network address
 Client goes to DCE daemon (well know port) on that machine
and ask for look up the end point (port) of the server in its end point
table
 In DCE, a table of (server, endpoint)-pairs is maintained on each
server machine by a process called the DCE daemon.
 The DCE daemon records this information (including which
protocols the server speaks) in the endpoint table for future use.
26
Mrs S G Bavachkar ATS,SBGI Miraj
Binding a Client to a Server (2)
Figure 4-13. Client-to-server binding in DCE.
27

More Related Content

What's hot

Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Peter R. Egli
 
System models in distributed system
System models in distributed systemSystem models in distributed system
System models in distributed systemishapadhy
 
Routing in Multicast Communication
Routing in Multicast CommunicationRouting in Multicast Communication
Routing in Multicast CommunicationSahil Jain
 
Unicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting NewUnicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting Newtechbed
 
Domain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTPDomain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTPsaurav kumar
 
OSI and TCPIP Model
OSI and TCPIP ModelOSI and TCPIP Model
OSI and TCPIP ModelTapan Khilar
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed SystemAshish KC
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systemsmridul mishra
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniquesvinitha96
 
Election algorithms
Election algorithmsElection algorithms
Election algorithmsAnkush Kumar
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
File replication
File replicationFile replication
File replicationKlawal13
 
Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03Ali Habeeb
 
MACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMaitree Patel
 

What's hot (20)

Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)
 
System models in distributed system
System models in distributed systemSystem models in distributed system
System models in distributed system
 
Routing in Multicast Communication
Routing in Multicast CommunicationRouting in Multicast Communication
Routing in Multicast Communication
 
Unicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting NewUnicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting New
 
Domain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTPDomain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTP
 
OSI and TCPIP Model
OSI and TCPIP ModelOSI and TCPIP Model
OSI and TCPIP Model
 
Transport layer
Transport layerTransport layer
Transport layer
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
 
DHCP basics
DHCP basicsDHCP basics
DHCP basics
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
 
Stream oriented communication
Stream oriented communicationStream oriented communication
Stream oriented communication
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Key management
Key managementKey management
Key management
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniques
 
Election algorithms
Election algorithmsElection algorithms
Election algorithms
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
File replication
File replicationFile replication
File replication
 
Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03Adhoc and Sensor Networks - Chapter 03
Adhoc and Sensor Networks - Chapter 03
 
JINI Technology
JINI TechnologyJINI Technology
JINI Technology
 
MACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block Ciphers
 

Viewers also liked

remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure callsAshish Kumar
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure CallAbdelrahman Al-Ogail
 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)Sri Prasanna
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure callsimnomus
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computingSatya P. Joshi
 
Diretrizes de RCP 2015
Diretrizes de RCP 2015Diretrizes de RCP 2015
Diretrizes de RCP 2015Fatima Tavares
 
мбоу сош № 78 программа пришкольного лагеря аврора осень
мбоу сош № 78 программа пришкольного лагеря аврора осеньмбоу сош № 78 программа пришкольного лагеря аврора осень
мбоу сош № 78 программа пришкольного лагеря аврора осеньЕлизавета Гришина
 
Uni barter Deck: 3DS
Uni barter Deck: 3DSUni barter Deck: 3DS
Uni barter Deck: 3DSPrateek Diwan
 
What is technology ?
What is technology ?What is technology ?
What is technology ?Shimul Haldar
 
Business Idea Competition: Concept Innovate
Business Idea Competition: Concept InnovateBusiness Idea Competition: Concept Innovate
Business Idea Competition: Concept InnovatePrateek Diwan
 
2016 SAE Convergence IBM
2016 SAE Convergence IBM2016 SAE Convergence IBM
2016 SAE Convergence IBMKal Gyimesi
 

Viewers also liked (20)

remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computing
 
RMI
RMIRMI
RMI
 
RPC
RPCRPC
RPC
 
Diretrizes de RCP 2015
Diretrizes de RCP 2015Diretrizes de RCP 2015
Diretrizes de RCP 2015
 
мбоу сош № 78 программа пришкольного лагеря аврора осень
мбоу сош № 78 программа пришкольного лагеря аврора осеньмбоу сош № 78 программа пришкольного лагеря аврора осень
мбоу сош № 78 программа пришкольного лагеря аврора осень
 
Latam Business School English
Latam Business School EnglishLatam Business School English
Latam Business School English
 
Gestores de contenidos
Gestores de contenidosGestores de contenidos
Gestores de contenidos
 
SMART GRID(a) (3)
SMART GRID(a) (3)SMART GRID(a) (3)
SMART GRID(a) (3)
 
certific-pdf
certific-pdfcertific-pdf
certific-pdf
 
Uni barter Deck: 3DS
Uni barter Deck: 3DSUni barter Deck: 3DS
Uni barter Deck: 3DS
 
Got grit1 presentation
Got grit1 presentationGot grit1 presentation
Got grit1 presentation
 
Shaun Falconer CV
Shaun Falconer CVShaun Falconer CV
Shaun Falconer CV
 
What is technology ?
What is technology ?What is technology ?
What is technology ?
 
Business Idea Competition: Concept Innovate
Business Idea Competition: Concept InnovateBusiness Idea Competition: Concept Innovate
Business Idea Competition: Concept Innovate
 
AMP.K-4
AMP.K-4AMP.K-4
AMP.K-4
 
2016 SAE Convergence IBM
2016 SAE Convergence IBM2016 SAE Convergence IBM
2016 SAE Convergence IBM
 

Similar to Rpc (20)

Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Rpc
RpcRpc
Rpc
 
Lecture9
Lecture9Lecture9
Lecture9
 
MSB-Remote procedure call
MSB-Remote procedure callMSB-Remote procedure call
MSB-Remote procedure call
 
5. Distributed Operating Systems
5. Distributed Operating Systems5. Distributed Operating Systems
5. Distributed Operating Systems
 
Remote procedure call
Remote procedure callRemote procedure call
Remote procedure call
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Distributes objects and Rmi
Distributes objects and RmiDistributes objects and Rmi
Distributes objects and Rmi
 
Cs 704 d rpc
Cs 704 d rpcCs 704 d rpc
Cs 704 d rpc
 
Rpc
RpcRpc
Rpc
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
 
Dos(rpc)avishek130650107020
Dos(rpc)avishek130650107020Dos(rpc)avishek130650107020
Dos(rpc)avishek130650107020
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
 
Rpc
RpcRpc
Rpc
 
Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxByte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 
Improved secure address resolution protocol
Improved secure address resolution protocolImproved secure address resolution protocol
Improved secure address resolution protocol
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 

Recently uploaded

Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Rpc

  • 1. Mrs S G Bavachkar ATS,SBGI Miraj Communication 1
  • 2. Mrs S G Bavachkar ATS,SBGI Miraj Introduction  Remote procedure Call (RPC) Hiding most of the intricacies of message passing client-server applications 2
  • 3. Remote Procedure Calls (RPC) • Avoid explicit message exchange between processes • Basic idea is to allow a process on a machine to call procedures on a remote machine – Make a remote procedure possibly look like a local one Mrs S G Bavachkar ATS,SBGI Miraj 3
  • 4. Conventional Procedure Call Figure 4-5. (a) Parameter passing in a local procedure call: the stack before the call to read. (b) The stack while the called procedure is active. a) Parameter passing in a local procedure call: the stack before the call to read(fd,buf,bytes) b) The stack while the called procedure is active Mrs S G Bavachkar ATS,SBGI Miraj 4
  • 5. Mrs S G Bavachkar ATS,SBGI Miraj Client and Server Stubs Figure 4-6. Principle of RPC between a client and server program. 5
  • 6. Remote Procedure Calls Mrs S G Bavachkar ATS,SBGI Miraj Remote procedure call (RPC) abstracts procedure calls between processes on networked systems. ❒ Stubs – client-side proxy for the actual procedure on the server. ❒ The client-side stub locates the server and Marshalls the parameters. ❒ The server-side stub receives this message, unpacks the marshalled parameters, and performs the procedure on the server. 6
  • 7. Mrs S G Bavachkar ATS,SBGI Miraj Passing Value Parameters (1) Figure 4-7. The steps involved in a doing a remote computation through RPC. 7
  • 8. Passing Value Parameters a) Original message on the Pentium (little-endian) b) The message after receipt on the SPARC (big-endian) Note: the little numbers in boxes indicate the address of each byte Mrs S G Bavachkar ATS,SBGI Miraj 8
  • 9. Passing Value Parameters a) Original message on the Pentium (little-endian) b) The message after receipt on the SPARC (big-endian) c) The message after being inverted (integer 5, string: “LLIJ”) Note: the little numbers in boxes indicate the address of each byte Mrs S G Bavachkar ATS,SBGI Miraj 9
  • 10. Passing reference parameters – What is Call By Value and Call By Refernce? – Example: call foo(int, int * ) or read(fd, buf, nbytes) – Call by copy/restore – The dreaded “pointer problem” • Linked list • Complex graph a b a’ b’ foo(a, &b ) Call foo(a, &b’ ) Copy value a and contents of loc b into a’ and loc b’ Return Copy contents of loc b’ into b Machine A Machine B Mrs S G Bavachkar ATS,SBGI Miraj 10
  • 11. Marshalling Values must cross the network Machine formats differ – Integer byte order • Little-endian or big-endian – Floating point format • IEEE 754 or not Marshalling − transferring data structure used in remote procedure call from one address space to another. Define a “network format”, for example following XDR (eXternal Data Representation) standard http://www.ietf.org/rfc/rfc1832.txt Mrs S G Bavachkar ATS,SBGI Miraj 11
  • 12. RPC: The basic mechanism Client routines Client stub RPC runtime Network routines Source: R. Stevens, Unix Network Programming (IPC) Vol 2, 1998 Server routines Server stub RPC runtime Network routines Process kernel Process kernel Client process Server process 1. Client calls a local procedure on the client stub 2. The client stub acts as a proxy and marshalls the call and the args. 3. The client stub send this to the remote system (via TCP/UDP) 4. The server stub unmarshalls the call and args from the client 5. The server stub calls the actual procedure on the server 6. The server stub marshalls the reply and sends it back to the client 1 2 3 4 5 6 Mrs S G Bavachkar ATS,SBGI Miraj 12
  • 13. Mrs S G Bavachkar ATS,SBGI Miraj Remote Procedure Calls (1) A remote procedure call occurs in the following steps: 1. The client procedure calls the client stub in the normal way. 2. The client stub builds a message and calls the local operating system. 3. The client’s OS sends the message to the remote OS. 4. The remote OS gives the message to the server stub. 5. The server stub unpacks the parameters and calls the server. Continued … 13
  • 14. Mrs S G Bavachkar ATS,SBGI Miraj Remote Procedure Calls (2) A remote procedure call occurs in the following steps (continued): 6. The server does the work and returns the result to the stub. 7. The server stub packs it in a message and calls its local OS. 8. The server’s OS sends the message to the client’s OS. 9. The client’s OS gives the message to the client stub. 10. The stub unpacks the result and returns to the client. 14
  • 15. Asynchronous RPC As in conventional procedure calls, when a client calls a remote procedure, the client will block until a reply is returned. This strict request-reply behaviour is unnecessary when there is no result to return, and only leads to blocking the client while it could have proceeded and have done useful work just after requesting the remote procedure to be called. RPC systems may provide facilities for what are called asynchronous RPCs, by which a client immediately continues after issuing the RPC request. With asynchronous RPCs, the server immediately sends a reply back to the client the moment the RPC request is received, after which it calls the requested procedure. The reply acts as an acknowledgement to the client that the server is going to process the RPC. The client will continue without further blocking as soon as it has received the server’s acknowledgement Mrs S G Bavachkar ATS,SBGI Miraj 15
  • 16. Mrs S G Bavachkar ATS,SBGI Miraj Traditional RPC (1) Figure 4-10. (a) The interaction between client and server in a traditional RPC. 16
  • 17. Mrs S G Bavachkar ATS,SBGI Miraj Asynchronous RPC (2) Figure 4-10. (b) The interaction using asynchronous RPC. 17
  • 18. Mrs S G Bavachkar ATS,SBGI Miraj • communication between the client and server through two asynchronous RPCs • The client first calls the server to hand over a list of host names that should be looked up, and continues when the server has acknowledged the receipt of that list. The second call is done by the server, who calls the client to hand over the addresses it found. Combining two asynchronous RPCs is sometimes also referred to as a deferred synchronous RPC 18
  • 19. Mrs S G Bavachkar ATS,SBGI Miraj Asynchronous RPC (3) Figure 4-11. A client and server interacting through two asynchronous RPCs. 19
  • 20. Mrs S G Bavachkar ATS,SBGI Miraj DCE RPC  Distributed Computing Environment (DCE) developed by Open Software Foundation (OSF)  DCE is a true middleware system in that it is designed to execute as a layer of abstraction between existing (network) operating systems and distributed applications. Initially designed for UNIX  There are a number of services that form part of DCE itself. The distributed file service is a worldwide file system that provides a transparent way of accessing any file in the system in the same way.  The directory service is used to keep track of the location of all resources in the system. These resources include machines, printers, servers, data, and much more. 20
  • 21. Mrs S G Bavachkar ATS,SBGI Miraj  The security service allows resources of all kinds to be protected, so access can be restricted to authorized persons  The distributed time service is a service that attempts to keep clocks on the different machines globally synchronized  Goals of DCE RPC  First and foremost, the RPC system makes it possible for a client to access a remote service by simply calling a local procedure  To start with, the RPC system can automatically locate the correct server, and subsequently set up the communication between client and server software (generally called binding). 21
  • 22. Mrs S G Bavachkar ATS,SBGI Miraj  Finally, the RPC system can automatically handle data type conversions between the client and the server, even if they run on different architectures and have a different byte ordering. Writing a Client and a Server 22
  • 23. Mrs S G Bavachkar ATS,SBGI Miraj Writing a Client and a Server (1) Figure 4-12. The steps in writing a client and a server in DCE RPC. 23
  • 24. Mrs S G Bavachkar ATS,SBGI Miraj Writing a Client and a Server (2)  The header file contains the unique identifier, type definitions, constant definitions, and function prototypes. It should be included (using #include) in both the client and server code. The client stub contains the actual procedures that the client program will call.  The client stub also handles unpacking the reply and returning values to the client.  The server stub contains the procedures called by the runtime system on the server machine when an incoming message arrives. These, in turn, call the actual server procedures that do the work.  The next step is for the application writer to write the client and server code. Both of these are then compiled, as are the two stub procedures 24
  • 25. Mrs S G Bavachkar ATS,SBGI Miraj Binding a Client to a Server (1) • Registration of a server makes it possible for a client to locate the server and bind to it. • Server location is done in two steps: 1. Locate the server’s machine. 2. Locate the server on that machine. 25
  • 26. Mrs S G Bavachkar ATS,SBGI Miraj Binding Client to Server (DCE RPC)  Server asks operating system for an end point (port)  Register the endpoint with DCE daemon that records in the end table  Server register with directory server with its network address and its name (program name)  Now Client pass the name to directory server and find the server network address  Client goes to DCE daemon (well know port) on that machine and ask for look up the end point (port) of the server in its end point table  In DCE, a table of (server, endpoint)-pairs is maintained on each server machine by a process called the DCE daemon.  The DCE daemon records this information (including which protocols the server speaks) in the endpoint table for future use. 26
  • 27. Mrs S G Bavachkar ATS,SBGI Miraj Binding a Client to a Server (2) Figure 4-13. Client-to-server binding in DCE. 27