You are on page 1of 12

The Client Server Model

Pampa Sadhukhan
Limitation of Conventional Networking in Distributed
System
• At the first glance, communication over the layered protocols along
the OSI model look like a fine way to organize a distributed system.
• The disadvantage of using OSI or TCP/IP protocols is that every
time a message is sent it must be processed by about half a dozen
layer.
• For a LAN-based distributed system, protocol overhead is often
substantial. Thus it does not use layered protocol stack at all, but
they do use only a subset of entire protocol stack.
The characteristics of Client-Server Model
• The client and server normally all run the same microkernel.
• A machine may run a single process or multiple servers or multiple clients or a
mixture of it.
• It uses a simple, connectionless request-reply protocol.
• The primary advantage is simplicity and then efficiency as the protocol stack is
shorter.
• The communication services provided by the microkernel are reduced to two
system calls. These are send(dest, &mptr) and receive(addr, &mptr)
Different types of addressing

• Physical Addressing – Each Machine should have a unique data link


layer address. As several processes are running on a single
machine, sender should address the specific process running on the
a particular machine by the following format
machine number.process id or process id@machine number.
• This approach is not transparent as the user is aware of where the
server is located
• Logical Addressing – This approach is used to assign each process
a unique address that does not contain an embedded machine
number.
– A centralized process address allocater maintains a counter. Upon
receiving a request for an address, it returns the current value of the
counter and increments it by one. This do not scale to large system.
– Each process picks up its identifier from a large sparse address space.
The sending kernel can locate the machine where the process is
running via broadcasting.
– This scheme puts extra load on the system.
• Name Server – each server process is referred by as ASCII string.
The mapping between the high level service name and the machine
address are kept by the name server. During runtime, client can
lookup the machine address by simply sending a query message
containing service name to the name server.
• Name server acts as a centralized component.
• Use a Special Hardware – processes pick random addresses
and the special hardware in the network interface chip allow
processes to store their address inside it. When a frame passes,
network interface chip can examine whether the process is on its
machine.
Synchronous and Asynchronous communication primitives
• a) In case of synchronous primitive, the process that invokes send
or receive system call remains blocked until the message has been
completely sent or a message has been received by the process.
• b) Asynchronous Primitive – If the send is asynchronous, control returns to
the caller immediately, before the message is sent completely.
• Sending process does not know when the transmission is done and it is
safe to reuse the buffer. The possible way out are as follows.
– Kernel copy the message to its internal buffer and allows the process to
continue. Extra CPU time is wasted for copying
– Interrupt the sender when the message has been completely sent. Designing the
program is more difficult and subject to race condition.
Buffered and Unbuffered Primitives
• a) When a call to receive(addr, &m) is invoked, the kernel knows that
receiving process i) is listening at the address specified by addr.
ii) is ready to receive an incoming message copied to buffer
pointed by m. When a new message comes for that process, kernel
unblocks the process and copy the message to that buffer. This is called
unbuffered primitive.
• If sender call send before receiver invoke receive call, kernel is confronted
with the choices of keeping it for a while or discard it immediately.
• b) A solution to this approach is buffered primitive. In this approach, kernel
on the receiver machine, can create a mailbox for each receiver process
where it can store all the incoming messages addressing to that receiver
process.
• A call to receive method, removes one message from the mailbox.
Reliability Issues

(a) Individually acknowledged messages. (b) Reply being used as acknowledgement


of request
Four Design Issues for the communication primitives and
some of the principal choices available

You might also like