Remote Procedure Calls (RPC)
Summary
TLDRThis lecture delves into Remote Procedure Calls (RPC), contrasting it with Inter-Process Communication (IPC). RPC facilitates communication between processes on different systems over a network, abstracting network details from the processes. It operates on a message-passing system, where messages are well-structured and include function identifiers and parameters. The lecture explains the role of RPC daemons, parameter marshalling, and the use of stubs on both client and server sides to hide communication complexities. It sets the stage for the next lecture, which will address challenges faced by RPC and their solutions.
Takeaways
- 🌐 **Remote Procedure Calls (RPC)**: RPC is a protocol that allows a program to request a service from another program located in a different computer or network without understanding the network's details.
- 💬 **Communication Between Systems**: RPC is used when processes in different systems connected over a network need to communicate with each other.
- 🔗 **Similarity to IPC**: RPC is similar to Inter-Process Communication (IPC) but is designed for processes executing on separate systems.
- 📦 **Message-Based Communication**: Unlike shared memory in IPC, RPC uses a message-based communication scheme because processes are on different systems.
- 📨 **Structured Messages**: Messages in RPC are well-structured and contain an identifier of the function to execute and parameters, unlike simple data packets in IPC.
- 📡 **RPC Daemon**: Each RPC message is addressed to an RPC daemon listening on a port on the remote system, which is always waiting for incoming requests.
- 🛠️ **Function as a Service**: In RPC, a function is considered a service that can be requested by one process from another, requiring the passing of parameters and potential return values.
- 🔄 **Parameter Marshalling**: Parameters are packaged into a form that can be transmitted over a network, which is a critical step in the RPC process.
- 🔄 **Message Passing**: The stub on the client side transmits a message to the server, which is received by a server-side stub to invoke the procedure.
- 🔙 **Return Values**: After a function is executed on the server, any return values are passed back to the client using the same message passing technique.
Q & A
What is the main focus of the lecture?
-The lecture focuses on remote procedure calls (RPC), which are used for communication between processes residing in different systems connected over a network.
How does RPC differ from local process communications?
-RPC differs from local process communications by enabling communication between processes that are located on separate systems connected via a network.
What is the role of a network in the context of RPC?
-In the context of RPC, the network connects different systems where processes reside and facilitates communication between them.
Why is message passing used in RPC instead of shared memory?
-Shared memory is not feasible in RPC because processes are in different systems. Therefore, message passing is used as the communication scheme.
What is the purpose of an RPC daemon?
-An RPC daemon is a program that always listens on a port on the remote system, waiting to receive incoming requests and execute the corresponding functions.
How are messages structured in RPC communications?
-Messages in RPC communications are well-structured and contain an identifier of the function to execute and the parameters to pass to that function.
What is a stub in the context of RPC?
-A stub in the context of RPC is a piece of code on the client side that hides the communication details from the client and facilitates the invocation of remote procedures.
What happens when a client invokes a remote procedure?
-When a client invokes a remote procedure, the RPC system calls the appropriate stub, which then locates the server's port and marshals the parameters before sending the message.
What is parameter marshalling?
-Parameter marshalling is the process of packaging parameters into a form that can be transmitted over a network for remote procedure calls.
How are return values from a remote procedure communicated back to the client?
-Return values from a remote procedure are communicated back to the client using the same message passing technique that was used to send the initial request.
What issues might arise in RPC and how are they addressed?
-Issues in RPC can include network latency, security concerns, and data serialization/deserialization problems. These issues are addressed in subsequent lectures.
Outlines
🔌 Introduction to Remote Procedure Calls (RPC)
This paragraph introduces the concept of Remote Procedure Calls (RPC) as a method for processes residing on different systems connected over a network to communicate. It contrasts RPC with Inter-Process Communication (IPC), which is typically local. The paragraph explains that RPC abstracts the network details, allowing programs to request services from other programs on the network without understanding the underlying network protocols. It also highlights the shift from shared memory systems used in IPC to message passing systems necessary for RPC due to the distributed nature of the systems involved.
📡 Understanding RPC Communication and Daemons
The second paragraph delves into how RPC communication is structured and the role of RPC daemons. It describes an RPC daemon as a program that constantly listens on a port for incoming requests. The paragraph explains that messages in RPC are well-structured and contain an identifier for the function to be executed and the parameters for that function. It also discusses the concept of 'function' in programming and how RPC mirrors this by allowing a process to request a service (function) from another system, with the results being returned to the requesting process.
🛠 The Role of Stubs and Parameter Marshalling in RPC
The final paragraph focuses on the technical aspects of RPC, particularly the function of stubs and parameter marshalling. It explains that stubs on the client side are used to abstract the communication details from the client process. When a remote procedure is invoked, the appropriate stub locates the server's port and marshals the parameters, packaging them in a form suitable for network transmission. The paragraph also describes the server-side stub, which receives the message, invokes the procedure with the provided parameters, and handles the return of any results back to the client using message passing techniques.
Mindmap
Keywords
💡Remote Procedure Calls (RPC)
💡Inter-Process Communication (IPC)
💡Message Passing
💡Shared Memory
💡Network
💡RPC Daemon
💡Parameters
💡Marshalling
💡Stub
💡Ports
Highlights
Remote Procedure Calls (RPC) enable communication between processes residing in different systems connected over a network.
RPC is a protocol that allows one program to request a service from another program located in another computer or network without understanding network details.
RPC uses a message-based communication scheme due to the processes executing on separate systems.
In RPC, messages exchanged are well-structured and contain an identifier of the function to execute and the parameters to pass.
RPC daemons listen to ports on remote systems to receive and process incoming requests.
RPC hides the communication details from the processes by providing a stub on the client side.
Each remote procedure has a corresponding stub that handles the communication on the client side.
When a client invokes a remote procedure, the RPC system calls the appropriate stub and passes the parameters.
The stub locates the server's port and marshals the parameters into a form that can be transmitted over the network.
Parameter marshaling is the process of packaging parameters into a form suitable for network transmission.
The server-side stub receives the message, invokes the procedure, and executes the function with the passed parameters.
After the remote procedure execution, return values are passed back to the client using the message passing system.
RPC semantics allow a client to invoke a procedure on a remote host as it would invoke a procedure locally.
RPC is similar to IPC but requires a message-based communication scheme due to the distributed nature of the processes.
The lecture will cover the issues faced by RPC and their resolutions in a subsequent session.
The next lecture will provide a comprehensive view of RPC after addressing the encountered issues.
Transcripts
in this lecture we'll be studying about
remote procedure calls in the previous
lecture we have been studying about
inter-process communications and we have
seen how inter-process communications
takes place using the shared memory
systems and also using the message
passing systems and we have also studied
about sockets and we saw how sockets
help in establishing communication
between processes so till now the
inter-process communications that we
have studied about we're mostly based on
local process communications that means
we were seeing how processes that
resides in a same system communicates
with each other now remote procedure
calls come into play when we want
processes that are residing in different
systems connected over a network wants
to communicate with each other so think
of a scenario where one process that is
residing in a system wants to
communicate to another process which is
residing physically in another system
and these two systems are connected via
a network so in this kind of a scenario
we need to use remote procedure calls
and remote procedure calls will help us
in communication between processes that
are residing in different systems
connected over a network so remote
procedure call or RPC is a protocol that
one program can use to request a service
from a program located in another
computer or a network without having to
understand the network's
details so RPC is a protocol that helps
one program to request a service from
another program located in another
computer on a network and it does so in
such a way that the processes that are
communicating does not need to
understand the network's details so the
network's details does not have to be
understood by the processes that are
communicating so RPC takes care of this
now this RPC is similar in many respect
to the IPC mechanism so we have studied
about IPC which stands for inter process
communication so RPC is similar to
I PC in many ways however because we are
dealing with an environment in which the
processes are executing on separate
systems we must use a messaged base
communication scheme to provide remote
service so though our PC is similar to
IPC in many ways the difference is that
since in our PC we are dealing with an
environment in which processes are
executed on separate systems we need to
use a messaged based communication
scheme so if you remember about the two
communication schemes that we have
studied we have studied about shared
memory system and we have studied about
message passing system so in shared
memory system what happens is when the
processors wants to communicate with
each other there is a region or shared
memory that they have and the process
that wants to communicate just writes
whatever it wants to communicate on the
shared region and the other process just
reads from that shared region but in
case of RPC we are dealing with
processes that are residing in two
different systems that are connected by
our network so in this kind of a system
it may not be possible to have a shared
region of memory so that shared memory
system may not be possible so we have to
use the other kind of communication
scheme that we have studied which is the
message passing system so in our PC we
will be using a message based
communication scheme so moving on let us
see what are the other differences that
our PC has as compared to IPC so in
contrast to the IPC facility the
messages exchanged in RPC communications
are well-structured and are thus no
longer just packets of data so in case
of IPC whenever we use the message
passing systems those messages were just
packets of data and nothing else so if
you remember when we studied about
message passing system the process that
wants to send the message just sends
that message as a packet to the kernel
and from the kernel it goes to the
process to which that message was
intended to so messages were just
packets of data but in case of RPC it is
not just happening in a single system it
has to travel between one system to the
other
so we cannot just keep our messages as
simple packets of data but they have to
be well structured because they have to
travel over a network
so each message is addressed to an RPC
daemon listening to a port on the remote
system and each contains an identifier
of the function to execute and the
parameters to pass to that function so
in case of RPC whenever the message
passing takes place that means whenever
one process wants to communicate to
another process residing in another
system the message is sent in such a way
that the message is addressed to a RPC
daemon which is listening to a port on
the remote system
so by daemon we mean that a program
which is always listening or which is
always on and which is always listening
and is waiting to get some input and
based on that it will work so this RPC
daemon is always listening to a port on
the remote system waiting for some
incoming requests so we have also
studied about the concept of port in the
lecture where we discuss about sockets
so if you have not seen that I request
you to kindly watch that lecture where
we have discussed about ports and how
ports are assigned to different
processes so as we were saying in case
of RPC when the message is sent it is
addressed to the RPC daemon which is
listening to the port on the remote
system and each of the message that is
send it contains an identifier of the
function to execute and the parameters
to pass to that function now we are
using the term function here so what is
a function so when we study programming
we know what are functions so function
is a piece of code that is written which
performs a specific task so what are the
requirements that we need in a function
the function needs parameters so based
on the parameters the operation is
performed on that parameters and
something is returned so in case of RPC
think of this function as a service
which is going to be requested by one
process from the other process so there
is a process deciding in a system and
this process wants a service which is
provided by another process residing in
another system so think of that service
as a function so what do we do we have
to pass the pattern
meters of the function and we have to
call the function and then the function
will be executed
so in the same way in this RPC we have
to pass the identifier of the function
which may be like a function name and
then the parameters that we have to pass
to the function then after that what
happens the function is then executed as
requested and any output is sent back to
the requester in a separate message so
let's take the example of a simple
function in programming again what
happens when we call a function when we
call a function we pass the parameters
and when the function is called the
function gets executed and after
execution if there are anything to be
returned that will be returned and where
will it be returned it will be returned
to the place where the function was
called so in case of our RPC who is the
one who called the function or the
service it is the first process or the
client so after the function is executed
in the other system the things that has
to be returned the return values has to
be passed back to the client again and
that will be done in a separate message
using the message passing system so that
is basically how the RPC functions so we
have seen an overview of how the RPC
functions now let us see how does the
semantics of RPC allow a client to
invoke a procedure on a remote host as
it would invoke a procedure locally so
we already know how processes
communicate in a local set up that means
when they are residing in the same
system so in case of RPC when the
processes are residing in two different
systems connected over a network let us
see how does the communication take
place so the RPC system hides the
details that allow communication to take
place by providing a stub on the client
side and typically a separate stub
exists for each separate remote
procedure so as I already told you RPC
system it hides the details that allow
communication to take place by providing
a stub on the client side so when we use
this RPC the process does not have to be
concerned about how the communication
takes place RPC hides the details of
that and how does it do by providing a
stub on the client side and we will see
what is a function of this stub as we
move ahead and typically a
stub exists for each separate remote
procedure so let us move ahead and see
what is a function of this stub what
does it do and how does it proceed so
when a client invokes a remote procedure
the RPC system calls the appropriate
stub passing it the parameters provided
to the remote procedure and this stub
locates the port on the server and
marshals the parameters so when a client
invokes a remote procedure that means
when a client a process in one system
wants to get the service of the process
residing in another system what does it
do it invokes that procedure the client
invokes the remote procedure we use the
term remote because it is residing in
another system not in the same system so
when the procedure is invoke what
happens the RPC system it calls the
appropriate stub and then it passes the
parameters provided to the remote
procedure so whenever we say remote
procedure think of it as a function a
function that we have written in a
program what does it do it executes
something it provides a certain service
so what is required in a function we
have to pass a parameters to a function
so when the client invokes a remote
procedure the RPC will call the
appropriate stub and it will pass the
required parameters that are provided to
the remote procedure and then this stub
locates the port on the server and
marshall's the parameters so the stuff
will locate the port on the server so on
the server there will be different kind
of services that will be available and
each service will be identified by a
port number so we have discussed about
port in the previous lecture where we
studied about sockets so that specific
port has to be found out so the stub
will do that part it will locate the
port on the server and it marshals the
parameters that means it will combine
the parameters in a specific way so let
us now understand what is the meaning of
this term marshall's and what is the
meaning of the stub marshall's the
parameters so parameter marshaling
involves packaging the parameters into a
form that can be transmitted over a
network so we got all the parameters
that were required for the function to
execute and where is it function keep in
mind it is in the server
it is the remote procedure that we are
going to invoke so we have all the
parameters to be passed to that and
parameter marshaling involves packaging
the parameters into a form that can be
transmitted over a network since the
procedure is residing in another system
this parameters has to be passed over
the network to the other system so since
it has to travel through the network the
parameters have to be in a form that can
be transmitted over a network
so parameter marshalling means it will
package the parameters into a form which
can be transmitted over the network so
that is what we mean by parameter
marshaling the stub then transmits a
message to the server using message
passing so now everything is ready and
after it is ready the stub will transmit
the message to the server using message
passing system so we have passed the
message from the client side to the
server so what happens on the server
side
a similar stub on the server side
receives this message and invokes the
procedure on the server so just like we
had stub on the client side there is a
stub also on the server side the stub on
the server side will receive the message
that we have sent and what was there in
the messages the parameters were there
for the function to be invoked so that
function will be invoked using the
parameters that was passed and the
function will be executed alright so
what will be the last step when we are
executing a function in a program what
is the last step after the function is
executed the result has to be a return
to the place where the function was
called so if necessary return values are
passed back to the client using the same
technique so similarly in this RPC after
the function is executed that means
after the service has been executed if
there are any return values it has to be
passed back to the place from where the
service was called and from where was it
called it was called from the client
side so those return values has to be
passed back to the client and how is it
passed back it is passed back by using
the same message passing technique so
this is how basically a remote procedure
call works so we have seen that remote
procedure call is something that is used
when communication has to take place
between processes
that are residing in different systems
connected over a network so this is the
basic working of an RPC all right though
we have seen the working of an RPC
during this procedure during this entire
process there are certain issues that we
face and these issues has to be
considered these issues has to be
addressed and there has to be some way
this issues have to be resolved so in
the next lecture we will see what are
the issues that are faced by an RPC and
how are those issues resolved and after
resolution of those issues we will see
as a whole how RPC works we have already
seen how RPC works in this lecture but
we also have to see how are those issues
tackled when they are encountered so we
will see the entire working of an RPC
after resolution of all those issues
in the next lecture so with this I hope
the basic concept of RPC was clear to
you thank you for watching and see you
in the next one
[Applause]
you
[Music]
関連動画をさらに表示
Communication in Client–Server Systems-Operating Systems-Unit-2-20A05402T
Message Passing Systems (Part 1)
Operating System: Inter Process Communication: Message Passing Shared Memory
Inter Process Communication | Introduction | Part-1/2 | OS | Lec-38 | Bhanu Priya
Types of System Calls
Revised Penal Code - Article 1 (Date of Effectiveness)
5.0 / 5 (0 votes)