PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru 1 Distributed Programming Model Session delivered by: Jishmi Jos C
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Session Objectives To introduce the basics and concepts of Distributed Systems. To understand the characteristics of Distributed Systems To understand different distributed system applications. To discuss the challenges arising from the distributed systems To discuss on the various Distributed System Models 2
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Session Topics Introduction to Distributed System Examples of Distributed systems. Resource sharing and the Web Challenges of Distributed systems. Distributed system models. 3
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru What is Distributed Systems A distributed system is one in which components located at networked computers communicate and coordinate their actions only by passing messages. The sharing of resources is a main motivation for constructing distributed systems. Eg Web. Resources may be managed by servers and accessed by clients or they may be encapsulated as objects and accessed by other client objects. 4
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Significant Consequences of DS Concurrency –The coordination of concurrently executing programs that share resources is an important one. No global clock –Close coordination depends on a shared idea of the time at which the programs actions occur. –The only communication is by sending messages through a network Independent failures –Fault in the network. –Unexpected termination of a program somewhere in the system /crash. –The programs may not be able to detect whether the network has failed or has become unusually slow. 5
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Distributed system Three Examples –The internet –An intranets which is a portion of the internet managed by an organization –Mobile and ubiquitous computing 6
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru The Internet The Internet is a very large distributed system The Internet is a vast interconnected collection of computer networks of many different types. Programs running on the computers connected to it interact by passing messages, employing a common means of communication. The internet protocols enabling a program running anywhere to address messages to program anywhere else. 7
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru A typical portion of the Internet 8
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru The Internet Intranets –Sub networks operated by companies and other organizations Internet Service Providers –Companies that provide modem links and other types of connection to individual users and small organizations –Enabling them to access services anywhere in the internet as well as providing local services such as and web hosting Backbone –A network link with a high transmission capacity –Employing satellite connections, fibre optic cables and other high-bandwidth circuits. 9
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Intranets An intranet is a portion of the Internet that is separately administered and has a boundary that can be configured to enforce local security policies. It is composed of several local area networks (LAN) linked by backbone connections. The network configuration of a particular intranet is the responsibility of the organization that administers it. It is connected to the internet via a router. 10
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru A typical intranet 11
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Intranets The role of the firewall is to protect an intranet by preventing unauthorized messages leaving or entering. It is implemented by filtering incoming and outgoing messages The main issues arising in the design of components for use in intranets are: file services, firewalls, cost of software installation and support. Some organizations do not wish to connect their internal networks to the internet at all: Police and other security Law enforcement agencies Military organizations 12
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile and Ubiquitous Computing Technological advances in device miniaturization and wireless networking have led increasingly to the integration of small and portable computing devices into distributed systems. Laptop computers Handheld devices, including mobile phones, pagers, video cameras and digital cameras Wearable devices, such as smart watches Devices embedded in appliances such as washing machines, hi- fi systems, cars, refrigerators. 13
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile and Ubiquitous Computing Mobile Computing/ Nomadic Computing is the performance of computing tasks while the user is on the move, or visiting places other than the usual environment. Ubiquitous Computing is the harnessing of many small, cheap computational devices that are present in users physical environments, including the home, office and elsewhere. 14
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Portable and handheld devices in a distributed system 15
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru The World Wide Web The WWW is an evolving system for publishing and accessing resources and services across the Internet. A key feature of the Web is that it provides a hypertext structure among the documents that it stores, reflecting the users requirement to organize their knowledge. That documents contain links – references to other documents and resources that are also stored in the Web. The Web is an open system: –Its operation is based on communication standards and document standards that are freely published and widely implemented. –The Web is one with respect to the types of ’resource’ that can be published and shared on. 16
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Important Terms of Web Services –A distinct part of a computer system that manages a collection of related resources and presents their functionality to users and applications. –http, telnet, pop3... Server –A running program (a process) on a networked computer that accepts requests from program’s running on other computers to perform a service, and responds apppropriately. –IIS, Apache... 17
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Important Terms of Web Client –The requesting processes.Requests are sent in messages from clients to a server and replies are sent in messages from server to the clients. Remote invocation –A complete interaction between a client and a server from the point when the client sends its request to when it receives the server’s response. 18
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru The Main Standard Components of Web HyperText Markup Language (HTML) Language for specifying the contents and layout of pages as they are displayed by web browsers Uniform Resource Locators (URLs) Identify documents and other resources stored as part of the Web. HyperText Transfer Protocol (HTTP) –HTTP is a ’request-reply’ protocol. –Defines the way in which browsers and any other types of client interact with web servers 19
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Web Servers and Web Browsers Internet Browsers Web servers Protocols Activity.html File system of 20
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru More Advanced Features-Services and Dynamic Pages Dynamic pages –CGI (Common Gateway Interface) A program that webservers run to generate content for their clients It may have any application specific functionality,as long as it can parse the arguments that the client provides to it and produce the content of the required type.(HTML text) The program will often consult or update a database in processing the request –Javascript It is the service related code run inside the browser at the users computer 21
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru More Advanced Features-Services and Dynamic Pages Java Script Code written in Javascript is downloaded with a webform in order to provide better quality interaction with the user than that supported by HTML’s standard widgets It can give the user immediate feedback on invalid entries It can also be used to update parts of a webpage’s contents without fetching an entire new version of the page and re- rendering it. –Applet An application that the browser automatically downloads and runs when it fetches a corresponding webpage. It may access the network and provide customized user interfaces, using the facilities of the Java language.Eg chat 22
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Challenges Heterogeneity Openness Security Scalability Failure handling Concurrency Transparency 23
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Heterogeneity It applies to different networks, hardware, operating systems, programming languages, developers We set up protocols to solve these heterogeneities. Middleware: a software layer that provides a programming abstraction as well as masking the heterogeneity.Eg. Java RMI It also provides a uniform computational models for use by the programmers of servers and distributed applications. Possible models include Remote Object Invocation (CORBA), Remote event notification, Remote SQL access and Distributed transaction processing. 24
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Heterogeneity Mobile code: code that can be sent from one computer to another and run at the destination. Eg Java applets. The Virtual machine approach provides a way of making code executable on any hardware. The compiler for a paricular language generates code for a virtual machine instead of a particular hardware order code. Eg Java Compiler It is not applicable to programs written in other languages. 25
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Openness The openness of DS 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. Open DS are based on the provision of a uniform communication mechanism and published interfaces for access to shared resources. Open DS can be constructed from heterogeneous hardware and software. But the conformance of each component to the published standard must be carefully tested and verified if the system is to work correctly. 26
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Security Security for information resources has three components: –Confidentiality: protection against disclosure to unauthorized individuals. –Integrity: protection against alteration or corruption. –Availability: protection against interference with the means to access the resources. Firewalls,Encryption Techniques... 27
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Security Two new security challenges: –Denial of service attacks (DoS). A user may wish to disrupt a service for some reason. This can be achieved by bombarding the service with such a large number of pointless requests that the serious users are unable to use it. –Security of mobile code. The possible effects of running the program are unpredictable. 28
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Scalability A system is described as scalable if it remains effective when there is a significant increase in the number of resources and the number of users. Eg. Internet. Challenges of scalable DSs: –Controlling the cost of resources or money. –Controlling the performance loss. –Preventing software resources from running out –Avoiding performance bottlenecks-by partitioning the name table between servers-DNS 29
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Failure Handling When faults occur in hardware or software, –Programs may produce incorrect results or –They may stop before they have completed the intended computation. Failures in a distributed system are partial –Some components fail while others continue to function 30
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Failure handling Techniques for dealing with failures: Detecting failures Checksum Masking failures Message retransamission Data written to a pair of disks Tolerating failures Leaving them free to try again later Recovering from failures State of permanant data can be recovered or rolled back Redundancy At least 2 different routes between any two routers. In the DNS, every name table is replicated. Database may be replicated. 31
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Concurrency It will arise when several clients will attempt to access a shared resource at the same time. Any object that represents a shared resource in a DS must be responsible for ensuring that operates correctly in a concurrent environment. For an object to be safe in a concurrent enviornment, its operation must be synchronized in such a way that its data remains consistent. Eg Semaphores 32
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Transparency Transparency is defined as the concealment from the user and the application programmer of the separation of components in a distributed system So that the system is perceived as a whole rather than as a collection of independent components. Eight forms of transparency: 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. 33
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Transparency Concurrency transparency: Enables several processes to operate concurrently using shared resources without interference between them. 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, allowing users and application programs to complete their tasks despite the failure of hardware or software components 34
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Transparency Mobility transparency: Allows the movement of resources and clients within a system without affecting 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 without change to the system structure or the application algorithms The Access and Location transparency together referred as Network Transparency. Eg. . 35
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru System Models -- Introduction In this session we bring out the common properties and design issues for distributed systems in the form of descriptive models. Each model is intended to provide an abstract, simplified but consistent description of a relevant aspect of DS design. An Architectural model of a distributed system is concerned with the placement of its parts and the relationship between them. Example-Client Server Model 36
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru System Models -- Introduction An Architectural model defines the way in which the components of systems interact with one another and the way in which they are maped onto an underlying network of computers. Fundamental models are concerned with a more formal description of the properties that are common in all the Architectural models. There are three fundamental models that help to reveal key problems for the designers of distributed system. They are Interaction Model, Failure Model and Security Model. 37
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Difficulties for and Threats to Distributed Systems Widely varying modes of use.-some webpages are accessed several millions times a day Wide range of system environments: heterogeneous h/w, os and networks Internal problems: non-synchronized clocks, conflicting data updates, many modes of hardware and software failure involving the individual components of a system. External threats: Attacks on data integrity and secrecy, denial of service. 38
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Architectural Models An architectural model of a distributed system first simplifies and abstracts the functions of the individual components of a DS and then it considers: The placement of the components across a network of computers The interrelationships between the components The initial simplification is achieved by classifying processes as server processes, client processes and peer processes The latter being the processes that cooperate and communicate in a symmetrical manner to perform a task. Example Client-Server Model and peer process model 39
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Architectural Models Software layers System architectures Variations on the client-server model Interfaces and objects Design requirements for distributed architectures 40
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Software and Hardware Service Layers In Distributed Systems 41
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Software Layers Software architecture means structuring of software layers or modules in a single computer and more recently in terms of services offered and requested between processes located in the same or different computers. The process and service-oriented view can be expressed in terms of service layers. Platform: It is the lowest hardware and software layers. –It provide services to the layers above them, which are implemented independently in each computer. Eg. Intel x86/Windows. 42
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Software layers Middleware: A software layer whose purpose is to mask heterogeneity and to provide a convenient programming model to application programmers. It raises the level of the communication activities of application programs through the support of abstractions –such as remote method invocation, remote procedure call, communication between a group of processes, notification of events, the replication of shared data and the transmission of multimedia data in real time. Object-oriented middleware products and standards include CORBA (Common Object request Broker Architecture), Java Remote Object Invocation (RMI),omniORB 43
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru System Architectures Client-server Architecture Peer to Peer Architecture 44
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Client Server Model It is the most often used and important model in the distributed Systems. Client processes interact with individual server processes in separate host computers in order to access the shared resources that they manage. Servers may in turn be clients of other servers. Example Web Server, Search engines. 45
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Clients Invoke Individual Servers 46
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Peer to Peer Model In this architecture all of the processes involved in a task or activity play similar roles, –Interacting cooperatively as peers without any distinction between clients and server processes to perform a distributed activity or computation. The aim of this architecture is to exploit the resources both data and hardware in a large number of participating computers for the fulfilment of a given task. 47
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru A Distributed Application Based On Peer Processes 48
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Peer to Peer Model Each object is replicated in several computers –To further distribute the load –To provide resilience in the event of disconnection of individual computers. This architecture substantially more complex than client server architecture because of –The need to place individual objects –The need to retrieve them –The need to maintain replicas amongst many computers 49
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Variations On the Models The use of multiple servers and caches to increase performance and resilience. The use of mobile code and mobile agents Users need low cost computers with limited hardware resources that are simple to manage The requirement to add and remove mobile devices in a convenient manner. 50
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Services Provided by Multiple Servers Services may be implemented as several server processes in separate host computers interacting as necessary to provide a service to client processes. The servers may partition the set of objects on which the service is based and distribute between themselves or they may maintain replicated copies of them on several hosts. Eg web. Replication is used to increase performance and availability and to improve fault tolerance. 51
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru A Service Provided by Multiple Servers 52
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Proxy Servers and Caches A cache is a store of recently used data objects that is closer than the objects themselves. Web browsers maintain a cache of recently visited web pages and other web resources in the clients’s local file system, –using a special HTTP request to check with the original server that the cached pages are up to date before displying them. Web proxy servers provide a shared cache of web resources for the client machines at a site or across sites. –The purpose of proxy servers is to increase availability and performance of the service by reducing the load on the wide area network and webservers. –They may be used to access remote web servers through a firewall. 53
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Web proxy server 54
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile Code Applets are 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 advatage of running the downloaded code locally is that it can give good interactive response –Since it does not suffer from the delays or variability of bandwidth associated with network communication. 55
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Web applets 56
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile Agent It is a running program (including both code and data) that travels from one computer to another in a network –Carrying out a task on someone’s behalf, such as collecting information, eventually returning with the results. It may make many invocations to local resources at each site it visits. For example accessing individual database entries. Mobile agents might be used –To install and maintain software on the computers within an organization. –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. 57
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile Agent The applicability of mobile agents might be limited because of –Mobile agents are a potential security threat to the resources in computers that they visit. –It can themselves to be vulnerable- they may not be able to complete their task if they are refused to access to the information they need. 58
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Network Computers Why we introduce Network Computers? –The OS and application software for desktop computers require much of the active code and data to be located on a local disk. –The management of application files and maintenance of a local software requires considerable technical effort that most users are not provided. The network computers downloads its OS and any application software needed by the user from a remote file server. Applications run locally but the files are managed by a remote file server. The processor and memory capacities of a network computer can be constrained in order to reduce its cost. 59
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Thin Clients It is 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. This architecture has the same low management and hardware cost as the network computer scheme. 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. It will be a multiprocessor or a cluster computer. The main drawback is in highly interactive graphical activities such as CAD and image processing, where the delays experienced by users are increased by the need to transfer.. 60
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Thin Clients and Compute Servers Thin Client Application Process Network computer or PC Compute server network 61
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile Devices and Spontaneous Interoperation Unlike mobile agents mobile devices are hardware computing components that move between physical locations and thus networks, carrying software components with them. Both clients and servers may exist on mobile devices Mobility transparency and Variable connectivity are the various issues related to mobile devices in client server architecture. 62
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Mobile Devices and Spontaneous Interoperation Mobility leads to spontaneous interoperation, a variation on the client server model in which associations between devices are routinely created and destroyed. The process of associating the device with suitable local service is called service discovery. 63
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Interfaces and Objects The set of functions available for invocation in a process (whether it is a server or a peer process) is specified by one or more interface definitions. Many objects can be encapsulated in server processes, and reference to them are passed to other processes so that their methods can be accessed by remote invocation. This approach is adapted by CORBA and by java with its RMI mechanism. 64
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Design Requirements for Distributed Architectures Performance issues It arises from the limited processing and communication capabilities of computers and networks. Quality of service The ability to meet the deadlines of users need. Use of caching and replication Dependability issues 65
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Performance Issues Responsiveness –Users of interactive application require a fast and consistent response to interaction. Throughput –The rate at which computational work is done. Balancing computer loads –In some case load balancing may involve moving partially- completed work as the loads on hosts change. Ex.applets 66
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Quality of Service Main non-functional properties of systems are Adaptability: To meet changing system configurations and resource availability. Reliability :related to failure model Security: related to security model Performance: responsiveness and computational throughput. 67
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Use of Caching and Replication Web Caching Protocol- part of the HTTP protocol –Both web browsers and proxy servers cache responses to client requests to web servers. –The cache consistency protocol can be configured to provide browsers with fresh copies of the resources held by the web server. –Browsers and proxies validate cached responses by checking with the original server when the client request the corresponding resources. 68
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Dependability Issues Correctness Security The need to locate sensitive data and other resources only in computers that can be secured effectively against attack. Fault Tolerance Dependable applications should continue to function correctly in the presence of faults in hardware, software and networks. 69
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Fundamental Models In general, a model contains only the essential ingredients in order to understand and reason about some aspects of a system’s behaviour. The purpose of a model is –To make explicit all the relevant assumptions about the system we are modelling –To make generalizations concerning what is possible or impossible, given those assumptions. 70
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Fundamental Models Interaction model Failure Model Security Model 71
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Interaction Model Computation occurs within processes, the processes interact by passing messages, resulting in communication and coordination between processes. The interaction model must reflect the facts that the Communication takes place with delays that are often of considerable duration The accuracy with which independent processes can be coordinated is limited by these delays and by the difficulty of maintaining the same notion of time across all the computers in a DS. 72
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Interaction Model Two significant factors affecting interacting processes in DS Communication performance is often a limiting characteristic It is impossible to maintain a single global notion of time 73
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Characteristic Performance of Communication Channels Latency is the delay between the sending of a message by one process and its receipt by another. It includes Time taken for transmission through a network to reach its destination. The delay in acessing the network, which increases significantly when the network is heavily loaded. The time taken by OS communication services at both sending and receiving processes. Bandwidth of a computer network is the total amount of information that can be trasmitted over it in a given time. Jitter is the variation in the time taken to deliver a series of messages. (lagging in multimedia data) 74
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Computer Clock and Timing Events Computer clocks drift from perfect time and their drift rates differ from one another. Clock drift rate refers to the relative amount that a computer clock differs from a perfect reference clock. 75
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Two Variants of the Interaction Model Synchronous distributed system –It has a strong assumption of time –It is used for the delivery of multimedia data Asynchronous distributed system –It makes no assumptions about time. –Actual DS are often of this type because of the need for process to share the processors and for communication channels to share the network. 76
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Two Variants of the Interaction Model Synchronous distributed system The time to execute each step of a process has known lower and uper 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. Asynchronous distributed system No bound on process execution speeds No bound on message transmisson delays No bound on clock drift rates. 77
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Event Ordering It says whether an event (sending or receiving a message) at one process occurred before, after or concurrently with another event at another process. The execution of a system can be described in terms of events and their ordering despite the lack of accurate clocks. 78
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Real-time Ordering of Events 79
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Event Ordering If the clocks on X’s,Y’s and Z’s computers could be synchronized, then each message could carry the time on the local computer’s clock when it was sent. Messages m1,m2 and m3 would carry times t1,t2 and t3 where t1<t2<t3. The messages received will be displayed to users according to their time ordering. If the clocks are roughly synchronized then these timestamps, will often be in the correct order. 80
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Event Ordering Since clocks cannot be synchronised perfectly, Lamport proposed a model of logical time that can be used to provide an ordering among the events at processes running in different computers in a DS. Logical time allows the order in which the messages are presented to be inferred without recourse to clocks. 81
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Event Ordering First of all we can state a logical ordering for pairs of events. Consider only the events concerning X and Y: X sends m1 before Y receives m1 Y sends m2 before X receives m2 Y receives m1 before sending m2. Logical ordering can be done by assigning a number to each event corresponding to its logical ordering, so that later events have higher numbers than earlier ones. Here the numbers 1 to 4 on the events X and Y 82
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Failure Model It defines the ways in which failure may occur in order to provide an understanding of the effects of failures. According to the faults in Failure model it is classified as Omission failures Arbitrary failures Timing failures Masking failures 83
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Omission Failures It refers to cases when a process or communication channel fails to perform actions that it is supposed to do. The chief omission failure of a process is to crash(it has halted and will not execute any further steps of its program ever). The method of crash detection relies on the use of timeouts – a method in which one process allows a fixed period of time for something to occur. 84
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Omission and Arbitrary Failures Class of failureAffectsDescription Fail-stopProcessProcess halts and remains halted. Other processes may detect this state. CrashProcessProcess halts and remains halted. Other processes may not be able to detect this state. OmissionChannelA message inserted in an outgoing message buffer never arrives at the other end’s incoming message buffer. Send- omission ProcessA process completes nd, a se but the message is not not put in its outgoing message buffer. Receive- omission ProcessA message is put in a process’s incoming message buffer, but omission that process does not receive it. Arbitrary (Byzantine) Process or channel Process/channel exhibits arbitrary behaviour: it may send/transmit arbitrary messages at arbitrary times, commit omissions; a process may stop or take an incorrect step. 85
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Timing Failures Class of FailureAffectsDescription ClockProcess Process’s local clock exceeds the bounds on its rate of drift from real time. PerformanceProcess Process exceeds the bounds on the interval between two steps. PerformanceChannel A message’s transmission takes longer than the stated bound. 86
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Masking Failures A service masks a failure, either by hiding it altogether or by converting it into a more acceptable type of failure. Ex. converting an arbitrary failure to Omission failure. Omission failure can be hidden by using a protocol that retransmits messages. Even process crashes may be masked – by replacing the process and restoring its memory from information stored on disk by its predecessor. 87
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Security Model The security of a DS can be achieved by securing the processes and the channels used for their interactions and by protecting the objects that they encapsulate against unauthorised access. Protection is described in terms of objects –Access rights specify who is allowed to perform the operations of an object Do so by associating with each invocation and each result the authority (principal) on which it is issued. –A principal may be a user or a process. –The client as well as server responsible for verifying identity each other. 88
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Objects and Principals 89
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru The enemy To model security threats we postulate an enemy. It is capable of sending any message to any process and reading or copying any message in between a pair of processes. The attack may come from a computer that is legitimately connected to the network or from one that is connected in an unauthorised manner. The threats from a potential enemy –threats to processes, threats to communication channels and denial of service 90
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru The enemy Communication channel Copy of m Process p q m The enemy m’ 91
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Defeating Security Threats Cryptography and shared secrets Encryption Authentication Secure Channels Each of the processes knows reliably the identity of the principal on whose behalf the other process is executing. 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 recorded. 92
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Secure channels Principal A Secure channel Process p q Principal B 93
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Other Possible Threats From An Enemy Denial of Service –The enemy interferes with the activities of authorized users by making excessive and pointless invocations on services or message transmissions in a network, resulting in overloading of physical resources. –These are made with the intention of delaying or preventing actions by other users. Mobile Code –These code may easily play a Trojan Horse role, purporting to fulfill an innocent purpose but in fact including code that accesses or modifies resources that are legitimately available to the host process but not to the originator of the code. 94
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Summary A distributed system is one in which components located at networked computers communicate and coordinate their actions only by passing messages The Examples to DS are The internet,An intranets, Mobile and ubiquitous computing. Challenges and design issues of the distributd system. The architectural models-client Server, Peer to peer and their variations. The fundamental models are Interaction Model, Failure model and Security Model. 95
PEMP CSN504 M.S. Ramaiah School of Advanced Studies, Bengaluru Reference Distributed Systems-Concepts and Design-Fourth Edition George Coulouris, Jean Dollimore, Tim Kindberg 96