0% found this document useful (0 votes)
3 views32 pages

Distributed Computing

The document provides an overview of distributed computing, including definitions, types, and key concepts such as interprocess communication (IPC), network services, and computing architectures. It discusses the strengths and weaknesses of distributed systems, highlighting advantages like scalability and resource sharing, alongside challenges like security concerns and multiple points of failure. Additionally, it covers various IPC operations, event synchronization, and the differences between unicast and multicast communication.

Uploaded by

hemanthofc2022
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views32 pages

Distributed Computing

The document provides an overview of distributed computing, including definitions, types, and key concepts such as interprocess communication (IPC), network services, and computing architectures. It discusses the strengths and weaknesses of distributed systems, highlighting advantages like scalability and resource sharing, alongside challenges like security concerns and multiple points of failure. Additionally, it covers various IPC operations, event synchronization, and the differences between unicast and multicast communication.

Uploaded by

hemanthofc2022
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DISTRIBUTED COMPUTING

UNIT I
2 Marks Questions
1. What is monolithic computing?
Monolithic computing is the simplest form of computing. A single computer such as
personal computer is used for computing. The computer that does monolithic computing is
not connected to any network.

2. Define Distributed Computing?


A distributed computer system consists of multiple software components that are on
multiple computers, but run as a single system. The computers that are in a distributed
system can be physically close together and connected by a local network, or they can be
geographically distant and connected by a wide area network.

3. What are Loosely coupled and Tightly coupled computers?


Loosely Coupled Computers: Independent computers connected via a network, each with
its own memory and processor, communicating through message passing.

Tightly Coupled Computers: Multiple processors share a common memory and are closely
linked, enabling faster communication and synchronization.

4. What are network service and network applications?


A network service is service provided by a special kind of program known as a server on a
network. The World Wide Web is such a service, as is electronic mail (email) and file
transfer (FTP).
A network application is an application that runs on networked computers for end users.
Network application range from enterprise applications such as online shopping carts and
electronic auction sites to noncommercial applications such as chatrooms and network
games.

5. What is node?
A node is a basic unit in a network or distributed system. It can be a computer, device, or
process that participates in communication.

6. What is parallel computing?


Parallel computing is the simultaneous use of multiple processors or cores to solve a problem
faster by dividing tasks into smaller sub-tasks that run [Link] simplified state
transition diagram.

7. What is IPC?
a process of exchanging the data between two or more independent process in a
distributed environment is called as Interprocess communication. Interprocess
communication on the internet provides both Datagram and stream communication.

8. What are the two types of inter-process communication?


Page | 1
DISTRIBUTED COMPUTING

The two types are:


1. Unicast
2. Multicast

9. What is unicast and multicast communication ?


Unicast: One sender communicates with one receiver.
Multicast: One sender communicates with multiple specific receivers (group
communication).

10. List the four operations of an archetypal IPC program interface.


The four operations are:
Send
Receive
Connect
Disconnect

11. What is the use of timeouts and threading?


Timeouts prevent indefinite waiting by setting a maximum wait time.

Threading allows concurrent execution within a process, improving efficiency and


responsiveness.

12. Differentiate “big-endian” and “little-endian” representation.


Big-Endian: Stores the most significant byte first. Example: 0x12345678 → 12 34 56 78

Little-Endian: Stores the least significant byte first. Example: 0x12345678 → 78 56 34 12

13. Expand FTP and SMTP.


FTP: File Transfer Protocol
SMTP: Simple Mail Transfer Protocol

14. What is text-based protocols?


Text-based protocols use human-readable text for communication. Examples include
HTTP, SMTP, and FTP.

15. What is request-response protocols?


Request-response protocols follow a model where a client sends a request and the server
replies with a response. Example: HTTP.

16. Differentiate event diagram and sequence diagram.


Event Diagram: Shows events and their relationships, used to model system events.
Sequence Diagram: Shows object interactions over time, used to model message flow
between objects.

17. What is event synchronization?


Page | 2
DISTRIBUTED COMPUTING

Event synchronization is the suspension of the execution of a operation issued by the


process until an process has been completed.

5Marks Questions:

1. List and explain different forms of computing. (7)


Different forms of Computing:
Monolithic Computing: In the simplest form of computing, a single computer, such as a
personal computer (PC), is used for computing. The computer is not connected to any
network, and thus it may use only those resources within its immediate access. This form of
computing may be called monolithic computing. The user runs applications on the system with
no access to resources beyond those available with the system Multiple users can engage in
monolithic computing. This form of computing, where the resources of a single computer can
be shared by concurrent users using a technique known as timesharing.
• Distributed Computing In contrast, distributed computing involves computing performed
among multiple network-connected computers, each of which has its own processor(s) and
other resources. A user, using a workstation, has full use of the resources on the local
computer to which its workstation is connected. In addition, through the interaction of local
computer and the remote computers, the user may access resources on the remote
computers. The World Wide Web is an excellent example of this type of computing. When
you use a browser to visit a web site, a program such as Netscape or Internet Explorer runs
on your local system and interacts with a program (known as a Web server) running on a
remote system to fetch a file that may reside on yet another remote system.
• Parallel Computing Similar to but distinct from distributed computing is a form of
computing known as parallel computing or parallel processing, which uses more than one
processor simultaneously to execute a single program. “Ideally, parallel processing makes a
program run faster because there are more engines (CPUs) running it.
• Cooperative Computing the term distributed computing has also been applied to
cooperative computing .Here two processes can share their data.

2. Explain strengths and weaknesses of distributed computing. (6)


Advantages
• The affordability of computers and availability of network access. Today’s personal
computer has computing power superior to that of the mainframe computers of the early
days, at a fraction of the size and the cost. Coupled with the fact that connectivity to the
Internet has become universally available and generally affordable, the large number of
interconnected computers makes for an ideal community for distributed computing.
• Resource sharing. The architecture of distributed computing mirrors the computing
architecture of modern organizations. Each organization independently maintains
computers and resources that are local to the organization while sharing resources over the
Page | 3
DISTRIBUTED COMPUTING

network.
• Scalability. With the monolithic computing, the available resources are limited to the
capacity of one computer. By contrast, distributed computing provides scalability in that
increasing demand for resources can be addressed effectively with additional resources.
• Fault tolerance. Compared to monolithic computing, distributed computing provides the
opportunity for fault tolerance in that a resource can be replicated (or mirrored) to sustain
its availability in the presence of failures. For example, backup copies of a data base can be
maintained on different systems on the network, so that when one system fails, other
copies can be accessed without disrupting the service.
Disadvantages:
• Multiple points of failure. There are more points of failure in DC. Since multiple
computers are involved, all of which depend on the network for communication, the failure
of one or more computers, or one or more network links, can spell trouble for a DC system.
• Security concerns. In distributed system, there are more opportunities for unauthorized
attack. Whereas in a centralized system all the computers and resources are typically under
the control of a single administration, in a distributed system management is decentralized,
often involving a large number of independent organizations. The decentralization makes it
difficult to implement and enforce security policies.

3. Draw the architecture of distributed applications and explain the same (5)
The idea of using multilayer to organize the functionalities of a data network can be applied
to distributed applications. Figure 1.20 presents an example of such an architecture. Using
this architecture, the functionalities of a distributed application can be classified in three
layers:
The presentation layer provides the user interface. For example, if the application is a
shopping cart, this layer generates the set of web pages that are viewable by a shopper
using a browser.

The application logic layer provides the computation fir the application. This layer is also
called the business logic layer for enterprise applications. In shopping cart application, this
layer is responsible for such tasks as credit verification and computing the dollar amounts
of the orders, sales tax, and delivery cost.
The service layer provides the underlying services needed to support the functionalities
of the top two layers. Services may include data access facilities (such as a database
management system), directory services for name lookups (such as Domain Name Service),
and interprocess communication (which allows data to be exchanged among processes).

Page | 4
DISTRIBUTED COMPUTING

4. Define IPC? Differentiate unicast and multicast. (4)


In distributed computing, two or more processes engage in IPC in a protocol, a set of rules
that must be observed by the participants in data communication agreed upon by the
processes. A process may be a sender at some points during a protocol, a receiver at other
points.
When communication is from one process to a single other process, the IPC is said to be a
Unicast. When communication is from one process to a group of processes, the IPC is said
to be a Multicast as shown below

5. Write a note on an archetypal IPC program interface. Explain the working of basic
HTTP works with block diagram. (7)
Consider a basic API that provides the minimum level of abstraction to facilitate IPC. Four
primitive operations are needed as given below
Send: This operation is issued by a sending process for the purpose of transmitting data to
a receiving process. The operation must allow the sending process to identify the receiving
process and specify the data to be transmitted.
Receive: This operation is issued by a receiving process for the purpose of transmitting
data to a sending process. The operation must allow the receiving process to identify the
sending process and specify a memory space that allows the data to be stored, to be
subsequently accessed by the receiver.
Connect: For connection-oriented IPC, this operation allow a logical connection to be
established between the issuing process and a specified process: one process issues a
request-to-connect (connect for short) operation while the other process issues an accept-
connection operation.
Disconnect: For connection-oriented IPC, this operation allow a previously established
logical connection to be deallocated at both sides of the communication.
A process involved in IPC issues these operations in some predetermined order. The
issuance of each operation causes the occurrence of an event.
For example, a send operation issued by a sending process results in the event wherein
data is transmitted to the receiving process, while a receive operation issued by a receiving
Page | 5
DISTRIBUTED COMPUTING

process results in data being delivered to the process. Network service protocols can be
implemented using primitive IPC operation. For example, in basic HTTP (hypertext transfer
protocol) one process, a web browser, issues a connect operation to establish a logical
connection to another process, a web server, followed by a send operation to the web
server, which transmits data representing a request. The web server process in turn issues a
send operation that transmits data requested by the web browser process. At the end of
the communication, each process issues a disconnect operation to terminate the
connection as shown below

6. Define is event synchronization? Mention its types (3) 2


A main difficulty with IPC is that the processes execute independently, with neither process
knowing what takes place in the process at the other end. The synchronization is by using
simplest way for an PC facility to provide for event blocking, which is the suspension of the
execution of a operation issued by the process until an process has been completed.
There are two types of operations
1) Blocking or synchronous and
2) Non_blocking or asynchronous.

Page | 6
DISTRIBUTED COMPUTING

A blocked process will experience indefinitely blocking, during which the process will
remain in the blocked state indefinitely, unless intervening measures are taken.
A non-blocking operation can be issued by a process when that process may proceed
without waiting for the completion of the event that the operation initiates.
Different modes of event synchronization with different scenarios:
a) Synchronous Send and Synchronous Receive
b) Asynchronous Send and Synchronous Receive
c) Synchronous Send and Asynchronous Receive
d) Asynchronous Send and Asynchronous Receive

7. Explain synchronous send and synchronous receive with block diagram (6)
Is a diagram, which we will as an event diagram, that illustrates the event synchronization
for a protocol session implement using synchronous send and receive operation. In this
scenario, a receive operation issued causes the suspension of the issuing process 2 until
data is received to fulfil the operation. Likewise, a send operation issued causes the sending
process1 to suspend. When the data sent has been received by process2, the IPC facility on
host2 sends an acknowledgment to the IPC facility on host1, and process1 may
subsequently be unblocked.

8. Explain asynchronous send and synchronous receive with block diagram


Below figure illustrates an event diagram for a protocol session implement using
asynchronous send and synchronous receive operation. In this case the sending process is
never blocked, so no acknowledgment is necessary from the IPC facility on the host of
process2.
This use of asynchronous send and synchronous receive is appropriate if the sender’s
application logic does not depend on the receiving of the data at the other end. However,
depending on the implementation of the IPC facility, there is no guarantee that the data

Page | 7
DISTRIBUTED COMPUTING

sent will actually be delivered to the receiver. For example, if the send operation is
executed before the corresponding receives operation is issued on the other side; it is
possible that the data will not be delivered to the receiving process unless the IPC facility
makes provision to retain the prematurely sent data.

9. Explain synchronous send and asynchronous receive. Explain all its scenarios with
diagram (8)

Page | 8
DISTRIBUTED COMPUTING

Above figure illustrates different scenario for a protocol session that employs synchronous
send and asynchronous receive operation. The receive operation will, in all cases, return
immediately, and there are three scenarios for what happens subsequently:
Scenario 1. The data requested by the receive operation has already arrived at the time
when the receive operation is issued. In this case, the data is delivered to process 2
immediately, and an acknowledgment from host 2’s IPC facility will unblock process 1.
Scenario 2. The data requested by the receive operation has not yet arrived: no data is
delivered to the process. It is the receiving process’s responsibility to ascertain that it has
indeed received the data and, if necessary, repeat the receive operation until the data has
arrived. Process1 is blocked indefinitely as long as process2 repeat the receive operation.
Scenario 3. The data request by the receive operation has not yet arrived. The IPC facility of
host 2 will notify process2 when the data it requested has arrived, at which point process2
may proceed to process the data.
10. Write a note on asynchronous send and asynchronous receive. (5)
Without blocking on either side, the only way that the data can be delivered to the receiver
is if the IPC facility retains the data received. The receiving process can then be notified of
the data’s arrival. Alternatively, the receiving process may poll for the arrival of the data
and process it when the awaited data has arrived.

11. Write a note on timeouts and threading. (4)


Although blocking provide the necessary synchronization for IPC, it is generally
unacceptable to allow a process to be suspended indefinitely. There are two measures to
address this issue. First, timeouts may be used to set a maximum time period for blocking.
Timeouts are provided by the IPC facility and may be specified in a program with an
operation. Second, a program may create a child process or a thread to issue a blocking
operation, allowing the main thread or parent process of the program to proceed with
other processing while the child process or child thread is suspended as shown below

Page | 9
DISTRIBUTED COMPUTING

12. Write a note on deadlocks and timeouts. (4)


Indefinite blocking may also be caused by a deadlock. In IPC, a deadlock may occur due to
the misunderstanding of a protocol, or due to programming error. Figure 2.10 illustrates
such a case. In process 1, a blocking receive operation is issued to receive data from
process2. Concurrently, process 2 issues a blocking receive operation where a send
operation was intended. As a result, both processes are blocked awaiting data sent from
the other, which can never occur (since each process is now blocked). As a result, each
process will be suspended indefinitely until a timeout occurs, or until the operating system
abort the process.

13. What do you mean by data representation? (5)


At the physical layer of the network architecture, data is transmitted as analog signals,
which represent a binary stream. At the application layer, a more complex representation
of transmitted data is needed in order to support data types and data structures provided
in programming languages, such as character string, integers, floating point values, arrays,
records, and object.

Page | 10
DISTRIBUTED COMPUTING

Example, suppose process 1, running on host A, wishes to send a single character ‘a’ to
process 2, running on host B. the program for process 1 uses ASCII representation for
character, while the program for process 2 uses Unicode representation.
Scheme 1 will call for process 1 to convert the ‘a’ to Unicode before sending.
Scheme 2 will call for process 2 to receive the data, and then convert it from ASCII
representation to the corresponding Unicode representation.
Scheme 3 will call for the two sides to agree on an external representation.
The term data marshaling is used in IPC to refer to the processing necessary to transmit
data values and data structures. It is needed for all the IPC and includes necessary steps for
conditioning the data to be transmitted:
1. . Serializing the data structures
2. Converting the data values to an external representation.

14. Explain event diagram and sequence diagram with suitable examples(7)
An event diagram is a diagram that can be used to document the detailed sequence of
events and blocking during the execution of a protocol. Figure 2.14 is an event diagram for
a request-response protocol involving two concurrent processes, A and B. the execution of
each process with respect to time is represented using a vertical line, with time increasing
downward. A solid (continuous)line interval along the execution line represents process is
in active state(executing). A dotted line (based line broken) represent process is blocked.

In the example, both processes are initially active. Process B issues a blocked receive
operation in anticipation of request 1 from process A. process A mean while issues the
awaited request 1 using a nonblocking send operation, then subsequently a blocking
receive operation in anticipation of process B’s response. The arrival of request 1
reactivates process B, which process A. process B then issues a blocking receive for request
2 from process A. the arrival of response and to issue request 2, which unblocks process B.
A similar sequence of events follows.
Example : Figure 2.15 uses an event diagram to describe basic HTTP.

Page | 11
DISTRIBUTED COMPUTING

In its basic from Sequence diagram is a diagram, to show the execution flow of each
participants of a protocol using is a dashed line and does not differentiate between the
states of blocked and executing. Each message exchanged between the two sides is shown
using a directed line between the two dashed lines, with a descriptive label above the
directed lines, as illustrated in figure 2.16

Example:

Page | 12
DISTRIBUTED COMPUTING

UNIT II
2 Marks Questions

1. Define abstraction.
Abstraction is used to hide background details or any unnecessary implementation about
the data so that users only see the required information. It is one of the most important
and essential features of object-oriented programming.

2. What are paradigms?


Paradigm means “a pattern, example, or model.” In the study of any subject of great
complexity,it is useful to identify the basic patterns or models, and classify the detail
according to these [Link] paradigms will be presented in the order of their level of
abstraction

3. Write the diagram of distributed computing paradigms and their level of abstraction.

4. What is message passing?


Message passing is the most fundamental paradigm for distributed applications. A process
sends a message representing a [Link] message is delivered to a receiver, which
processes the request, and sends a message in response.

5. Mention the basic operations required to support the message passing


Send – Transmit a message from one process to another.
Receive – Accept a message sent by another process.
Connect – Establish a communication link between processes.
Disconnect – Terminate the communication link.

6. What is client server paradigm?


Perhaps the best known paradigm for network applications, the client-server model assigns
asymmetric roles to two collaborating processes. One process, the server, plays the role of
a service provider which waits passively for the arrival of requests. The other, the client,
issues specific requests to the server and awaits its response.

7. What do you mean by peer-to-peer paradigm?


Page | 13
DISTRIBUTED COMPUTING

In system architecture and networks, peer-to-peer is an architecture where computer


resources and services are direct exchanged between computer systems. These resources
and services include the exchange of information, processing cycles, cache storage, and disk
storage for files.

8. What are message system paradigm and their types?


The message system acts as a switch for messages, through which processes exchange
messages asynchronously, in a decoupled manner.
There are two main subtypes of message system models
1) The Point-To-Point Message Model
2) The Publish/Subscribe Message Model

9. Mention any two software engineering issues that should be considered while choosing a
tool.
1. Level of Abstraction
2. Cross Platform

10. What are UDP and TCP? Why they are used?
The User Datagram Protocol (UDP) allows a packet to be transported using connectionless
communication. The data packet thus transported is called a datagram.
The Transmission Control Protocol (TCP) is connection-oriented and transports a stream of
data over a logical connection established between the sender and the receiver.
Sockets that use UDP for transport are known as datagram sockets, while sockets that use
TCP are termed stream sockets.

11. List two transport layer protocols used in datagram socket API.
The User Datagram Protocol (UDP)
The Transmission Control Protocol (TCP)

12. What are the two types of sockets in stream mode socket API?
1. Server socket: For accepting connections
2. Socket : For data exchange

13. Name the two classes in Java for the datagram socket API.
1. The DatagramSocket class for the sockets.
2. The DatagramPacket class for the datagram exchanged.

14. What is SSL?


Secure Sockets Layer(SSL) is a protocol for establishing secure links between networked
computers.

15. What is JSSE?


The Java Secure Socket Extension (JSSE) enables secure Internet communications. It
provides a framework and an implementation for a Java version of the SSL

Page | 14
DISTRIBUTED COMPUTING

5 Marks Questions

1. Write a note on message passing.


Message passing is the most fundamental paradigm for distributed applications.
• A process sends a message representing a request.
• The message is delivered to a receiver, which processes the request, and sends a message
in response.
• In turn, the reply may trigger a further request, which leads to a subsequent reply, and so
forth.
• The basic operations required to support the basic message passing paradigm are send,
and receive.
• For connection-oriented communication, the operations connect and disconnect are also
required.
• With the abstraction provided by this model, the interconnected processes perform input
and output to each other, in a manner similar to file I/O. The I/O operations encapsulate
the detail of network communication at the operating-system level.
• The socket application programming interface is based on this paradigm.

2. Explain client-server paradigm with block diagram.

Perhaps the best known paradigm for network applications, the client-server model assigns
asymmetric roles to two collaborating processes. One process, the server, plays the role of
a service provider which waits passively for the arrival of requests. The other, the client,
issues specific requests to the server and awaits its response.
• Simple in concept, the client-server model provides an efficient abstraction for the
delivery of network services. Operations required include those for a server process to

Page | 15
DISTRIBUTED COMPUTING

listen and to accept requests, and for a client process to issue requests and accept
responses.
• By assigning asymmetric roles to the two sides, event synchronization is simplified: the
server process waits for requests, and the client in turn waits for responses.
• Many Internet services are client-server applications. These services are often known by
the protocol that the application implements. Well known Internet services include HTTP,
FTP, DNS, finger, gopher, etc.

3. Explain peer-to-peer paradigm with block diagram

In system architecture and networks, peer-to-peer is an architecture where computer


resources and services are direct exchanged between computer systems. These resources
and services include the exchange of information, processing cycles, cache storage, and disk
storage for files.
• In such architecture, computers that have traditionally been used solely as clients
communicate directly among themselves and can act as both clients and servers, assuming
whatever roles are most efficient for the network.
• In the peer-to-peer paradigm, the participating processes play equal roles, with
equivalent capabilities and responsibilities (hence the term “peer”). Each participant may
issue a request to another participant and receive a response.
• Where the client-server paradigm is an ideal model for centralized network service, the
peer-to-peer paradigm is more appropriate for applications such as instant messaging,
peer-to-peer file transfers, video conferencing, and collaborative work.
• It is also possible for an application to be based on both the client-server model and the
peer-to-peer model. A well-known example of a peer-to-peer file transfer service is
[Link] which allows audio files to be transmitted among computers on the Internet
along with a server for directory.
• For web applications, the web agent is a protocol promoted by the XNSORG (the XNS
Public Trust Organization) for peer-to-peer interprocess communication
• Project JXTA is a set of open, generalized peer-to-peer protocols that allow any connected
device (cell phone, PDA, etc) on the network to communicate.

Page | 16
DISTRIBUTED COMPUTING

4. What is message system paradigm? Explain its 2 types.


The Message System or Message-Oriented Middleware (MOM) paradigm is an elaboration
of the basic message-passing paradigm. In this paradigm, a message system serves as an
intermediary among separate, independent processes.
• A sender deposits a message with the message system, which forwards it to a message
queue associated with each receiver. Once a message is sent, the sender is free to move on
to other tasks.
• The message system acts as a switch for messages, through which processes exchange
messages asynchronously, in a decoupled manner.
There are two main subtypes of message system models
1) The Point-To-Point Message Model
2) The Publish/Subscribe Message Model

The Point-To-Point Message Model


• In this model, a message system forwards a message from the sender to the receiver’s
message queue. Unlike the basic message passing model, the middleware provides a
message depository, and allows the sending and the receiving to be decoupled.
• Via the middleware, a sender deposits a message in the message queue of the receiving
process. A receiving process extracts the messages from its message queue, and handles
each one accordingly.
• Compared to the basic message-passing model, this paradigm provides the additional
abstraction for asynchronous operations. To achieve the same effect with basic message-
passing, a developer will have to make use of threads or child processes.

The Publish/Subscribe Message Model


• In this model, each message is associated with a specific topic or event. Applications
interested in the occurrence of a specific event may subscribe to messages for that event.
• When the awaited event occurs, the process publishes a message announcing the event
or topic. The middleware message system distributes the message to all its subscribers.
• The publish/subscribe message model offers a powerful abstraction for multicasting or
group communication. The publish operation allows a process to multicast to a group of
processes, and the subscribe operation allows a process to listen for such multicast.
• Using the publish/subscribe message model the auctioning system could be implemented
as follows:
1) Each participant subscribes to begin-auction event message.
2) The auctioneer indicates the beginning of the auction by sending a begin-auction
event message.
3) Upon receiving the begin-auction event, the participant subscribes to an end
auction message.
4) The auctioner wishing to subscribe for new bidding sends the new bid event
message.
• Message Queue Services (MQS) have been in use since the 1980’s. Other existing
supports for this include Microsoft’s Message Queue (MSQ) and Java’s Message Service.

5. Write a note on Point-to-Point message Model [refer ans 4]


Page | 17
DISTRIBUTED COMPUTING

6. What do you mean by publish/subscribe message model? Explain. [refer ans 4]

7. Write a note on trade-offs of distributed computing paradigms.


The term trade-off means compromising one thing or feature of a process in return for
another to balance the working of that process. It can be said as a technique of reducing or
forgoing one or more desirable outcomes in exchange for increasing or obtaining other
desirable outcomes in order to maximize the total return or effectiveness under given
circumstances.

As there are large number of paradigms, challenge is to choose suitable paradigm for given
application
Each paradigm or tool has some advantages and disadvantages

Some issues that to be considered when selecting a paradigm.

• Level of Abstraction

• Scalability

• Cross Platform Support

Level of Abstraction versus Overhead


At the lowest levels are the most basic paradigms: message passing and client server. At
the highest levels are object spaces and collaborative computing, which may be readily
aided by a tool that offers a high level of abstraction. Consider the overheads involved.
Consider the remote method invocation, where software modules are processed as
distributed objects. The run time support and additional hardware overheads are
additional issues. The RMI will require modern resources and will have a heavy resource
overhead. On the other hand, RMI or other tools may be the most appropriate if the
response time and resource consumption are not a concern.

Scalability
The complexity of distributed application increases exponentially as the number of nodes
increases. On the other hand, paradigms such as Publish/Subscribe complexity is managed
by the system itself. Mobile Agent is another paradigm that will scale well.

Cross Platform Support


The most abstract models are platform independent. Generally, a tool that supports
heterogeneous platforms will be more complex when compared to a tool that supports a
single platform. Java Virtual Machines, COM/DCOM are deployable on Microsoft platforms
only but CORBA is designed for cross-platform support.

8. List and explain different protocols used in Datagram Socket API


• There are two key protocols at the transport layer of the Internet architecture: User
Datagram Protocol (UDP) and Transmission Control Protocol (TCP).
Page | 18
DISTRIBUTED COMPUTING

• The User Datagram Protocol (UDP) allows a packet to be transported using connectionless
communication. The data packet thus transported is called a datagram. In accordance with
connectionless communication, each datagram transported is individually addressed and
routed, and may arrive at the receiver in any order
• The Transmission Control Protocol (TCP) is connection-oriented and transports a stream
of data over a logical connection established between the sender and the receiver.
• The Java socket API, as with all other socket APIs, provides socket programming
constructs that make use of either the UDP or TCP protocol. Sockets that use UDP for
transport are known as datagram sockets, while sockets that use TCP are termed stream
sockets.

9. With diagram explain connectionless datagram socket[refer ans 10]

10. What are connectionless and connection oriented datagram sockets? Explain with
diagrams (6)

• Datagram sockets can support both connectionless and connection-oriented


communication at the application layer. This is so because even though datagrams are sent
or received without the notion of connections at the transport layer, the run-time support
of the socket API can create and maintain logical connections for datagrams exchanged
between two processes.

Page | 19
DISTRIBUTED COMPUTING

• In Java, two classes are provided for the datagram socket API:
1. The DatagramSocket class for the sockets
2. The DatagramPacket class for the datagrams exchanged
• A process wishing to send or receive data using this API must instantiate a
DatagramSocket object or a socket in short. Each socket is said to be bound to a UDP port
of the machine local to the process.
• To send a datagram to another process, a process creates an object that represents the
datagram itself. This object can be created by instantiating a DatagramPacket object which
carries:
1. The payload data as a reference to a byte array, and
2. The destination address (the host ID and port number to which the receiver’s
socket is bound).
• Once the DatagramPacket object is created and loaded with payload data and
destination, the sending process then invokes a call to the send method in the
DatagramSocket object, specifying a reference to the DatagramPacket object as an
argument.
• In the receiving process, a DatagramSocket object must also be instantiated and bound
to a local port, the port number must agree with that specified in the datagram packet of
the sender.
• To receive datagrams sent to the socket, the process creates a DatagramPacket object
which references a byte array and calls a receive method in its DatagramSocket object,
specifying as argument a reference to the DatagramPacket object.

Page | 20
DISTRIBUTED COMPUTING

11. What do you mean by stream-mode socket API? Explain with diagram. (6)

The datagram socket API supports the exchange of discrete units of data (that is,
datagrams).
• The stream socket API provides a model of data transfer based on the stream-mode I/O
of the UNIX operating systems. By definition, a stream-mode socket supports connection-
oriented communication only.
• In stream mode input-output, data is transferred using the concept of a continuous data
stream flowing from a source to a destination (also called a sink).
• Data is inserted or written into a stream by a process that controls the source and data is
extracted or read from the stream by a process attached to the destination. Figure 4.7
illustrates the concept of a data stream.

• Note that the continuous nature of stream allows data to be inserted and extracted at
different rates. Hence the unit of data written and read each time need not match.
• The stream-mode socket API (Figure 4.8) is an extension of the stream-mode I/O model.
Using the API, each of the two processes individually creates a stream mode socket.
• A connection between the sockets is then formed. Data, as a stream of characters, are
written into the sender's socket, which can then be read by the receiver via its socket.
• This is similar to the connectionless datagram socket API, except for the difference in the
discrete nature of the data transported in datagram sockets.

Page | 21
DISTRIBUTED COMPUTING

• In Java, the stream-mode socket API is provided with two classes:


➢ Server socket: for accepting connections; we will call an object of this class a
connection socket.
➢ Socket: for data exchange; we will call an object of this class a data socket.
• Using this API, a process known as the server establishes a connection socket and then
listens for connection requests from other processes.
• Connection requests are accepted one at a time. When a connection is accepted, a data
socket is created for the connection.
• A process that wishes to communicate with the server is known as a client. A client
creates a socket; then, via the server's connection socket, it makes a request to the server
for a connection.
• Once the request is accepted, the client's socket is connected to the server's data socket
so that the client may proceed to read from and/or write to the data stream
• When the communication session between the two processes is over, the data socket is
closed, and the server is free to accept the next connection request.

12. Write a note on secure socket API. (4)

• Secure socket APIs are the socket APIs enhanced with data security measures. Using
conventional socket APIs, data is transmitted as bit streams over network links. The bit
streams, if intercepted by means of tools such as network protocol analyzers, can be
decoded by someone who has knowledge of the data representation of the data
exchanged.
• Hence it is risky to use sockets to transmit sensitive data, such as credit information and
authentication data. To address the problem, protocols have been introduced to secure the
data transmitted using socket APIs. Some of the well-known protocols: Secure Sockets
Layer (SSL) and The Java™ Secure Socket Extension (SSE).

The Secure Socket layer


Secure Sockets Layer (SSL) was a protocol developed by Netscape Communications
Corporation for transmitting private documents over the Internet. An SSL API has methods
or functions similar to the socket API, except that data is encrypted before it is transmitted
over an SSL connection. SSL is supported by modern browsers. When run with the SSL
protocol selected, these browsers will transmit encrypted data using the SSL socket API.
Many Web sites also use the protocol to obtain confidential user information, such as credit
card numbers. By convention, the URL of a Web page that requires an SSL connection starts
with https, instead of http.

The Java Secure Socket Extension


The Java™ Secure Socket Extension (SSE) is a set of Java packages that enable secure
Internet communications. It implements a version of SSL and TLS (Transport Layer Security)
protocols and includes functionalities for data encryption, server authentication, message
integrity, and optional client authentication. Using JSSE, developers can provide for the
secure passage of data between two processes.

Page | 22
DISTRIBUTED COMPUTING

UNIT III
2 Marks Questions
1. Draw the diagram of request response pattern of interprocess communication in the
client server model.

The request response pattern of IPC in the Client-Server model

2. What are the primitive operations of multicast API?


[Link]
[Link]
[Link]
[Link]

3. What is reliable multicast?


A reliable multicast is any computer networking protocol that provides a reliable sequence
of packets to multiple recipients simultaneously.

4. What is unreliable multicast?

Unreliable multicast is a communication method where a message is sent from one sender to
multiple receivers, but delivery is not guaranteed.

5. What are the classifications of reliable multicast systems?


The definition of reliable multicast places no restriction on the order in which the messages
are delivered to each individual process: Each process may receive the messages in any
permutation of the order in which those messages were sent. For applications where the
order of message delivery is significant, it is helpful to further classify reliable multicast
systems as described below.
Unordered Multicast
FIFO multicast
Causal Order Multicast
Atomic order multicast .

Page | 23
DISTRIBUTED COMPUTING

6. What is FIFO multicasting?


A system which guarantees that the delivery of the messages adhere to the following
condition is said to provide FIFO (first-in-first-out) or send-order multicast

7. What is causal order multicasting?

Causal order multicasting is a communication technique used in distributed systems to ensure


that messages are delivered in an order that respects their causal relationships.

8. What is atomic order multicasting?


In an atomic-order multicast system, all messages are guaranteed to be delivered to each
participant in the exact same order. Note that the delivery order does not have to be FIFO
or causal, but must be identical for each process.

9. What are the classes used in java basic multicast API?


1. Join – This operation allows a process to join a specific multicast group. A process that
has joined a multicast group can receive all multicast messages addressed to the group.
2. Send – This operation allows a process to send a message to all processes currently
participating in a multicast group.
3. Receive –This operation allows a member process to receive messages sent to a multicast
group.
4. Leave –This operation allows a process to leave a multicast group and stop receiving any
multicast addressed to the group.

[Link] the block diagram for an archetypal distributed object system.

11. Four Well-Known Toolkits for Distributed Object Systems


• CORBA (Common Object Request Broker Architecture)
• Java RMI (Remote Method Invocation)
• Microsoft DCOM (Distributed Component Object Model)
• SOAP/.NET Remoting
Page | 24
DISTRIBUTED COMPUTING

12. Expand RPC and RMI


• RPC → Remote Procedure Call
• RMI → Remote Method Invocation

13. What is RMI?


Remote Method Invocation (RMI) is a Java-based mechanism that allows an object
running in one Java Virtual Machine (JVM) to invoke methods on an object running in
another JVM.

[Link] Local Objects and Distributed Objects


• Local Objects
o Exist within the same process or machine.
o Method calls are direct, fast, and don’t involve networking.
o Lifetime and scope are limited to the local program.
• Distributed Objects
o Can reside on different machines across a network.
o Method calls involve communication protocols (RPC/RMI).
o Provide transparency so remote calls look like local calls, but require
marshalling/unmarshalling of data.

5 Marks Questions

1. Write a note on an archetypal multicast API. (5)


An application program interface that supports multicasting must provide the following
primitive operations:
➢ Join – This operation allows a process to join a specific multicast group. A process that
has joined a
multicast group can receive all multicast messages addressed to the group. A process may
be a member of one or more multicast groups at any one time.
➢ Send – This operation allows a process to send a message to all processes currently
participating in a
multicast group.
➢ Receive –This operation allows a member process to receive messages sent to a
multicast group.
➢ Leave –This operation allows a process to leave a multicast group and stop receiving any
multicast
addressed to the group.

2. Write a note on connectionless versus connection oriented multicast and reliable


versus unreliable multicasting.
Connectionless versus Connection-Oriented Multicast:
A basic multicast mechanism is connectionless. The reason is obvious if you consider the
oneto-many nature of multicasting. In a group of n processes, if a connection is to be
established between a sender and every other process in the group, a total of n-1
Page | 25
DISTRIBUTED COMPUTING

connections will be needed. Moreover, each of the n processes may potentially be a


sender, so that each process must maintain a connection with every other process,
resulting in a total of n * (n - 1) or roughly n 2 connections. If n is large, the sheer number of
such connections will become prohibitively expensive.
Moreover, connectionless IPC is appropriate for a common type of multicast applications
like audio or video data transmission among processes in real time. When audio or video
data is transmitted, the reduction in latency provided by connection less communication
outweighs the advantages offered by connection-oriented communication. For example
when data for animation is sent it is more acceptable for a receiver to experience a
distortion in the image of an occasional frame than a frequent, perceptible delay between
consecutive frames.

Reliable Multicast v/s Unreliable Multicast :


When a multicast message is sent by a process, the run-time support of the multicast
mechanism is responsible for delivering the message to each process currently in the
multicast group.
Due to factors such as failures of network links, network hosts, routing delays or any other
software and hardware problems, the time between when a multicast message is sent and
when it is received may vary among the recipient processes.
In some cases, the correct message is received by all processes and in other cases, some of
the participants may not receive the message at all.
Sometimes the messages may be received by other processes in the group in a corrupted
form. Such a system is said to provide unreliable multicast.
On the other hand, a multicast system which guarantees that each message is eventually
delivered to each process in the group in uncorrupted form is said to provide reliable
multicast. In such a system, each message sent by a process can be assumed to be delivered
in a noncorrupted form to all processes in the group eventually.
Some applications, such as video conferencing or database applications can tolerate an
occasional miss or disordering of messages for which such anomalies are unacceptable.
Therefore, when employing a multicasting mechanism for an application, it is important
that you choose one with the characteristics appropriate for your application. Otherwise,
measures will need to be provided in the logic of the application in order to handle the
anomalies that may occur in message delivery

3. Write and explain the classification of reliable multicast systems. (8)


Classifications of reliable multicast
The definition of reliable multicast places no restriction on the order in which the messages
are delivered to each individual process: Each process may receive the messages in any
permutation of the order in which those messages were sent. For applications where the
order of message delivery is significant, it is helpful to further classify reliable multicast
systems as described below.
1. Unordered Multicast
2. FIFO multicast
3. Causal Order Multicast
4. Atomic order multicast
Page | 26
DISTRIBUTED COMPUTING

1 Unordered Multicast :
An unordered reliable multicast system provides no guarantee on the delivery order of the
messages.
Example:
Processes P1, P2, and P3 have formed a multicast group. Further suppose that three
messages, m1, m2, m3 have been sent to the group. Then an unordered reliable multicast
system may deliver the messages to each of the three processes in any of the 3! = 6
permutations (m1- m2-m3, m1-m3-m2, m2-m1-m3, m2-m3-m1, m3-m1-m2, m3-m2-m1).

2 FIFO multicast:
A system which guarantees that the delivery of the messages adhere to the following
condition is said to provide FIFO (first-in-first-out) or send-order multicast:
If process P sent messages mi and mj, in that order, then each process in the multicast
group will be delivered the messages mi and mj, in the same order. Suppose P1 sends
messages m1, m2, and m3 in order, then each process in the group is guaranteed to have
those messages delivered in that same order: m1, m2, then m3.
Note that FIFO multicast places no restriction on the delivery order among messages sent
by different processes. To illustrate the point, let us use a simplified example of a multicast
group of two processes: P1 and P2.
Suppose P1 sends messages m11 then m12, while P2 sends messages m21 then m22. Then
a FIFO multicast system can deliver the messages to each of the two processes in any of the
following orders: m11-m12-m21-m22, m11-m21-m12-m22, m11-m21-m22-m12, m21-m11-
m12-m22, m21-m11-m22-m12, m21-m22-m11-m12.

.3 Causal Order Multicast :


A multicast system is said to provide causal multicast if its message delivery satisfies the
following criterion:
If message mi causes (results in) the occurrence of message mj, then mi will be delivered to
each process before mj. Messages mi and mj are said to have a causal or happen-before
relationship, denoted mi -> mj. The happen-before relationship is transitory: if mi -> mj and
mj -> mk, then mi -> mj -> mk. In this case, a causal-order multicast system guarantees that
these three messages will be delivered to each process in the order of mi, mj, then mk. For
example suppose three processes P1, P2, and P3 are in a multicast group. P1 sends a
message m1, to which P2 replies with a multicast message m2. Since m2 is triggered by m1,
the two messages share a causal relationship of m1-> m2. Suppose the receiving of m2 in
turn triggers a multicast message m3 sent by P3, that is, m2-> m3. The three messages
share the causal relationship of m1-> m2-> m3. A causal-order multicast message system
ensures that these three messages will be delivered to each of the three processes in the
order of m1- m2- m3.
As a variation of the above example, suppose P1 multicasts message m1, to
which P2 replies with a multicast message m2, and independently P3 replies to m1 with a
multicast message m3. The three messages now share these causal relationships: m1 -> m2
and m1 -> m3. A causalorder multicast system can deliver these message in either of the
following orders:
Page | 27
DISTRIBUTED COMPUTING

m1- m2- m3
m1- m3- m2
In such a system, it is not possible for the messages to be delivered to any of the processes
in any other permutation of the three messages, such as m2- m1- m3 or m3- m1- m2, the
first of these violates the causal relationship m1 -> m2, while the second permutation
violates the causal relationship m1 -> m3.

4 Atomic order multicast or Total Ordering multicasting


In an atomic-order multicast system, all messages are guaranteed to be delivered to each
participant in the exact same order. Note that the delivery order does not have to be FIFO
or causal, but must be identical for each process.
Example:
P1 sends m1, P2 sends m2, and P3 sends m3. An atomic system will guarantee that the
messages will be delivered to each process in only one of the six orders:
m1- m2- m3, m1- m3- m2, m2- m1 - m3,
m2- m3- m1, m3- m1- m2, m3- m2- m1.

Consider an example for this:


P1 sends m1 then m2.
P2 replies to m1 by sending m3.
P3 replies to m3 by sending m4.
Although atomic multicast imposes no ordering on these messages, the sequence of the
events dictates that P1 must be delivered m1 before sending m2. Likewise, P2 must receive
m1 then m3, while P3 must receive m3 before m4. Hence any atomic delivery order must
preserve the order m1- m3- m4. The remaining message m2 can however be interleaved
with these messages in any manner. Thus an atomic multicast will result in the messages
being delivered to each of the processes in one of the following orders: m1- m2- m3- m4,
m1- m3- m2- m4 or m1- m3- m4- m2. For example, each process may be delivered the
messages in this order m1- m3- m2- m4

4. Explain
i. FIFO reliable multicasting.
ii. causal-order reliable multicasting.
iii. atomic order reliable multicasting. (6)
[refer ans 3]

5. Write a note on reliable multicast API. (5)


The Java basic Multicast API provides unreliable multicast which does not guarantee the
delivery of messages to any of the receiver participants.
If you run your processes on one host or on hosts on one subnet, you are not likely to
observe any loss of messages or scrambling in the delivery order of the messages. These
anomalies are more likely when the participating hosts are remotely connected, due to
network failures or routing delays.
There are applications for which unreliable multicasting is unacceptable. For such
applications, there are a number of available packages that provide reliable multicast API,
Page | 28
DISTRIBUTED COMPUTING

some of which are as follows:


The Java Reliable Multicast Service (JRM Service) provides the capabilities for a receiver to
repair multicast data that are lost or damaged, as well as security measures to protect data
privacy.
The Totem system, developed by the University of California, provides reliable totally
ordered delivery of messages to processes within process groups on a single local-area
network, or over multiple local-area networks interconnected by gateways.
TASC’s Reliable Multicast Framework (RMF) provides reliable and send ordered (FIFO)
multicast.

[Link] do you mean by message passing and distributed objects? (5)


The message-passing paradigm is a natural model for distributed computing, in the sense
that it mimics inter-human communications. It is an appropriate paradigm for network
services where processes interact with each other through the exchanges of messages.
However, the abstraction provided by this paradigm does not meet the needs of the
complexity of sophisticated network applications. · Processes are tightly-coupled:
Throughout their interaction, the processes must be in direct communication with each
other. If communication is lost between the processes(due to failure in the communication
link, in the systems, or in one of the processes), the collaboration Fails. The message-
passing paradigm is data-oriented: Each Message containing marshalled data, and is
interpreted as a request or response according to the protocol. The receiving of each
message triggers an action in the receiving process. It is inadequate for complex
applications involving a large mix of requests and responses. In such an application, the task
of interpreting the messages can become overwhelming. The distributed object paradigm is
a paradigm that provides abstractions beyond those of the message-passing model. It is
based on objects that exist in a distributed system. In Object-oriented programming,
supported by an object-oriented programming language such as Java, Objects are used to
represent an entity significant to an application. Each object encapsulates: · The State or
data of the entity : in java, such data is contained in the instance variables of each object; ·
The operations of the entity, through which the state of the entity can be accessed or
updated. Local objects are those whose methods can only be invoked by a local process, a
process that runs on the same computer on which the object exists. A Distributed Object is
one whose methods can be invoked by a remote process, a process running on a computer
connected via a network to the computer on which the object exists. In a distributed object
paradigm, network resources are represented by distributed objects. To request service
from a network resource, a process invokes one of its operations or methods, passing data
as parameters to the method. The method is executed on the remote host, and the
response is sent back to the requesting process as a return value.

6. What is an archetypal distributed object architecture? Explain with diagram. (6)


A distributed object is provided , or exported, by a process, here called the Object Server. A
facility, here called an Object Registry, must be present in the system architecture for the
distributed object to be registered. · To access a distributed object, a process –an Object
Client –looks up the object registry for reference to the object. This reference is used by the
object client to make calls to the methods. · Logically, the object client makes a call directly
Page | 29
DISTRIBUTED COMPUTING

to a remote method. · In reality, the call is handled by a software component, called a client
proxy, which interacts which the software on the client host that provides the runtime
support for the distributed object system. · The runtime support is responsible for the inter-
process communication needed to transmit the call to the remote host, including the
marshalling of the argument data that needs to be transmitted to the remote object.
A similar architecture is required on the server side, where the runtime support for the
distributed object system handles the receiving of messages and the unmarshalling of data,
and forwards the call to a software component called the server proxy. · The server proxy
interfaces with the distributed object to invoke the method call locally, passing in the
unmarshalled data for the arguments. · The method call results in the performance of some
tasks on the server host. The outcome of the execution of the method, including the
marshalled data for the return value, is forwarded by the server proxy to the client proxy, via
the runtime support and network support on both sides

7. What do you mean by remote procedure call? Differentiate local procedure call and
remote procedure call
with diagram and explain (5)
‘Remote Method Invocation’ has its origin in a paradigm called Remote Procedure Call. In
the remote procedure call model, a procedure call is made by one process to another, with
data passed as arguments. Upon receiving a call, the actions encoded in the procedure are
executed, the caller is notified of the call, and a return value, if any, is transmitted from the
callee to the caller.

The main difference between remote call procedure and local call is that remote call can fail
often and it occurs without the knowledge of the user while local calls generally doesn't fail
and are easily handled.

Page | 30
DISTRIBUTED COMPUTING

8. Write the Java RMI Client-side and server-side architecture. (6)


Client-Side Architecture
1. The Stub Layer. A client process’s remote method invocation is directed to a proxy
object, known as stub. The stub layer lies beneath the application layer and serves to
intercept remote method invocations made by the client program; then it forwards them to
the next layer below, the Remote Reference Layer

2. The Remote Reference Layer interprets and manages references made from clients to
the remote service objects and issues the IPC operations to the next layer, the transport
layer, to transmit the method calls to the remote host.

[Link] Transport Layer is TCP based and therefore connection-oriented. This layer and the
rest of the network architecture carry out the IPC, transmitting the data representing the
method call to the remote host

Server-Side Architecture The server-side architecture also involves three abstractions:

1. The Skelton Layer lies just below the application layer and serves to interact with the
stub layer on the client side.

2. The Remote Reference Layer. This layer manages and transforms the remote reference
originating from the client to local references that are understandable to the Skelton layer.

3. The Transport Layer. As with client-side architecture, this layer is the connection-
Page | 31
DISTRIBUTED COMPUTING

oriented transport layer, that is, the TCP in the TCP/IP network architecture.

9. With a neat diagram explain the Java RMI architecture. (7)


The following figure illustrates the architecture of the Java RMI API. As with RPC APIs, Java
RMI Architecture calls for proxy software modules to provide the run-time support needed
to transform the remote method invocations to local method calls, and to handle the
details for the underlying inter-process communications. In this architecture, three
abstraction layers are present on both the client side and the server side1

Page | 32

You might also like