6- Communication in Client Server System
6- Communication in Client Server System
CSC351-Operating System
Week-3 Lecture-6
Semester 5
2
➢ Process concept
➢ Operations on
Preamble Processes
(Past lesson ➢ Inter process
Communication
brief)
Remote Procedure Call (RPC) is a 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,
A remote procedure call is also known as a subroutine call or a function
call.
It is similar in many respects to the IPC mechanism.
However, because we are dealing with an environment in which the processes
are executing on separate systems, we must use a message-based
communication scheme to provide remote service.
Client
Client Stub
RPC Runtime
Server Stub
Server
The RPC system hides the details that allow communication to take place
by providing a stub on the client side.
Typically, a separate stub exists for each separate remote procedure
When the client invokes a remote procedure, the RPC system calls the
appropriate stub, passing it the parameters provided to the remote
procedure. This stub locates the port on the server and marshals the
parameters.
Parameter marshalling involves packaging the parameters into a form
that can be transmitted over a network
The stub then transmits a message to the server using message passing
A similar stub on the server side receives this message and invokes the
procedure on the server
If necessary, return values are passed back to the client using the same
technique
Lahore Garrison University
12
Pipes
If two-way communication is required, two pipes must be used, with each pipe
sending data in a different direction.
On UNIX systems, ordinary pipes are constructed using the function pipe(int
fd[]) This function creates a pipe that is accessed through the int fd[]
file descriptors: fd[0] is the read-end of the pipe, and fd[1] is the write-end.