DC 2 QA Unit II

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

BUILDERS ENGINEERING COLLEGE, KANGEYAM

UNIT II
1. Draw the Middleware Architecture.
Application
RMI,RPC and events
Request reply protocol
External data representation
Operating system

2. What are the benefits of programming with interface in DS?


I. As with any form of modular programming, programmers are concerned only with
the abstraction offered by the service interface and need not be aware of
implementation details.
II. In potentially heterogeneous distributed systems , programmers also do not need to
know the programming language or underlying platform used to implementation
service.
III. This approach provides natural support for software evolution in this
implementation can change as long as the interface remains the same.
3. Define IDL.
Interface Definition Languages (IDLs) are designed to allow procedures implemented in
different languages to invoke one another. An IDL provides a notation for defining interfaces
in which each of the parameters of an operation may be described as for input or output in
addition to having its type specified.
4. List the used of IDL in web services.
The concept of an IDL was initially developed for RPC systems but applies
equally to RMI and also web service. Some of them are:
I. Sun XDR as an example of an IDL for RPC
II. CORBA IDL as an example of an IDL for RMI
III. The web service Description Language (WSDL),which is designed for an
Internet wide RPC supporting web service.

CS3551-DISTRIBUTED COMPUTING Page 1


BUILDERS ENGINEERING COLLEGE, KANGEYAM

5. What is meant by action in object model?


Action is an object oriented program is initiated by an object invoking a method
in another object. An invocation can include additional information needed to carry out the
method. The receiver executes the appropriate method and then returns control to the invoking
objects, sometimes supplying a result .An invocation of a method can have three effects:
I. The state of the receiver may be changed.
II. A new object may be instantiated, for example, by using a constructor in
java or C++.
III. Further invocation on methods in other objects may take place.
6. Define object reference.
Objects can be accessed via object reference. For example in java a variable that
appears to hold an object actually holds a reference to that object. To invoke a method in an
object the object reference and method name are given together with any necessary arguments.
The object whose method name is invoked is sometimes called the target and sometimes the
receiver. Object reference are first class values, meaning that they may be assigned to variables,
passed as arguments and returned as results of methods.

7.What is meant by garbage collection?


It is necessary to provide a means of freeing the space occupied by objects when they are no
longer needed. A language such as java, that can detect automatically when an object is no
longer accessible recovers the space and makes it available for allocation to other objects. This
process is called garbage collection; the programmer has to cope with the freeing of space
allocated to objects. This can be a major source of errors.
8.List the heart of distributed object model.
Remote object references: Other objects can invoke the methods of a remote object if they have
access to its remote object reference. For example a remote object reference for B must be
available to A.
The notation of object reference is extended to allow any object that can receive an RMI to have
a remote object reference. A remote object reference is an identifier that can be used throughout
a distributed system to refer to a particular unique remote object. Its representation which is

CS3551-DISTRIBUTED COMPUTING Page 2


BUILDERS ENGINEERING COLLEGE, KANGEYAM

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.

CS3551-DISTRIBUTED COMPUTING Page 3


BUILDERS ENGINEERING COLLEGE, KANGEYAM

11. List the choices of RPC invocation semantics.


The choices of RPC invocation semantics are defined as follows:
a Maybe semantics: With maybe semantics, the remote procedure call may be executed once or
not at all. Maybe semantics is useful only for applications in which occasional failed calls are
acceptable. Maybe semantics arises when no fault-tolerance measures are applied and suffer
from the following types of failure;
i. Omission failures if the request message is lost;
ii. Crash failures when the server containing the remote operation fails.
b. At-least-once semantics :With at-least-once semantics ,the invoker receives either a result ,in
which case the invoker knows that the procedure was executed at least once ,or an exception
informing it that no result was received .At-least-once semantics can be achieved by the
retransmission of request message . Which masks the omission failures of the request message.
At-least-once semantics can suffer from the following types of failure:
i. crash failure when the sever containing the remote procedure fails;
ii. arbitrary failures – incase when the request message is retransmitted, the remote server may
receive it and execute the procedure more than once, possible causing wrong values to be
returned.
c. At-most-once semantics : With at-most-once semantics , the caller receives either a Result ,
in which case the caller knows that the procedure was executed exactly once, or an Exception
informing if that no r using result was received, in which case the procedure will have been
executed either once or not at all. At-most-once semantics can be achieved by all, At-most-once
semantics can be achieved by using all of the fault-tolerance.
12. Sketch the RMI reply-request message structure.
Message Type
Request Id
Object Reference
Method Id
arguments

CS3551-DISTRIBUTED COMPUTING Page 4


BUILDERS ENGINEERING COLLEGE, KANGEYAM

13. List the action of remote reference module.


The action of the remote module is as follows:
 When a remote object is to be passed as an argument or a result for the first time, the
remote reference module is asked to create a remote object reference which it adds to its
table.
 When a remote object reference arrives in a request or reply message, the remote
reference module is asked for the corresponding local object reference, which may refer
either to a proxy or to a remote object.
 This module is called by components of the RMI software when they are marshalling and
unmarshalling remote object reference.
14. List the function of activator.
 processes that start server processes to host remote objects are called activators, for the
following reasons.
i) A remote object is described as active when it is available for invocation
within a running process wherever it is called passive if it is not currently
active but can be made active
ii) A passive object consists of two parts:
1. the implementation of its methods.
2. its state in the marshaled form.
 An activator is responsible for:
i. Registering passive objects that are available for activation which involves
recording the names of servers against the URLs or file names of the
corresponding passive objects.
ii Starting named server processes and activating remote objects in them
iii. keeping track of the locations of the servers for the remote objects that it
has already activated.
15.What is persistent object store?
An object that is guaranteed to live between activations of processes is called a persistet
object. Persistent objects are generally managed by persistent object stores, which store their
state in a marshaled from on disk. In generally a persistent object store will manage very large
numbers of persistent object which are stored in a disk or in a database until they are needed.

CS3551-DISTRIBUTED COMPUTING Page 5


BUILDERS ENGINEERING COLLEGE, KANGEYAM

16. How we decide whether the object is persistent or not.


There are two approaches to deciding whether an object is persistent are not:
i. The persistent object store maintains some persistent roots and any object
that is reachable from a persistent root is defined to be persistent. This
approach is used by persistent java, java Data Objects and perDis. They
make use of a garbage collector to dispose of objects that are no longer
reachable from the persistent roots.
ii. The persistent objects store provides some classes on which persistent is
based objects belong to their subclasses.
17. Define RPC.
The software components required to implement RPC are
The client that accesses a service includes one stub procedure for each procedure the
service interface. The stub procedure behaves like a local procedure to the client but instead of
executing the call it marshals the procedure identifier and the arguments into a request message
which it sends via its communication module to the server. When the reply message arrives it
unmarshals the results.
The server process contains a dispatcher together with one server stub procedure and one
service procedure for each procedure in the service interface. The dispatcher selects one of the
server stub procedures according to the procedure identifier in the request message.
18.What is event notification?
The distributed event based system extend the local event model by allowing multiple
object at different location to be notified of events takes place at an object. They use the publish
subscribe paradigm. A publish subscribe system is a system where publishers publish structured
events to an event service and subscriber express interest in particular events through
subscriptions which can be arbitrary patterns over the structure events.
19. List the example of publish subscribe system.
Publish-subscribe system is used in a wide variety of application domains particularly those
related to a large scale dissemination of events.
 Financial information systems.
 Other area with live feeds of real time data(including RSS feeds)

CS3551-DISTRIBUTED COMPUTING Page 6


BUILDERS ENGINEERING COLLEGE, KANGEYAM

 Supports for cooperative working where a number of participants need to be informed of


events of shared interest
 Support for computing including the management of events from the infrastructure
20. List the characteristics of publish-subscribe system.
Heterogeneity: When event notifications are used as a means of communication components in
a distributed system that were not designed to interoperate can be made to work together. All that
is required is that event generating objects publish the types of events they offer and that other
objects subscribe to patterns of events and provide an interface for receiving and dealing with the
resultant notification.
21. Define callbacks.
The general idea behind callbacks is that instead of clients polling the server to find out whether
some event has occurred, the server should inform its clients whenever that event occurs. The
term callback is used to refer to a server’s action of notifying clients about an event.
22. How callback is implemented in RMI.
Callback can be implemented in RMI as follows;
i. The client creates a remote object that implements an interface that contains method
for the server to call. We refer to that as a callback object.
ii. The server provides an operation allowing interest clients to inform it of the remote
object references of their callback objects. It records these in a list.
iii. Whenever an event of interest occurs, the server calls the interested clients, For
example, the whiteboard server would call its clients whenever a graphical object is
added.
23. List the responsibilities of core OS.
The core OS components and their responsibilities are :
Process manager: Creation of and operations upon process. A process is a unit of resource
management, including an address space and one or more threads.
Thread manager: Thread creation, synchronization and scheduling. Threads are schedulable
activities attached to processes.
Communication manager: Communication between threads attached to different processes on
the same computer some kernels also support communication between threads in remort

CS3551-DISTRIBUTED COMPUTING Page 7


BUILDERS ENGINEERING COLLEGE, KANGEYAM

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;

CS3551-DISTRIBUTED COMPUTING Page 8


BUILDERS ENGINEERING COLLEGE, KANGEYAM

 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.

2. Discuss the following: a) UDP datagram communication b) TCP stream


communication
1. UDP datagram communication
A datagram sent by UDP is transmitted from a sending process to a receiving
process without acknowledgement or retries. If a failure occurs, the message may not
arrive. A datagram is transmitted between processes when one process sends it and
another receives it
The following are some issues relating to datagram communication:
Message size
Blocking
Timeouts
Receive from any
Failure model for UDP datagrams
Omission failures
Ordering:
Use of UDP
For some applications, it is acceptable to use a service that is liable to occasional
omission failures. For example, the Domain Name System, which looks up DNS names
in the Internet, is implemented over UDP. Voice over IP (VOIP) also runs over UDP.
UDP datagrams are sometimes an attractive choice because they do not suffer from the
overheads associated with guaranteed message delivery. There are three main sources of
overhead:
• the need to store state information at the source and destination;
• the transmission of extra messages;
• latency for the sender.
2. TCP stream communication
The following characteristics of the network are hidden by the stream abstraction:
Message sizes: The application can choose how much data it writes to a stream or reads
from it. It may deal in very small or very large sets of data. The underlying
implementation of a TCP stream decides how much data to collect before transmitting it
as one or more IP packets. On arrival, the data is handed to the application as requested.
Applications can, if necessary, force data to be sent immediately.
Lost messages: The TCP protocol uses an acknowledgement scheme. As an example of a
simple scheme (which is not used in TCP), the sending end keeps a record of each IP
packet sent and the receiving end acknowledges all the arrivals. If the sender does not
receive an acknowledgement within a timeout, it retransmits the message. The more
sophisticated sliding window scheme cuts down on the number of acknowledgement
messages required.
CS3551-DISTRIBUTED COMPUTING Page 10
BUILDERS ENGINEERING COLLEGE, KANGEYAM

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.

3. What is marshalling? Explain the marshalling operation in CORBA?


Marshalling is the process of taking a collection of data items and assembling them into a
form suitable for transmission in a message. Unmarshalling is the process of
disassembling them on arrival to produce an equivalent collection of data items at the
destination. Thus marshalling consists of the translation of structured data items and
primitive values into an external data representation. Similarly, unmarshalling consists of
the generation of primitive values from their external data representation and the
rebuilding of the data structures.
Marshalling in CORBA • Marshalling operations can be generated automatically from
the specification of the types of data items to be transmitted in a message. The types of
the data structures and the types of the basic data items are described in CORBA IDL,
which provides a notation for describing the types of the arguments and results of RMI
methods. For example, we might use CORBA IDL to describe the data structure in the
message in as follows:
struct Person{
string name;
string place;
CS3551-DISTRIBUTED COMPUTING Page 11
BUILDERS ENGINEERING COLLEGE, KANGEYAM

unsigned long year;


};
The CORBA interface compiler generates appropriate marshalling and unmarshalling
operations for the arguments and results of remote methods from the definitions of the
types of their parameters and results.

4. Illustrate IP multicast communication.


A multicast operation is more appropriate – this is an operation that sends a single
message from one process to each of the members of a group of processes, usually in
such a way that the membership of the group is transparent to the sender.

Multicast messages provide a useful infrastructure for constructing distributed


systems with the following characteristics:
1. Fault tolerance based on replicated services
2. Discovering services in spontaneous networking
3. Better performance through replicated data
4. Propagation of event notifications

IP multicast – An implementation of multicast communication


When a multicast message arrives at a computer, copies are forwarded to all of
the local sockets that have joined the specified multicast address and are bound to the
specified port number. The following details are specific to IPv4:
 Multicast routers
 Multicast address allocation

5. Describe CORBA RMI and its services.


Remote method invocation (RMI) is similar to RPC but for distributed objects,
with added benefits in terms of using object-oriented programming concepts in
distributed systems and also extending the concept of an object reference to the global
distributed environments, and allowing the use of object references as parameters in
remote invocations.
Request-reply protocols
This form of communication is designed to support the roles and message
exchanges in typical client-server interactions. The protocol described here is based on a
trio of communication primitives, doOperation, getRequest and sendReply

 The doOperation method is used by clients to invoke remote operations


 getRequest is used by a server process to acquire service requests
 sendReply to send the reply message to the client.

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:

CS3551-DISTRIBUTED COMPUTING Page 12


BUILDERS ENGINEERING COLLEGE, KANGEYAM

 a requestId, which is taken from an increasing sequence of integers by the


sending process;
 an identifier for the sender process, for example, its port and Internet address.

Failure model of the request-reply protocol • If the three primitives doOperation,


getRequest and sendReply are implemented over UDP datagrams, then they suffer from
the same communication failures. That is:
• They suffer from omission failures.
• Messages are not guaranteed to be delivered in sender order.

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

6. Explain the RPC mechanism with various functional components.


Design issues for RPC
• the style of programming promoted by RPC – programming with interfaces;
• the call semantics associated with RPC;
• the key issue of transparency and how it relates to remote procedure calls.
Implementation of RPC

7. Elucidate the design issue for RMI.


RMI invocation semantics
Level of transparency
8. Discuss about design and implementation issues of DSM.
Distributed shared memory (DSM) is an abstraction used for sharing data between
computers that do not share physical memory.

CS3551-DISTRIBUTED COMPUTING Page 13


BUILDERS ENGINEERING COLLEGE, KANGEYAM

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

Message passing versus DSM


The DSM and message-passing approaches to programming can be contrasted as follows:
Service offered
Efficiency

9. Bring out the features of distributed object model.


The key characteristic of distributed objects is that they allow you to adopt an
object-oriented programming model for the development of distributed systems and,
through this, hide the underlying complexity of distributed programming.

Middleware based on distributed objects is designed to provide a programming model


based on object-oriented principles and therefore to bring the benefits of the
objectoriented approach to distributed programming.

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

CS3551-DISTRIBUTED COMPUTING Page 14

You might also like