DC 2 QA Unit II
DC 2 QA Unit II
DC 2 QA Unit II
UNIT II
1. Draw the Middleware Architecture.
Application
RMI,RPC and events
Request reply protocol
External data representation
Operating system
generally different from that of a local object reference. Remote object references are analogous
to local one in that:
The remote object to receive a remote method invocation is specified by
the invoker as a remote object reference.
Remote object references may be passed as arguments and results of
remote methods invocations.
Remote interfaces: Every object has a remote interface that specifies which of its methods can
be invoked remotely..
The class of a remote object implements the methods of its remote interface, for example as
public instance methods in java.Object in other processes can invoke only the methods that
belong to its remote interface.
9.Define RMI .
Each process contains a collection of objects, some of which can receive both
local and remote invocations whereas the other objects can receive only local invocations as
shown in figure.
Method invocation between objects in different processes, whether in the same computer or not,
are known as remote method invocations. Method invocation between objects in the same
process is local method invocation. We refer to objects that can receive remote invocation as
remote objects.
10. What are the main choices to be considered in design of RMI?
RMI invocation semantics
a. Retry-reply protocols, where we showed that doOperation can be implemented in different
ways to provide different guarantees.
b. The main choices are:
i. Retry request message: Controls whether to retransmit the request message until
either a reply is received or the server is assumed to have failed.
ii. Duplicate filtering: Controls when retransmissions are used and whether to filter out
duplicate requests at the server.
Iii.Retrasmission of results: Controls whether to keep a history of result message to
enable lost results to be retransmitted without re-executing the operations at the server.
processes. Other kernels have no notion of other computers built into them, and an additional
service is required for external communication.
Memory manager: Management of physical and virtual memory. It describes the utilization of
memory management techniques for efficient data copying and sharing.
Supervisor: Dispatching of interrupts, system call traps and other exceptions; control of memory
management unit and hardware caches; processor and floating-point unit register manipulation.
This is known as the Hardware Abstraction Layer in Windows.
24. Define process.
A process consists of an execution environment together with one or more threads.
25. Define thread.
A thread is the operating system abstraction of an activity (the term derives from the phrase
‘thread of execution’). An execution environment is the unit of resource management: a
collection of local kernel managed resources to which its threads have access.
26. Define Unix address space.
This representation of an address space as a sparse set of disjoint regions is a generalization of
the UNIX address space, which has three regions: a fixed, unmodifiable text region containing
program code; a heap, part of which is initialized by values stored in the program’s binary file ,
and which is extensible towards higher virtual addresses ; and a stack, which is extensible
towards lower virtual addresses.
27. List the uses of shared region.
The uses of shared regions include the following:
Libraries: Library code can be very large and would waste considerable memory if it was loaded
separately into every process that used it.
Kernel: Often the kernel code and data are mapped into every address space at the same location.
Data sharing and
Communication: Two processes, or a process and the kernel, might need to share data in order to
cooperate on some task. It can be considerably more efficient for the data to be shared by being
mapped as regions in both address spaces than by being passed in messages between them.
28. List the architecture of multi threaded server.
Working pool Architecture
Thread-per-request Architecture;
Thread-per-connection Architecture
Thread-per-object Architecturre:
29. Compare process and threads.
a. Creation a new thread within an existing process is cheaper than creating a process.
b. More importantly switching to a different thread within the same process is cheaper than
switching between threads belonging to different processes.
c. Threads within a process may share data and other resources conveniently and efficiently
compared with separate processes.
d. But by the same token threads within processes are not protected from one another.
30. Explain thread lifetime.
A new thread is created on the same Java Virtual machine (JVM) as its creator in the
SUSPENDED state. After it is made RUNNABLE with the start() method, it execute in the run()
method of an object designated in its constructor, The JVM and the threads on top of it all
execute in a process on top of the underlying operating system. Threads can be assigned a
priority so that a java implementation that supports priorities will run a particular threads in
preference to any thread with lower priority.
16 MARKS QUESTION
1. Explain in detail about the architectural model of distributed system.
The architecture of a system is its structure in terms of separately specified
components and their interrelationships. The overall goal is to ensure that the
structure will meet present and likely future demands on it.
Examples of architecture models are:
Client – server model
Peer to peer model
Proxy server model
Architectural elements:
Communicating entities: The first two questions above are absolutely
central to an understanding of distributed systems; what is communicating
and how those entities communicate together define a rich design space for
the distributed systems developer to consider. It is helpful to address the
first question from a system-oriented and a problem-oriented perspective.
Communication paradigms: We now turn our attention to how entities
communicate in a distributed system, and consider three types of
communication paradigm:
interprocess communication;
remote invocation;
indirect communication.
CS3551-DISTRIBUTED COMPUTING Page 9
BUILDERS ENGINEERING COLLEGE, KANGEYAM
Architectural patterns
Layering • The concept of layering is a familiar one and is closely related
to abstraction. In a layered approach, a complex system is partitioned into
a number of layers, with a given layer making use of the services offered
by the layer below.
Flow control: The TCP protocol attempts to match the speeds of the processes that read
from and write to a stream. If the writer is too fast for the reader, then it is blocked until
the reader has consumed sufficient data.
Message duplication and ordering: Message identifiers are associated with each IP
packet, which enables the recipient to detect and reject duplicates, or to reorder messages
that do not arrive in sender order.
Message destinations: A pair of communicating processes establish a connection before
they can communicate over a stream. Once a connection is established, the processes
simply read from and write to the stream without needing to use Internet addresses and
ports. Establishing a connection involves a connect request from client to server followed
by an accept request from server to client before any communication can take place.
The following are some outstanding issues related to stream communication:
Matching of data items
Blocking
Threads
Use of TCP
Many frequently used services run over TCP connections, with reserved port
numbers. These include the following:
HTTP: The Hypertext Transfer Protocol is used for communication between
web browsers and web servers
FTP: The File Transfer Protocol allows directories on a remote computer to be
browsed and files to be transferred from one computer to another over a
connection.
Telnet: Telnet provides access by means of a terminal session to a remote
computer.
SMTP: The Simple Mail Transfer Protocol is used to send mail between
computers.
Message identifiers • Any scheme that involves the management of messages to provide
additional properties such as reliable message delivery or request-reply communication
requires that each message have a unique message identifier by which it may be
referenced. A message identifier consists of two parts:
Styles of exchange protocols • Three protocols, that produce differing behaviours in the
presence of communication failures are used for implementing various types of request
behaviour.
• the request (R) protocol;
• the request-reply (RR) protocol;
• the request-reply-acknowledge reply (RRA) protocol
The main point of DSM is that it spares the programmer the concerns of message
passing when writing applications that might otherwise have to use it. DSM is primarily a
tool for parallel applications or for any distributed application or group of applications in
which individual shared data items can be accessed directly. DSM is in general less
appropriate in client-server systems, where clients normally view server-held resources as
abstract data and access them by request
The added complexities: Because of the added complexities involved, the associated
distributed object middleware must provide additional functionality, as summarized
below:
Inter-object communication
Lifecycle management
Activation and deactivation
Persistence