0% found this document useful (0 votes)
7 views

Dist_Sys_Unit_1_Notes

A distributed system is a collection of independent computers that users perceive as a single coherent system, characterized by resource sharing, openness, concurrency, scalability, fault tolerance, and transparency. It can be organized as middleware and includes various types such as distributed computing systems, distributed information systems, and distributed pervasive systems. Applications span multiple domains including finance, healthcare, and education, and architectural styles include centralized, decentralized, and hybrid architectures.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Dist_Sys_Unit_1_Notes

A distributed system is a collection of independent computers that users perceive as a single coherent system, characterized by resource sharing, openness, concurrency, scalability, fault tolerance, and transparency. It can be organized as middleware and includes various types such as distributed computing systems, distributed information systems, and distributed pervasive systems. Applications span multiple domains including finance, healthcare, and education, and architectural styles include centralized, decentralized, and hybrid architectures.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Distributed Systems CSE

Definition of Distributed System

 A distributed system is a collection of independent computers that appears to its users as a


single coherent system.

 a distributed system consists of components (i.e., computers) that are autonomous

 users (people or programs) think they are dealing with a single system

Characteristics of Distributed System

 Various computers and communications are mostly hidden from the users

 Consistent and uniform interaction

 Easy to expand or scale

 Continuous availability

Distributed System as middleware

A Distributed system organized as middleware. The middleware layer extends over multiple
machines, and offers each application the same interface

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1


Distributed Systems CSE
Goals of Distributed System

 Resource Sharing
 Openness
 Concurrency
 Scalability
 Fault Tolerance
 Transparency

 Resource Sharing

 It is the ability to use any hardware/software/data any where in the system

 Openness:

 Is Concerned with extension(to existing system) and improvement of distributed


systems

 Concurrency:

 Load can be shared among all the commutes in the network

 Scalability:

 Any time we can scale up the no of systems in the network

 Fault Tolerance:

 In a single or multiple systems fail in the hardware or software the network will not
have any problem it can run with no problem.

 Transparency:

 Hiding the complexity of distributed system to the user & application

 The Transparency in distributed system should hide the fact that the process &
resource are physically distributed across multiple computers

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2


Distributed Systems CSE
Types of Distributed System

 Distributed Computing Systems

 Cluster Computing Systems

 Grid Computing Systems

 Cloud Computing Systems

 Distributed Information Systems

 Distributed Pervasive Systems

Distributed Computing Systems

 Uses group of computers that share a common communication problem among them so as to
generate an efficient results in short time span.

i) Cluster Computing:

 It is a form of distributed computing where group of computes are linked together in a


network to perform a single task

 Can perform load balancing

 Only disadvantage is all systems should be homogenous

ii) Grid Computing

Grids are usually composed of different types of computers (hard ware, OS, network, security etc.)

iii) Cloud Computing

It is defined as storing of data and computing services over the internet

Distributed Information Systems

 Used to keep track of information about application running over the network which are
distributed among various entitles

 Used in management & integration of business information

Transaction Processing Systems:

 Focus on database applications - operations on a database are usually carried out in the form
of transactions.

 Programming using transactions requires special primitives that must either be supplied by
the underlying distributed system or by the language runtime system.
SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1
Example Primitives of Transactions:
Distributed Systems CSE
 Exact list of primitives depends on what kinds of objects are being used in the transaction.

 e.g. mail system - may be primitives to send, receive, and forward mail.

 e.g. accounting system - may be different.

 Ordinary statements, procedure calls, etc, are allowed inside a transaction

Properties of Transactions (ACID)

1. Atomic: To the outside world, the transaction happens indivisibly.

2. Consistent: The transaction does not violate system invariants.

• e.g. a banking system - a key invariant is the law of conservation of money. After every
internal transfer, the amount of money in the bank must be the same as it was before the
transfer.

3. Isolated: Concurrent transactions do not interfere with each other.

4. Durable: Once a transaction commits, the changes are permanent.

Distributed Pervasive Systems

 These are basically used with mobile and embedded devices

 Used to get real time values

 These are all around us and can be controlled by themselves

 Ex: Electronic health care system, sensor network.

Applications of Distributed System

 Finance and Commerce:

 Ex: amazon, e-bay, online banking

 The Information Society:


SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2
Distributed Systems CSE
 Ex: Search engines, Wikipedia, social networking

 Creative Industries and entertainment:

 Ex: Online gaming, music, YouTube

 Health Care:

 Ex: online patient record, health informatics

 Education:

 Ex :e-learning,

 Transport &logistics:

 Ex: GPS, google maps

 Environment Management:

 Ex: Sensor Tech

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE
Architectural Styles, Middleware & Self Management

• There are 3 types of Architectural Styles

– Layered architectures

– Object-based architectures

– Data-centered architectures and

– Event-based architectures

LAYERED ARCHITECTURES

 It separates layers of components from each other giving it a more modular approach just like
OSI model

 Each interaction is s sequential where a layer will contact the adjacent layer and this process
continues

 Request flow from top to bottom and response is from bottom to up

OBJECT-BASED ARCHITECTURES

 This architecture style is based on loosely coupled arrangement of objects. There is no specific
architecture like layers.

 GIRIJA
SUTHOJU Each of the components
RANI, Assistantare objects where
Professor, CSE,each
NGITobjects can interact with a given1 interface
Distributed Systems CSE
 Even their could be some direct method calls

These calls are procedurally called as RPC

DATA-CENTERED ARCHITECTURES

 A Data store(Files or DB or repositories) resides at the centered of the architecture &


accessed frequently by other components that add, delete or modify data with in the storage

EVENT-BASED ARCHITECTURES

 The entire communication in this kind of system happens through events

 When an event is generated it will sent to the system bus

 System with this everyone else will be notified telling such an


event has occurred

Middleware in Distributed System

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2


Distributed Systems CSE

Interceptors

an interceptor is nothing but a software construct that will break the usual flow of control and allow
other (application specific) code to be executed

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE

SELF -MANAGEMENT IN DISTRIBUTED SYSTEMS

• These are the systems which can themselves adjust when some thing happens, these
automatically adapt on the account of

– Self configuration

– Self managing

– Self healing

– Self Optimization

Feedback control system

• Best Example: Machine Learning

• Based on the final output if the accuracy is too low, Back tracking is done by adjusting valves

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 4


Distributed Systems CSE
System Architectures

 These explain how distributed systems are actually organized considering where software
components are placed.

Types of system architectures

 Centralized Architecture

 Decentralized Architecture

 Hybrid Architecture

Centralized Architecture : Central server many clients

Client-Server Architecture:

• The most commonly used Architecture which has two major subsystems(Processes)

– Client: This is the first process that issues a request to the second process i.e. server.

– Server: This the second process that receives the request, carries it out and also send a
reply to the client

Application Layering

One of the most common client server layering has 3 layers:

1.User Interface

2.Process level

3.Data level

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1


Distributed Systems CSE

Multi tiered Architecture

 Multi tiered Architecture is a client server architecture in which the functions such as
presentation, application processing and data management are physically separated.

 Hence by separating now the developer has more flexibility and reusable applications(small
changes can be done easily).

 The common multi-tiered architecture is the three tiered architecture having:

1. Presentation tier 2.Application tier 3.Data storage tier

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2


Distributed Systems CSE
Presentation tier

 It is the top most level where user can interact with the application

 It might me front end of the web page or GUI of application using which a user can
interact/communicate with the other layers

 This layer is always user friendly and easy to understand as this layer where end user
communicates with application

Application tier

 Business logic, logic tier, middle ware

 The place where application code, working functionalities reside

 It also moves and process data between two resounding layers

Data storage tier

 Here data is stored and retrieved database or file system as the requirements. Then the data
is passed through processing then back to user.

 Some of the popular sites who have applied this architecture are: MakeMyTrip.com, Sales
Force enterprise application, Indian Railways – IRCTC, Amazon.com, etc.

Decentralized Architectures

Peer to Peer architecture

Unlike client server P2P model data not distinguish between client/server, instead of each node can
either a client/server depends on whether the node requesting or providing the service.

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE

• Patterns of communication between them depends entirely on application requirement

• Each object is replicated in several computers to further distribute the load and to provide
residence in the event of disconnection of individual complex

Hybrid Architecture

• It is the combination of client-server and peer to peer

• Edge Server Systems(Content delivery ) and bit torrent

• Shows the content delivery network how data is transferred from provider to client as per
requirements

• As the content provider is the host (server) gives to all and once data reaches to ISP(also acts
as server) shares to respective client

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 4


Distributed Systems CSE

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 5


Distributed Systems CSE
Processes : Process is program in execution

 Stack:Temp data such as functions,parms etc.

 Heap: Dynamic memory Allocation

 Data: Global var,Static variable

 Execution content

 Program Counter(PC)

 Stack Pointer(SP)

 Data Register

 An instance of program that is being executed on one of the OS Processors

 A Process has virtual address space, executable code, open handles system objects, a security
content, a unique identifier, environment variables, a priority class and at last one thread of
execution

Thread : Thread is a Light weight process. It is unit of execution with in a process

 A process can have anywhere from just one thread to multiple threads

 A thread executes its own piece of code, independently from other threads

 A way of process to split it elf into two or more simultaneously running tasks

 A thread maintains only the minimum information to allow a CPU to be shared by several
threads

 Execution Content :

 Program Counter

 Stack Pointer

 Data Register

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1


Distributed Systems CSE
Process vs Thread

 Process: Each process has one or more thread

 Inter Process communication is expensive: need to context switch.

 Secure: One process cannot corrupt other process

 Thread: Each thread belong to one process

 Inter process communication is cheap: Can use process memory and may not need to
context switch

 Not secure: A thread can write the memory used by other thread

Threads in Distributed Systems

 Used to Express communication in the form of multiple logical connections at the same time

 An important property of threads that they can provide convenient means of allowing
systems calls without blocking the entire process in which system is running

 A Main contribution of threads in distributed systems is that they allow client and server to be
constructed in such that communication and local processing can overlap, resulting high level
of performance

 Multi thread client : e.g.: web browser

 Multi thread server : e.g. : web server

Multithreaded Client & Server

 It can be used to hide/delay in network communications by initiating communication and


immediately proceeding with some thing else

 Ex :Web Browser(Such as IE multi Threaded)

 A web browser can start up several threads like one main html file has been fetched , separate
threads can activated to take care of fetching the other parts one each per images on
animations/applets etc..
SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2
Distributed Systems CSE
 A Multithreaded server organized in a dispatcher/workers model

 Multithreaded server that has more than one thread

 Server implementation schemes

 Single-threaded server

 Multi-threaded server

 Finite state machine server

Model - Characteristics

 Threads-parallelism , Blocking system calls

 Single threaded process- parallelism , Blocking system calls

 Finite state machine-parallelism, non Blocking system calls

Three ways to construct a server

 Blocking system calls make programming easier and parallelism improves performance

 Single Thread server retains the ease and simplicity of blocking systems but gives up
performance

 Finite state machine approach actives high performance through Parallelism and uses
non blocking calls

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE
Virtualization

 It is the process of making physical resources as virtual resources

 It allows us to share single physical instance of application or resource or application among


multiple organizations

 Hardware virtualization: it means creating virtual machine over existing OS and H/W

 Host machine: Machine on which virtual machine created

Architecture of Virtual Machines

Advantages of virtualization

 More flexible and efficient

 Low cost

 Cost per usage

 Enable running multiple OS

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1


Distributed Systems CSE
Types of virtualization

1. Application virtualization

2. Network virtualization

3. Desktop virtualization

4. Storage virtualization

1.Application virtualization

 The server stores all the personal information and other characteristics of the application but
can still run on local work station through internet. Helps a user to have remote access of an
application from server

2.Network virtualization

 The ability to run multiple virtual networks with each has a separate control & data pan.

 E.g. : VPN

3.Desktop virtualization

 It allows the user OS to remotely stored server and allow control from any device or machine
connected to it

4. Storage virtualization

 It is an array of servers that are managed by a virtual storage. We don’t know exactly where
data is stored but we can read it and do any operation on it.

 E.g. : AWS, Microsoft Azure

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2


Distributed Systems CSE

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE
Software agents

 A software agent is an piece of software that functions as an agent for a user or another
program, working autonomously and continuously in a particular environment.

 Independent views of execution are concluded in software agents

 Collaborative agents: autonomy and corporation

 Mobile agents: ability to move between different machine

 Interface agents: assist end user in use of one or more applications

 Information agent : manage information from different sources

Some important properties by which different types of agents can be distinguished

Property Common to all agents Description

Autonomous Yes Can act on its own

Reactive Yes Responds timely to change in its environment

Proactive Yes Imitates actions that affect its environment

Communicative Yes Can exchange information with uses and other agents

Continuous No Has a relatively long life span

Mobile No Can migrate from one site to another

Adaptive No Capable of learning

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1


Distributed Systems CSE
Clients

 A program which interact a human user and a remote server

 Typically the user interact with client via a GUI

Networked User Interfaces

A networked application with it own protocol

Servers

 A process that implement a specific service on behalf of collection of clients

 A separate thread/sub program /process that handles the request and returns result to the
client(no wait parallel execution)

 Two operations

 wait

 Provide service

Types of servers

 Iterative server :Server handles request ,then returns results to client, if any new
request must wait for previous request to complete(Also called sequential)

 Concurrent server: server itself does not handle request

Server states

1.Stateless server:

 No information is maintained on current connections to the server

 The web is the classic example

2.Stateful server:

 information is maintained on current connections to the server


SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2
Distributed Systems CSE
Code migration

Moving code from one space to another space

Reasons for code migration:

 Improving computing performance by moving processes from heavily loaded machine to


lightly loaded machine

 Improve communication time by shipping code to systems where large data set resides

 Client first fetches the necessary software and then invoke server

Migration models

 A process contains 3 segments

 Code segment

 Resource segment

 Execution segment

 Weak Migration: Only code segment is migrated

 Strong Migration: code and execution segment both can be transferred

 Migration can be sender initiated and receiver initiated

 Sender initiated : Uploading code to server

 Receiver initiated : Downloading code from server by client

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE
Communication in Distributed Systems

 Communication nothing but exchanging of information between two devices. It includes

 Message oriented communication

 Stream oriented communication

 Multicast communication

 Remote Procedure calls(RPC)

 Remote Method Invocation(RMI)

Communication is done/passed through OSI model

Message Oriented Communication

 It is way of communication between the process on the sender’s and receiver’s machine, in
term of sending and receiving explicit messages between them

 Classification of Communication:

Synchronous communication:(One after another)

 The sender is blocked until its message stored in local buffer at receiver end

Asynchronous communication:

 Sender continuous sends immediately after a message sent

 The message is either stored in local buffer or at the first communication server

Persistent communication:

 Message that has been submitted is stored by the communication system as long as it
takes to deliver it to receiver

 Ex:Mail

Transit Communication

 Message are stored as long as sending and receiving applications are running

 Ex: Router

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 1


Distributed Systems CSE

Stream Oriented Communication

 A (Continuous) data steam in a connection oriented communication facility that supports I


synchronous(both synchronous and asynchronous) data transfer

 Stream Oriented Communication is a form of communication in which timing plays crucial role
SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 2
Distributed Systems CSE
 FEATURES:

 Supports Continuous data(audio,video,sensor data)

 Streams in distributed

 Stream management

 Asynchronous no restriction with respect to when data is delivered

 Synchronous defines a max end delivery

Characteristics

 Streams are unidirectional

 There is generally a single source and one or more sinks

 Often , either sink/source in wrapper around hardware(Camera,CD Drive)

Multicast Communication

 It supports for sending data to multiple receivers

APPLICATION LEVEL MULTICATING

 In Application level multicasting nodes(ie application processes ) are organized in to an


overlay network and multicast message are sent along multicast trees create on overlay
network

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT 3


Distributed Systems CSE
Remote procedure call (RPC)

RPC is a protocol that one program can use to request a service from a program located in another
computer on a network without having to understand the networks details

A procedure call is also called function call or subroutine call. RPC uses client model

It induces mainly five elements:

1.The client

2.The client stub

3.The RPC run time

4.The server stub

5.Server

Stub: piece of code used for converting parameters

The client

 It is the user process which initiates RPC

 The client makes a perfectly normal call that invokes a corresponding procedure in the client
stub

The client stub:

 On Receipt of a request it packs a requirements into a message and asks to RPC run time to
send

 On receipt of a result it unpack the results and passes to the client

RPC Runtime: It handles transmission of message between client & server

The Server

 It executes an appropriate procedure and returns the result from a server stub

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT


Distributed Systems CSE
Server stub:

 It unpacks a call request and make perfectly normal call to invoke appropriate procedure in
the server

 On receiving the request a procedure pack will pack it and send to RPC run time

Steps of RPC

 1.Client procedure calls client stub in normal way

 2.clint stub builds message ,call local OS

 3.clint OS sends a message to remote OS

 4.remote OS gives message to server stub

 5.server stub unpacks parameters, calls server

 6.server does work, returns result to the stub

 7.server stub packs it in message, calls local OS

 8.servers OS sends a message to client OS

 9.client OS gives message to client stub

 10.stub unpacks , returns to client

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT


Distributed Systems CSE
Example of RPC

Implementation issues in RPC

 RPC protocol:

The First issue is the choice of the protocol

 Connection Oriented Protocol:

 The Client is bounded to the server and a connection is established between them

 Advantage : Communication becomes much easier

 Disadvantage : Especially over a LAN, is the performance loss

 Connection less Protocol

 IP and UDP are easy to use and fit in well with existing UNIX system and networks the
internet, but downside is performance

 Packet and message length identification is an issue

 Reading a 64k file in a single 64k RPC is mostly more efficient than reading it in 64 1k
RPC’s

Advantages of RPC

 RPC supports process oriented and thread oriented models

 The internal message passing mechanism of RPC is hidden from user

 The effort of re-write and re- develop the code is minimum in RPC

 RPC can be used in distributed environment and local environment

 Many of the protocol layers are omitted by RPC to improve


3

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT


Distributed Systems CSE
Disadvantages of RPC

 RPC is the concept that can be implanted in different ways. It is not standard

 There is no flexibility in RPC for h/w architecture

 There is increase in costs because of RPC

Remote method invocation (RMI)

 The RMI is an API that provides a mechanism to create distributed application in java

 It allows an object to invoke methods on object running in other JVM

 (JVM ) Client and (JVM) server

 The RMI provides remote connection between applications using two applications using two
objects stub(client side) and skeleton(server side)

RMI system layer

It consists of three layers

 Stub/Skeleton Layer

 Remote reference layer

 Transport layer

Stub

 RMI uses stub and skeleton object for communication with remote objects

 Remote object is an object whose method can be invoked from another JVM

STUB(Client side)

 It is the object acts as gateway for the client side, all out going request are routed through it
4

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT


Distributed Systems CSE
 It resides at the client side and represents remote object

STEPS

 It initiates a connection with JVM

 It writes and transmits(marshals) the parameters to the remote virtual machine

 It waits for the result

 It reads(un marshals) the return value or expression

 It finally, returns value to the caller

Skeleton

 It is an object acts gate way for the server side object

 All the incoming requests are routed through it

STEPS

 It reads the parameter for the remote object

 It invokes method on the actual remote object and

 It writes and transmits (marshals) the result to the caller

GOALS OF RMI:

 To minimize the complexity of application

 To Preserve the type safety

 Distributed garbage collection

 Minimize the difference between working with local and remote objects

SUTHOJU GIRIJA RANI, Assistant Professor, CSE, NGIT

You might also like