You are on page 1of 37

Module - 9 Middleware Technology

Rosin Claude NGUEVEU

Trebas Institute

10 mai 2023

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 1 / 37


Overview

1 Remote Procedure Call

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 2 / 37


Contenu

1 Remote Procedure Call


RPC
XML-RPC
MS-RPC

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 3 / 37


Contenu

1 Remote Procedure Call


RPC
XML-RPC

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 4 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Definitions


Remote Procedure Call is a software communication protocol that one
program can use to request a service from a program located in
another computer on a network without having to understand the
network’s details. RPC is used to call other processes on the remote
systems like a local system. A procedure call is also sometimes known
as a function call or a subroutine call. a
a. https://www.techtarget.com/searchapparchitecture/definition/
Remote-Procedure-Call-RPC

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 5 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Definitions


Remote Procedure Call (RPC) is a protocol that provides the
high-level communications paradigm used in the operating system.
RPC presumes the existence of a low-level transport protocol, such as
Transmission Control Protocol/Internet Protocol (TCP/IP) or User
Datagram Protocol (UDP), for carrying the message data between
communicating programs. a
a. https:
//www.ibm.com/docs/en/aix/7.1?topic=concepts-remote-procedure-call

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 6 / 37


Middleware technologies : Remote Procedure Call (RPC)

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 7 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Architecture
Client-Server Model
Synchronous operation (require program suspension until the results
are returned)
Multiple RPC through threading
Interface Definition Language (IDL) a are commonly used
▶ Provide a bridge between machines at either end of the link (#OSes or
Computer languages)

a. language that lets a program or object written in one language communicate with
another program written in an unknown language. IDLs describe an interface in a
language-independent way, enabling communication between software components that
do not share one language, for example, between those written in C++ and those
written in Java.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 8 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Components
Client
Server
Client Stub
Server Stub
Port Mapper / RPCBind

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 9 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Client
Computer or process that accesses the services or resources of another
process or computer on the network
Knows how to address the remote computer and server application
Send a message across the network that requests the remote procedure

RPC : Server
Computer that provides services and resources, and that implements
network services.
Provides application/server services and features to remotely
connected RPC clients
▶ Request can be for server access, data or any other server-based
requests
Send a message across the network that requests the remote procedure

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 10 / 37


Middleware technologies : Remote Procedure Call (RPC)
RPC : Client Stub
Piece of code that converts parameters passed between the client and
server during a remote procedure call (RPC).
Compiled and linked with the client application
▶ Included in the compiled code that acts as the representative of the
remote procedure code.
Packs the procedure parameters into a message and makes a system
call to send the message
▶ Translates the parameters as needed into a standard network data
representation (NDR) format for transmission over the network
▶ Calls functions in the RPC client runtime library to send the request
and its parameters to the server
Contacts a name server to determine the transport address where the
server resides (the first time the stub is invoked).
Instead of containing the actual code that implements the remote
procedure, the client stub code is used
Rosin C. NGUEVEU Middleware Technology 10 mai 2023 11 / 37
Middleware technologies : Remote Procedure Call (RPC)

RPC : Server Stub


Unpacks the parameters – called unmarshalling – from the message
Compiled and linked with the server application
Reconstructs the call stack, and then executes the corresponding
user-implemented server function.
▶ Dispatch routine, performs whatever service is requested, and sends a
reply back to the client.
Attempt to minimize unnecessary memory usage when possible
Performs the same operations as the client stub to return the server
computation results

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 12 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Port mapper or RPC bind


Started automatically whenever a machine is booted
Maps RPC program and version numbers to a transport-specific (
TCP/IP, UDP/IP, ...) port number.
Makes dynamic binding of remote programs possible
Every port mapper on every host is associated with port number 111
Only network service that must have a dedicated port
Other network services can be assigned port numbers either statically
or dynamically, as long as the services register their ports with their
host’s port mapper.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 13 / 37


Middleware technologies : Remote Procedure Call (RPC)

Operation
When an RPC server is started, it will tell portmap what port number it is
listening to, and what RPC program numbers it is prepared to serve. When
a client wishes to make an RPC call to a given program number, it will first
contact portmap on the server machine to determine the port number
where RPC packets should be sent.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 14 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Features


Batching calls
Broadcasting calls
Callback procedures
The select subroutine

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 15 / 37


Middleware technologies : Remote Procedure Call (RPC)

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 16 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Batchning calls


Allows a client to send an arbitrarily large sequence of call messages to
a server
Can be thought of as placing RPC messages in a pipeline of calls to a
desired server.
When batching, the client never waits for a reply from the server, and
the server does not send replies to batched requests.
▶ RPC architecture is designed so that clients send a call message and
then wait for servers to reply that the call succeeded. This implies that
clients do not compute while servers are processing a call. However, the
client may not want or need an acknowledgment for every message
sent. Therefore, clients can use RPC batch facilities to continue
computing while they wait for a response.
Normally, a sequence of batch calls should be terminated by a
legitimate, nonbatched RPC to flush the pipeline.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 17 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Batchning calls properties


Each remote procedure call in the pipeline requires no response from
the server, and the server does not send a response message
The clients are not notified of any failures that occur (why ?)
The server sends no message
The client can generate new calls that run parallel to the server’s
execution of previous calls
Batched calls are buffered, so the client should eventually perform a
nonbatched remote procedure call to flush the pipeline with positive
acknowledgment

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 18 / 37


Middleware technologies : Remote Procedure Call (RPC)
Remote Procedure Call : Broadcasting calls
Permits a client to send a data packet to the network and wait for
numerous replies.
Differences between broadcast RPC and normal RPC :
▶ Normal RPC expects only one answer, while broadcast RPC expects
one or more answers from each responding machine.
▶ The implementation of broadcast RPC treats unsuccessful responses as
garbage by filtering them out (i.e : cannot detect version mismach
between broacaster and remote service).
All broadcast messages are sent to the port-mapping port.
▶ Only services that register themselves with their port mapper are
accessible through the broadcast RPC mechanism.
Broadcast requests are limited in size to the maximum transfer unit
(MTU) of the local network (1500 bytes for the Ethernet system).
Broadcast RPC is supported only by packet-oriented (connectionless)
transport protocols such as UPD/IP.
Rosin C. NGUEVEU Middleware Technology 10 mai 2023 19 / 37
Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Callback procedure


Occasionally, the server may need to become a client by making an
RPC callback to the client’s process.
To make an RPC callback, the user needs a program number on which
to make the call.
The program number is dynamically generated and should be in the
transient range, 0x40000000 to 0x5fffffff .

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 20 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : The select subroutine


Checks the specified file descriptors (can be passed in readfds,
writefds, and exceptfds parameters) and message queues :
▶ if they are ready for reading (receiving) or writing (sending)
▶ if they have an exceptional condition pending.
Allows the server to interrupt an activity, check for data, and then
continue processing the activity :
▶ e.g : if the server processes RPC requests while performing another
activity that involves periodically updating a data structure, the process
can set an alarm signal to notify the server before calling the svc_run
routine. However, if the current activity is waiting on a file descriptor,
the call to the svc_run routine does not work.
▶ svc_run : waits for RPC requests to arrive and calls the appropriate
service procedure.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 21 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Steps
The client invokes a "client stub" which resides in the client’s own
address space.
This stub converts the message into the standard format according to
the client’s network services.
Then it transfers the message to the remote network service.
On the other side, the server invokes the "server stub" which decodes
the transferred
message according to its standard format and takes up the regular
procedure call.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 22 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Steps
Once the call is executed according to its procedure the call is
returned to the server
stub and it transfers the message to the transport layer.
Then the transport layer sends back the message to the client server
stub.
Then the client server stubs decode the message into its standard form
and the call gets completed.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 23 / 37


Middleware technologies : Remote Procedure Call (RPC)

RPC : Steps
Client calls the client stub.
Stub generates a system call to forward the message and adds
parameters to the message.
Message forwarding from client to server via client OS.
Message further passes to server stub with the help of OS.
Message parameters are removed.
Server stub calls the server procedure.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 24 / 37


Middleware technologies : Remote Procedure Call (RPC)

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 25 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Relationship with middleware


?

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 26 / 37


Middleware technologies : Remote Procedure Call (RPC)
Remote Procedure Call : Relationship with middleware
Connects the Enterprise Integration Systems (EIS) Tier and the
Clients Tier

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 27 / 37


Middleware technologies : Remote Procedure Call (RPC)

Remote Procedure Call : Relationship with middleware


Connects the Enterprise Integration Systems (EIS) Tier and the
Clients Tier
One of the key service for DCE (Distributed Computing Environment)
Facilitates efficient access of resources distributed across the network.
Provides portability and network independance.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 28 / 37


Contenu

1 Remote Procedure Call


RPC
XML-RPC
MS-RPC

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 29 / 37


Middleware technologies : XML-RPC
XML-RPC
Specification and a set of implementations that allow software running
on disparate operating systems, and in different environments, to
make procedure calls over the Internet.
Makes the calls using HTTP as the transport and XML as the
encoding
XML-RPC is designed to permit complex data structures to be
transmitted, processed, and returned.

XML-RPC : Aspects of protocol when building middleware


XML-RPC is built on HTTP
Similar to ordinary Web traffic, its stateless conversations are of the
request and response variety.
There is no built-in support for transactions a or encryption.
a. transaction processing is information processing [1] that is divided into individual,
indivisible operations
Rosin C. NGUEVEU called transactions. Each
Middleware transaction must succeed
Technology 10 maior fail as a 30 / 37
2023
Middleware technologies : Microsoft-RPC

Microsoft-RPC
MS-RPC (Microsoft Remote Procedure Call : protocol that allows
requesting service from a program on another computer without
having to understand the details of that computer’s network.
Compatible with the Open Group’s Distributed Computing
Environment (DCE) specification for remote procedure calls
interoperable with other DCE-based RPC systems : HP-UX and IBM
AIX UNIX-based operating systems
The RPC facility is compatible with the Open Group specification.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 31 / 37


Middleware technologies : Microsoft-RPC

XML-RPC : Aspects of protocol


uses other RPC mechanisms, such as named pipes, NetBIOS, or
Winsock, to establish communications between the client and the
server
Essential program logic and related procedure code can exist on
different computers (important for distributed applications).
RPC is based on the concepts used for creating structured programs,
which can be viewed as having a backbone to which a series of ribs
can be attached.

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 32 / 37


Middleware technologies : Some definitions
Pipes : The pipe type constructor is a highly efficient mechanism for
passing large amounts of data, or any quantity of data that is not all
available in memory at one time. By using a pipe, RPC run time
handles the actual data transfer, eliminating the overhead associated
with repeated remote procedure calls. After a client invokes a remote
procedure that has a pipe parameter, the client and server enter loops
to transfer data. The data can be produced on the client or the server.
NetBIOS : A particular network transport that is part of the LAN
Manager protocol suite. NetBIOS uses a broadcast communication
style that was applicable to early segmented local area networks
Winsock Proxy lets a Windows Sockets application, running on a
private network client, behave as if it were directly connected to a
remote Internet server application. The Microsoft Proxy Server acts as
the host for this connection. This means that all application-level
communications are channeled through a single secured
computer—the gateway computer running Microsoft Proxy Server.
Rosin C. NGUEVEU Middleware Technology 10 mai 2023 33 / 37
Middleware technologies : Microsoft-RPC

Microsoft-RPC : Components
MIDL compiler
Runtime libraries and header files Transport interface modules
Name service provider
Endpoint supply service

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 34 / 37


Middleware technologies : Microsoft-RPC
Microsoft-RPC : Components
MIDL compiler : Microsoft implementation of IDL a
▶ Generates the stubs that translate local procedure calls into remote
procedure calls.
▶ Network becomes almost completely transparent to one’s distributed
application.
▶ The client program calls what appears to be local procedures ; the work
of turning them into remote calls is done automatically.
▶ All the code that translates data, accesses the network, and retrieves
results is generated by the MIDL compiler and is invisible to one’s
application.
▶ The RPC allows a process running in one address space to make a
procedure call that is executed in another address space.
a. language that lets a program or object written in one language communicate with
another program written in an unknown language. IDLs describe an interface in a
language-independent way, enabling communication between software components that
do not share one language, for example, between those written in C++ and those
written in Java.
Rosin C. NGUEVEU Middleware Technology 10 mai 2023 35 / 37
Middleware technologies : Microsoft-RPC

Microsoft-RPC : Components
Runtime libraries and header files Transport interface modules
▶ Windows 2000 uses dynamic link libraries (DLLs) to provide procedure
code and backbone code.
▶ This enables the DLLs to be modified or updated without changing or
redistributing the backbone portion.
▶ Client applications are developed with specially compiled stub libraries
provided by the application program.
▶ This module is responsible for finding the server that can satisfy the
RPC command.
▶ Once found, the function and data are sent to the server, where they
are picked up by the RPC runtime component on the server
Name service provider
Endpoint supply service

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 36 / 37


Middleware technologies : Microsoft-RPC

Microsoft-RPC : Components
Name service provider
▶ Allows client applications to use a logical name instead of a specific
protocol sequence and network address
Endpoint supply service
▶ network location where a program could transfer its RPC requests to
access server data

Rosin C. NGUEVEU Middleware Technology 10 mai 2023 37 / 37

You might also like