You are on page 1of 13

Def1:A distributed system is a collection of independent computers

that appear to the users of the system as a single computer.

Def2:A distributed system is a collection of autonomous computing elements that appears to its
users as a single coherent system

Centralized systems are systems that use client/server architecture where one or more client nodes
are directly connected to a central server.

Decentralized means that there is no single point where the decision is made. Every node makes a
decision for it’s own behaviour and the resulting system behaviour is the aggregate response.

Distributed means that the processing is shared across multiple nodes, but the decisions may still be
centralized and use complete system knowledge.

Goals or Design Issues:-

1.connecting users and resources


2.transparency
3.openness
4.scalability
5.Flexibility
6.security
7.fault tolerance
8.robustness
9.concurrency
10.heterogeneity
Transparency:-

hiding the fact that its


processes &resources are physically
distributed among multiple computers

1.Access:data representation,resources accessed


2.Location:physical location
3.Relocation:resource can be accessed while moving
4.Migration:resource can be moved
5.Replication:several coipies of a resource
6.Concurrency:same resources being used by others
7.Failure:Masking failures
8.Persistence: resources is in volatile or disk storages

Openness:
1.standard rules that define/describe
syntax and semantics.
2.In distributed systems services are
mostly defined by interfaces.
3.IDL:Interface Definition Language
provides syntax of services only
Names,return values,parameters,exception.
4.Completeness:Users and developers specify
semantics of services or interfaces.
4.Completeness and neutrality:
interoperability and portablity

Scalability:(performance problem)
scalability dimension:-
1.Size scalability:
2.Geographical scalability:
3.Administrative scalability.

Techniques used in scaling:-


1.hiding communication latency
2.distribution
3.replication

Advantages:
economics
speed
inherent distribution
reliability
incremental growth
data sharing
Device /resource sharing
communication
flexibility
Host load balancing
scalability
reduced data processing delay

Disadvantages:
Software:-Not well defined
Network failure:- It may
saturate if failure occurs above
tolerance points.
Very Exensive
High Maintainance cost
Not readily available
Difficuit to explicitly control
security

Hardware Concepts:-

Flynn classified computing


devices: as Instruction and
Data Streams.

1.SISD
2.SIMD
3.MISD
4.MIMD

distributed systems are categorized


in MIMD.
Switched Multiprocessors
Bus-Based Multiprocessors
Bus-Based Multicomputer
Switched Multicomputers
High speed buses or Intelligent Switching components are used to interconnect computing devices.

The CAP Theorem states that, in a distributed system, you can only have two out of the following
three guarantees across a write/read pair:
Consistency, Availability, and Partition Tolerance ,one of them must be sacrificed.

Consistency - A read is guaranteed to return the most recent


write for a given client.
Availability - A non-failing node will return a reasonable
response within a reasonable amount of time (no error or timeout).
Partition Tolerance - The system will continue to function when
network partitions occur.

Software Concepts:-

1.Distributed Operating System


2.Distributed Database
3.APIs/frameworks.
Distributed Operating system APIs Distributed Databases
Plan 9 Apache Hadoop ClustrixDB
Inferno Apache Spark MySQL Cluster CGE
MINIX Apache Flink Dynamo
LOCUS Apache Beam Cassandra
Mach CUDA CouchDB
ChorusOS OpenCL Voldemort
OpenHMPP Redis
OpenMP MongoDB
Amazon Web Services Hbase
(AWS) Bigtable

A Kernel is the central part of an operating


system. It manages the operations of the
computer and the hardware - most notably
memory and CPU time.the kernel is responsible
for memory management, process and task
management, and disk management. The kernel
connects the system hardware to the application
software. Every operating system has a kernel.

Monolithic kernel user services and kernel


services both are kept in the same address space. Monolithic kernel is a single large processes
running entirely in a single address space.

Microkernel is the near-minimum amount of software that can provide the mechanisms needed to
implement an operating system. These mechanisms include low-level address space management,
thread management, and inter-process communication.

Conclusion
Microkernel is slower but more secure and reliable than monolithic kernel. Monolithic kernel is fast
but less secure as any service failure may lead to system crash.
Key Differences Between Microkernel and Monolithic Kernel
1. The basic point on which microkernel and Basis for
Microkernel
Monolithic
Comparison Kernel
monolithic kernel is distinguished is that
In monolithic
microkernel implement user services and kernel In microkernel
kernel, both
user services
services in different address spaces and monolithic user services
and kernel,
and kernel
kernel implement both user services and kernel Basic services are
services are
kept in
services under same address space. kept in the
separate
same address
2. The size of microkernel is small as only kernel address space.
space.
services reside in the kernel address space. However, Microkernel
Monolithic
kernel is larger
the size of monolithic kernel is comparatively larger Size are smaller in
than
size.
than microkernel because both kernel services and microkernel.
user services reside in the same address space. Slow
Execution Fast execution.
execution.
3. The execution of monolithic kernel is faster as the The The
communication between application and hardware is Extendible microkernel is monolithic
easily kernel is hard
established using the system call. On the other extendible. to extend.
hands, the execution of microkernel is slow as the If a service
If a service
communication between application and hardware of crashes, the
crashes, it does
whole system
the system is established through message passing. Security effect on
crashes in
working of
4. It is easy to extend microkernel because new service monolithic
microkernel.
kernel.
is to be added in user address space that is isolated To write a
To write a
from kernel space, so the kernel does not require to microkernel,
monolithic
Code kernel, less
be modified. Opposite is the case with monolithic more code is
code is
required.
kernel if a new service is to be added in monolithic required.
kernel then entire kernel needs to be modified. Linux, BSDs
(FreeBSD,
5. Microkernel is more secure than monolithic kernel QNX,
OpenBSD,
Symbian,
as if a service fails in microkernel the operating NetBSD),
L4Linux,
Microsoft
sytem remain unaffected. On the other hands, if a Singularity,
Windows
Example K42, Mac OS
service fails in monolithic kernel entire system fails. (95,98,Me),
X, Integrity,
Solaris, OS-9,
6. Monolithic kernel designing requires less code, PikeOS,
AIX, HP-UX,
HURD, Minix,
which further leads to fewer bugs. On the other and Coyotos.
DOS,
OpenVMS,
hands, microkernel designing needs more code XTS-400 etc.
which furher leads to more bugs.
Fallacies or pitfalls of distributed computing

The fallacies are:


The network is reliable
Latency is zero
Bandwidth is infinite
The network is secure
Topology doesn't change
There is one administrator
Transport cost is zero
The network is homogeneous

• Software applications are written with little error-handling on networking errors. During a
network outage, such applications may stall or infinitely wait for an answer packet,
permanently consuming memory or other resources. When the failed network becomes
available, those applications may also fail to retry any stalled operations or require a
(manual) restart.
• Ignorance of network latency, and of the packet loss it can cause, induces application- and
transport-layer developers to allow unbounded traffic, greatly increasing dropped packets
and wasting bandwidth.
• Ignorance of bandwidth limits on the part of traffic senders can result in bottlenecks.
• Complacency regarding network security results in being blindsided by malicious users and
programs that continually adapt to security measures.
• Changes in network topology can have effects on both bandwidth and latency issues, and
therefore can have similar problems.
• Multiple administrators, as with subnets for rival companies, may institute conflicting
policies of which senders of network traffic must be aware in order to complete their desired
paths.
• The "hidden" costs of building and maintaining a network or subnet are non-negligible and
must consequently be noted in budgets to avoid vast shortfalls.
• If a system assumes a homogeneous network, then it can lead to the same problems that
result from the first three fallacies.
characteristics of a distributed system
Three significant characteristics of distributed systems are:
1.concurrency of components,
2.lack of a global clock,
3.independent failure of components.

Snooping Cache
Cache memory which uses snooing protocol or bus-snooping protocol, a protocol for maintaining
cache coherency in symmetric multiprocessing environments. In a snooping system, all caches on
the bus monitor (or snoop or eavesdropping) the bus to determine if they have a copy of the block
of data that is requested on the bus. Every cache has a copy of the sharing status of every block of
physical memory it has. Multiple copies of a document in a multiprocessing environment typically
can be read without any coherence problems; however, a processor must have exclusive access to
the bus in order to write.
Snooping Protocol Types
There are two main types of snooping protocol:
1.Write-invalidate
The processor that is writing data causes copies in the caches of all other processors in the system to
be rendered invalid before it changes its local copy. The local machine does this by sending an
invalidation signal over the bus, which causes all of the other caches to check for a copy of the
invalidated file. Once the cache copies have been invalidated, the data on the local machine can be
updated until another processor requests it.

2.Write-update
The processor that is writing the data broadcasts the new data over the bus (without issuing the
invalidation signal). All caches that contain copies of the data are then updated. This scheme differs
from write-invalidate in that it does not create only one local copy for writes.

A distributed database management system (DDBMS) is a set of multiple, logically interrelated


databases distributed over a network. They provide a mechanism that makes the distribution of
data transparent to users.

Distributed Database System A distributed database is basically a database that is not limited to
one system, it is spread over different sites, i.e, on multiple computers or over a network of
computers. A distributed database system is located on various sited that don’t share physical
components. This maybe required when a particular database needs to be accessed by various users
globally. It needs to be managed such that for the users it looks like one single database.

Types:
1. Homogeneous Database:

In a homogeneous database, all different sites store database identically. The operating system,
database management system and the data structures used – all are same at all sites. Hence, they’re
easy to manage.

2. Heterogeneous Database:

In a heterogeneous distributed database, different sites can use different schema and software that
can lead to problems in query processing and transactions. Also, a particular site might be
completely unaware of the other sites. Different computers may use a different operating system,
different database application. They may even use different data models for the database. Hence,
translations are required for different sites to communicate.

Distributed Data Storage

There are 2 ways in which data can be stored on different sites. These are:
1. Replication
In this approach, the entire relation is stored redundantly at 2 or more sites. If the entire database is
available at all sites, it is a fully redundant database. Hence, in replication, systems maintain copies
of data.
This is advantageous as it increases the availability of data at different sites. Also, now query
requests can be processed in parallel.
However, it has certain disadvantages as well. Data needs to be constantly updated. Any change
made at one site needs to be recorded at every site that relation is stored or else it may lead to
inconsistency. This is a lot of overhead. Also, concurrency control becomes way more complex as
concurrent access now needs to be checked over a number of sites.

2. Fragmentation
In this approach, the relations are fragmented (i.e., they’re divided into smaller parts) and each of
the fragments is stored in different sites where they’re required. It must be made sure that the
fragments are such that they can be used to reconstruct the original relation (i.e, there isn’t any loss
of data).
Fragmentation is advantageous as it doesn’t create copies of data, consistency is not a problem.
Fragmentation of relations can be done in two ways:

Horizontal fragmentation – Splitting by rows – The relation is fragmented into groups of tuples
so that each tuple is assigned to at least one fragment.
Vertical fragmentation – Splitting by columns – The schema of the relation is divided into smaller
schemas. Each fragment must contain a common candidate key so as to ensure lossless join.

In certain cases, an approach that is hybrid of fragmentation and replication is used.

Communication in Distributed Systems


1.Layered Protocols(OSI Ref Model) 2.ATM Model 3.RPC(Client-Server Model)

LAYERED PROTOCOLS:-
To deal with the numerous levels and issues
involved in
communication, the International Standards
Organization (ISO) has developed a
reference model that clearly identifies the
various levels involved, gives them
standard names, and points out which level
should do which job. This model is
called the Open Systems Interconnection
Reference Model (OSI Model or ISO OSI
Model)
An open system is one that is prepared
to communicate with any other
open system by using standard rules that
govern the format, contents, and mean-
meaning of the messages sent and received.
These rules are formalized in what are
called protocols.
ATM:ASYNCHRONOUS TRANSFER MODE NETWORKS
When the telephone companies decided to build networks for the 21st Cen-
Century, they faced a dilemma: voice traffic is smooth, needing a low, but constant
bandwidth, whereas data traffic is bursty, usually needing no bandwidth (when
there is no traffic),
Neither traditional circuit switching (used in the Public Switched Tele-
Telephone Network) nor packet switching (used in the Internet) was suitable for both
kinds of traffic.
After much study, a hybrid form using fixed-size blocks over virtual circuits
was chosen as a compromise that gave reasonably good performance for both
types of traffic. This scheme, called ATM (Asynchronous Transfer Mode)
has become an international standard and is likely to play a major role in future
distributed systems, both local-area ones and wide-area ones.
The ATM model is that a sender first establishes a connection (i.e., a virtual
circuit) to the receiver or receivers. During connection establishment, a route is
determined from the sender to the receiver(s) and routing information is stored
in the switches along the way. Using this connection, packets can be sent, but
they are chopped up by the hardware into small, fixed-sized units called cells.
The cells for a given virtual circuit all follow the path stored in the switches.
When the connection is no longer needed, it is released and the routing informa-
information purged from the switches.
This scheme has a number of advantages over traditional packet and circuit
switching. The most important one is that a single network can now be used to
transport an arbitrary mix of voice, data, broadcast television, videotapes, radio,
and other information efficiently, replacing what were previously separate net-
networks (telephone, X.25, cable TV, etc.). New services, such as video conferenc-
conferencing for businesses, will also use it. In all cases, what the network sees is cells;

A problem arises when two cells arrive at the same time on different input lines and need to go to
the same output port.Just throwing one of them away is allowed by the standard, but if your switch
drops more than 1 cell in 1012, you are unlikely to sell many switches. An alternative scheme is to
pick one of them at random and forward it, holding the other cell until later. In the next round, this
algorithm is applied again. If two ports each have streams of cells for the same destination,
substantial input queues will build up, blocking other cells behind them that want to go to output
ports that are free. This problem is known as head-of-line blocking.

Message-passing primitives
The message-passing primitives can be of following types called

1.blocking primitives or synchronous primitives.


When Send/Receive msgs blocks the process till it gets ACK.
2.nonblocking primitives or asynchronous primitives.
When Send/Receive msgs doesnt blocks the process for ACK.
3.Buffered Primitives
When Send/Receive msgs may get buffered
4.Unbuffered Primitives
When Send/Receive msgs cant get buffered
5.Reliable Primitives
When Send/Receive msgs are reliable
6.Unreliable Primitives
When Send/Receive msgs are non-reliable
REMOTE PROCEDURE CALL:-
Remote Procedure Call (RPC) is a powerful technique for constructing distributed, client-server
based applications.
It is based on extending the conventional local procedure calling
so that the called procedure need not exist in the same address space as the calling procedure.
The two processes may be on the same system, or they may be on different systems with a network
connecting them.
When making a Remote Procedure Call:

1. The calling environment is suspended,


procedure parameters are transferred across
the network to the environment where the
procedure is to execute, and the procedure is
executed there.
2. When the procedure finishes and produces
its results, its results are transferred back to
the calling environment, where execution
resumes as if returning from a regular
procedure call.
The following steps take place during a
RPC:
1. A client invokes a client stub procedure,
passing parameters in the usual way. The
client stub resides within the client’s own
address space.
2. The client stub marshalls(pack) the
parameters into a message. Marshalling
includes converting the representation of the
parameters into a standard format, and
copying each parameter into the message.
3. The client stub passes the message to the
transport layer, which sends it to the remote
server machine.
4. On the server, the transport layer passes the
message to a server stub, which
demarshalls(unpack) the parameters and
calls the desired server routine using the regular procedure call mechanism.

5. When the server procedure completes, it returns to the server stub (e.g., via a normal procedure
call return), which marshalls the return values into a message. The server stub then hands the
message to the transport layer.
6. The transport layer sends the result message back to the client transport layer, which hands the
message back to the client stub.
7. The client stub demarshalls the return parameters and execution returns to the caller.
RPC ISSUES
• Issues that must be addressed:

1. RPC Runtime: RPC run-time system is a library of routines and a set of services that handle the
network communications that underlie the RPC mechanism. In the course of an RPC call, client-
side and server-side run-time systems’ code handle binding, establish communications over an
appropriate protocol, pass call data between the client and server, and handle
communications errors.
2. Stub: The function of the stub is to provide transparency to the programmer-written
application code.
On the client side, the stub handles the interface between the client’s local procedure call and the
run-time system, marshaling and unmarshaling data, invoking the RPC run-time protocol, and if
requested, carrying out some of the binding steps.
On the server side, the stub provides a similar interface between the run-time system and the local
manager procedures that are executed by the server.
3. Binding: How does the client know who to call, and where the service resides?
The most flexible solution is to use dynamic binding and find the server at run time when the RPC
is first made. The first time the client stub is invoked, it contacts a name server to determine the
transport address at which the server resides.
Binding consists of two parts:
• Naming: Remote procedures are named through interfaces. An interface uniquely
identifies a particular service, describing the types and numbers of its arguments. It is
similar in purpose to a type definition in programming languauges.
• Locating: Finding the transport address at which the server actually resides. Once we have
the transport address of the service, we can send messages directly to the server.
ADVANTAGES
1. RPC provides ABSTRACTION i.e message-passing nature of network communication is hidden
from the user.
2. RPC often omits many of the protocol layers to improve performance. Even a small performance
improvement is important because a program may invoke RPCs often.
3. RPC enables the usage of the applications in the distributed environment, not only in the local
environment.
4. With RPC code re-writing / re-developing effort is minimized.
5. Process-oriented and thread oriented models supported by RPC.
Group communication:
Modes of Communication. Unicast , anycast, netcast , multicast, broadcast
Groups
Groups are dynamic
– Created and destroyed
– Processes can join or leave
• May belong to 0 or more groups
Send message to one entity
– Deliver to entire group

Design Issues
• Closed vs. Open
– Closed: only group members can sent messages
• Peer vs. Hierarchical
– Peer: each member communicates with group
– Hierarchical: go through coordinator
• Managing membership
– Distributed vs. Centralized
• Group Adressing
• Atomicity
• Message-ordering
• Scalability
• Leaving & joining must be synchronous
• Fault tolerance?

You might also like