100% found this document useful (1 vote)
39 views210 pages

DC Aiml

The document is a textbook on Distributed Computing tailored for Mumbai University students, aligning with the prescribed curriculum. It covers various modules including communication, synchronization, resource management, and distributed file systems, with specific course objectives and outcomes outlined. The book also includes lab objectives, suggested experiments, and assessment criteria for both theory and practical components.

Uploaded by

sanjanabhosle27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
39 views210 pages

DC Aiml

The document is a textbook on Distributed Computing tailored for Mumbai University students, aligning with the prescribed curriculum. It covers various modules including communication, synchronization, resource management, and distributed file systems, with specific course objectives and outcomes outlined. The book also includes lab objectives, suggested experiments, and assessment criteria for both theory and practical components.

Uploaded by

sanjanabhosle27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 210
sem / ‘tek tad ander | DLOC II (ELECTIVE) —— Distributed Computing [Dr. Nilesh Madhukar Patil [Dr. Pratik Kanani [Mrr. Aniket Kore (SVKM's D. 3. Sanghvi COE, Mumbai) PUBLICATIONS TeesNeo | WC Price 365/- DLOC II (ELECTIVES) Creu keaun Te hese ott) Cees ease) ree A eee eer aes Preface It delights us to write this book on “Distributed Computing” for the students of Mumbai University. This book has been strictly written as per the prescribed curriculum, Every chapter of the book corresponds to the respective module mentioned in the syllabus. The topics within the chapters have been arranged in a proper sequence to ensure smooth flow of the subject. We are thankful to Mr. Sachin Shah, Managing Director of Tech-Neo Publications for his encouragement and support. We are also thankful to the staff of Tech-Neo Publications for their timely efforts in the making of this book. We, together have taken every possible care to eliminate errors in the book. If they still exist, kindly let us know. ‘We are also thankful to our family, friends, colleagues, and students. Sure Marks Notes and Paper Solutions Elevating Excellence Guides & University Paper Solutions Written, Edited by most experienced faculty. Chapterwise & Topicwise Paper Solutions. Most Likely questions also included, Consolidated list of Formulae. Answers exactly as per the weightage of marks given in exam. All Latest Q. Papers included. Syllabus... Mumbai University BE Computer Engineering Distributed Computing Course Code : CSC801 Prerequisite : Computer Networks and Operating Systems. Course Objectives ‘To provide students with contemporary knowledge in distributed systems. ‘To explore the various methods used for communication in distributed systems. To provide skills to measure the performance of distributed synchronization algorithms. To provide knowledge of resource management, and process management including process migration. To learn issues involved in replication, consistency, and file management. To equip students with skills to analyze and design distributed applications. Course Outcomes : At the end of the course students will be able to Demonstrate the knowledge of basic elements and concepts related to distributed system technologies. Illustrate the middleware technologies that support distributed applications such as RPC, RMI and Object-based middleware. Analyze the various techniques used for clock synchronization, mutual exclusion and deadlock. Demonstrate the concepts of Resource and Process management. Demonstrate the concepts of Consistency, Replication Management and fault Tolerance. Apply the knowledge of Distributed File systems in building large-scale distributed applications. Course Contents > Module 1 : Introduction to Distributed Systems 1.1 Characterization of Distributed Systems : Issues, Goals, Types of distributed systems, Grid and Cluster computing Models, Hardware and Software Concepts : NOS, DOS. 1.2. Middleware : Models of middleware, Services offered by middleware. (Refer Chapter 1) > Module 2: Communication 2.1 Interprocess communication (IPC) : Remote Procedure Call (RPC), Remote Method Invocation (RMD. 2.2. Message-Oriented Communication, Stream Oriented Communication, Group Communication. (Refer Chapter 2) > Module 3 : Synchronization Clock Synchronization : Physical clock, Logical Clocks, Election Algorithms. Distributed Mutual Exclusion, Requirements of Mutual Exclusion Algorithms and Performance measures. Non-token Based Algorithms : Lamport, Ricart-Agrawala’s and Maekawa's Algorithms; Token-based Algorithms : Suzuki-Kasami’s Broadcast Algorithms and Raymond's Tree-based Algorithm; and Comparative Performance Analysis. Deadlock : Introduction, Deadlock Detection : Centralized approach, Chandy-Misra_Hass Algorithm. (Refer Chapter 3) 4.1. Desirable Features of Global Scheduling algorithm, Task assignment approach, Load balancing approach and Igaq sharing approach. 4.2. Introduction to Process Management, Process Mi tion, Code Migration. (Refer Chapter 4) > Module 5 : Replication, Consistency and Fault Tolerance S.A Distributed Shared Memory : Architecture, design issues. 5.2 Introduction to replication and consistency, Data-Centric and Client-Centric Consistency Models, Replica Management. 53. Fault Tolerance : Introduction, Process resilience, Recovery (Refer Chapters) > Module 6: istributed File Systems 6.1 Introduction and features of DFS, File models, File Accessing models, File-Caching Schemes, File Replication, Case Study : Network File System (NFS). 6.2 Designing Distributed Systems : Google Case Study (Refer Chapter 6) Assessment Internal Assessment Assessment consists of two class tests of 20 marks each. The first-class test is to be conducted when approx. 40% syllabus is completed and the second-class test when an additional 40% syllabus is completed. The duration of each test shall be one hour. End Semester Theory Examination (1). The question paper will comprise a total of six questions. (2) “All question carries equal marks. 3) Questions will be mixed in nature (for example supposed Q.2 has par (a) from module 3 then part (b) will be from ‘any module other then module 3) (4) Only four questions need to be solved. (5) _Inquestion paper weightage of each module will be proportional to the number of respective lecture hours as mentioned in the syllabus. Distributed Computing Lab Lab Code : CSL801 Prerequisite : Computer Networks and Operating Systems. Lab Objectives (1). To understand basic underlying concepts of forming distributed systems. (2) To lear the concept of clock Synchronization. (3) Tolearn Election Algorithm. (4) Toexplore mutual exclusion algorithms and deadlock handling in the distributed system. (5) To study resource allocation and management. (6) Tounderstand the Distributed File System. Lab Outcomes : At the end of the course, the students will be able to (1). Develop test and debug using Message-Oriented Communication or RPC/RMI based client-server programs. 2) Implement techniques for clock synchronization. (3). Implement techniques for Election Algorithms. (4) Demonstrate mutual exclusion algorithms and deadlock handling. (5) Implement techniques of resource and process management. (6)_Describe the concepts of distributed File Systems with some case studies. ‘Suggested List of Experiments Sr.No. Title of Experiment Inter-process communication’ Client/Server using RPC/RMI Group Communication Clock Synchronization algorithms Election Algorithm Mutual Exclusion Algorithm Deadlock Management in Distributed System Load Balancing Distributed shared Memory Distributed File System (AFS/CODA) nN Case Study : CORBA Case Study : Android Stack ‘Term Work (1) Term work should consist of 10 experiments. (2) Journal must include at least 2 assignments o1 7 . Computing). ig mn content of theory and practical of CSC801 and CSL801 (Distributed (3). The final certification and acceptance of term w i ae i ‘ork ensure satisfactory performance of laboratory work and ‘minimum passing marks in term work. me i (4) Total 25 Marks (Experiments : 1S-marks, Attendance Theory & Practical: 05-marks, Assignments: 05-marks) Oral and Practical exam Based on the entire syllabus of CSC801 : Distributed Computing and CSL801 : Distributed Computing Lab Index —\— Module | Chapter Chapter Name Page Nos, ———— 1-1 to 1-25 Introduction to Distributed Systems 1 Communication 2-1 to 2-29 Synchronization 3-1 to 3-35 Resource and Process Management 4-1 to 4-28 —T Replication, Consistency and Fault | 5-1 to 5-42 Tolerance Distributed File Systems 6-1 to 6-22 Lab Manual L-1 to L-23 1 12 13 14 18 MODULE 1 Introduction to CHAPTER 1 Distributed Systems Introduction to Distributed Systems... GQ. Define Distributed System. State the advantages and disadvantages of a distibuted system. 4.1.1 Characteristics of Distributed System nnn 4.1.2 Advantages of Distributed System.. 4.1.3. Disadvantages of Distributed System. 1.1.4 Applications Area of Distributed System... Distributed System UG. —_Explain diferent issues and goal related to dosign of Distributed System. Explain transparency in detail. (CEE). UQ. What are the issues in designing a distributed system? (I EIIEVAL........ UO. —_ What are the common issues with which the designer of a heterogeneous distributed system must deal? (MU = May-17) 1.2.1 Types of Transparencies .. GQ. _Explain different types of transparencies in distributed syster Goals of Distributed Systems Ua. State the goals of distributed system. (TERESA ISIS... ‘Types of Distributed System.. GQ. Explain different types of distributed systems with neat diagrar 1.4.1 Distributed Computing Systems, 1.4.1(A) Cluster Computing istributed Information Systems 1.4.2(A) Transaction Processing Systems, 1.4.2(B) Enterprise Application Integration . 1.4.3 Distributed Pervasive Systems... Distributed System Modols.. Ua. What are various system models of 1.5.1 Physical Modol.. stibuted systom? Ee Syston)... Distributed Computing (MU) _nroducion 1 Distributed Systoms)..Page no. (1.9 1.5.1(A) Early distributed systems. 1.5.1(B) Intemet-scale distributed systems 1.5.1(C) Contemporary cistributed systems... 1.5.1(D) Types of Physical Models Based on Hardware and Computation. 1.5.2 Architectural Model. UQ, Explain sohware models supported by the distributed system. (TEIIENEE) UG. Discuss in brit the diferent architectural madots in Distrbuted System, Explain with neal diagram, TESA) 1.5.2(A) Client-Server Model. 1.5.2(8) Peer-to-Peer Model . 1.5.2(C) Comparison between Client-server and Peer-o-Peer Model 153 Fundamental Model. Ua. Explain ditferent types of Failure Models. (UEININEZ).. 1.5.3{A) Interaction Mode. 1.5.3(B) Fault Model 1.5.3 (C) Security Mode. 1.6 Hardware Concepts. 1.6.1 Difference Between Muttiprocessor and Multicomputer Systems saunse 1.7 Software Concepts UQ. _ Differentiate between NOS, DOS and Middleware in the design of a Distributed ‘Systems [UERIENED) 1-17 1.7.1 Distributed Operating Systems. 1.72 Network Operating System, 173° Middieware.. 1.7.4 Comparison between the DOS, NOS, and Middleware 1.8 Services olfered by Middleware... 1.8 Types of Middleware GQ. Explain citferent types of middleware in the distrbuted system. 1.10 Models of Middleware. UG, —_ What are the different models of middleware ? (UENIENET®... 1.11 Client-Server Architectural Mode! 4.11.1. Different Types of Client-Server Architecture. . Chapter End... flabus wes academic year 22-23) Tech-Neo Publications..A SACHIN SHAH VentU'® (MU-New Sy! ee Distributed Computing (MU) {Introduction to Distributed Systems)....Page no. (1-3) PI 1.1 INTRODUCTION TO DISTRIBUTED SYSTEMS ind disadvantages of a distributed system. Define Distributed System. State the advantage : connected by-a network and. are able to work together on a job is known as a «© A group of separate computers that distributed system. ——— ; Tmewence. it isa group of autonomous entities working together to address a challenge that neither of entity can handle alone = “Adistributed system is made up of several separate computers that work together to give users the impression of using a single computer + Ttis feasible to construct a single system made up of numerous computers and use it as a single consolidated system by ‘employing high-performance computers connected by high-speed network, « In-such a system, many resources combine to provide the necessary processing speed, and the operating system is in charge of system upkeep and general maintenance. + Computers in a distributed system are connected via a fast network rather than being in isolation. + Thimplies that a large number of computers, whether workstations or desktop systems connected together, may do tasks normally performed by a high performance supercomputer. pit af an 3 1 oe Computing Computing oda, node ‘Computing nodes are es ‘Interaction (anFig 1.1.1 : Architecture of Distributed Systems % 1.1.1 Characteristics of Distributed System Distributed systems have the following characteristics : (1) No standard physical clock. ~~ (2) Ithas improved reliability, (3) Improvement in the performance/cost ratio.” (4) Access to tant information and resources“ (5) Distributed systems are scalable, ~ (MU-New Syllabus w.es academic year 22-23) Tech-Neo Publications..A SACHIN SHAH Venture = Sf (1) Heterogeneity : Networks, computer hardwate, operating systems, and developer implementations arc all examples of Distributed wid ing (MU) Advantages of Distributed System G) Applications are by definition distriuted when used in distributed systems 2) Users who are spread out geographically share information in distributed systems. (3)_ Resource Exchange is possible that is Autonomous systems can share resources from remote locations, (4) His more exible and offers a superior prive-porformance rato, (5)_Ieresponds faster and moves data more quickly. 1.1.3 Disadvantages of Distributed System (1) Hardware and software requirements vary depending on the application. (2) As resources are shared among several systems, there is a security issue caused by there is a network latency, the user ple access to data @)_ Data transport may be hampered by networking saturation: ectting the data have trouble The Gatabase wed by distributed systems is far more complicated and dificult to operate than the database used by single user system % 1.1.4 Applications Area of Distributed System (1) Finance and commerce are the focus of distributed systems, including Amazon, eBay, o websites banking, and e-commerce (2) Search engines, Wikipedia, social media, and cloud computing are examples of the information society which ves Distributed systems in the background, (3) AWS, Salesforce, Microsoft Azure, and SAP all use cloud technologies, (4) YouTube, online gaming, and music provide entertainment. (5) Healthcare : Health Informatics and online patient records, (©) Ertleaming for education. (7) Logistics and transportation: GPS, Google Maps, (8) Management of the environment: sensor technologies, DH _1.2 _ ISSUES IN DISTRIBUTED SYSTEM UQ What are the issues in designing a (renee | {UQ_ What are the common issues with which the designer of heterogeneous distributed system must deal? The following are the issues in distributed systems : heterogeneous systems, Middleware is erucial element of the client-server heterogeneous distributed. sytem environment, A set of services known as middleware allows users and applications to communicate with one anothet across u diverse distributed system. (MU-New Syllabus w.e- academic year 22-23) Ll rect-nico Publications..A SACHIN SHAH Venture Distributed Computing (MU) Introduction to Distributed Systems)....Pago no. (1-5) 7) Openness : The degree to which new revourcesharing services may be made accessible to users determines the distributed system's openness. ability : The system should be scalable even when the number of users and linked resources significantly grows. Ye (4) Security : High degrees of encryption are required to secure shared resources and sensitive data since data is shared across various resources. (6) Failure handling : Corrective steps should be put in place to deal with this situation because when hardware or software failures happen, they may provide inaccurate results oF cease before finishing the planned calculation. (6 Concurreney + It's possible for several clients to try to access a single shared resource at once. The same read, write, and update of resources are requested by several users. Any object in a distributed system that represents a shared resource must make sure that it functions properly in a multi-threaded setting. (7) Transparency Transparency makes sure that users or application programmers see the distributed system as a single, collaborating system rather than a group of independent systems. The user should not be aware of the location of the services, and moving data from a local workstation to a distant one should be seamless. W. 1.2.1 Types of Transparencies Bp different types of transparencies in distributed system. “The implementation of the distributed system is very complex, as a number of issues have to be considered to achieve its final objective. The complexities should not worry the user of the distributed system from usin the complexities should be hidden from the user who uses the distributed system. This property of the distributed system is called its transpareney. There are different kinds of transparencies that the distributed system has to incorporate. The following are the different transparencies encountered in the distributed systems. Access Transparency Location Transparency Concurrency Transparency Replication Transparency Failure Transparency Migration Transparency Performance Transparency Scaling Transparency } (1) Access Transparency © Clients should be unaware of the distribution of the files. The files could be present on a totally different set of servers which are physically distant apart and a single set of operations should be provided to access these remote as well as the local files. ‘© Applications written for the local file should be able to be executed even for the remote files. The examples illustrating this property are the File system in Network File System (NFS), SQL queries, and Navigation of the web. » (2) Location Transparency © Clients should see a uniform file name space. Files or groups of files may be relocated without changing their pathnames, A location transparent name contains no information about the named object's physical location. property is important to support the movement of the resources and the availability of services. The location and access transparencies together are sometimes referred as Network transparency. The examples are File system in NFS and the pages of the web. > (3) Concurrency Transparency + Users and Applications should be able to access shared data or objects without interference between each other. This (MU-New Syllabus w.e¥ academic year 22-23) ‘Tech-Neo Publications..A SACHIN SHAH Venture roauction to Distributed Systoms). Distributed ing (MU) ntrodet =e S220 (1 as trve concuirency rather than th Fequires very complex mechanisms in a iatited system. since there sina neous! ‘concurrency of a central system. The shared objets are access simultaneously The examples are NFS, Automatic Tetiy The concurrency contrat and its implementation is hard task ching (ATI) network. > (4) Reptication Transparency * This kind of transparency: should be mainly incomrated for the distributed filesystems, which replicate the dy, at, of more kites for more reliability. " 4 * The client generally should mot be aware that a replicated copy of the data exists. The clients SHOU alg gy ‘operations to retum only one set of values. The examples are Distributed DBMS and Mirroring of Web pages, hhantware or software components. Fault tolerance is provided by the mechanisms that relate 0 access transparency, + The distributed system ts more prone to failures as any of the component may fail which may lead 10 degraded seg othe tral absence of that service. A the incacis are iden the isinction Between 8 fled and & low ryngige [Process in difficult, Examples are Database Management Systems > (6) Migration Transparency + This transparency allows the user to be unaware of the movement of information or processes within a System withyy, affecting the operations of the users and the applications that are running, + This mechanism allows for the load balancing of any particular client, which might be overloaded. The systems thy implement this transparency are NFS and Web pages. > (7) Pertormance Transparency Allows the system to be reconfigured to improve the performance as the load varies. > (8) Scaling Transparency * A system should be able to grow without affecting application algorithms. Graceful growth and evolution is an important requirement for most enterprises. + A system should also be capable of scaling down to small environments where required, and be s efficient as required, The best-distributed system example implementing this transparency is the World Wide Web, and/or time OO —————————— DH 1.3 _ GOALS OF DISTRIBUTED SYSTEMS eras SUQ _— State the goals of distributed system A number of important goals must be met in order for the effort involved in developing a distributed system to be Successful, A distributed system should be open, scalable, and easy for users to access resources. The objective is to do the following at tue maximum level possible. (1) Bringing Users and Resources Together : A distributed system's major objective is to give users easy access 10 remote resources and to share those resources in a regulated way with other users. (2) Transparency : Transparency indicates that a distibuted system may seem to users and applications as if it wert # single computer system. (3) Openness : Distribuied systems must work to be as open as possible. An open distributed system is one that offers services in accordance with standards that outline the syntax and semantics of those service instances. (MU-New Syllabus wee academic year 22-23) Tech-Neo Publications..A SACHIN SHAH Venture Distributed Computing (MU) {introduction to Distrbuted Systems)....Page no. (1-7) (@) Scalability : The generat trend in distributed systems is larger systems. Algorithms that work well for systems with 1000 machines can be used by systems with 100 machines, but cannot be used at all by systems with 10,000 machines. To begin with, the centralized algorithm does not scale well (5) Reliability ; The main goal was to increase the dependability of distributed systems relative to single processor systems, According to the concept, when one machine malfunctions, another one adjusts to it (6) Performance : If a distributed system cannot achieve the desired performance, it is pointless to develop it as transparent, lexible, and reliable. A distributed system ought to offer the highest level of performance. 1.4 TYPES OF DISTRIBUTED SYSTEM in different types of distributed systems with neat diagram. Before delving into the concepts of distributed systems, let us first examine the various types of distributed systems. 1.4.1 Distributed Computing Systems «These distributed computing systems are designed to provide high computing performance to meet the demands of real- time applications. « Incluster computing the underlying hardware consists of a collection of similar workstations or PCs, losely connected” hy means of a high-speed local-area network, + In-addition, each node runs the same operating system. The situation becomes quite different in the case of grid computing. + This subgroup consists of distributed systems that are often constructed as a federation of computer systems, where cach system may fall under a different administrative domain, and may be very different when it comes to hardware, software, and deployed network technology. ws 1.4.1(A) Cluster Computing |) agen C5 © Cluster computing is a type of distributed computing that involves the use of a cluster, which is a group of interconnected computers that work together as a single system. ‘+ Ina cluster computing system as shown in Fig, 1.4.1, the computers in the cluster are connected together by a high- speed network, and each computer has its own processing power, memory, and storage. The main advantage of cluster computing is that it allows for the parallel processing of large amounts of data and the execution of complex applications that require a lot of computational power. * By dividing the workload among the computers in the cluster, a cluster computing system can achieve better performance and scalability than a single computer. : cog) i Masternode Compute node Compute nade Compute node CONTR Rs | comparent | |[eomrarant a ak Ms a | atgicaten |] || stotenton pelicabir fe ae (uaiFig. 14.1 : Cluster Computing System < enNS FO Op - (MU-New Syllabus wef academic year 22-23) [Bal tech-nveo Publications.A SACHIN SHAH Venture Distributed Computing (MU introuction to Distributed ©The primary benefit of cluster computing és that makes it possible to run complicated programs that Need a tog og Processing power and analyse massive volumes of data in kimultancowsty + Acluster computing aystem may perform and acale better than a single computer hy distrituting the workload acrogy the machines in the cluster PR 1.4.1(8) Ged Computing Abkey issue in # grid computing system ik that resources from different organizations are broupht together 10 allow the collaboration of a group af people or institutions + Typically, resources comuist of compute servers, slornge facilities, and databases © Given its nature, much of the software for realizing grid computing evolves around providing access 10 FesOUrceS from Aten odes domaine. Wee 908 BE dain heterg eng Shere la Kine (08: Linux Mint a asi 1 Grd Computing sn Dw Disttbnted tntormisbarstaes® = Med sty Prenet ween t have heen presented with a plethors of + Another major type of distributed systems may be found in businesses tha networked applications yet have found interoperability to be an unpleasant experience, with an architecture that made integrating apps into + Many current middleware solutions are the consequence of wor enterprise-wide information systems simpler, ¢ Inthe following section, we concentrate on following wo forms of distributed information systems. %. 1.4.2(A) Transaction Processing Systems labase operations ute often carried out in the form of transactions, + In practise, © There may be primitives in # mail system for sending, receiving, and forwarding mail ‘2 They might be substantially different in an accounting system. However, READ and WRITE are common instances. * Ordinary statements, procedure calls, and the like afe likewise permitted inside a transaction. * The charscteristic feature of a transaction is either all of these operations are executed or none are executed. ‘These may be system calls, library procedures, oF bracketing statements in a language, depending on the implementation. This all-or-nothing property of trunsactions is one of the four characteristic properties that transactions have. | * More specifically, transactions are | (G) Atomic : To the outside world, the transaction happens indivisibly. (2) Consistent : The transaction does not violate system invariants. (3) Isolated : Concurrent transactions do wot imerfere with each other. (4) Durable : Once # transaction commits, the changes are permanent. Tech-Neo Publications..A SACHIN SHAH Venture (MU-New Syllabus wef academic year 22-23) Distributed muy (ntrortuction to Distributed Systorrs za 1.4.2(B) Enterprise Apptication Integration » Application components, in particular, should be able fo interact directly with one another rather than relying on the requestreply behaviour allowed by transaction processing systems ‘The main idlea was that existing applications could directly exchange information, An application component may succesfully submit a request fo another apptication component via remote procedure calle (RPC) by performing a local procedure call, which results in the request being packaged as a mexage and tranemitted to the eallee milarly, 8 consequence of the procedure call, the result will be transmitted back and returned to the appfication. As object technology grew in prominence, ways for calling remote objects were created, resulting in what is known as remote method invocations (RMI. Ag RMI is similar to. an RPC in that if acts on objects rather than applications. RPC and RMI have the drasback of requiring both the caller and the callee to be active at the time of the communication 1.4.3. Distributed Pervasive Systems The devices in the distributed pervasive systems are frequently tiny, battery-powered, transportable, and have just a wireless connection, however not all of these features apply to all devices. Furthermore, these traits do not have to be interpreted as restricted. Ibis the newt step in integrating common things with microprocessors so that this data can interact. These systems ate built to distribute data, processes, and conteol Few examples of pervasive systems are (i) Home System : Many household equipments are now digital, allowing us to operate them from anywhere and at any time. (ii) Electronic Health Care Systems : Smart medical wearable gadgets are already available, allowing us to frequently check our health. (li) Sensor Networks : A sensor network is often made up of tens to hundreds or thousands of small nodes, each of which is equipped with a sensing device. Most sensor networks communicate wirelestly, and the nodes are often powered by batteries. Because of their limited resources, limited communication capabilities, and limited power 9 on the list of design objectives. consumption, 1.5 DISTRIBUTED SYSTEM MODELS WU5.1 Physical Model ng hardware pieces of a distributed system that abstracts from the features of S used. A physical model represents the under! the computer and networking technologie ‘The physical model may be divided into three generations of distributed systems: early distributed systems, Internet- scale distributed systems and contemporary distributed systems. Hardware and software components can communicate and coordinate their operations by sending and receiving messages. (MU-New Syllabus w.ef academic year 22-23) TBA rec-eo Pucations.A SACHIN SHAH Ventre ™~ Distributed Computing (Mu) (Introduction 10 paths Se rey %1.5.1(A) Barty distributed systems jetworking tech © Emerged in the late 1970s and early 1980s as a result ofthe introduction of local aren i technology, with limited Internet access ang “vg * The system is generally comprised of 10 to 100 nodes connected by a LAN. (c-g.. shared local Printer, file servers) %1-5.1(B) Internet-scale distributed systems * Tearose in the 1990s as result of the expansion of the Internet. izati i rogeneity, @ greater ¢ © Tincludes a large number of nodes from many organizations, and it has increased heteroge tealer empha in ileware technologies such as CORBA and Web Services. a open standards and services, and associated %1.5.1(C) Contemporary distributed systems * The emergence of mobile computing leads to nodes that are location- independent nodes. * These nodes should have additional features such as service discovery and support for ad hoe interconnectivity, + Heaided in the development of cloud computing and ubiquitous computing. * Cloud computing is a collection of independent nodes that perform a specific role to pools of nodes that work (ogee {0 deliver certain high-performance services, * _Rblguitous computing tas resulted inthe transition from discrete nodes to systems in which computers ae embed in everyday objects in an environment. Z 7 1-5.1(D) Types of Physical Models Based on Hardware and Computation ) Mintcomputer Mode! * This approach uses a communication network to connect a few minicomputers or supercomputers. Multiaer | ‘minicomputers are common. * Each minicomputer has multiple interactive terminals. Each user logs into one minicomputer with remote access others. * The network lets users access remote resources on other machines. * Minicomputer models are simple extensions of centralized time-sharing systems. Paradigm might be employed. + Minicomputer-based distributed computing systems include early ARPAnet (2) Workstation Modet * Multiple workstations connected by a network make up a workstation-based distributed computing system. + Each workstation in a building or campus may be a single-user computer with its own disk + Insuch a setup, many workstations are idle at any given time, wasting CPU time, Distributed Computing (MU) ‘Communication network Workstation Workstation Workstation (a) Minicomputer model (b) Workstation model ‘Workstation Workstation Workstation ‘Communication network Minicomputer as Minicomputer as Minicomputer as file server database server print server OBI of processirs (©) Workstation-server model (@) Processor-pool model (usFig. 1.5.1 : Distributed System Physical Models, (8) Workstation-Server Model ‘© A distributed computing system based on the workstation-server architecture has a few minicomputers and several ‘workstations (most of which are diskless, but some may be diskful) connected via a communication network. © Diskless workstations on a network must use a file system implemented by a diskful workstation or a minicomputer with a disc. © One or more minicomputers implement the file system. Other minicomputers can offer database and print functions. Thus, each minicomputer serves many services as a server. © In the workstation-server approach, there are workstations and specialized computers (maybe workstations) that run server programs (called servers) to manage and provide access to shared resources. © Multiple servers manage a type of resource in a distributed computing system for reliability and scalability. In this model, users log onto their home workstations. The user's home workstation dees normal computing activities, but requests for special servers (such as file or database servers) are routed to a server that executes the user's requested activity and sends the output to the user's workstation. ‘* Inthis paradigm, user processes do not need to migrate to server machines to complete their task, (4) Processor-Pool Mode! ‘© The processor-pool model is based on the fact that users rarely need computational power but occasionally peed a lot of it for a short time (e.g,, when recompiling a program consisting of a large number of files after changing & basic shared declaration). {MU-New Syllabus wef academic year 22-23) Tech-Neo PublicationsA SACHIN SHAH Venture al s tod Systoms)...Page no. introduction to Distribul Distributed Computing (MU concept pools CPUs for use 1 processor ool ters form the processor Pool 1 system or application program, to share as ny Thus, unlike the workstation-server model, * Many networked microcomputers and minicom : ‘© Each pool processor has memory to foal and run a distributed computn (8) Hybrid Model + Most distributed computing systems are built using the wor ‘emails, and run minor programs. rastation-server model. ‘+ Most computer users merely edit documents, send © Simple usage suits the workstation-server approach, . +The processor-poo! model is heuer in a workplace with groups of users that often do Big computing, % 1.5.2 Architectural Model 1.UQ. Explain software models supported by the distributed system. 1 UQ. Discuss in brief the different architectural models in Distributed System. Explain wth neat diagram, bmi } = ‘A distributed system architecture model simplifies and abstracts the functionality of the individual components of distributed system, It deals with the arrangement of components throughout the network of computers, and their interdependence, ie, hoy these components communicate with one other. + Itcontains several architectural aspects including : @ Communicating entities : This section identifies the entities in the distributed system that are communicating with ‘one another. (ii) Communication paradigm : This refers to how various entities interact with one another and the communication paradigm they use-There are three kinds of communication paradigms : (a) inter-process communicatca, (b) remote invocation, and (c) indirect communication. (Ui) Roles and Responsibilities ; This part describes what roles and responsibilities this entity has in the larger architecture. It is divided into two architectural styles : (a) client-server architecture and (b) peer-to-peer architecture . Distibuted 4 None Peer to Peer ((a9Fig. 1.5.2 : Distributed Architectural Model Tech-Neo Publications..A SACHIN SHAH Vertu® (MU-New Syllabus wef academic year 22-23) Distributed Computing (MU) {Introduction to Distributed Systems)....Page-n, (1-15) za 1.5.2(A) Client-Server Model n «_Inactient server network, there are clients and servers «Accent can be a device or a program. It helps the end users to access the web. «Some examples of clients are desktop, laptops, smartphones, web browsers, etc. ¢ Asserver is a device or a program that responds to the clients with the services. « Itprovides files, databases, web pages, shared resources according to its type. «© Inthis network, a client requests services from the server. «The server listens to the client requests and responds to them by providing the required service. © The main advantage of a client server network is that it more secure as the server always manages the access and security. ‘+ Itis also easier to take backups © Onthe other hand, itis not very reliable as a failure in the server will affect the functioning of the clients. Furthermore, it is expensive to set up and maintain. °% 1.5.2(B) Peer-to-Peer Model © Inapeer to peer network, there is no specific client or a server. ‘+ Advice can send and receive data directly with each other. * Each node can either be a client or a server. It can request or provide services accordingly. © Anode is also called a peer. In peer to peer network, a node joins the network and start providing services and request for services from other nodes. ‘There are two methods to identify which node provides which se © Anode registers the service it provides into a centralized lookup ser When any node requires obtaining a service, it checks the centralized lookup to find which node provides which facilities. Then, the service providing node and service requesting node communicate with each other. In the other method, a node that requires specific services can send a broadcast message to all other nodes requesting a service, Then, the node that has the required service responds to the requested node by providing the service. There are multiple advantages in peer to peer network. It is easier to maintain. It is not necessary to have a specialized ‘expert to maintain the network, The entire network does not depend on a single machine. Moreover, it does not require extensive hardware to set up the network. On the other hand, a peer to peer network is not very secure. It can also be difficult to maintain an organized file structure. Furthermore, the users need to manage their own backups. %1.5.2(C) Comparison between Client-server and Peer-to-Peer Model ‘Table 1.5.1: it-Server Model Vs Peer-to-Peer Model Basis of Client-Server Model Peer-to-Peer Model Comparison Basic In a client-server network, we have a specific | In a peer-to-peer network, clients are not server and specific clients connected to the | distinguished; every node act as a client and server. server. (MU-New Syllabus w.es academic year 22-23) Tech-Neo Publications..A SACHIN SHAH Venture (Introduction to Distributed Systoms)...Page no. (1-14) Distributed Computing (MU) Basis of Client-Server Model Peer-to-Peer Model | Comparison ail Expense ‘A Client-Server network is more expensive to | A Peer-to-Peer is less expensive to implement. implement | Stability 1t is more stable and sealable than a peerto- | It is less stable and scalable, if the number of peers increases in the system, | peer network, Data In a client-server network, the data is stored in | In a peer-to-peer network, each peer has its own a centralized server. data. 4 Server ‘A server may get overloaded when many | A server is not bottlenecked since the services are ‘customers make simultancous service requests. } dispersed among numerous servers using a peer-to. | | peer nework. Focus Sharing the information. Connectivity. Service ‘The server provides the requested service in } Each node has the ability to both request and response to the client's request. delivers services. Because the server does the bulk of the work, | Because resources are shared in a big peer-to-peer Performance performance is unaffected by the growth of | network, performance will likely to suffer. clients. Security ‘A Client-Server network is a secured network | The network's security deteriorates, and its because the server can verify a client's access | susceptibility grows as the number of peers rises. to any area of the network, making it secure. Fundamental Model UQ,__ Explain ferent ypes of Fllure Models. + A.system’s fundamental model identifies the system's primary elements and specifies how they interact with one i another. ' ‘© A model's objective is to express all ofthe underlying assumptions about the system being described © To explain distibuied systems, three models are used: the Interaction Model, the Failure Model, and the Security Model. %. 1.5,3(A)_ Interaction Model ‘+ Processes in a distributed system engage with one another via passing messages, resulting in communication (message twansmission) and coordination (synchronization and ordering of operations) amongst processes, ‘+ Each process has a distinct state, Process interaction in distributed systems is influenced by two major factors: (1) Communication speed is frequently a limiting factor; (2) there is no one global concept of time since clocks on various systems drift. + Communication across « computer network has performance characteristics in erms of latency, bandwidth, and jitter. * The Interaction model has two variants: Synchronous distributed system and Asynchronous distributed system, (04U- New Syllabus weet academic yeor 22:23) (Ba rectvteoPubicatons_A SACHIN SHAH Ventre Distributed Computing (MU) _—(lnrocuction to Distbutod Systeme)...Page no. (1-15) © Synchronous distributed systems are those in which the time required to execute cach step of a process has a known lower and upper constraint; each sent message is received within a known bounded time and each process has a local clock with a known drift rate from real-time, It is challenging to arrive at realistic values and to offer assurances about the values selected. + Asynchronous distributed systems have different process execution speeds, message transmission delays, and clock drift rates and they are all unbounded. They are identical to the Internet, in which there is no inherent limit on server or network load, and hence on how long it takes, for example, to upload a file over FTP, Asynchronous distributed systems ‘are common in practice. wa 1.5.3(B) Fault Model ‘+ Both processes and communication routes may fa ina distributed system. ‘© Failures are classified into three types : omission failures, arbitrary failures, and timing failures. (1) Omission Failures : These are situations in which a process or communication channel fails to aécomplish the acts that expected to do. It includes both process errors and communication omissions. (2) Arbitrary Failures : A process continues to run, but responds with a wrong value in response to an invocation. It might also arbitrarily omit to reply. This kind of failure is the hardest to detect. 3) Timing Failures : These are only relevant to synchronous distributed systems with time constraints on process execution, message delivery, and clock drift rate. Any of these errors might result in replies not being provided to customers within a certain time frame. % 1.5.3 (C) 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. ‘© Itcontains the following : (1) Object protection : Access rights are used to indicate who is authorized to do an object’ actions, such as who is allowed to read and write a file. (2) Securing processes and their interactions : The same is true for a client that gets the result of an invocation but is unsure if it is from the appropriate server. (8) Adversary : Privacy and information integrity might be compromised, An ‘enemy' who has the ability to copy, change, or insert messages as they move through the network.Another kind of attack is to save copies of communications and respond to them later, (A) Use of Security Models : There are several methods for enhancing security measures such as cryptography, authentication, and authorization. (1.6. HARDWARE CONCEPTS ‘Hardware in distributed systems can be organized in several different ways : (1) Multiprocessor System (2) Multicomputer Systems (MU-New Syllabus wef academic year 22-23) [Bl rech.aveo Publications. SACHIN SHAH Venture Distributed Computing (MU) » > (2) Matecomputer Systems Liewoduction to Distributed Systems)...Page no. (1-16) (1) Multiprocessor System Multiple processors are used in distributed systems, either spread throughout the network or present at a fixed location, A multiprocessor tem is a computer system with two or more CPUs‘and complete access to RAM. Increased system execution § peed is the main objective of using.a multiprocessor, with fault tolerance and effective application execution serving as secondary objectives. Wmight have shared memory or private memory when it comes to storage and processing as shown in Fig.1.6.1. (Shared Memory (Tightly Coupled) : Shared memory is memory that many processors may access simultaneously in order to improve collaboration or reduce duplication. Shared memory is a helpful tool for transmitting data across different processes. (i)_ Private memory (Loosely Coupled) : Multicomputer with each CPU directly connected to its local memory are referred to as having private memory. : Mutiprocessore Mutteomputers Single address space an na sacar shared memory Pavate memory Hew HH aw | fF) Fl bl |e AA £ ™ &) fy HE] [cHE] x Y (HE Hz] paseTuaIMS [El Processor [i] Memory (45 Fig.1.6.1 : Shared and private memory architecture with multiple processors A computer system with many processors that are linked together to solve a problem is refered to as a multicomputer system. Each CPU has a separate memory that is only accessible by that processor, and those processors are connected by ‘an interconnection network that allows them to interact, with one another. A multicomputer system can be homogeneous where all CPUs and memory are identical. It can also be heterogeneous where all CPUs and memory are not identical. (anFig, 1.6.2: Multicomputer System (MU-New Syllabus w.e academic year 22-23) TB rech-eo Pubic 's..A SACHIN SHAH Venture Distributed Computing (MU) {lotroduetion to Distributed Systems)... Page no. (1-17 %. 1.6.1 Difference Between Multiprocessor and Multicomputer Systems Table 1.6.1: Multiprocessor System Vs Multicomputer System ‘sr. Multiprocessor System Malticomputer System B ‘ (1) | A multiprocessor is a system with two or more central | A multicomputer is a system with multiple processors processing units (CPUs) that can perform multiple | that are attached via an interconnection network to tasks, perform a computation task. (2) | A multiprocessor system is a single computer that A multicomputer system is a cluster of computers that ‘operates with multiple CPUs. operate as a singular computer. (3) | Construction of multiprocessor is difficult and cost Construction of multicomputer is easier and cost ineffective than a multicomputer. effective than a multiprocessor. (4) | In multiprocessor system, program tends to be easier. | In multicomputer system, program tends to be more difficult. (5) _| Multiprocessor supports parallel computing. Multicomputer supports distributed computing. DH 1.7 SOFTWARE CONCEPTS Differentiate between NOS, DOS and Middleware the design of a =? (MU - May 22))f 3 The software of a distributed system consists of an appropriate operating system that is used to facilitate interaction between a user and the hardware. This interaction is necessary for the system to perform. ‘There are three types of software widely used in distributed systems: distributed operating system, network operating system and middleware, 1.7.1 Distributed Operating Systems A fundamental kind of operating system is a distributed operating system (DOS). A distributed operating system is a distributed system that abstracts resources, such as memory or CPUs, and exposes ‘common services and primitives that in tur are used by (distributed) applications. In a nutshell it's the same thing that Android or iOS does for mobile phone apps or Linux, macOS or Windows does for desktop apps, just that it happens to coordinate and orchestrate resources that are distributed, typically in a cluster of machines and makes the cluster look like one big box to the app. ‘Through a single communication channel, it links several computers. Each of these systems also has its own processor and memory. ‘These CPUs may also communicate through high-speed buses. Distributed operating system is also called as “tightly coupled system”. (MU-New Syllabus wef academic year 22-23) TB rech-Nco Pubications A SACHIN SHAH Venture lod Systoms)...Pago no. (1-18). Distributed Computing (MU) Machine A Machine B Machine © Distributed applications Structure of Distributed Operating System. van ig. ‘YW 1.7.2 Network Operating System An operating system called a network operating system (NOS) is created specifically to handle workstations, database sharing, application sharing. file and printer access sharing, and other network-wide computer functions. Iv is specifically designed for the heterogeneous multicomputer system, where multiple hardware and network platforms are supported, thas multiple operating systems that are running on different hardware platforms. © tis also called as “loosely coupled system” Microsoft Windows NT and Digital's OpenVMS are two examples of standalone operating systems that have multipurpose features and can also function as network operating systems. Linux, Mac OS X, Microsoft Windows Server 2003, and Microsoft Windows Server 2008 are some of the most well- known network operating systems. Machine A Machine 8 Machine C Distributed applications Network asFig. 1.7.2 : Structure of Network Operating System 1.7.3 Middleware © In the contest of distributed spplications, middleware refers to software that offers additional services above and beyond those offered by the opersting system to allow data management and communication across the various distributed system components. ¢ Complex distributed applications are supported and made easier by middleware. Middleware often enables interoperability between applications that nun on different operating systems, by supplying services so that the application can exchange dats in a standards-based way. Tech-Neo Publications_A SACHIN SHAH Venture (MU-New Sytabus wed academic year 22-23) Distributed Computing (MU) {Introduction to Distributed Systems)...Page no. (14, ‘e Middleware sits “in the middle” between application software that may be working on different operating systems. © Middleware comes in many forms, content-centric middleware, and messa cluding database middleware, transactional middleware, intelligent middlewatt, -oriented middleware. Middleware provides a variety of services, including control services, communication services, and security services. Machino A Machine 8 Machine C. Distributed applications. Network OS services Kernel Network (w1oFig. 1.7.3 : Structure of Middleware 1.7.4 Comparison between the DOS, NOS, and Middleware ‘Table 1.7.1 : Comparison of DOS, NOS, and Middleware . Distributed Operating System ea Features Netw ‘Middleware No. A Multiprocessor | Multicomputer | Operating System (1)_| Degree of Transparency Very High High Low High (2)_| Same OS on alll nodes Yes Yes No No (3)_] Number of copies of OS 1 N N N : : Model (4) | Basisfor Communication | Shared Memory _| Messages Files : Specific (5)_| Resource Management Global, central Global, distributed Per node Per node ©_| Seatabitity No Moderately Yes Varies )_| Openness Closed Closed Open Open DH 1.8 SERVICES OFFERED BY MIDDLEWARE ‘There are many services that are offered by the middleware system. Many of them are common in most systems. @) Communication services : Middleware is used to facilitate communication. It offers services like procedure calls across networks (sending and receiving messages over networks in either a local or remote call), remote-object method invocation (connecting one system to another local system that is remotely located), message queuing system (messages are stored in queues and move through them based on priority), and advanced communication streams (it provides notification of any event going to occur in future), (MU-New Syllabus wef academic year 22-23) Tech-Neo Publications_.A SACHIN SHAH Venture (Introduction to Distributed Systoms)...Page no, Distrbuted Computing (MU) (2) Information services : Services used to handle data in a distributed system are known as information services. It off, advan ed services like large-scale, system-wide naming services (where data is managed using naming. services) directory services (where data is stored in the directory), location services for tracking mobile objects, persistent storapy facilities, data caching, and replication (cache data and replicate without losing consistency). 3) Control Services : These services allow applications to choose when, where, and how to access data, Examples ineluge distributed transaction processing (which aid inthe processing of transactions that occur across a distributed networ4y n two workstations, one workstation is heavily loaded they code migration (helps in migration of function, for e.g. if the process is transferred to another workstation using control service). (4) Security Services Services for safe processing and communication are referred to as security services. It offers features like as authentication and authorization, encryption, and inspection of whole system. (5) Persistence : Its used to store distributed objects permanently onto the data store, (6) Messaging : It is used to send or receive messages in terms of request/reply primitive. Querying : Iis used to query on distributed objects. (8) Concurrency : It is used to share and access resources concurrently. DA 1.9 TYPES OF MIDDLEWARE f middleware in the distributed 1GQ. Explain diferes Middleware comes in a variety of forms, some of which are listed here. (1). MessageOriented Middleware (MOM) (2) Object Middleware (4) Database Middleware (3) RPC Middleware © Portal Middleware (5) Transaction Middleware (7) Content-centric Middleware (8) Embedded Middleware (1) Message Oriented Middleware (MOM) Asa kind of middleware, message-oriented middleware facilitates communication between applications. It provides a _messaging framework for applications to communicate with one another asynchronously, without requiring both parties {0 be online at the same time. By using MOM, apps may communicate without worrying about how the other works physically or technically, This. makes it possible for programs written in various programming Janguages and built for various platforms to | communicate with one another. * MOM systems often have characteristics like message routing, message persistence, and message transformation 10 allow the fast and reliable flow of messages among applications. Examples of MOM systems include Apache ActiveMQ, IBM WebSphere MQ, and Microsoft Message Queue. > (2) Object Middleware Object middleware facilitates communication between different Programs and parts. It provides a set of services and an underlying architecture that allow programs to use each other's data and objects as if they were their own, Object middleware often includes features like object-oriented messaging, distributed object management, and object transaction support to promote efficient and reliable communication between programs, Object middleware technologies include CORBA and Java's Remote Method Invocation, in distributed systems, where applications run on a noraber of different computers connected through a network and must communicate with OD€ another to get access to a set of shared resourees and services, object middleware is often used. It allows programs 10 (MU-New Syllabus we.f academic year 22-23) & ‘Tech-Neo Publications... SACHIN SHAH Venture Distributed Computing (MU) (ntroduction to Distributed Systems)....Page no. (1-21) interact in a way that is independent of the underlying network and operating system, which simplifies the design and ‘maintenance of distributed applications, > (3) RPC Middleware + RPC middleware is a sort of middleware that enables programs to invoke procedures or functions on remote systems as if they were local. It provides a messaj get responses concurrently 8 architecture that allows programs to make requests to remote processes and ‘+ RPC middleware often includes features like message routing, message persistence, and message transformation to facilitate the efficient and reliable transfer of requests and responses between applications. * One such RPC middleware framework is Apache Thrift. Programs using RPC middleware are often employed in distributed systems when access to shared resources or services requires the execution of remote programs. > (A) Database Middleware © Database middleware is a of middleware that provides an interface between applications and databases, letting programs read from and write to databases without understanding their underlying structure or operations. * Database middleware often includes features like data access libraries, data maj facilitate high-level, abstracted communication between programs and the database. > (5) Transaction Middleware tools, and query languages to ‘The architecture for handling distributed transactions is provided by transaction middleware, a kind of middleware. It enables programs to perform atomic operations that may either finish or roll back any changes, ensuring that information is always correct and consistent. ‘Transaction middleware often includes features like transaction management, transaction coordination, and transaction recovery to facilitate the execution of transactions across many systems. Transaction middleware systems like the Java ‘Transaction API are one example > (6) Portal Middleware By definition, portal middleware is software that provides a gateway through which users may access and integrate a ‘wide variety of applications and services via the Internet. It eliminates the need for users to switch between applications ‘or websites in order to have access to the many programs and data that are available to them. Portal middleware often includes features like authentication and authorization, user profile management, and content publishing to facilitate the development and maintenance of portal applications. A few of popular portal middleware options include Liferay and Microsoft SharePoint. Whenever there is a need for several applications and data sources to be accessed and managed via a unified portal, portal middleware is often used. > (7) Content-centrle Middleware ‘This kind of middleware is known as “content-centric” because it concentrates on the distribution and management of Content rather than on the management of applications and data, It's a set of resources that may be used to provide apps ‘more control over data and make it easier for them to share resources with one another. © Content-centrie mi Heware often includes capabilities like content management, content routing, and content transformation to facilitate the efficient and reliable distribution of data, Some examples of content-centric middleware are content delivery networks and content management systems (CDN). > (8) Embedded Middleware Embedded middleware is software designed to run on devices with limited hardware and software resources, such as. those found in embedded systems, sensors, and oT devices. By using the offered infrastructure and services, applications may interact with the device's hardware and software, communicate with one another, and have access to shared resources, (MU-New Syllabus we,f academic year 22-23) [el tech.Aveo Pubiations. SACHIN SHAH Venture Distributed Computing (MU) Introduction to Distributed Systems)....Page no. (1-22) + The development of software for embedded devices is facilitated by embedded middleware, which often includes features like resource management, communication protocols, and device abstraction. Examples of embedded middleware include the LoT platform and the Real-Time Operating System (RTOS). ‘© Embedded middleware is often used in applications for embedded systems and Internet of Things (IoT) devices because to the limited hardware and software resources of such devices, which must be carefully regulated to ensure stable and effective operation. WI 1.10 MODELS OF MIDDLEWARE IQ. What are the different models of middleware 7 ‘There are five distinct models of middleware discussed in this section. (@). Client-server model (2) Vertical distribution model (3) Horizontal distribution model (4) Peer-to-Peer Model (S)_Hybrid Model > (1) Client-server model - + ie sien sever mots away orn nd igleneing mise] rte eva see tot eisai pune sera clin pao ay tn sc clo pln neste te LAM a tt is RE A nds ei seo Tse mc cor nly vt for eco splcaon, wher he mddlowen see le woe earver Wat roids services To Web browsers or ther client applications.) et Groupware EC curnFig. 1.10.1 : Middleware facillitating Clie > (2) Vertical distribution model -Server Communication ‘Also known as Muti-tier Model In other words, fi's a more advanced form of client-server architecture. This approach Ticomporates a cluster of servers. | ~ sacral ene. | Requests from client applications are sent to the first middleware server, which then processes the request and transmits it to the next server unil it receives the results. Web applications often follow this architecture, with the middleware server being a web server that offers its services to client browsers or other software. HTTP requests and responses () Client Web server Application servers Database (1atqFig.1.10.2: Middleware as a Vertical Distribution Server (MU-New Syllabus wees academic year 22-23) [sl techies Publications. A SACHIN SHAN Ventre Distributed Computing (MU) (troduction to Distributed Systems)....Page no. (1-23) > ¥ (3) Horlrontal distribution model ‘The limitations of the preceding models in terms of scalability and reliability necessitated the adoption of a horizontally distributed model todistribute the tasks of a single server over several workstations. Interface handling requests Rather of relying on a centralised server or broker, each server's applications are responsible for communicating directly with the applications on other servers. Applications running on multiple computers often employ this architecture. Replicated web servers, sharing the same resources (winFig. 1.10.3 : Middleware as a Horizontal Distribution Model (4) Peer-to-Peer Model It operates on a decentralized approach to communication known as the “peer-to-peer” (P2P) paradigm. In a P2P network, each machine is treated equally and may perform the roles of both client and server. This kind of technology eliminates the need for a centralized server, allowing users (0 exchange data and services between themselves. File sharing is a common use case for peer-to-peer systems because any user may publish files to the network and get files from other users This allows for more efficient use of bandwidth and reduces the workload on each individual server. Peers Poar 4. (aoFig.1.104 : Peer-to-peer Model (5) Hybrid Model A hybrid model includes elements from many middleware architectures, such as client-server and peer-to-peer. This allows the best features of both architectures to be combined into one, resulting in a system with more adaptability and scalability, A client-server architecture may be used in a hybrid middleware system to provide services like financial transactions with the highest possible degree of security and reliability. Services such as file sharing may benefit from the scalability and adaptability of a peer-to-peer architecture, and they may be utilized simultaneously, » 1.11, CLIENT-SERVER ARCHITECTURAL MODEL Clients in a client-server architecture are often users of the system, who are using personal computers, whereas servers are stationed elsewhere on the network and are typically more powerful computers. In a client-server system, the server is responsible for providing and managing most of the data and functions that end users, or "clients," need to complete their tasks. (MU-New Syllabus wef academic year 22-23) [ell rech-neo Publcations.-A SACHIN SHAH Venture istributed Computing (MU) (Introduction to Distributed Systoms)....Page no, AS all requests Computing paradigm is sometimes called the client server network of networking computing mole. Client-server architecture has three main parts that must all be present for it to function properly. Clients, servers, and ‘network handware are the three main parts © To get the required resources, the client first makes a network request to the server, client requests are processed by the server, and the server then sends back a response to the client through the network, casFig. 1.1 lient-Server Architecture wt 1.1 Different Types of Client-Server Architecture This section discusses different types of client-server architectures. ()ITyer Architecture : The term “I-tier architecture,” or “single-tier architecture,” is used to describe a spe software architecture in which all the necessary components for the functioning of type of pplication are accessible un @) 2-Mer Architecture : An example of a two-tier architecture is one in which the user interface and the database are hosted on separate computers. In this setup, the client and server are on different machines, ‘Chront 1 ‘Chior 2 Ghent 3 (AWFig. 1.11.2 : 2-Ter Client-Server Architecture ()_3-Tler Architecture : As opposed tothe direct connection between the client snd the server in 2tir des tier is present in 3tier client server architecture. The middle tier wil be the fis 10 receive a request from the client to et data from the server. After tha, it will be sent off to the server for processing. When the server responds to the clicnt, it will follow the same format. In a 3-ticr design, the presentation layer the application/logi layer, and the data fier are the three fundamental components of the structure. 1,4 middle Tech-Neo Publications... SACHIN SHAH Venture (MU-New Syllabus w.e.f academic year 22-23) Distributed (MU) Introduction to Distributed S: Prosentation ter ‘ata vor Ne = =) Ghent (arFig 1.11.3 : 3-Tler Client Server Architecture (4) n-Tler Architecture : There isa kind of architecture called n-tier architecture, where ‘n” is the number of ters, and itis also known as distributor architecture, Between the UL and the DB, many application servers mediate in an n-tier architecture, which is different from the more common 3-ticr architecture. This is done to ensure that the business logics are spread out across many servers. Ifthe number of servers ever has to expand, this design can easily adapt. Ter 0 Tor! Tor 2 Ter3 Ctiont with wob browser (amnFig 1.114 : n-tier Client-Server Architecture Descriptive Questions Q.1 Define distributed systom. Stato the advantages and disadvantagos of a distributed system. Q.2 Stato tho goals and issues in designing distributed system, 2.3. Explain ditferent typos of transparencies in distributed systems. 0.4 Explain ditferont distibutod systom models. Q.5 Explain diforont typos of distributed system. 2.6 Compare and contrast cliont-server and poer-to-poot models. 2.7 Explain in briot tho hardware and software madols supported by the distributed systern. ©.8 Explain in detail architectural models of distrbuted system. @.9 _Difforentiato botwoon DOS, NOS and middloware based distributed system. Q.10 Explain citforent ctiont-sorvor modols with neat diagram, Chapter Ends... aqoo MODULE 2 : = Communication -CHAPTER 2 2.1. Introduction. Ga. 244 212 Ga. 2.1.2 (A) MPL Communication Methods.. 2.2 Layered Protocols... 2.3 Remote Procedure Call (RPC)... ua. ua, ua, ua. 23.4 2.3.2 233 2.3.3(A) Implementing RPC Mechanism. 2.3.4 23.5 23.6 237 23.8 2.3.9 2.3.10 Ga. Define Inter-process Communication. Explain different types of Communications. Types of Communications . Message Passing Interface (MP)).. Explain the concept of Message Passing Interface (MPI) in detail Explain the concept of Remote Procedure Call. (UEEEEET... Define Remote Procedure Call (RPC). Explain the working of RPC in detail Explain call semantics of RPC. (UEEESETD.... Write a note on RPC and RMI. (UEIXENEE) Features of RPC. ‘Types of RPC... Extended RPC Models... Working of RPC... Issues of Remote Procedure Call (RPC) Advantages of RPC Disadvantages of RPC Parameter Passing in RPC. PC Call Semantics... Communication Protocols for RPC..... Explain different communication protocols used in RPC. .... Distributed Computing (MU) (Communication)....Page no. (2-2) 24 25 26 27 28 Remote Object Invocation. 247 24.1 Distributed Object Model. 2.4.2 Compile-Timo versus Runtime Objects... 2.4.3 Persistent and Transient Objects.. Remote Method Invocation (FIMI) 25.1 Stub. 25.2 Skeleton. 25.3 25.4 2.5.5 Advantages of RMI... 25.6 Disadvantages of RMI. Message Oriented Communication UG. Give examples forthe following messago communication models. (a) Transient Synchronous (©) Response based synchronous communication (c) Transient Asynchronous (d) Persistent Asynchronous (¢) Receipt based communications 2.6.1 Message Quoue 2.6.2 Advantages of Message Queu Stream-Oriented Communication... UG. Explain Stream Oriented Communication with a suitable example. (EG) Ua. Differentiate between Message oriented and Stream oriented communications. (UEEESST) Ua. Compare and contrast Message oriented and Stream oriented communications. ((UERESRE. 2.7.1 Quality of Service (QoS) in Stream Oriented Communication. 2.7.2 Comparison of Message-Oriented and Stream-Oriented Communication.. Group Communication. GQ. Explain group communication in detail with its types... 28.1 Types of Group Communication in a Distributed System 282 Group Communication Properties. 2.8.3 Design issues in Group Communication... . Chatper End (MU-New Syllabus wes academic year 22-23) ‘Tech-Neo Publications..A SACHIN SHAH Venture (Communication)...Page no. (2-3) Distributed Computing (MU) D-H 2.1 INTRODUCTION ifferent types of Communications. ia various processes that run on different 1GQ.__ Define Inter-process Communication. Explai Communication refers to the exchange of messages and information ‘machines. Communication between two processes in a distributed system is required to exchange various data, such as code or a file, between the processes. Inter-process Communication is a process of exchanging data between two or more independent processes in a distributed environment. User Usor = User User User (18)Fig. 2.1.1 : Inter-process Communication in Distributed System : Synchronization and Message Passing. © Inter-process communication has two functio Inter-process communication requires synchronization. It refers to a situation in which the data used to communicate between processors is control information. It is either provided by the inter-process control mechanism or handled by the communicating processes. In message-passing systems, processors communicate with one another by sending and receiving messages over a ‘communication channel. Message passing takes several forms such as pipes, FIFO, Shared Memory, and Message Queues. 2 2.1.1 Types of Communications Following are the different types of communications as shown ia Fig. 2.1.2. ) Persistence : Persistence means that the network can store messages for an arbitrary period until the next receiver is ready. Email and ground deliveries are good examples. (2) Transient : Message is stored only so long as the next receiver is ready, For example, Transport- level communication discards the message if the process crashes for any reason. The system will not store the message. (3) Asynchronous : Asynchronous communication means that the sender is doing non-blocking sending. It continves immediately after submitting the message. (4) Synchronous : Synchronous communication blocks the process until the message is received or the sender gels @ response from the server. [Bl rech-Neo Pu tions... SACHIN SHAH Venture (MU-New Syllabus wef academic year 22-23) Distributed Computing (MU) (Communication)..Page no. (2-8) () Persistent synchronous communication : The sender is blocked when it sends the message, waiting for an acknowledgement to come back. The message is stored in a local buffer, waiting for the receiver to run and receive the ‘message. Some instant message applications, such as Blackberry messenger, are good examples. When you send out a ‘message, the app shows you the message is “delivered” but not “read”. After the message is read, you will receive another acknowledgement, (©) Transient asynchronous communication : Since the message is transient, both entities must be running. Also, the sender doesn’t wait for responses because it is asynchronous. UDP is an example. (7) Receipt-based transient synchronous communication : The acknowledgement sent back from the receiver indicates that the message has been received by the other end. The receiver might be working on some other process. (8)_Delivery-based transient synchronous communication : The acknowledgement comes back to the sender when the ‘other end takes control of the message. Asynchronous RPC is an example. (9) Response-based transient synchronous communication : The sender blocks until the receiver processes the request and sends back a response. RPC is an example. There is no clear mapping of TCP to any type of communication, From fn application standpoint, it maps to transient asynchronous communication. However, from a protocol standpoint, it ‘maps to a receipt-based transient synchronous communication if it only has a one-size window. ‘conde message ‘Avenda message and andcontnues —— Asopped ‘wats inl agoepted pray A So Message is stored ALB’ locaton for, Accepted lator delivery . Time Bs . = — isnot gehen masse Bist sctineronag running a running ss {@) Persistent asynchronous (Persistent synchronous ‘Asends message Sond requost and wait ‘and continues ‘nti regeived A a A a Message can be sent only if Bis Request Jack. Is eceived Te B icc petsag Running, Butdoing Process — someting eee request (© Transient asynchronous (@) Transient synchronous : (Receipt-based) Send request and wait Send request ntl accepted and walt for roply, —— SS — Running, But doing Process Running, But doing Provess something else - request ‘something else request (© Transient synchronous (0 Transient synchronous @elivery-based) ‘Response-based) wea Fig. 2.1.2 : Types of Communications ‘Tech-Neo Publiations.A SACHIN SHAH Venture (MU-New Syllabus wef academic year 22-23) Distributed Computing (MU) (Communiction)..Pago no. (2-8) % 2.1.2 Message Passing Interface (MPI) GQ. Explain the concept of Message Pas: Sockets are designed for simple send-and-reccive primitives and one-to-one communication using general-purpose protocol stacks such as TCPAP. “The message-passing interface (MPI) is a standardized interface for exchanging messages between multiple computers, running a parallel program across distributed memory. ‘MPI is designed for parallel applications and as such is tailored to transient communication. tion, and [MPI can be used for communication between clusters of clients and servers, which have intensive communi the overhead of TCP/IP is very high for this scenario. ‘The MPI standard defines the syntax and semantics of library routines helpful in writing portable message-passing programs, MPI isn't a programming language. It's a library of functions that programmers can call from C, C+, or Fortran code to write parallel programs. With MPI, an MPI communicator can be dynamically created and have multiple processes concurrently running on separate nodes of clusters. Each process has a unique MPI rank to identify it, its own memory space, and executes independently from the other processes. «Processes communicate with each other by passing messages to exchange data. «| MPI’s goals are high performance, scalability, and portability. Parallelism occurs when a program task gets partitioned into small chunks and distributes those chunks among the processes, in which each process processes its part ‘+ MPI also has more advanced primitives of different forms of buffering and synchronization. (1) MPI_bsend : Transient asynchronous communication is supported by means of this primitive. (2). MPI_send : The primitive MP1_send may either block the caller until the specified message has been copied to the ited a receive operation. (receipt based). ‘MPI runtime system at the sender's side or until the receiver has (3) MPlssend : Synchronous communication by which the sender blocks until its request is accepted for further processing is available through the MPI_ssend primitive. (delivery based). (@) -MPIsendrecy : When a sender calls MPI_sendrecy, it sends a request to the receiver and blocks until the Jatter returns a reply, which provides the strongest form of synchronous communication. Basically, this primitive corresponds to a normal RPC. (reply based). (5) MPlisend : A sender passes a pointer to the message after which the MPI runtime system takes care of communication. The sender immediately continues. When the messages to be sent are very large, memory copy ‘overhead can be substantial. So, it sends a pointer to 2 local buffer instead of the whole copy of the data. (6) MPI_issend : Variant of MPL_ssend with sending pointer instead of a copy. (D) MPL recy : The operation MPI_recv is called to receive a message; it blocks the caller until a message arrives. (8) MPLirecv : It’s an asynchronous variant of MPI_recv, by which a receiver indicates that is prepared to accept a message. The receiver can check whether a message has indeed arrived, or block until one does, [Bl rech-eo Publications..A SACHIN SHAH Venture (MU-New Syllabus w.ef academic year 22-23) Distributed Computing (MU) yw. 2.1.2 (A) MPI Communication Methods (Communication)....Page no. (2-6) MPI provides three different communication methods that MPI processes can use to communicate with each other. The communication methods are discussed as follows: (1), Point-to-Point Communication ‘+ Point-to-Point communication is the most used communication method in MPI. ‘+ Itinvolves the transfer of a message from one process to a particular process in the same communicator. * _ MPI provides blocking (synchronous) and non-blocking (asynchronous) Point-to-Point communication. With blocking communication, an MPI process sends a message to another MPI process and waits unti receiving process completely and correctly receives the message before it continues its work. the On the other hand, a sending process using non-blocking communication sends a message to another MPI process and continues its work without waiting to-ensure that the message has been correctly received by the receiving process. (2) Collective Communication With this type of MPI communication method, a process broadcasts a message is to all processes in the same communicator including itself. (8) One-Sided Communication With the MPI One-sided communication method, a process can directly access the memory space of another process without involving it ———————————————— D1 2.2 LAYERED PROTOCOLS ss + Due to the Jack of shared memory in distributed systems, all communication is based on sending and receiving (low- level) messages. ‘When process A wishes to communicate with process B, it constructs a message in its own address space first. ‘Then it makes a system call, which instructs the operating system to send the message to B over the network. Although this basic concept appears straightforward, A and B must agree on the meaning of the bits being sent to avoid chaos. A variety of agreements are required, How many volts should be used to signal a O-bit, and how many volts should be used to signal a 1-bit? How does the receiver know which part of the message is the last? How does it know if a ‘message is damaged or lost, and what should it do if it does? How long and how are numbers, strings, and other data items represented? In short, agreements are required at multiple levels, ranging from low-level details of bit transmission to high-level details of how information is to be expressed. To easily deal with the numerous levels and issues involved in communication, the International Standards Organization (ISO) has developed a reference model that clearly identifies the various levels involved, gives them standard names, and indicates which level should do which job. ‘This model is known as the Open Systems Interconnection Reference Model, abbreviated as ISO-OST or simply the OSI model. An open system is one that can communicate with any other open system by following standard rules that govern the format, content, and meaning of messages sent and received. Protocols are documents that formalize these rules. (MU-New Syllabus w.ef academic year 22-23) ‘Tech-Neo Publications..A SACHIN SHAH Venture Dovid Corecing (WD) * A protocol isa set of males and regulations that govern the communication describing how two enti information. + Netaorking tasks, soch as file transfer, frequently necessitate the use of more than one protocol. ‘+ The OST model separates two types of protocols into generic categories. + With connection-orfemted protocols tbe sender and receiver must deliberately establish a connection before data cay be seat When they are done, they must release (terminate) the connection. The telephone is a connection-orientey communication system. + Conneetioness protocols dont require any sep beforehand. When the fist message is prepared, the sender simply sends it. A connectioaless communication example is placing a leter in a mailbox. ‘Both coanection-oriented and conectionless communication are common with computers. ‘+ Asscen in Fig. 22.1, the OSI model divides communication into seven levels or layers. Each ayer addresses a distin, ‘communication-related issue > Layer 1 : Physical Layer This layer defines the physical media that connects hosts and networks, as well as the procedures for transferring data between machines using a specified media. This layer is commonly referred to as the model's hardware layer. © Layer 2: Data Link Layer This layer bas the responsibility of ensuring that data is delivered reliably across the physical network. For example, it provides an abstraction of a reliable connection over the potentially unreliable physical layer. Layer : Network Layer This layer has the responsibility of directing the flow of communications between different machines. The address of the machine to which the transmission is being sent is used as the basis for its determination of the route that the ‘transmission must travel. This layer is also responsible for addressing issues related to network congestion. This layer delivers data in a sequential order from start to finish. It is the lowest layer that provides end-to-end service ‘0 applications and higher layers. This layer conceals the underlying network's topology and characteristics from users. If the service characteristics demand it, it provides reliable end-to-end data delivery. © Layer 5: Session Layer ‘This layer manages sessions between cooperating applications. 5 Layer 6 : Presentation Layer This layer converts data from the computer's local representation to the processor-independent format that is sent across. the network. It can also negotiate transfer formats in some protocol suites, Standard routines that compress text or convert ‘graphic images into bit streams for network transmission are common examples. «© Layer 7 : Application Layer This layer includes the user-level programs as well as the network services. Telnet, FTP, and TFTP are a few examples of application layer protocols. (MU-New Syllabus w.e.f academic year 22-23) fl Tech-Neo Publications...A SACHIN SHAH Venture Distributed Computing (MU) (Comersicatin)....Page ro. (2-8) Vache t Mache? (1e9Fig. 2.2.1 : ISO-OSI Reference Model DA 2.3 REMOTE PROCEDURE CALL (RPC) 1 UQ. Explain the concept of Remote Procedure Call. CEnee | 1 UQ. Define Remote Procedure Call (RPC). Explain the working of RPC in detail. : 'UQ Explain call semantics of RPC. : 1 UQ. Write a note on RPC and RML Remote Procedure Call is an inter-process communication technique used to construct distributed and client-server applications. Itis also known as a function call or a subroutine call. * A remote procedure call is when a computer program Server Chore causes a procedure to execute in a different address space, imma cupxyn @ coded as a local procedure call, without the programmer explicitly stating the details for the remote interaction. ' © The programmer writes essentially the same code whether the subroutine is local to the executing program or remote. This is a form of client-server interaction implemented via a request-response message-passing system. (195Fig. 2.3.1 : Model of Remote Procedure Call (MU-New Syllabus wef academic year 22-23) ‘Tech-Neo Publications..A SACHIN SHAH Venture (Communication)....Pago no. (2-9) Distributed Computing (MU) i ‘© The RPC model implies location transparency which indicates that calling procedures are Jocal or remote. © Usually, they are not identical. Remote calls are usually orders of magnitude slower and less reliable than local calls, address spaces. largely the same, whether © RPCS are an instance of inter-process communication (IPC), where different processes use different + On the same host computer, they each have their own vinwal 5 Caler fen nay address space, despite sharing the same physical address space. Nevertheless, the physical address space is different if they are on separate hosts. © During a Remote Procedure Call(RPC) : Receive procedure t t ' 1 ' ' and start procedure t (1) The OS suspends and transfers the calling environment and ‘execution procedure parameters respectively, across the network and to —_a execution the environment where the procedure executes. (2) The OS transfers back the result produced by a procedure 10 Resume the calling environment. Execution also resumes just like a executon regular procedure call. Reply MeSSAG> | Send reply and wait fornext request (15Fig. 2.3.2 : Implementation of RPC ‘©The two major components of the RPC model are : 4 (J) Calling Procedure : It is in the local machine and contacts the remote procedure to be executed by placing a request message to the called procedure. @) Called Procedure (remote Procedure) : It may be located on the same computer as the calling procedure or on a ‘different computer. Gets the parameters from the request message sent by the calling procedure and executes accordingly giving the results via @ reply message to the calling process. © The two types of messages involved in the implementation of an RPC system are as follows : (1) Call Messages : They are sent by the client to the server for request execution of a particular remote procedure. (2) Reply Messages : They are sent by the server to the client for returning the result of remote procedure exec! 2.3.1 Features of RPC In an operating system, remote procedure call (RPC) has the following features, such as : (1) RPC hides the complexity of the message passing process from the user. (2) RPC only uses specific layers of the OSI model like the transport layer, (3) Clients can communicate with the server by using higher-level languages. (4) RPC works well with both local environments and remote environments. (5) The program of RPC is written in simple code and js easily understood by the programmer. (6) The operating system can handle processes and threads involved in RPC easily. (7). The operating system hides the abstractions of RPC from the user. ‘% 2.3.2 Types of RPC These are the five types of the remote procedure call (1) Synchronous RPC : This is the normal method of oper server returns the reply. The client makes a call and does not continue until the (MU-New Syllabus wef academic year 22-23) Tech-Neo Publications...A SACHIN SHAH Venture Distributed Computing (MU) (Communication)....Page no. (¢ 2-10) (2) Nonblocking RPC : The client makes a call and continues with its own processing. The server does not reply. (3) Batch-mode RPC : This is a facility for sending several client nonblocking calls in one batch. (4) Functions of Batch-mode RPC : (i) It minimizes the overhead involved in sending a request as it sends them over the network in one batch to the server, ii). This type of RPC protocol is only efficient for application that needs lower call rates. (iii) It needs a reliable transmission protocol. (6) Broadcast RPC : RPC clients have a broadcast facility, that is, they can send messages to many servers and then receive all the consequent replies. Functlons of Broadcast RPC (1) Allows you to specify thatthe client's request message must be broadcasted. @) Youcan declare broadeast ports. 3) Ithelps to reduce the load on the physical network (4) Callback RPC : The client makes a nonblocking clienvserver call, and the server signals completion by calling 2 procedure associated with the client. Functions of Callback RPC (i) Remotely processed interactive application problems Offers server with clients handle i (iv) Manage callback deadlocks Callback makes the client process wait (¥)_ It facilitates a peer-to-Peer paradigm among participating processes. 2.3.3 Extended RPC Models ‘The extended RPC models use RPC for their communication. The extended RPC models like lightweight RPC (Doors), Asynchronous RPC, Deferred Synchronous RPC, and One-way RPC are discussed in this section. (1) Lightweight RPC (Doors) (2) Asynchronous RPC (3) Deferred Synchronous RPC (4) One-way RPC > (1) Lighewelght RPC (Doors) RPCs can be optimized by using lightweight RPC when the client and server processes are running on the same computer. * Although the kernel tries to reduce overhead when it discovers that the packets are directed to itself, message construction overhead is still unavoidable. ‘Therefore, the client simply sends a buffer from the client to the server over a shared memory region, inserting the RPC request and the parameters, and instructing the server to access it from there rather than sending an explicit network communication. Since memory is shared for message sending and receiving, explicit message forwarding is not required. ‘The client sends the arguments to the stack, which is a trap for the kemel. The kernel, in turn, changes the memory map of the client in such a way that the memory location where the arguments were pushed in the stack is now available to the server, (MU-New Syllabus w.e- academic year 22-23) (BB) tech-Neo Pubications-A SACHIN SHAH Venture 1 Distributed Computing (MU) (Communication). ‘After that, the server retrieves the request from the memory region and begins processing it, Following the completion of the execution on the server's end, the reply is then transmitted back to the client in the same manner. It might be possible to avoid the overhead of sending messages over a network if one used this unstructured methog op ‘communication, ‘The decision of using Lightweight RPCs can be made either at compile time or at run time. For compile-time support, linking against Lightweight RPCs is forced over the usual RPC using a compiler flag bit ‘The other option is to compile in both Lightweight and usual RPC support and choose one at runtime, | Tks then handled by the RPC runtime system: it can decide whether to send a message over TCP or use shared memory buffers. © Client makes an RPC call, and it waits only for an acknowledgement from the server and not the actual lent ree Call remote + The server then processes the request asynchronously and procedure sends back the response asynchronously to the client which enerates an interrupt for the client to read the response received from the server. This is useful when the RPC call is Server Calflocal procedure Time—m. (189Fig. 2.3.3 : Asynchronous RPC long-running computation on the server, meanwhile, the client can continue execution. > (3) Deferred Synchronous RPC ‘+ Here, the client and server interact through two asynchronous RPCs. The client sends an RPC request to the server, and the client waits only for acknowledgement of the received Client request from the server, post that the client carties on Cell remot with its computation. Procedure © Once the server processes the request, it sends back the response to the client which generates an interrupt on the Server=—E°2USSt client side, the client then sends a response received eel porete ON ane acknowledgement to the server. one-way RPC cenFig. 2.3.4 : Deferred Asynchronous RPC > (4) One-way RPC * The client sends an RPC request and doesn't wait for an acknowledgement from the server, it ust sends an RPC request and continues execution. * The reply from the server is handled through an interrupt generated on receipt ofthe response on the client side. * The downside here is that this model is not reliable. If i is running on a non-reliable transport medium such as UDP, there will be no way to know if the request was received by the server, % 2.3.3(A) Implementing RPC Mechanism The implementation of an RPC mechanism is built on the idea of stubs, which offer an abstraction of a procedure call that is entirely normal by hiding the interface to the underlying RPC System from clients (MU-New Syllabus we.f academic year 22-23) fl) Tech-Neo Publications... SACHIN SHAH Venture pistibuted Computing (MU) ‘4 The implementation of an RPC mechanism usually involves the following five elements of the program: The ‘The Client Stub, The RPC Runtime, The Server Stub, and The Server. The Client is the init ting process for a remote procedure call. To invoke a remote procedure, the client makes a normal local call, which invokes the corresponding procedure in the client stub. 4 The Client Stub is responsible forthe following two responsibilities: (1) Upon receiving a call request from the client, it requests the local RPC Runtime to send a message containing the target procedure and its parameters to the server stub. (2) When it receives the result of a procedure’s execution, it unpacks it and sends it to the client. ‘The RPC Runtime manages the delivery of messages between client and server machines across the network It ‘manages retransmissions, acknowledgements, packet routing, and encryption. The client machine's RPC runtime gets the call request message from the client stub and then transmits it to the server machine. The RPC runtime on the server machine receives the message containing the procedure’s execution result from the server stub and transmits it to the client machine, «The Server Stub is responsible for the following two responsibilities = (1) When the server stub receives the call request message from the local RPC Runtime, it unpacks it and makes a perfectly normal call to run the proper server procedure. (2) The server stub requests the local RPC Runtime to transmit the result of procedure execution to the client stub uupon receiving the result of procedure execution from the server. When the Server receives a call request from the server stub, it executes the necessary procedure and provides the result to the server stub. %& 2.3.4 Working of RPC + RPCis used to implement the client/server model. It is easier to program than sockets. When the client process makes a call to the remote function, the following steps are executed to complete the RPC (Fig. 2.3.5) (1) The client procedure makes a local procedure call to the client stub. A client stub is conceptually a collection of functions with the same name as the remote function. This function contains code that sends a request message to the server with the actual parameters to the remote function, waits for the response, reads the response, and returns the results. Stub compilers, such as rpegen, can generate stubs automatically. During compilation, the stub is inserted into the code, : (2) The client stub invokes network routines via system calls. It consists of preparing the message buffer, packing parameters into the buffer, constructing the message, and sending the message to the kernel. (3). The message is sent to the remote kemel by the local kernel in this step. The kernel is in charge of the process. The message is transferred to the kemel, and the destination address is determined. The network interface is then configured, and a timer is started to re-transmit the message. (4) When the message is received successfully by the remote kernel, it is transferred to the server stub via system calls. ‘The packet is first validated, and then the stub to which the message is to be seat is determined. The message is copied onto the server stub if the stub is waiting. (5). The server stub unpacks the parameters and calls the server procedure once the control is passed to it. This is known as unmarshalling. (6) The process is carried out by the server, and the results are retumed to the server stub, (D)_ Finally, the server stub packages the results into a message and sends it to the Kernel. (MU-New Syllabus w.e.f academic year 22-23) fl ‘Tech-Neo Publications. SACHIN SHAH Venture li ee eae MV Communication. .Pege no. (2.4 Dae Comeving See R) Tevet hy the sever ere (8) The results are then transmitted to the cl (9) The results then passed to the client tubby the clients Kernel (10) The rests ae unpacked and ree he cent pres hy the cent SI Cent proces Server proc ‘arguments cwsFig. 2.3.6 : Working of RPC (Courtesy : Distributed Component Architecture, G. Sudha Sadasivam) W255 Issues of Remote Procedure Call (RPC) In an operating system. Remote procedure call or RPC faced some issues that must be addressed, such as : (1) RPC Rustin 2) Sub G) Binding (4) The calling semantics associated with RPC ) Db (1) RPC Runtime ‘The RPC runtime system is a collection of routines and services that handle the network communications that are at the core of the RPC mechanism. Client-side and server-side runtime systems code handle binding, establish communications over an appropriate protocol, pass call dats between the client and server, and handle communications errors daring 20 RPC call > (2) Saab ‘+The stub's purpose is to provide transparency to the programmer-written application code. * On the client side, the stub handles the interface between the clients local procedure call and the runtime system, marshaling and unmarshalling dats, invoking the RPC runtime protocol, and performing some of the binding steps if requested. * On the server side, the stub acts as an interface between the runtime system and the server's local manager Procedures. > (3) Binding ¢ tis how does the client know who to call and where to find the service? The most adaptable solution is to use dynamic binding and locate the server at runtime when the RPC is made for the first time. + When the client stub is first invoked, it comacts « name server to determine the transport address of the server. THE binding is made up of two pans : (MU-New Syllabus wef academic year 22-23) &) Tech-Neo Publications..A SACHIN SHAH Venture pjstrbuted Mt When an interface is exported. it is registered (i) Naming : A server that provides a service export an interface for it. ‘with the system so that elients ean use it (ii) Locating : Refore communication can begin, a client must import a (exported) interface. > (4) The calling semantics associated with RPC his mainly classified into the following types ()_ Retry request mescage : When a server fils oF the mestage is not received. whether to retry sending the request message. (ii) Duplicate filtering : Remove the duplicate server requests. (ii) Retransmission of results : To resend lost messages without re-executing server-side operations. 2.3.6 Advantages of RPC Some of the advantages of RPC are as follows : (1). Remote procedure calls support process-oriented and thread-oriented models. (2). The internal message-passing mechanism of RPC is hidden from the user. (2). The effort to re-write and re-develop the code is minimum in remote procedure calls. (4) Remote procedure calls can be used in a distributed environment as well as the local environment. (5) Many of the protocol layers are omitted by RPC to improve performance. 2.3.7 Disadvantages of RPC Some of the disadvantages of RPC are as follows (1). The remote procedure call is a concept that can be implemented in different ways. It is not a standard. 2). There is no flexibility in RPC for hardware architecture. It is only interaction based. (3) There is an increase in costs because of the remote procedure call. Y. 2.3.8 Parameter Passing In RPC + In RPC, parameters are passed in two ways, namely, call by value and call by reference. ‘© Incall by value, actual parameters are their data types are copied into a stack and passed to the called procedure. + Incall by reference, a pointer to data is passed instead of value to the called procedure at the server end. However, itis very difficult to implement as the server needs to Keep track of the pointer to the data at the client's address space. %2.3.9 RPC Call Semantics RPC has the same semantics as a local procedure call, the calling process calls the procedure, sives inputs to it, and then Waits while it executes. When the procedure is finished, it can return results to the calling process. The different types of call semantics used in RPC systems are discussed here. (1) Possibly or May-Be Call Semantics : It is the weakest semantics. Here, the caller is waiting until a predetermined timeout period and then continues with its execution, Iti used in services where periodic updates are required. 2) Last-one Call Semantics : Based on timeout, retransmission of call message is made. After the elapsing of the timeout period, the obtained result from the last execution is used by the caller Kt sends out oephan calls It finds its application in designing simple RPC. (MU-New Syllabus wef academic year 22-23) TB tech-Neo Publications.A SACHIN SHAH Venture (3) Last-of-Many Call Semantics It is like Lastone Call semantics but the difference here ie that it neglects on ‘hrough call identifier, A new cal-id is assigned to the call whenever i i repeated. Iti accepted by the the caller id matches the most recent repeated call (4) At-enst-once Call Semantics : The execution of the call is there ane ot more times, but the results Biven t0 the calle, AE not specified. Here also retransmissions rely on the time-out period without giving a thought to orphan call, Inthe Case of nested cals, the result 1s taken from the fist response mextage if there are orphan calls and others are ignorea invespective of the accepted response fs whether from an orphan or not (5) Exactly-once Call Semantics : No matter how many times the call is transmitted, the Potential of the procedure bein, Conducted more than once 1s eliminated. When the server receives an acknowledgment from the client then only ig deletes information from the reply cache. Phan cal aller only ig % 2.3.10 Communication Protocols for RPC SQ.__ Explain different communication protocols used in RPC. The following are the communication protocols that are used in RPC. Q) Request Protocol (2) RequestReply Protacot (3)_The RequestReply/Acknowledgement-Reply Protocol } (1) Request Protocol ‘The Request Protocol is also known as the R protocol, IC is used in Remote Procedure Call (RPC) when a Procedure. After execution of the request, required of the execution of a procedure . Fequest is made from the calling procedure to the called # called procedure has nothing to return and there is no confirmation Because there is wo acknowledgement or reply message, only one message is sent from client to server, Arreply is not required so after sending the request message the client can May-be call semuntics are provided by this protocol, which eliminates the requirement for retransmission of sFoquest packets. further proceed with the next request. Asynchronous Remote Procedure Call (RPC) employs the R Cactt Server Protocol for enhancing the combined performance of the Client and server. By using this protocol, the cl ——— nt need not wait for a reply from the and the server does not need ply server andthe server Gocs not need a to send that. ‘executon * ln.an Asynchronous Remote Procedure Call (RPC) in case — Communication fails, the RPC Runtime does not retry the —————__—|___ Fequest. TCP is x betier option than UDP since it does not fequire retransmission and is connection oriented Next RPC {In most eases, asynchronous RFC with un unstable transpon Protocol is utilized to implement periodic update services, One of its applications is the Distributed System Window, Procedure execution (MU-New Syllabus wef academic year 22-23) Tech: Neo Publications..A SACHIN SHAH Venture pistibuted Computing (MU) > (Communication)...Page no. (2-16) (2) Request/Reply Protocol + The Request Reply Protocol also known asthe RR protecol +I works wel for systems that involve simple RPCs, + The parameters and result valves are enclosed in a single packet buffer in simple RPCS. The duration of the call and the time between calls are both briefs, + This protocol has a concept hase of using implicit acknowledgements instead of explicit acknowledgements. Here, a reply from the server is treated as the acknowledgement (ACK) for the client's request message, and a clicnt’s following call is considered as an acknowledgement (ACK) of the server's reply message to the previous call made by the client, + To deal with failure handling e.g. lost messages, the Chere Server timeout transmission technique is used with RR protecol Ifa client does not get a response message within the First RPC predetermined timeout period, it retransmits the request message, + Ex ics is. provided by servers as responses get held in reply cache that helps in filtering the duplicated request messages and reply messages are retransmitted without processing the request again, once sem Next RPC. If there is no mechanism for filtering duplicate messages then at least-call semantics is used by RR : protocol in combination with timeout transmission. (ataFig. 23.7 : The request'reply (RR) Protocol (3) The Request/Reply/Acknowledgement-Reply Protocol This protocol is also known as the RRA protocol (requesteply/acknowledge-reply) Exactly-once semantics is provided by RR protocol which refers fo the responses getting held in reply cache of servers resulting in loss of replies that have not been delivered. ‘The RRA (RequesUReply/Acknowledgement-Reply ) Protocol is used to get rid of the drawbacks of the RR (RequestReply) Protocol + In this protocol, the client acknowledges the receiving of reply messages andl when the server gets back the acknowledgement trom the clicat then only deletes the information from its cache, First RPC Because the reply acknowledgement message may be Jost at times, the RRA protocol requires unique ordered message identities. This keeps track of the acknowledgement series that as been sent Next RPC the request/reply/acknowledge-reply (RRA) Protocol uP ig. 28 (MU-New Syllabus wef academic year 22-23) Tech-Neo Publications.-A SACHIN SHAH Venture

You might also like