Communication in Client–Server Systems-Operating Systems-Unit-2-20A05402T
Summary
TLDRThis operating system class video script covers the fundamentals of client-server communication, focusing on three primary methods: circuit communication, remote procedure call (RPC), and pipes. It explains the client-server architecture, where clients request services and servers respond. The script delves into the concept of circuits as endpoints for communication, the use of well-known ports, and the process of establishing connections. It also introduces RPC as a powerful technique for client-server interaction, detailing the components involved in message passing and the process of marshalling and demarshalling. Lastly, it touches on pipes for inter-process communication in Unix systems, highlighting their unidirectional nature and the need for two pipes for two-way communication.
Takeaways
- 🌐 The script discusses the communication in client-server systems, focusing on three main methods: circuit communication, RPC (Remote Procedure Call), and pipes.
- 🔌 Circuit communication involves establishing a connection between a client and a server using IP addresses and port numbers, with well-known ports reserved for specific services like HTTP on port 80.
- 📞 In RPC, a client can call a procedure on a server as if it were local, without worrying about the details of the remote interaction, which simplifies programming for distributed systems.
- 📦 Marshalling in RPC is the process of packing the procedure call with its parameters into a message that can be sent over the network to the server.
- 📬 Unmarshalling is the reverse process of marshalling, where the server unpacks the received message to extract the procedure call and its parameters.
- 💻 The client and server systems are connected through a client stub, RPC protocol, server stub, and the server program, which work together to facilitate the remote procedure call.
- 🔑 Well-known ports, ranging from 0 to 1023, are reserved for specific services, ensuring that communication is directed to the appropriate service on the server.
- 🔄 Pipes provide a mechanism for inter-process communication (IPC) in Unix-like systems, allowing data to be passed from one process to another in a producer-consumer fashion.
- 🔄 Ordinary pipes are unidirectional, meaning they allow communication in only one direction, typically from a producer process to a consumer process.
- 🔄 For two-way communication, two separate pipes are required, each facilitating communication in one direction.
- 📝 Pipes are limited to processes that have a common parent process, which restricts their use in certain IPC scenarios.
- 📚 The script concludes with a question about marshalling and demarshalling in RPC, inviting students to answer in the comment box, indicating an interactive teaching approach.
Q & A
What is the basic concept of a client-server system?
-A client-server system is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients. Clients are connected to the server through the internet, and the server provides services to the clients in response to their requests.
How does communication take place in a client-server system?
-Communication in a client-server system occurs when the client sends a request to the server for a specific service. The server then processes the request and sends a response back to the client. This can be done through various methods such as circuit communication, RPC (Remote Procedure Call), and pipes.
What is a circuit in the context of client-server communication?
-A circuit is an endpoint for communication between two processes, one in the client and the other in the server. It is established for the duration of their interaction and is defined by an IP address concatenated with a port number.
What are well-known port numbers and why are they reserved?
-Well-known port numbers are a range of port numbers (0 to 1023) that are reserved for certain common services. For example, port 23 is reserved for Telnet, 21 for FTP, and 80 for HTTP. These ports are used to identify the service requested by the client.
Can you explain the concept of RPC (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. It allows a client to call a procedure on a server as if it were a local procedure call, abstracting the remote interaction details.
What is the role of a client stub in RPC communication?
-A client stub in RPC communication is responsible for packing the message with the procedure parameters, which is then sent to the RPC protocol for transmission to the server. It also unpacks the server's response and provides the result to the client.
What is marshalling in the context of RPC?
-Marshalling in RPC is the process of converting the data into a format that can be transmitted over the network. The client stub performs marshalling by packing the message with parameters before sending it to the server.
What is the purpose of the RPC protocol in client-server communication?
-The RPC protocol is responsible for transferring the packed message from the client to the server and vice versa. It ensures that the message is delivered and received correctly between the client and server systems.
What is a pipe in client-server communication?
-A pipe is a mechanism for inter-process communication (IPC) in Unix and Unix-like operating systems. It allows two processes to communicate with each other in a producer-consumer fashion, where one process writes to the pipe (producer) and another reads from it (consumer).
How does a pipe facilitate communication between processes?
-A pipe allows for unidirectional communication between processes. The output of one process is written to the write end of the pipe, and another process reads from the read end of the pipe. This is useful for passing the output of one process as input to another.
What is the limitation of using pipes for inter-process communication?
-The limitation of using pipes for IPC is that the processes using pipes must have a common parent process. This restricts the use of pipes to processes that are part of the same hierarchical process structure.
Outlines
🌐 Client-Server Communication Basics
This paragraph introduces the fundamental concepts of client-server communication in operating systems. It explains the simple architecture where multiple clients are connected to a server via the internet. The communication process involves clients sending requests to the server, which then responds with the requested service. The paragraph also touches on different types of communication, such as circuit communication and RPC (Remote Procedure Call). It further delves into the concept of a circuit as an endpoint for communication between client and server processes, identified by IP addresses and port numbers. The significance of well-known port numbers for services like FTP, Telnet, and HTTP is highlighted, along with the process of establishing a connection and exchanging packets between the client and server.
📞 Remote Procedure Call (RPC) Mechanism
The second paragraph focuses on RPC, a powerful technique for client-server communication that allows a client to execute a procedure on a server system as if it were local. The concept of local versus remote procedures is clarified, with examples provided to illustrate the difference. RPC is described as a message-passing system between client and server, involving five components: the client, client stub, RPC protocol, server stub, and server. The process of sending a message from the client to the server and back is detailed, including the steps of marshalling (packaging the message and parameters), the RPC protocol transferring the message, the server stub unpacking the message, the server processing the request, and the return value being sent back to the client through unmarshalling (unpackaging the return value).
🔄 Understanding Pipes for Inter-Process Communication
This paragraph explores the use of pipes in client-server communication, particularly in the context of Unix operating systems. Pipes allow for unidirectional communication between processes, with the example of a producer writing to one end of the pipe and a consumer reading from the other. The paragraph explains how pipes can be used to pass the output of one process as input to another, with the system temporarily holding this information until the receiving process is ready. The creation and use of file descriptors for accessing the read and write ends of the pipe are discussed, along with the concept of using two pipes for two-way communication. The limitation that processes using pipes must have a common parent process is also mentioned.
📝 Recap of Client-Server Communication Methods
The final paragraph serves as a recap of the three main methods of client-server communication covered in the script: socket communication, RPC, and pipes. It emphasizes the importance of understanding these methods for effective communication between clients and servers. The paragraph concludes with a question about marshalling and demarshalling in RPC, inviting students to answer in the comment box, and a teaser for the next class's topic.
Mindmap
Keywords
💡Client-Server System
💡Circuit Communication
💡Remote Procedure Call (RPC)
💡Well-known Port Numbers
💡Socket
💡Marshalling
💡Demarshalling
💡Pipes
💡File Descriptor
💡Two-way Communication
Highlights
Introduction to client-server communication in operating systems.
Simple architecture of client-server system explained with multiple clients connected to a server.
Clients request services from the server, which responds with the requested service.
Discussion on circuit communication and its role in client-server interaction.
Definition of a circuit as an endpoint for communication between client and server processes.
Explanation of socket communication, defined by IP address and port number.
Port numbers 0 to 1023 are reserved for well-known services like telnet, FTP, and HTTP.
Server receives client requests through specified ports, establishing a circuit connection.
Example given of host X connecting to a web server, illustrating socket communication.
Unique port numbers must be assigned for each connection to ensure uniqueness.
Introduction to remote procedure call (RPC) as a powerful technique for client-server communication.
RPC allows function calls to be made to procedures available on a different system.
Client-server interaction via RPC involves request and response message passing.
Five components involved in sending messages from client to server in RPC.
Explanation of marshalling and demarshalling in RPC, where messages are packed and unpacked.
Introduction to pipes for client-server communication, allowing processes to communicate in a producer-consumer fashion.
Ordinary pipes are unidirectional, requiring two pipes for two-way communication.
Pipes are used for passing information from one process to another, with a limitation that processes must have a common parent.
Summary of three types of client-server communication: socket communication, RPC, and pipes.
Transcripts
hello friends welcome to today's
operating system class and in this class
we will see the communication in client
server system
and this is the very simple architecture
of client server system here we are
having more number of clients all the
clients will be connected to the server
through internet
and all the services will be there in
the server system first the client will
give request to the server for any
particular service
requested to the server and the server
will provide that particular service to
the client in the form of response
response okay so this is the very simple
architecture how
this communication will be taken place
here we are going to see
the circuit communication
and rpc communication and pipe rpc is
nothing but remote procedure call okay
let us see all these things one by one
the first one is communication using
circuits
first let us see what is circuit circuit
is nothing but the end point for
communication between two processes
one process is in client and another
process is in server okay this is the
simple client server architecture for
the socket communication here the socket
is defined by ip address concatenated
with the port number see
up to this is ip address
and this one is port number
port number okay
and when come to the server system this
is ip address
and this is port number
when come to port number
1024 port numbers are defined for some
special purpose and those are called as
well known port numbers
that is 0 to
1023 port numbers are reserved port
numbers okay here 23 is reserved for
telnet and 21 is reserved for ftp that
is fine transfer protocol and 80 is
reserved for web server or http
okay
so if we use any browser then
we are using this
id port number that is for web server
okay here the server receives
clients request
this is the server system the server
should receive the request from the
client
by specified port
by specified port so normally the client
can use browser
browser hence
http protocol is being used and port 80
is reserved for this
okay and
once the request is received
from the client
then the server will accept that request
and the connection from the client
circuit will be established
okay next the server implement the
specific services
through the through this particular
circuit okay which may be either through
telnet or through file transfer protocol
or through
the http hypertext transport protocol
okay and
listen to this well-known ports
okay so the server will receive the
request only through well-known ports
only through well-known course that is
normally the browser so client how to
use the browser or ftp
or telnet
for establishing the connections and it
will give this request to only through
that connections okay that is the
circuit connection
let us see one example for this
in this diagram we are having two
systems first one is hostiac
host x
um the ip address for host x is
146.86.5.20
and this host x wanted to connect with
the web server which ip address is this
one that is 161.25.19.8
okay and the port number for this host x
is
16.25 and for web server this is
reserved for 80 because this is the web
server this is the web server hence 80
is reserved for this web server okay now
the connection will consist of pair of
circuits which are the pair of circuits
this is the socket one and this is
circuit that is client circuit and this
is server circuit and from these two
circuits connection will be established
and the packets will be traveled between
this connection
okay the packets are traveling between
host are delivered to appropriate
process based on the destination port
number
okay so 1625 is assigned for host x the
port number is assigned for host tx and
80 is assigned for the web server here
all the connections must be unique
must be unique that is we have to assign
a different port number for all the
connections
suppose if the host y which is wanted to
connect with the server
that is the web server then we have to
assign different port number to this
particular
um
host that is host y other than 0 to 1023
okay so and we have we should not assign
this
uh
1625 here again because all the port are
unique
and this ensures all connections consist
of unique pair of circuits this is
important
the second one is remote procedure call
which is another important and very
powerful technique
for communicating client and server
systems
okay and this is also known as function
call our subroutine curve
okay why it is called as function color
subroutine curve for example this is our
main program it may be void main
okay in our main program we are having
some function called
student details
student details that may be
start here to here and some programs are
also here
see if we call this student detail
in between this main program then this
is the
local procedure called not the remote
procedural because the student detail
function is available within the program
itself within the system itself
okay
but
when come to remote procedure call
this function is available in some other
system
okay and we have tried to call that
particular function from the client
system
okay so
this is the
function call that is the procedure call
we we have to call this procedure p
with the parameter xyz with the
parameter xyz then the server system
will receive this particular request and
it will return the
return value p to the client
okay return to this procedure result
that is the return value to this client
okay
here
when a program causes a procedure to
execute in different address space
different address space means the
procedure is available in the server
system not in the client system okay but
we have to code
to call the procedure as a local
procedure call without the details of
remote interaction we simply call this
particular procedure here the programmer
how to write the same code whether the
subroutine is local to this particular
program to executing or the subroutine
may be available in the remote program
okay this is important
okay so this form of client server
interaction implemented via request and
response message passing system
okay here we are passing only the
messages between the client and the
server
the server will receive the message in
the form of procedure call and the
client will receive the message in the
form of result of this procedure
here
through this remote procedure called the
client and server systems will be
connected between each other okay so our
pc protocol is available in the both end
here this is the client system
client system and this is server
server system in this architecture five
components are involved to sending
message from
the client to server
client to server here
we are having the first one is client
this is the client okay client and
clients tab claim staff is here and rpc
protocol which is used to connect
between the
client and system and second next one is
server step
and the last one is server server is
here okay so to sending the message from
client to server to sending the message
from client to server five components
are involved
[Music]
and now let us see how the communication
will be taken between the client system
on the server system client system one
server system
as per this remote procedure call first
the client sends the message to the
client step say this is the client
client send the message to client step
and the client stop packs the message
that is message with the parameters
message with the parameter that is the
function parameter or procedure
parameters then this is called as
marshalling and that will be sent to the
remote procedure call so what is the
duty of client step client stub will
pack
the message with the parameter okay and
that packed message sends to the
remote procedure called protocol rpc
protocol and step 3 is the rpc protocol
sends the packed message to rpc protocol
of server see rpc protocol will transfer
this message
to the
protocol of server system
okay here and that will be given to
servers tab
the server step unpacks the message that
is message
plus parameter
the server system the server step will
unpack the message and parameter and
that argument list will be given to the
server program next the server processes
the message via several functions are
subroutines
and sends back to the server step
okay again the value will be written to
the server step here the server step
again packs the message that is the
return value with the message
okay
plus message
so this is called as smart selling again
okay and that
message backed message will be given to
rpc protocol next day the server rpc
protocol sends the
packed message to the client rpc
protocol now the connection will comes
like this
right and then the message is received
by the clients tab
client staff and the client stuff will
deem or selling the message with the
return value and this written value will
be given to client system
okay
the third type of client server
communication
is by using pipes
let us see first the ordinary pipes
ordinary pipes allows two process can
communicate
to each other the standard formatter is
producer and consumer fashion okay
producer will stay in one end this is
producer
and this is consumer
okay here the producer writes to one end
of the pipe okay this is called as right
end
right end and the consumer reads from
other end of this pipe so this end this
is called as radiant
radiant here
the ordinary pipes are unidirectional
okay only one way communication is
possible in this ordinary pipes
in unix operating system
the pipe is a technique for passing
information from one program's process
to another process
okay here the pipe is used to pass the
parameters such as the output of one
process to be
the input of another process okay so
this is process one this is p1 the
output of p1
this is the output will be given to
input of
another process for example p2
okay
so
the system temporarily holds this piped
information that is the temporary result
a result of p1
p1 result until it reads by the
receiving process okay so
the output will be weight until p2 is
ready to read this particular output
okay so for this we have to use this
pipe to hold
the
temporary result or the output of p1
so any pipe can access by using the read
and write system calls
here
the pipe of
int fd
which is
nothing but
to create the pipe
that accessed through
this particular file descriptor
okay fd is
the file descriptor of type integer fd
means file descriptor
and
fd of 0 that is file descriptor 0 ftf 0
is read end of the pipe okay so this is
radiant
read end of the pipe and f1
this is f1
that is in the right end
okay suppose if we want to read anything
we have to use only this
radian that is all fd of 0
will access only in the read end and all
fd of 1 will access only in the right
end
suppose if we want two-way communication
the two-way communication required two
pipes two different pipes okay
so this is this pipe is for one
direction this is right end
and this is radiant
radial this is parent process and child
process okay suppose if we want to use
this as
read and this as right then we have to
use another pipe
okay pipe 2 should be used here we
cannot read that is we cannot write in
this end and we cannot read in this end
because this is now right end
we can write only this end and reading
will be taken place only this particular
end hence this is called as
radiant
so here it is
right end and this is radiant
when come to pipe two and this is right
sorry radiant and this is right in okay
so one pipe can use to form only one
communication if you want two-way
communication then we have to use two
different pipes type one and pipe two
and only one limitation in the pipe
for this inter-processor's communication
is that the process use pipes must have
common parent process
this is the only limitation in this
pipe communication
after this we have seen the
communication in client server systems
and there are three types first one is
socket communication and second one is
rpc that is remote procedure call and
third one is pipes so by using these
three methods the client server system
will be communicated to each other now
this is the question time
and
what is the marshalling and d marshaling
in
rpc
okay students please write your answer
in the comment box
and the next class we will see another
important topic from second unit thank
you
Browse More Related Video
Remote Procedure Calls (RPC)
Remote Procedure Call (RPC) - IOT - Pascasarjana STMIK Handayani
NW LAB 1. Basics of Socket Programming in C : TCP and UDP - Program Demo
What is a server? Types of Servers? Virtual server vs Physical server 🖥️🌐
Interprocessor Communication and Syncronization (Computer Architecture)
SMT 1-1 Web Service Fundamentals
5.0 / 5 (0 votes)