- Information
- AI Chat
DC(U1) - Distributed Computing Lecture Notes
Principles Of Distributed Computing (Level 1) (CSEL 571)
Pondicherry University
Students also viewed
Related Studylists
nihaPreview text
Unit I Introduction: Characteristics, Examples, Applications, Challenges –System models:- Architectural models and Fundamental models – Network principles and Internet protocols – Inter-process communication: API, Marshalling ,Multicast communication, Client-server communication, Group communication.
UNIT I
1 INTRODUCTION TO DISTRIBUTED SYSTEMS
Definition
- A distributed System is a collection of independent computers that appeals to its users as a single coherent system.
- Important Characteristics of distributed System : (i) In distributed systems, the differences between the various computers and the ways in which they communicate are hidden from users. Internal Organization of distributed system also hidden from the users. (ii) Users and applications can interact with a distributed system in a consistent and uniform way, regardless of where and when interaction takes place.
- A distributed system will normally be continuously available, although perhaps certain parts may be temporarily out of order.
- The motivation for constructing and using distributed system is resource sharing.
- Resources such as printers, files, web pages or database records are managed by servers of appropriate type.
- The purpose of this chapter is to convey a clear view of the nature of distributed systems andthe challenge that must be addressed in order to ensure that they are successful.
- We look at some key examples of distributed systems, the components from which they are constructed and their purposes. 1 Examples of distributed Systems
- Let us now have a look at several examples of distributed systems. The internet is an example of distributed system.
- The internet is an interconnected collection of computer networks of many different types. Figure 1 Illustrates the typical portion of the Internet.
Figure 1 A typical portion of the internet
It enables the users, wherever they are, to make use of services such as World Wide Web, e-mail and file transfer.
The services of internet can be extended by addition of server and new type of services.
The above figure shows a collection of intranets. Intranets are subnetwork operated by companies and other organizations.
ISPs (Internet Service Providers) are companies that provide Connections to individual users and small organizations.
The intranets are linked together by back bones.
A back bone is a network link with a high transmission Capacity. It employs satellite connections, fiber optical cables and other high band width cables.
Multimedia services are available in the internet. This service enable the users to access audio and video data.
As a second example, consider a work flow information system that supports the automatic processing of orders.
Typically, such a system is used by people from several departments, at different locations.
For example, people from the sales department may be spread across a large region or an entire country. Orders areplaced bymeans of laptop computers that are connected to the system through the telephone networks. Incoming orders are automatically forwarded to the planning department. The system will automatically forward orders to an appropriate and available person.
As a final example, consider the world wide web. The web offers a simple, consistent, and uniform model of distributed documents.
To see a document, a user need merely activate a reference, and the document appears on the screen. Publishing a document is also simple: you only have to give it a unique name in the form of uniform.
Resource Locator that refers to a local file containing the document's content. 1. CHALLENGES The key challenges faced by the designers of Distributed system are Heterogeneity. Openness. Security. Scalability. Failure handling. Concurrency. The need for transparency. 1.3 Heterogeneity
They must be constructed from a variety of different networks, operating systems, computer hardware and programming languages.
The internet Communication protocols mask the difference in networks, and middleware can deal with other differences.
The term Middleware applies to a software layer that provides a programming abstraction as well as masking the heterogeneity of the underlying networks, hardware, operating systems and programming languages. Example: Common Object Request Broker Architecture (CORBA). 1.3 Openness
The openness of a computer system is the characteristic that determines whether the system can be extended and re- implemented in various ways.
The openness of distributed systems is determined primarily by the degree to which new resource sharing services can be added and be made available for use by a variety of client programs.
Preventing software resources running out
- As an Example, the supply of available internet addresses is running out.
- There is no correct solution to this problem. It is difficult to predict the demand that will be put on a system years ahead. Avoiding performance bottle necks
- Algorithms should be decentralized to avoid having performance bottlenecks.
- Because, in a large distributed system, enormous number of messages have to be routed over many lines.
- The optimal way to do this is collect complete information about the load on all machines and lines, and then run a graph theory algorithm to compute all the optional.
- The trouble is that collecting and transporting all the Input and output information would again be a bad idea because these messages world overload part of the network. 1.3 Failure handling
- Failures fall into two obvious categories: hardware and software.
- If failure occurs, program may produce incorrect results on they may stop before they have completed and intended computation.
- Failures in a distributed system are partial, i., some components fail while others continue to function. Therefore, the handling of failures is particularly difficult.
- The techniques dealing with failures are listed below. Detecting failures - Some failures can be detected. E. checksums can be used to detect corrupted data in a message or a file Masking failures - Some failures that have been detected can be hidden or made less severe. E. messages can be retransmitted when they fail to arrive. Tolerating failures - It is not possible to detect and hide all the failures that might occur in large network. Their clients can be designed to tolerate failures, which generally involve the users tolerating them as well. Services can be made to tolerate failures by the use of redundant components.
- Recovery from failures - Recovery involves the design of software so that the state of permanent data can be recovered or rolled back after a server has crashed. 1.3 Concurrency
- Both services and applications provide resources that can be shared by clients in a distributed system.
- There is therefore a possibility that several clients will attempt to access a shared resource at the same time.
- The process that manages a shared resource could take one client request at a time. But that approach limits throughput.
- Therefore, services and applications generally allow multiple client requests to be processed concurrently.
- For an object to be safe in concurrent environment, its operations must be synchronized in such a way that it s data remains consistent.
- This can be achieved by standard techniques such as semaphores. 1.3 Transparency
- It is defined as the concealment from the user and the application programmer of the separation of components in a distributed system.
- Hence, the system is perceived as a whole rather than as a collection of independent components.
- The main aim of the transparency is to make certain aspects of distribution invisible to the application programmers. Access transparency enables local and remote resources to be accessed using identical operations. Location transparency enables resources to be accessed without knowledge of their location.
Concurrency transparency enables several processes to operate concurrently using shared resources. The resources wil not interfere among themselves. Replication transparency enables multiple instances of resources to be used to increase reliability and performance without knowledge of the replicas by users or application programmers. Failure transparency enables the concealment of faults. It allows users and application programs to complete their tasks even though they have the failure of hardware or software components.
Mobility transparency allows the movement of resources and clients within a system. The movement will not affect the operation of users or programs. Performance transparency allows the system to be reconfigured to improve performance as loads vary. Scaling transparency allows the system and applications to expand in scale it will not change to the system structure or the application algorithms.
- There are two important transparencies available. They are access and location transparency; their presence or absence most strongly affects the utilization of distributed resources. They are referred together as network transparency. 1 ARCHITECTURAL MODELS
- An architectural model of a distributed system is concerned with placement of its parts and the relationships between them.
- An architectural model defines the way in which the components of systems interact with one another and the way in which they are mapped onto an underlying network of computers.
- The overall goal is to ensure that the structure will meet present and likely future demands on it.
- Major concerns are to make the system reliable, manageable, adaptable and cost effective.
- An architectural model first simplifies and abstracts the functions of the individual components of a distributed system and then it considers : oThe placement of the components across a network of computers, seeking to definite useful patterns for the distribution of data and workload.
- This classification identifies the responsibilities of each and hence helps us to assess their workloads and to determine the impact of failures in each of them. 1.4 Software layers
- The term 'software architecture' refers to the structuring of software as layers or modules in a single computer and in terms of services offered and requested between processes located in the same or different computers.
- This process and service-oriented view can be expressed in terms of service layers.
Figure: 1 Software and Hardware services Platform
The lowest level hardware and software layers are known as a platform for distributed systems and applications.
These low level layers provide services to the layers above them.
Figure 1: A service provided by multiple servers
Proxy servers and caches
- A cache is a store of recently used data objects.
- When a new object is received at a computer it is added to the cache store, replacing some existing objects, if necessary.
- When an object is needed by a client process, the caching service first checks the cache and supplies the object from there if an up-to-date copy is available.
- If not, an up-to-date copy is fetched from the server. Caches may be co-located with each client or in a proxy server that can be shared by several clients.
- Web proxy servers provide a shared cache of web resources for the client machines at a site or across several sites. The purpose of proxy servers is to increase availability and performance of the service by reducing the load on the WAN and web servers.
Figure 1: Web proxy Server Peer Processes In this architecture, all of the processes play similar roles, interacting cooperatively as peers to perform a distributed activity without any distinction between clients and servers. In this model, code in the peer processes maintains consistency of application-level resources and synchronizes application-level actions when necessary. The elimination of server processes reduces inter-process communication delays for access to local objects.
1.4 Variations on the client-server model Several variations on the client-server mode' can be derived from the consideration of the following factors: The use of mobile code and mobile agents OUser's need low cost computers with limited hardware resource that are simple tomanage. oThe requirement to add and remove mobile devices in a convenient manner. Mobile code - Applets are a well-known and widely used example of mobile code. - The user running a browser selects a link to an applet whose code is stored on a web server, the code is downloaded to the browser and runs there. - An advantage of running the downloaded code locally is that it can give good interactive response since it does not suffer from delays or variability of band width associated with network communication. Mobile agents - Amobile agent is a running program including both code and data that travels from one computer to another m a network carrying out a task on someone's behalf such as collecting information, eventually returning with the result. - Mobile agents might be used to install and maintain software on the computers within an organization or to compare the prices of products from a number of vendors by visiting the site of each vendor and performing a series of database operations. - Mobile agents are a potential security threat to the resources in computers that they visit. - The environment receiving a mobile agent should decide on which of the local resources it should be allowed to use, based on the identity of the user on whose behalf the agent is acting. Thin clients - The term thin clients refers to a software layer that supports a window- based user interface on a computer that is local to the user while executing application programs on a remote computer. - Instead of downloading the code of applications into the user's computer, it runs them on a compute server (a powerful computer that has the capacity to run large numbers of applications simultaneously).
Network Computers The OS and application software for desktop computers typically require much of the active code and data to be located on a local disk.
But the management of application files and the maintenance of a local software base require considerable technical effort of a nature that most users are not qualified to provide.
The network computer is a response to this problem.
It downloads its operating system and any application software needed by the user from a remote file server.
Applications are run locally but the files are managed by a remote file server. Since all the application data and code is stored by a file server, the users may migrate from one network computer to another. 1 FUNDAMENTAL MODELS
- Fundamental models are concerned with a more formal description of the properties that are common in all of the architectural models.
- All communication between processes is achieved by means of messages.
- Message communication over a computer network can be affected by delays. It may suffer from a variety of failures.
- It is vulnerable to security attacks. These issues are addressed by three models.
- The interaction model deals with performance and with the difficulty of setting time limits in a distributed system.
- The failure model attempts to give a precise specification of the faults that can be exhibited by processes and communication channels.
- The security model discusses the possible threats to processes and communication channels. It introduces the concept of a secure channel, which is secure against these threats. 1.5 Interaction model
- Interacting processes perform all activities in a distributed system.
- Each process has its own state, consisting of the set of data that it can access and update, including the variables in its program.
- The state belonging to each process is completely private, i., it cannot be accessed or updated by any other process.
- Two significant factors affecting interacting processes in a distributed system are:
- Communication performance is often a limiting characteristic.
- It is impossible to maintain a single global notion of time. Performance of communication Channels Communication over a computer network has the following performance characteristics relating to latency, bandwidth and jitter.
Delay between the start of a message is transmission from one process and the beginning of its receipt by another is referred to as l atency , the latency includes: o The delay in accessing the network. o The time taken by the OS communication services which may vary according to the load on the OS.
Bandwidth is the total amount of information that can be transmitted in a given time. When a large number of communication channels are using the same network, they have to share the available bandwidth.
Jitter is the variation in the time taken to deliver a series of messages. Jitter is relevant to multimedia data. E., if consecutive samples of audio data are played with different time intervals then the sound will be badly distorted. Computer clocks and timing events
Each computer in a distributed system has its own internal clock, which can be used by local processes to obtain the value of the current time.
Therefore, two processes running on different computers can associate timestamps with their events.
However, even if two processes read their clocks at the same time, their local clocks may supply different time values.
This is because computer clocks drift from perfect time and their drift rates differ from one another.
The term clock drift rate refers to the relative amount that a computer clock differs from a perfect reference clock.
Even if the clocks on all computers are set to the same time initially, their clock would eventually vary quite significantly unless corrections are applied. Two variants of the interaction model In a distributed system it is hard to set time limits for process execution, message delivery or clock drift. Two opposing extreme positions provide a pair of simple models, the first has a strong assumption of time and the second makes no assumption about time. (i) Synchronous distributed systems It is defined as one in which the following bounds are specified: The time to execute each step of a process has known lower and upper bounds. Each message transmitted over a channel is received within a known bounded time. Each process has a local clock whose drift rate from real time has a known bound.
It is possible to suggest likely upper and lower bounds for process execution time message delivery and clock drift rates in a distributed system.
But it is difficult to arrive at realistic values and to provide guarantees of the chosen values.
Unless the values are guaranteed, any design based on the chosen values will not be reliable. (ii) Asynchronous distributed system
An asynchronous distributed system is one in which there are no bounds on process execution speeds, message transmission delays and clock drift rates.
This exactly models the Internet, in which there is no intrinsic bound on server or network load.
For example, to transfer a file using ftp. Actual distributed systems are very often asynchronous because of the need for processes to share the processors and for communication channels to share the network. 1.5 The failure model The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failures. There are three types of failures andare explained below: Omission failures : The faults classified as omission failures refer to cases when a process or communication channel fails to perform actions that it is supposed to do. There are two types of omission failures. They are:
Class of failure Affects Description Clock Performance Performance
Process Process Channel
Local clock exceeds the bounds Process exceeds the bounds Message transmission takes longer
- Timing is particularly relevent to multimedia computers with video and audio channels. Video information may require a large amount of data to be transferred. To deliver such information without timing failures will make demands on the operating system as well as communication system. Masking failure
- Each component in a distributed system is generally constructed from a collection of other components.
- It is possible to construct reliable services from components that exhibit failures. For example, multiple servers that hold replicas of data can continue to provide a service when one of them crashes.
- A Knowledge of the failure characteristics can enable a new service to be designed to mask the failure of the components on which it depends.
- A service masks a failure, either by hiding it altogether or by converting it into a more acceptable type of failure 1.5 Security Model
- The security of a distributed system can be achieved by securing the processes and the channels used for their interactions and by protecting the objects that they encapsulate against unauthorized access. Protecting objects
- Protection is described in terms of objects.
- Objects are intended to be used in different ways by different users. For example, some objects may hold a user's private data and other objects may hold shared data such as Web pages.
- To support this, access rights specify who is allowed to perform the operations (read/write) of an object.
- The server is responsible for verifying the identity of the client behind each invocation and checking their access rights on the requested object.
- The clients in turn can check the authenticity of the server.
Fig : Objects and pincipals
Securing processes and their interactions
- Distributed systems are deployed and used in tasks that are likely to be subject to external attacks by hostile users.
- This is true for applications such as financial transactions. For these applications, secrecy or integrity is crucial. Integrity is threatened by security violations and communication failures.
- In order to identify and defeat threats we have to analyze those threats.
- We will explsore a model for the analysis of security threats in the following paragraph.
- Processes interact by sending messages.
- The messages are exposed to attack because the network and the communication service are open.
- Servers and peer processes expose their interfaces, enabling invocations to be sent to them by any other process.
- To secure the messages passed over the network, cryptographic algorithms (encryption) is applied to the message, to provide confidentiality, authentication and integrity.
- The threats from a potential enemy are discussed under the following headings 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 thesender.
- This lack of reliable knowledge of the source of a message is a threat to the correct functioning of both servers and clients. E. Spoofing Threats to communication channels
- An enemy can copy, alter or inject messages as they travel across the network and its intervening gateways.
- Such attacks present a threat to the privacy and integrity of information as it travels over the network and to the integrity of the system.
- All these threats can be defeated by the use of secure channels, which is described below: Secure Channels
- A secure channel ensures the privacy and integrity of the data transmitted across it.
- Encryption and authentication are used to build secure channels as a service layer on top of existing
communication services.
- A secure channel is a communication channel connecting a pair of processes with the following
properties
- Each of the processes knows reliably the identity of other processes.
- It ensures the privacy and integrity of the data transmitted across it.
- Each message includes a physical or logical time stamp to prevent messages from being replayed or
reordered.
Denial of service
This is a form of attack in which the enemy interferes with the activities of authorized users by
making excessive invocations on services or message transmission in a network, resulting in
overloading of physical resources.
- Whenever receive is issued, the process blocks until a message arrives.
- In asynchronous form of communication, the use of send operation is non-blocking.
- The sending process is allowed to proceed as soon as the message have been copied to a buffer and the transmission of the message proceeds in parallel with the sending process.
- Receive operation can have blocking and non-blocking variants.
- Messages are sent to(Internet address,localport)pairs. A local port is a message information within a computer, specified as an integer.
- A port has exactly one receiver but can have many senders.
- Processes may use multiple ports from which to receive messages.
- Servers generally publicize their port numbers for use by clients.
Socket
Both forms of communication( UDP and TCP) use the socket abstraction which provides end point for communication between processes
Inter-process communication consists of transmitting a message between a socket m one process and a socket in another process.
For process to receive messages,its socket must be bound to a local port and the Internet address of the computer on which it runs.
Processes may use the same socket for sending and receiving messages.
Any process may make use of multiple ports to receive messages but a process cannot share ports with other processes on the same computer.
Processes using IP address are an exception in that they do share ports.
UDP datagram communication
A datagram sent by UDP is transmitted from a sending process to a receiving process without acknowledgement or retries.
If a failure occurs, the message may not arrive.
To send or receive messages, a process must first create a socket bound to an Internet address of the localhost and local port.
A server will bind its socket to a server port-one that it makes known to clients so that they can send messages to it.
A client binds its socket to any free local port.
Few issues relating to datagram communication are:
Message Size
The receiving process need to specify an array of bytes of a particular size.
If the message is too big for the array,it is truncated on arrival.
Any application requiring messages larger than the maximum must fragment them into chunks of that size.
Blocking
Sockets normally provide non-blocking sends and blocking receives for datagram communication. Timeouts
The receive that blocks for ever is suitable for use by a server that is waiting to receive requests from its clients.
But in some program,it is no appropriate that a process that has used a receive operation should wait indefinitely in situations where the potential sending process has crashed or the expected message has been lost.
Receive from any
- The receive method does not specify an origin for messages.
- Instead an invocation of receive gets a message addressed to its socket from any origin.
- A failure model for UDP datagram suffer from the following failures:
- Omission failures –Messages may be dropped occasionally.
- Ordering-Messages can sometimes be deliver out of sender order.
Use of UDP
The Domain Name Service(DNS) which looks up DNS names in the Internet, is implemented over UDP.
UDP datagrams are sometimes an attractive choice because they do not suffer from overheads associated with guaranteed message delivery.
JAVA API for UDP datagram The JAVA API provides datagram communication by means of two classes: DatagramPacket DatagramSocket
DatagramPacket
- This class provides a constructor that makes an instance out of an array of bytes comprising a message,the length of the message and the Internet address and local port number of the destination socket.
- This class provides another constructor for receiving a message.
- Its arguments specify an array of byte to receive the message and its length.
Fig 1 Datagram Packet
Datagram Socket
- This class supports sockets for sending and receiving UDP datagrams.
- It provide a constructor that takes a port number as argument,for use by a processes that need to use particular port.
- It also provides a non-argument constructor that allows the system to choose a free local port.
- The class Datagram Socket provides the following methods:
- send and receive: These methods are for transmitting datagrams between a pair of sockets. SetSoTimeout: This method allows a time out to be set a timeout set,the receive method will block for the time specified and the throws an InterruptedIOException. connect This method is used for connecting it to a particular remote port and Internet address.
Program:UDPclient
import java.*;
import java.*;
Threads - When a server accepts a connection,it generally creates a new thread to communicate with the new client. Failure Model - To satisfy the integrity property, TCP use checksums to detect and reject corrupt packets and sequence numbers to detect and reject duplicate packets. - In order to satisfy the validity property, timeouts and retransmissions are used by TCP. Uses of TCP
- Many frequently used services run over TCP connection with reserved port numbers.
- Those include HTTP, FTP, Telnet and SMTP. JAVA API for TCP stream The JAVA interface to TCP streams is provided in the classes ServerSocket and Socket. Server Socket
- This class is intended for use by a server to create a socket at a server port for listening for connect requests from clients.
- Its accept method gets a connect request from the queue,or the queue is empty ,it blocks until one arrives. Socket
- The client uses this constructor to create socket specifying the DNS hostname and port of a server.
- The Socket class provides methods getInputStream and getOutputStream for accessing the two streams associated with a Socket. TCP client program
import java.; import java.; public class TCPClient { public static void manin( String args[ ]) { try { int serverport =7896; Socket c=new Socket(args[1],serverport); DataInputStream in =new DataInputStream(c()); DataOutputStream out =new DataOutputStream(c()); out(args[0]); String data=in(); System.out(<Received:=+data); } Catch(UnknownHostException e) { System.out:=+e()); } Catch(EOFException e) { System.out(<EOF:=+e()); } Catch(IOException e) { System.out(<IO:= +e()); } finally{if(c!=null) try{c();}catch(IOException e);
In the client program,the argument of the main method supply a message and the DNS name of the server.
The client creates a socket bound to the hostname and server port 7896.
It makes DataInputStream and DataOutputStream then writes the message to its output stream and waitsto read a reply from its input stream is an encoding that representing in a particular format.
The server program opens a server socket on its serverport(7896) and listens for connect sets.
When one arrives,it makes a new thread in whinch to communicate with the client. Server program
DC(U1) - Distributed Computing Lecture Notes
Course: Principles Of Distributed Computing (Level 1) (CSEL 571)
University: Pondicherry University
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades
Why is this page out of focus?
This is a preview
Access to all documents
Get Unlimited Downloads
Improve your grades