Unit 1distributed
Unit 1distributed
DISTRIBUTED SYSTEM
Any Social Media can have its Centralized Computer Network as its Headquarters and
computer systems that can be accessed by any user and using their services will be the
Autonomous Systems in the Distributed System Architecture.
Resource Sharing: It is the ability to use any Hardware, Software, or Data anywhere in
the System.
Openness: It is concerned with Extensions and improvements in the system (i.e., How
openly the software is developed and shared with others)
Concurrency: It is naturally present in Distributed Systems, that deal with the same
activity or functionality that can be performed by separate users who are in remote
locations. Every local system has its independent Operating Systems and Resources.
Fault tolerance: It cares about the reliability of the system if there is a failure in
Hardware or Software, the system continues to operate properly without degrading the
performance the system.
Transparency: It hides the complexity of the Distributed Systems to the Users and
Application programs as there should be privacy in every system.
While distributed systems offer many advantages, they also present some challenges that
must be addressed. These challenges include:
1. Architectural Models
2. Interaction Models
3. Fault Models
1. Architectural Models
Architectural model describes responsibilities distributed between system components
and how are these components placed.
the Client-Server model is described as follows:
Client: The Client is a computer (Host) i.e. capable of receiving information or using a
particular service from the service providers (Servers).
Servers: Server is a remote computer which provides information (data) or access to
particular services.
So, its basically the Client requesting something and the Server serving it as long as its
present in the database.
In the P2P network architecture, the computers connect with each other in a workgroup
to share files, and access to internet and printers.
Each computer in the network has the same set of responsibilities and capabilities.
Each device in the network serves as both a client and server.
The architecture is useful in residential areas, small offices, or small companies where
each computer act as an independent workstation and stores the data on its hard
drive.
Each computer in the network has the ability to share data with other computers in
the network.
The architecture is usually composed of workgroups of 12 or more computers.
How Does P2P Network Work?
One of the most well-known peer-to-peer networks is torrent. All computer in this
kind of network is linked to the internet, allowing users to download resources shared by
any one computer.
File sharing: P2P network is the most convenient, cost-efficient method for file
sharing for businesses. Using this type of network there is no need for intermediate
servers to transfer the file.
Blockchain: The P2P architecture is based on the concept of decentralization. When
a peer-to-peer network is enabled on the blockchain it helps in the maintenance of a
complete replica of the records ensuring the accuracy of the data at the same time. At
the same time, peer-to-peer networks ensure security also.
Direct messaging: P2P network provides a secure, quick, and efficient way to
communicate. This is possible due to the use of encryption at both the peers and
access to easy messaging tools.
Collaboration: The easy file sharing also helps to build collaboration among other
peers in the network.
File sharing networks: Many P2P file sharing networks like G2, and eDonkey have
popularized peer-to-peer technologies.
Content distribution: In a P2P network, unline the client-server system so the clients
can both provide and use resources. Thus, the content serving capacity of the P2P
networks can actually increase as more users begin to access the content.
IP Telephony: Skype is one good example of a P2P application in VoIP.
Advantages of P2P Network
Easy to maintain: The network is easy to maintain because each node is independent
of the other.
Less costly: Since each node acts as a server, therefore the cost of the central server
is saved. Thus, there is no need to buy an expensive server.
No network manager: In a P2P network since each node manages his or her own
computer, thus there is no need for a network manager.
Adding nodes is easy: Adding, deleting, and repairing nodes in this network is easy.
Less network traffic: In a P2P network, there is less network traffic than in a client/
server network.
the local area network (LAN), which is typically preferred by small workplaces for the
purpose of resource sharing, is another frequently used example of the peer-to-peer
network.
● BitTorrent - popular P2P file-sharing protocol, usually associated with piracy ● Skype -
it used to use proprietary hybrid P2P protocol, now uses client-server model after
Microsoft’s acquisition ● Bitcoin - P2P cryptocurrency without a central monetary
authority
2.Interaction Model
Interaction model are for handling time i. e. for process execution, message delivery, clock
drifts etc.
Main features:
Important consequences:
1. In a synchronous distributed system there is a notion of global physical time (with
a known relative precision depending on the drift rate).
2. Only synchronous distributed systems have a predictable behavior in terms of
timing. Only such systems can be used for hard real-time applications.
3. In a synchronous distributed system it is possible and safe to use timeouts in order
to detect failures of a process or communication link.
4. It is difficult and costly to implement synchronous distributed systems.
Important consequences:
3. Fault Models
● Failures can occur both in processes and communication channels. The reason can
be both software and hardware faults.
● Fault models are needed in order to build systems with predictable behavior in
case of faults (systems which are fault tolerant).
● such a system will function according to the predictions, only as long as the real
faults behave as defined by the “fault model”.
Types of Fault
Omission faults
Arbitrary faults
Timing faults
Omission Faults:
A processor or communication channel fails to perform actions it is supposed to
do: the particular action is not performed by the faulty component!
Arbitrary Faults: These kinds of failures are known as arbitrary failures. Arbitrary
failures are ones that occur when a node responds with different responses when parts
of the system communicate with it.
Timing faults: It can occur in synchronous distributed systems, where time limits are
set to process execution, communications, and clock drifts. A timing fault results in any
of these time limits being exceeded.
basis of Client-Server Network Peer-to-Peer Network
Comparison
Stability It is more stable and scalable than a peer- It is less stable and scalable, if the
to-peer network. number of peers increases in the
system.
Data In a client-server network, the data is stored In a peer-to-peer network, each peer
in a centralized server. has its own data.
Server A server may get overloaded when many A server is not bottlenecked since
customers make simultaneous service the services are dispersed among
requests. numerous servers using a peer-to-
peer network.
Service The server provides the requested service Each node has the ability to both
in response to the client's request. request and delivers services.
Performance Because the server does the bulk of the Because resources are shared in a
work, performance is unaffected by the big peer-to-peer network,
growth of clients. performance will likely to suffer.
In an RMI application, we write two programs, a server program (resides on the server)
and a client program (resides on the client).
● Inside the server program, a remote object is created and reference of that object
is made available for the client (using the registry).
● The client program requests the remote objects on the server and tries to invoke
its methods.
The following diagram shows the architecture of an RMI application.
Whenever a client invokes a method that accepts parameters on a remote object, the
parameters are bundled into a message before being sent over the network. These
parameters may be of primitive type or objects. In case of primitive type, the parameters
are put together and a header is attached to it. In case the parameters are objects, then
they are serialized. This process is known as marshalling.
At the server side, the packed parameters are unbundled and then the required method
is invoked. This process is known as unmarshalling.
d)RMI Registry
RMI registry is a namespace on which all server objects are placed. Each time the server
creates an object, it registers this object with the RMIregistry
(using bind() or reBind() methods). These are registered using a unique name known
as bind name.
To invoke a remote object, the client needs a reference of that object. At that time, the
client fetches the object from the registry using its bind name (using lookup() method).
The following illustration explains the entire process −
e)Goals of RMI
Request Protocol
Request/Reply Protocol
The Request/Reply/Acknowledgement-Reply Protocol
Request Protocol: