Module 2
Module 2
All processes in task play similar roles, interacting cooperatively as peers without any
distinction between client and server process.
It aims to exploit the resources in large number of participating computers for fulfillment of
task.
Each object is replicated in several computers to further distribute the load.
Eg: Music sharing system Napster.
SYSTEM MODELS
2.PHYSICAL MODEL:
Physical model deals with the types of computers and the devices which form a system with
their interconnectivity but the technology behind it is hided.
2.1 Baseline Physical Model
Hardware or software components located at networked computers communicate and
coordinate their actions only by passing messages.
This leads to a minimal physical model of a distributed system as an extensible set of
computer nodes interconnected by a computer network for the required passing of messages.
2.2 Early distributed systems
System emerged in the 1980’s with local area network around 10 to 100 nodes
interconnected with limited network connectivity and supported a small range of services
such as shared local printers and file servers as well as email and file transfer across the
Internet.
Advantages:
Homogenous
Openness
Disadvantages:
Qos
2.3 Internet-scale distributed systems
Emerged in 1990’s in response to the dramatic growth of internet during this time.
Ex:Google search Engine(1996)
Globally established the extensible set of nodes interconnected by networks for global
organization and across industries.
Advantages:
Heterogenity
QoS
Middleware technology like CORBA
2.4 Contemporary distributed systems
Above systems, nodes were typically desktop computers and therefore relatively static
(that is, remaining in one physical location for extended periods), discrete (not embedded
within other physical entities) and autonomous (to a large extent independent of other
computers in terms of their physical infrastructure)
In this contemporary distributed systems
• Emergence of Mobile computing
• Emergence of Ubiquitous and pervasive computing
• Emergence of Cloud computing
2.5 Distributed systems of systems
Drawbacks:
• Communication performance is often a limiting characteristic.
• It is impossible to maintain a single global notion of time.
Performance of Communication Channels
• Latency :
The delay between the start of a message’s transmission from one process and the beginning of
its recipient by another.
The latency includes:
• The time taken for the first of a string of bits transmitted through a network to reach its
destination.
• The delay in accessing the network, which increases significantly when the network is
heavily loaded.
• The time taken by the operating system communication services at both the sending and the
receiving processes,
Bandwidth:
• The bandwidth of a computer network is the total amount of information that can be transmitted over it
in a given time. When a large number of communication channels are using the same network, they
have to share the available bandwidth.
• JITTER: variation in the time taken to deliver a series of messages. Jitter is relevant to multimedia data.
For example, if consecutive samples of audio data are played with differing time intervals, the sound
will be badly distorted.
Two variants of the interaction model
3.2 Failure model-Failure occur if the system operation is disturbed which may be in individual system or network.
This model provides solution for analysis and design to rectify faults.
Failure occurs in processes and communication channel.
Omission Failure
Process and communication channel fail to perform actions which leads to crash and Timeouts helps to detect failure.
Class of Failure:
Fail stop, Crash, Omission, Send omission, receive omission , Arbitrary(BYZANTINE)
Send----- outgoing buffer--------incoming buffer------receiver
SYSTEM MODELS
3.3 Security Model
The security of distributed system can be achieved by securing the processes and chennels used for interaction
and by protecting the objects against unauthorized access.
System will get attacked by means of internal or external agents.
Security model provides solution for those attacks by means of defining and classifying the attacks to made the
system to resist such attacks.
Threats are classified as:
• Threats to processes
• Threats to communication channels
• Denial of service.
• Mobile code
Defeating security threats:
• Cryptography and shared secrets-
• Authentication.
A secure channel has the following properties:
A secure channel ensures the privacy and integrity of the data transmitted across it.
Each message includes a physical and logical time stamp to prevent messages from being
replayed or reordered.
Each of the process knows the identity of user.
Protecting objects
• The users can run client programs that send invocations to the server to perform operations
on the objects. The server carries out the operation specified in each invocation and sends
the result to the client.
• Objects are intended to be used in different ways by different users. For example, some
objects may hold a user’s private data, such as their mailbox, and other objects may hold
shared data such as web pages.
• To support this, access rights specify who is allowed to perform the operations of an object –
for example, who is allowed to read or to write its state.
• Authority is called as Principal either the user or the process or server.
ENEMY:
• Attacks can be made simply by using a computer connected to a network to run a program
that reads network messages addressed to other computers on the network, or a program
that generates messages that make false requests to services, purporting to come from
authorized users.
• The attack may come from a computer that is legitimately connected to the network or from
one that is connected in an unauthorized manner.
The threats from enemy include:
• Threats from processes
• Threats to communication channels.
Threats to processes:
• A process that is designed to handle incoming requests may receive a message from any
other process in the distributed system, and it cannot necessarily determine the identity of
the sender.
• Servers
• Clients
Threats to communication channels:
• An enemy can copy, alter or inject messages as they travel across the network and its
intervening gateways.
Drawbacks:
Privacy
Integrity
SYSTEM MODELS
World Wide Web consortium (W3C) defines a web service as: a software application identified
by a URI, whose interfaces and bindings are capable of being defined, described and discovered
as XML artifacts.
A web service supports direct interaction with other software agents using XML-based
message exchanges via internet based protocols.
ISSUES:
1.Message size:
IP allows messages upto 216 bytes.
Application requiring messages larger than the maximum it should fragment.
If arriving message is too big for array allocated to receive message, truncation occurs.
2.Timeouts
• The receive that blocks forever is suitable for use by a server that is waiting to receive requests from its
clients. But in some programs, it is not appropriate that a process that has invoked a receive operation
should wait indefinitely in situations where the sending process may have crashed or the expected
message may have been lost.
• Timeouts is used to set time period for blocking i.e. how long the process can be blocked.
• Program may spawn a child process i.e. threads to issue blocking operation.
• Parent process will proceed further.
• Indefinite blocking results in deadlock.
3.Blocking
Send: non blocking upon arrival message is placed in a queue for the socket that is bound to the destination port.
Receive: blocking preemption by timeout possible and if process wishes to continue while waiting for packet,use
separate thread.
UDP datagram suffer from following failures like omission failure,messages may be dropped occasionally and
ordering.
4.Receive from any
UDP Communication properties:
• No guarantee of order preservation.
• Message loss and duplications are possible.
FAILURES OF UDP:
Omission failure
Ordering
TCP stream communication:
Connection oriented protocol
Characteristics include:
• Size of message
• Lost message
• Flow control
• Message destinations
Services run over TCP connection are:
• HTTP, FTP ,Telnet, SMTP
Issues related to stream communication:
• Matching of data items
• Blocking
• Threads
Features of TCP connection:
Connection oriented
Reliability
Handles lost packets
Handles packet sequencing
Handles duplicated packets
Server socket- It is used to create a socket at server port to listen for connect request from
clients.
Socket- It is used by a pair of processes with a connection. The client uses a constructor to
create a socket and connect it to the remote host and port of a server.
It provides method for accessing input and output streams associated with a socket.
EXTERNAL DATA REPRESENTATION.
The information stored in running program is represented as data structures, whereas the information
in messages consists of sequence of bytes.
The data structure must be converted to a sequence of bytes before transmission and rebuilt on arrival.
Marshalling and Unmarshalling
Marshalling is the process of taking a collection of data items and assembling them into a form for
transmission of message.
Unmarshalling is the process of disassembling a collection of data on arrival to produce a equivalent
collection of data items at the destination.
Three approaches to external data representation and marshalling are:
• CORBA
• Java’s object serialization
• XML
• CORBA describes a messaging mechanism by which objects distributed
over a network can transfer messages with each other irrespective of the
platform or language used to create those objects.
• In Java remote method invocation (RMI), both objects and primitive data
values may be passed as arguments and results of method invocations.
• XML is used to enable clients to communicate with web services and for
defining the interfaces and other properties of web services.
• The marshalling and unmarshalling activities are intended to be carried
out by a middleware layer without any involvement on the part of the
application programmer.
• The information stored in running programs is represented as data structures.
• In a distributed system information in messages transferring between
components consists of sequences of bytes.
• To communicate any information these data structures must be converted to a
sequence of bytes before transmission. Also in the arrival of messages, the data
should be re-converted into its original data structure.
• To effectively communicate these different types of data between computers
there should be a way to convert every data to a common format.
• External data representation is the data type that act as the intermediate data
type in the transmission.
MULTICAST
Multicast is Communication of One-to-Group of devices, where group is created based on some
criteria.
Each process in a group can send and receive message.
A message sent by any process in the group can be received by each participating process in
the group.
Multicast operation is an operation that sends a single message from one process to each of the
members of a group of processes.
In an application or network service which makes use of multicasting, a set of processes form a
group, called a multicast group.
Provides no guarantees about message delivery or ordering.
IP Multicast
F-filter
E-events
Characteristics of publish subscribe systems
• Heterogeneity
• Asynchronicity
Four Schemes:
• Topic based
• Channel Based
• Content based
• Type based
IMPLEMENTATION ISSUES:
Flooding
Filtering
Advertisement
Rendezvous
Message Queue
Message queue provide an asynchronous communication protocol in which the sender and receiver of
messages don’t need to interact at the same time-messages are held in queue until the recipient
retrieves them.
The basic architecture of a message queue is simple, there are client applications called producers that
create messages and deliver them to the message queue.
An other application, called consumer, connect to the queue and get the messages to be processed.
Messages placed onto the queue are stored until the consumer retrieves them.
Email is probably the best example of asynchronous messaging.
When an email is sent the sender continue processing other things without an immediate response
from the receiver.
This way of handling messages decouple the producer from the consumer.
The producer and the consumer of the message do not need to interact with the message queue at the
same time.
Producer(sender)--------queue---------consumer(receiver)
Message Queue
Three styles of receive are generally supported:
Blocking receive-which will block until an appropriate message is available.
Non blocking receive- (a polling operation)- which will check the status of the queue and
return a message if available, or not available indication will receive
Notify operation-which will issue an event notification when a message is available in the
associated queue.
Message queue follow FIFO normally, but most queue implementation support concept of
higher priority messages delivered first.
Distributed Shared Memory
Indirect communication establishes like only when processes share a common mailbox each pair of
processes sharing several communication links.
• Distributed shared memory (DSM) is an abstraction used for sharing data between
• computers that do not share physical memory. Processes access DSM by reads and
• updates to what appears to be ordinary memory within their address space
Shared memory is a memory shared between two or more processes that are established using
shared memory between all the processes.
In shared memory model, memory is shared by cooperating processes, which can exchange
information by reading and writing data but in message passing communication takes place by means
of messages exchanged between the cooperating processes.
Tuple space systems (generative communication)
• Processes place items of structure data (tuples) and other processes can read or remove the tuples by
specifying patterns of interest notan address. The tuple space is persistent, readers and writers do
not need to exist at the same time.
Shared Memory
Shared Memory