SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
© Peter R. Egli 2015
1/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
Peter R. Egli
INDIGOO.COM
OVERVIEW OF ONC RPC, AN
RPC TECHNOLOGY FOR UNIX BASED SYSTEMS
ONC RPCOPEN NETWORK COMPUTING
REMOTE PROCEDURE CALL
© Peter R. Egli 2015
2/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
Contents
1. What is RPC?
2. Local versus remote procedure call
3. RPC service daemon on the remote machine (portmapper)
4. RPC system components
5. RPC parameter passing
6. Network transport protocol for RPC
7. RPC interface description and code generation
8. RPC procedure call semantics
9. RPC remote procedure location and discovery
10. RPC interaction
© Peter R. Egli 2015
3/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
1. What is RPC?
RPC is an extension of conventional procedure calls:
RPC allows a client application to call procedures in a different address space on the same or
on a remote machine (= transfer of control and data to a different address space and process).
RPC as middleware for traditional client – server programming:
RPC extends sockets with remote procedure call semantics. RPC allows an application to call
a remote procedure just as it were a local procedure (location transparency).
Different flavors of RPC:
1. SUN-RPC (= ONC RPC):
ONC RPC = Open Network Computing RPC. Initially developed by Sun Microsystems.
First widely adopted RPC implementation.
Standards: RFC4506 XDR (Data presentation), RFC1057 RPC protocol specification.
2. DCE/RPC:
Distributed Computing Environment RPC by OSF (Open Software Foundation).
Not widely adopted by the IT industry.
3. MS RPC:
Microsoft’s extension of DCE/RPC.
© Peter R. Egli 2015
4/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
2. Local versus remote procedure call
Local procedure call:
Remote procedure call:
Client:
Calling
procedure
Server:
Called
procedure
Arguments
Results
The calling procedure executes the
called procedure in its own address
space and process.
Client:
Calling
procedure
Server:
Called
procedure
Client stub Server stub
Network
(TCP/IP)
Request
message
Request
message
Reply
message
Reply
message
Results
Client and server run as 2 separate processes
(on the same or on different machines).
ResultsCall with
arguments
Call with
arguments
Stubs allow communication between client and
server. These stubs map the local procedure call
to a series of network RPC function calls.
© Peter R. Egli 2015
5/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
3. RPC service daemon on the remote machine (portmapper)
How is the remote procedure called?
The remote procedure request message is received by a process (service daemon called
portmapper). The daemon dispatches the call to the appropriate server stub.
The service daemon listens on incoming requests.
callrpc() with
request
Dispatch service
procedure
Execute
procedure
Assemble reply
return() reply
Client is
blocked
Client
Service
daemon
Server
procedure
© Peter R. Egli 2015
6/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
4. RPC system components
Main RPC components:
The client stub is a proxy object that passes calls to the server stub. The message modules
pack and unpack the marshaled arguments in UDP packets.
Client:
Calling
procedure
Server:
Called
procedure
Client stub Server stub
Network
(TCP/IP)
Request
message
Request
message
Reply
message
Reply
message
Results Results
Message module
Portmapper with
Message module
Results Results
Client stub: Pack arguments (marshal)
Server Stub: Unpack arguments (unmarshal)
Message modules: Send & receive RPC messages.
The portmapper runs as a daemon process (listener
process).
Server daemon
Call with
arguments
Call with
arguments
Call with
arguments
Call with
arguments
© Peter R. Egli 2015
7/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
5. RPC parameter passing (1/2)
Local procedures:
The call of a local procedure allows pass-by-value and pass-by-reference.
Call by value example (plain old C):
int sqrt(int arg0)
{
return arg0 * arg0;
}
...
int number = 9;
int result;
result = sqrt(number);
Call-by-reference example (plain old C):
struct Arguments {
int number0;
int number1;
} args;
struct Arguments args;
...
int product(Arguments* args)
{
return args->number0 * args->number1;
}
...
int result = product(&args);
© Peter R. Egli 2015
8/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
5. RPC parameter passing (2/2)
Remote procedures / RPC:
RPC only allows pass-by-value because pointers are meaningless in the address space of the
remote process.
XDR (the RPC Interface Description Language, see below) allows declaring pointers to data
structures. But RPC does actually copy-in/copy-out parameter passing (passes full copies of
referenced data structures to the remote procedure).
Example:
XDR file with pointer argument:
/* msg.x: Remote msg printing protocol */
struct PrintArgs {
char* name;
int number;
};
program MSGPROG {
version PRINTMSGVERS {
int PRINTMSG(PrintArgs*) = 1;
} = 1;
} = 0x20000001;
Client application:
struct PrintArgs printArgs;
int* result;
result = printmsg_1(&printArgs, clnt);
© Peter R. Egli 2015
9/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
6. Network transport protocol for RPC
RPC uses the underlying network just as any other network application.
RPC may use connection oriented (TCP, SCTP) or connectionless transport protocols (UDP).
Usually RPC uses UDP because UDP (connectionless transport service) better supports the
RPC protocol because:
1. RPC interactions are generally short so connections are not really required.
2. Servers generally serve a large number of clients and maintaining state information on
connections means additional overhead for the server.
3. LANs are generally reliable so the reliable service of TCP is not needed.
Client:
Calling
procedure
Client stub
result = printmsg_1(&printArgs, clnt);
Message module
Socket
UDP
IP
Marshal parameters
Request packet
Create request message
RPC Request message
R
R+H
IPUR+H
Server:
Called
procedure
Server stub
Message module
Socket
UDP
IP
R
R+H
© Peter R. Egli 2015
10/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
Program number
Procedure declaration (procedure number 1)
Version of (remote) program (=1 in the example)
Name of the (remote) program
7. RPC interface description and code generation (1/2)
Interface definition:
The server procedure(s) are defined as an interface in a formal language (XDR) and then
compiled to source code (plain old C).
Elements of XDR (External Data Representation):
1. Interface definition language (IDL).
XDR defines procedure signatures (procedure names, parameters with types) and
user defined types.
2. Data encoding standard (how to encode data for transmission over the network).
XDR defines how to pack simple types like int and string into a byte stream.
Example XDR file:
/* msg.x: Remote msg printing protocol */
program MESSAGEPROG
{
version PRINTMESSAGEVERS
{
int PRINTMESSAGE(string) = 1;
} = 1;
} = 0x20000001;
© Peter R. Egli 2015
11/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
7. RPC interface description and code generation (2/2)
Code generation from XDR file:
The RPC compiler (ONC RPC: rpcgen) generates all the necessary C source files from the XDR
interface specification file (header files, stubs).
XDR
file
RPC
compiler
C
compiler +
linker
Client
appl.
Client
stub
Server
proc.
Server
stub
Client
executable
C
compiler +
linker
Server
executable
rpcgen
Shared
header
files
© Peter R. Egli 2015
12/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
8. RPC procedure call semantics (1/4)
Potential problems with RPC calls:
a. The request message may be lost (in the network, in the message module).
b. The reply message may be lost.
c. The server or client may crash during an RPC call.
In these cases, it is not clear to the client if the remote procedure has been called or not.
RPC incorporates different strategies for handling these situations.
Client:
Calling
procedure
Server:
Called
procedure
Client stub Server stub
Network
(UDP/IP)
Message module Message module
R
R
© Peter R. Egli 2015
13/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
8. RPC procedure call semantics (2/4)
RPC message delivery strategies:
1. Retry request message:
The client retransmits the request message until either a reply is received or the server is
assumed to have failed (timeout).
2. Duplicate filtering:
The server filters out duplicate request messages when retransmissions are used.
3. Retransmission of replies:
The server maintains a history of reply messages.
In case of a lost reply message, the server retransmit the reply without re-executing the server
operation.
© Peter R. Egli 2015
14/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
8. RPC procedure call semantics (3/4)
RPC supports 3 different “call semantics” that define the level of guarantee of requests:
1. maybe call semantics.
2. at-least-once call semantics.
3. at-most-once call semantics.
RPC mechanisms usually include timeouts to prevent clients waiting indefinitely for reply
messages.
1. maybe call semantics:
• No retransmission of request messages.
• Client is not certain whether the procedure has been executed or not.
• No fault-tolerance measures (RPC call may or may not be successful).
• Generally not acceptable (low level of guarantee).
2. at-least-once call semantics:
• The message module repeatedly resends request messages after timeouts occur until it
either gets a reply message or a maximum number of retries have been made.
• No duplicate request message filtering.
• The remote procedure is called at least once if the server is not down.
• The client does not know how many times the remote procedure has been called. This could
produce undesirable results (e.g., money transfer) unless the called procedure is
“idempotent” (= repeatable with the same effect as a single call).
© Peter R. Egli 2015
15/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
8. RPC procedure call semantics (4/4)
3. at-most-once call semantics:
• Retransmission of request messages.
• Duplicate request message filtering.
• If the server does not crash and the client receives the result of a call, then the procedure
has been called exactly once. Otherwise, an exception is reported and the procedure will
have been called either once or not at all.
• Works for both idempotent and non-idempotent operations.
• More complex support required due to the need for request message filtering and for
keeping track of replies.
Comparison of call semantics:
Delivery guarantees
RPC call semantics Retry request
message
Duplicate filtering Re-execute
procedure or
retransmit reply
Maybe No Not applicable Not applicable
At-least-once Yes No Re-execute
procedure
At-most-once Yes Yes Retransmit reply
© Peter R. Egli 2015
16/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
9. RPC remote procedure location and discovery (1/2)
How does the client find the IP address and port of the host hosting the remote procedure?
In RPC, binding refers to determining the location and identity of the called procedure.
The binder (RPCBIND, formerly portmapper) is a daemon that:
- is a registry for registering server procedures on the server,
- is a lookup service for the client to get the address of the server procedure host,
- runs on the host and listens on a well-known address (port number 111).
Client
Client
stub
Binder
Message
module
RPC
call
bind
LookUp
LookUp response
Message
module
Server
stub
Server
Register procedure
ACK
send
RPC request
call
RPC response
return
HostClient
© Peter R. Egli 2015
17/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
9. RPC remote procedure location and discovery (2/2)
Static versus dynamic binding:
Static binding:
• Binds the host address of a server into the client program at compilation time.
• Undesirable because the client and server programs are compiled separately and often at
different times and the server may be moved from one host to another.
Dynamic binding:
• Dynamic lookup of the server address (see previous slide).
• Allows servers to register and remove their exporting services.
• Allows clients to lookup the named service.
Binding API:
PROCEDURE Register (serviceName:String; serverPort:Port; version:integer)
Binder records the service name and server port of a service in its table, together with a
version number.
PROCEDURE Withdraw (serviceName:String; serverPort:Port; version:integer)
Binder removes the service from its table.
PROCEDURE LookUp (serviceName:String; version:integer): Port
The binder looks up the named service and returns its address (or set of addresses) if the
version number agrees with the one stored in its table.
© Peter R. Egli 2015
18/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
10. RPC interaction (1/3)
RPC allows synchronous and asynchronous interaction.
Synchronous RPC:
In synchronous RPC, the client is blocked until it received the server reply.
Synchronous RPC is the default mode of interaction.
Easier to program (no synchronization required on client).
Client is blocked during the entire RPC operation (waste of execution time, performance
negatively affected).
Client
Server
procedure
callrpc() with
request
Execute
procedure
return() reply
Client is
blocked
© Peter R. Egli 2015
19/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
10. RPC interaction (2/3)
Asynchronous RPC:
If a remote procedure does not require a response, the client can send a request to the server
without waiting for a reply and continue with its work.
The client is not blocked, can continue with its work.
Only possible for remote procedures that do not return a result (e.g. send a log message to a
log server).
Client
Server
procedure
callrpc() with
request
Server executes the
request asynchronously
return()
Client continues
with its work
© Peter R. Egli 2015
20/20
Rev. 2.00
SUN / ONC RPC (Remote Procedure Call) indigoo.com
10. RPC interaction (3/3)
Deferred synchronous RPC:
With deferred synchronous RPC, the client sends a request to the server and only waits for the
acceptance of the request. The server executes the request and sends an answer back to the
client.
This mode is useful in cases where the server procedure requires lengthy computations.
Client not blocked, can continue with its work.
More complicated synchronization required on the client.
Client
Server
procedure
callrpc() with
request
Server executes the
request asynchronously
Accept request
Client waits for
acceptance of
request and
then continues
with its work
Return result(s)Client is
interrupted,
processes the
result
ACK
Each pair of call and reply
message is matched by a
transaction ID (XID field).

Contenu connexe

Tendances

distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar
 
Congestion on computer network
Congestion on computer networkCongestion on computer network
Congestion on computer network
Disi Dc
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
GowriLatha1
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
sumitjain2013
 

Tendances (20)

Cyclic Redundancy Check
Cyclic Redundancy CheckCyclic Redundancy Check
Cyclic Redundancy Check
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 
System models in distributed system
System models in distributed systemSystem models in distributed system
System models in distributed system
 
Middleware
MiddlewareMiddleware
Middleware
 
Tcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport LayerTcp Udp Icmp And The Transport Layer
Tcp Udp Icmp And The Transport Layer
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Congestion on computer network
Congestion on computer networkCongestion on computer network
Congestion on computer network
 
GO BACK N PROTOCOL
GO BACK N PROTOCOLGO BACK N PROTOCOL
GO BACK N PROTOCOL
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
 
Coda file system
Coda file systemCoda file system
Coda file system
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systems
 
Directory and discovery services
Directory and discovery servicesDirectory and discovery services
Directory and discovery services
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Key management and distribution
Key management and distributionKey management and distribution
Key management and distribution
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Tcp
TcpTcp
Tcp
 
message passing
 message passing message passing
message passing
 
WEP
WEPWEP
WEP
 
Distance Vector Routing
Distance Vector RoutingDistance Vector Routing
Distance Vector Routing
 

En vedette (7)

Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
 
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
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
 
RPC
RPCRPC
RPC
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 

Similaire à Sun RPC (Remote Procedure Call)

Distributes objects and Rmi
Distributes objects and RmiDistributes objects and Rmi
Distributes objects and Rmi
Mayank Jain
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
sanjoysanyal
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
elliando dias
 

Similaire à Sun RPC (Remote Procedure Call) (20)

Lecture9
Lecture9Lecture9
Lecture9
 
Distributes objects and Rmi
Distributes objects and RmiDistributes objects and Rmi
Distributes objects and Rmi
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
 
Dos(rpc)avishek130650107020
Dos(rpc)avishek130650107020Dos(rpc)avishek130650107020
Dos(rpc)avishek130650107020
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
 
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMI
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxByte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Rpc
RpcRpc
Rpc
 
DCE daemonless and outbound-only communication with hp open view operations
DCE daemonless and outbound-only communication with hp open view operationsDCE daemonless and outbound-only communication with hp open view operations
DCE daemonless and outbound-only communication with hp open view operations
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
 
Jaimin chp-6 - transport layer- 2011 batch
Jaimin   chp-6 - transport layer- 2011 batchJaimin   chp-6 - transport layer- 2011 batch
Jaimin chp-6 - transport layer- 2011 batch
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Firewalls
FirewallsFirewalls
Firewalls
 
Rpc mechanism
Rpc mechanismRpc mechanism
Rpc mechanism
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 

Plus de Peter R. Egli

Plus de Peter R. Egli (20)

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking Concepts
 
Communication middleware
Communication middlewareCommunication middleware
Communication middleware
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET Platform
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud Computing
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Web services
Web servicesWeb services
Web services
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBA
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Sun RPC (Remote Procedure Call)

  • 1. © Peter R. Egli 2015 1/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com Peter R. Egli INDIGOO.COM OVERVIEW OF ONC RPC, AN RPC TECHNOLOGY FOR UNIX BASED SYSTEMS ONC RPCOPEN NETWORK COMPUTING REMOTE PROCEDURE CALL
  • 2. © Peter R. Egli 2015 2/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com Contents 1. What is RPC? 2. Local versus remote procedure call 3. RPC service daemon on the remote machine (portmapper) 4. RPC system components 5. RPC parameter passing 6. Network transport protocol for RPC 7. RPC interface description and code generation 8. RPC procedure call semantics 9. RPC remote procedure location and discovery 10. RPC interaction
  • 3. © Peter R. Egli 2015 3/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 1. What is RPC? RPC is an extension of conventional procedure calls: RPC allows a client application to call procedures in a different address space on the same or on a remote machine (= transfer of control and data to a different address space and process). RPC as middleware for traditional client – server programming: RPC extends sockets with remote procedure call semantics. RPC allows an application to call a remote procedure just as it were a local procedure (location transparency). Different flavors of RPC: 1. SUN-RPC (= ONC RPC): ONC RPC = Open Network Computing RPC. Initially developed by Sun Microsystems. First widely adopted RPC implementation. Standards: RFC4506 XDR (Data presentation), RFC1057 RPC protocol specification. 2. DCE/RPC: Distributed Computing Environment RPC by OSF (Open Software Foundation). Not widely adopted by the IT industry. 3. MS RPC: Microsoft’s extension of DCE/RPC.
  • 4. © Peter R. Egli 2015 4/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 2. Local versus remote procedure call Local procedure call: Remote procedure call: Client: Calling procedure Server: Called procedure Arguments Results The calling procedure executes the called procedure in its own address space and process. Client: Calling procedure Server: Called procedure Client stub Server stub Network (TCP/IP) Request message Request message Reply message Reply message Results Client and server run as 2 separate processes (on the same or on different machines). ResultsCall with arguments Call with arguments Stubs allow communication between client and server. These stubs map the local procedure call to a series of network RPC function calls.
  • 5. © Peter R. Egli 2015 5/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 3. RPC service daemon on the remote machine (portmapper) How is the remote procedure called? The remote procedure request message is received by a process (service daemon called portmapper). The daemon dispatches the call to the appropriate server stub. The service daemon listens on incoming requests. callrpc() with request Dispatch service procedure Execute procedure Assemble reply return() reply Client is blocked Client Service daemon Server procedure
  • 6. © Peter R. Egli 2015 6/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 4. RPC system components Main RPC components: The client stub is a proxy object that passes calls to the server stub. The message modules pack and unpack the marshaled arguments in UDP packets. Client: Calling procedure Server: Called procedure Client stub Server stub Network (TCP/IP) Request message Request message Reply message Reply message Results Results Message module Portmapper with Message module Results Results Client stub: Pack arguments (marshal) Server Stub: Unpack arguments (unmarshal) Message modules: Send & receive RPC messages. The portmapper runs as a daemon process (listener process). Server daemon Call with arguments Call with arguments Call with arguments Call with arguments
  • 7. © Peter R. Egli 2015 7/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 5. RPC parameter passing (1/2) Local procedures: The call of a local procedure allows pass-by-value and pass-by-reference. Call by value example (plain old C): int sqrt(int arg0) { return arg0 * arg0; } ... int number = 9; int result; result = sqrt(number); Call-by-reference example (plain old C): struct Arguments { int number0; int number1; } args; struct Arguments args; ... int product(Arguments* args) { return args->number0 * args->number1; } ... int result = product(&args);
  • 8. © Peter R. Egli 2015 8/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 5. RPC parameter passing (2/2) Remote procedures / RPC: RPC only allows pass-by-value because pointers are meaningless in the address space of the remote process. XDR (the RPC Interface Description Language, see below) allows declaring pointers to data structures. But RPC does actually copy-in/copy-out parameter passing (passes full copies of referenced data structures to the remote procedure). Example: XDR file with pointer argument: /* msg.x: Remote msg printing protocol */ struct PrintArgs { char* name; int number; }; program MSGPROG { version PRINTMSGVERS { int PRINTMSG(PrintArgs*) = 1; } = 1; } = 0x20000001; Client application: struct PrintArgs printArgs; int* result; result = printmsg_1(&printArgs, clnt);
  • 9. © Peter R. Egli 2015 9/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 6. Network transport protocol for RPC RPC uses the underlying network just as any other network application. RPC may use connection oriented (TCP, SCTP) or connectionless transport protocols (UDP). Usually RPC uses UDP because UDP (connectionless transport service) better supports the RPC protocol because: 1. RPC interactions are generally short so connections are not really required. 2. Servers generally serve a large number of clients and maintaining state information on connections means additional overhead for the server. 3. LANs are generally reliable so the reliable service of TCP is not needed. Client: Calling procedure Client stub result = printmsg_1(&printArgs, clnt); Message module Socket UDP IP Marshal parameters Request packet Create request message RPC Request message R R+H IPUR+H Server: Called procedure Server stub Message module Socket UDP IP R R+H
  • 10. © Peter R. Egli 2015 10/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com Program number Procedure declaration (procedure number 1) Version of (remote) program (=1 in the example) Name of the (remote) program 7. RPC interface description and code generation (1/2) Interface definition: The server procedure(s) are defined as an interface in a formal language (XDR) and then compiled to source code (plain old C). Elements of XDR (External Data Representation): 1. Interface definition language (IDL). XDR defines procedure signatures (procedure names, parameters with types) and user defined types. 2. Data encoding standard (how to encode data for transmission over the network). XDR defines how to pack simple types like int and string into a byte stream. Example XDR file: /* msg.x: Remote msg printing protocol */ program MESSAGEPROG { version PRINTMESSAGEVERS { int PRINTMESSAGE(string) = 1; } = 1; } = 0x20000001;
  • 11. © Peter R. Egli 2015 11/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 7. RPC interface description and code generation (2/2) Code generation from XDR file: The RPC compiler (ONC RPC: rpcgen) generates all the necessary C source files from the XDR interface specification file (header files, stubs). XDR file RPC compiler C compiler + linker Client appl. Client stub Server proc. Server stub Client executable C compiler + linker Server executable rpcgen Shared header files
  • 12. © Peter R. Egli 2015 12/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 8. RPC procedure call semantics (1/4) Potential problems with RPC calls: a. The request message may be lost (in the network, in the message module). b. The reply message may be lost. c. The server or client may crash during an RPC call. In these cases, it is not clear to the client if the remote procedure has been called or not. RPC incorporates different strategies for handling these situations. Client: Calling procedure Server: Called procedure Client stub Server stub Network (UDP/IP) Message module Message module R R
  • 13. © Peter R. Egli 2015 13/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 8. RPC procedure call semantics (2/4) RPC message delivery strategies: 1. Retry request message: The client retransmits the request message until either a reply is received or the server is assumed to have failed (timeout). 2. Duplicate filtering: The server filters out duplicate request messages when retransmissions are used. 3. Retransmission of replies: The server maintains a history of reply messages. In case of a lost reply message, the server retransmit the reply without re-executing the server operation.
  • 14. © Peter R. Egli 2015 14/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 8. RPC procedure call semantics (3/4) RPC supports 3 different “call semantics” that define the level of guarantee of requests: 1. maybe call semantics. 2. at-least-once call semantics. 3. at-most-once call semantics. RPC mechanisms usually include timeouts to prevent clients waiting indefinitely for reply messages. 1. maybe call semantics: • No retransmission of request messages. • Client is not certain whether the procedure has been executed or not. • No fault-tolerance measures (RPC call may or may not be successful). • Generally not acceptable (low level of guarantee). 2. at-least-once call semantics: • The message module repeatedly resends request messages after timeouts occur until it either gets a reply message or a maximum number of retries have been made. • No duplicate request message filtering. • The remote procedure is called at least once if the server is not down. • The client does not know how many times the remote procedure has been called. This could produce undesirable results (e.g., money transfer) unless the called procedure is “idempotent” (= repeatable with the same effect as a single call).
  • 15. © Peter R. Egli 2015 15/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 8. RPC procedure call semantics (4/4) 3. at-most-once call semantics: • Retransmission of request messages. • Duplicate request message filtering. • If the server does not crash and the client receives the result of a call, then the procedure has been called exactly once. Otherwise, an exception is reported and the procedure will have been called either once or not at all. • Works for both idempotent and non-idempotent operations. • More complex support required due to the need for request message filtering and for keeping track of replies. Comparison of call semantics: Delivery guarantees RPC call semantics Retry request message Duplicate filtering Re-execute procedure or retransmit reply Maybe No Not applicable Not applicable At-least-once Yes No Re-execute procedure At-most-once Yes Yes Retransmit reply
  • 16. © Peter R. Egli 2015 16/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 9. RPC remote procedure location and discovery (1/2) How does the client find the IP address and port of the host hosting the remote procedure? In RPC, binding refers to determining the location and identity of the called procedure. The binder (RPCBIND, formerly portmapper) is a daemon that: - is a registry for registering server procedures on the server, - is a lookup service for the client to get the address of the server procedure host, - runs on the host and listens on a well-known address (port number 111). Client Client stub Binder Message module RPC call bind LookUp LookUp response Message module Server stub Server Register procedure ACK send RPC request call RPC response return HostClient
  • 17. © Peter R. Egli 2015 17/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 9. RPC remote procedure location and discovery (2/2) Static versus dynamic binding: Static binding: • Binds the host address of a server into the client program at compilation time. • Undesirable because the client and server programs are compiled separately and often at different times and the server may be moved from one host to another. Dynamic binding: • Dynamic lookup of the server address (see previous slide). • Allows servers to register and remove their exporting services. • Allows clients to lookup the named service. Binding API: PROCEDURE Register (serviceName:String; serverPort:Port; version:integer) Binder records the service name and server port of a service in its table, together with a version number. PROCEDURE Withdraw (serviceName:String; serverPort:Port; version:integer) Binder removes the service from its table. PROCEDURE LookUp (serviceName:String; version:integer): Port The binder looks up the named service and returns its address (or set of addresses) if the version number agrees with the one stored in its table.
  • 18. © Peter R. Egli 2015 18/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 10. RPC interaction (1/3) RPC allows synchronous and asynchronous interaction. Synchronous RPC: In synchronous RPC, the client is blocked until it received the server reply. Synchronous RPC is the default mode of interaction. Easier to program (no synchronization required on client). Client is blocked during the entire RPC operation (waste of execution time, performance negatively affected). Client Server procedure callrpc() with request Execute procedure return() reply Client is blocked
  • 19. © Peter R. Egli 2015 19/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 10. RPC interaction (2/3) Asynchronous RPC: If a remote procedure does not require a response, the client can send a request to the server without waiting for a reply and continue with its work. The client is not blocked, can continue with its work. Only possible for remote procedures that do not return a result (e.g. send a log message to a log server). Client Server procedure callrpc() with request Server executes the request asynchronously return() Client continues with its work
  • 20. © Peter R. Egli 2015 20/20 Rev. 2.00 SUN / ONC RPC (Remote Procedure Call) indigoo.com 10. RPC interaction (3/3) Deferred synchronous RPC: With deferred synchronous RPC, the client sends a request to the server and only waits for the acceptance of the request. The server executes the request and sends an answer back to the client. This mode is useful in cases where the server procedure requires lengthy computations. Client not blocked, can continue with its work. More complicated synchronization required on the client. Client Server procedure callrpc() with request Server executes the request asynchronously Accept request Client waits for acceptance of request and then continues with its work Return result(s)Client is interrupted, processes the result ACK Each pair of call and reply message is matched by a transaction ID (XID field).