Title: CSE 8343 Adv. OS Group A2 Communication in Distributed File System
1 CSE 8343 Adv. OS
Group A2 Communication in
Distributed File System
- by
- Sajida Begum
- Samina Choudhry
2 Outline
- Client Server Model
- - Blocking Vs Non-Blocking.
- - Buffered Vs Un-Buffered.
- - Reliable Vs Un-Reliable.
- - Server architecture concurrent Vs.
sequential. - - Scalability
- Remote Procedure Call
- Group Communication
3Client Server Computing
- Client Machines Generally single user PCs or
workstations that provide user friendly interface
to the end user. - Server Machines Provide a set of share user
services to the clients. - The server enables many clients to share access
to the same database and enable the use of a
high-performance computer system to manage the
database.
4 Client/Server Environment
LAN or WAN
Servers
Workstations or Clients
5 Client/Server Applications
Client Requests (128.32.)
Server Responds to (128.32)
6 Client/Server Model
- Key Concept The client component and the server
component of the client/server model are software
applications running on computers. - The Client requests an operation or service
from the server. - -The client may request data or programs
- from the server
- -The client may send data for the server
- to store
- - The client may send data to be passed
- on to another computer on the network
7 Addressing (Locating Servers)
- Hard wired address
- - Not transparent
- - Difficult to migrate
- Broadcast based
- - Server chooses address from address space
- - Client broadcast request.
- - Can Cache response for future.
- Locate Address via Naming Server
8 Addressing cont..
- Use of Name Server
- - Name Server located at well-known address
maintains mapping between servers logical names
and their physical addresses. - - Client sends a lookup request to NS
requesting address of server. - - NS reply indicates serer address.
- - Client sends request to server
- - Server sends reply to client.
9 Blocked Vs Non-Blocked
- Blocking communication (synchronously)
- Sender specifies msg (in buffer) to send and
destination address. - Remains blocked until the message has been sent.
- Non Blocked (Asynchronously)
- Returns control to invoker as soon as message to
be sent has been copied in a (local) kernel
buffer. - Transmission process proceeds asynchronously from
sender.
10How Block Sends Receives
- Block sends
- Message placed in buffer
- Send invokes process blocks
- Message copied into kernel
- Message is transmitted.
- Block receives
- Received invoked by process
- If there is a message then copied into process
space - If no message process blocks until a message
arrives.
11How Un-Block Sends Receives
- Un-Block sends
- Message placed in buffer
- Send invokes process continues
- Message is transmitted.
- Un-Block receives
- Received invoked by process
- If there is a message then copied into process
space - If no message process continues.
- Process needs to check for message arrivals.
12Buffered VS. UnBuffered primitives
- Buffered primitives
- - process invoking receive requires kernel to
create a mailbox for it, specifies its own local
address(e.g. a port number) and blocks. - - The kernel maintains the mailbox in kernel
space. - - Incoming message containing process address is
deposited by the kernel in the process mailbox,
pending receive is terminated unblocking the
process. - - mailbox full race conditions in kernel
space kernel may have discard message.
13Buffered VS. UnBuffered cont..
- UnBuffered Primitives
- receive(addr, m) invoked by process to receive
a message at address addr into buffer pointed at
by m, in the invokers memory space. - Invoker blocks after invocation.
- Kernel unblocks invoker when message is received
and copied in buffer m. - If message is received and there are no pending
receive , the kernel discards message and client
retries. - If receive is invoked by server, race conditions
may occur when this is doing work for other
client.
14Remote Procedure Call (RPC)
- RPC is a protocol that manages the messages sent
between the client and the server processes.It is
- a set of rules for marshalling and un-marshalling
parameters and results - a set of rules for encoding and decoding
information transmitted between two processes - a few primitive operations to invoke an
individual call, to return its results, and to
cancel it - provision in the operating system and process
structure to maintain and reference state that is
shared by the participating processes.
15 RPC Architecture
Server
Client
Local Call
Remote Procedure
Client Stub
Server Stub
RPC
RPC
Send
Receive
Send
Receive
Network
16RPC Remote Invocation mechanism
- 1. Client calls client stub in normal way
- 2. Client stub builds call msg, marshalling
(Packing) parameters, and calls OS routine for
msg sending. - 3. OS sends the message to server node.
Call
Pack params
Unpack params
call
return
return
Unpack results
Pack results
17RPC Remote Invocation cont..
- 4. Server node receives msg, hands it to server
stub. - 5. Server stub unmarshalls (unpacks) parameters,
and calls actual routine. - 6. Call is executed and results returned to
server stub. - 7. Server marshals parameters, builds result msg,
and hands it to OS for transmission. - 8. Message is sent to client node.
- 9. Client stub receives message.
- 10.Message is unmarshalled, and the stub returns
the call to the client.
18RPC Design Issues
- Parameter passing
- Binding (locating servers)
- Treatment of failures
- Parameter languages employ various techniques
- - Call by value The parameter value is copied
on the stack, in the called procedure, a local
variable gets initialized to this value. The
called procedure - may modify it, but such changes do not affect
the value of the original value. - - Call by reference The reference to the
variable (pointer) is copied on the stack the
called procedure can therefore access the
variable and changes are directly reflected in
the calling program.
19RPC Scheme binds client server
- Binding information may be pre-decided in the
form of fixed port addresses. - - at compile time, an RPC call has a fixed port
number associated with it. - - once the program is compile the server cannot
change the port number of the requested service. - Binding can be done dynamically
- - Operating system provides a daemon on a fixed
RPC port. - - Client then sends a message to the daemon
requesting the port address of the RPC it needs
to execute.
20RPC Design Issues IDL
- A specification language is necessary for
specifying service routines - - For C programs, one can use C class
definitions, but this becomes rather language
specific. Special Interface Definition Languages
(IDLs) have been suggested to allow mixed-
language programming. - - you need IDL to your language stub
compiler. - - client and servers could be written in
different languages.
21RPC failures
- Failure Model
- 1. Communication failures functioning
processes temporarily unable to communicate. - 2. Node crashes a node ( computer) either
works or crashes (stops working), a crashed node
eventually recovers.
22Understanding about failures
- First, we begin by defining the possible failure
events during a call - 1. Client is unable to locate server process.
- 2. Clients request to message lost
- 3. Servers reply message lost
- 4. Server crashes during the call
- 5. Client crashes during the call.
23