Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
34 views
110 pages
Pds Sem 8
Uploaded by
Main Hoondon
AI-enhanced title
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
Download
Save
Save pds sem 8 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
34 views
110 pages
Pds Sem 8
Uploaded by
Main Hoondon
AI-enhanced title
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
Carousel Previous
Carousel Next
Download
Save
Save pds sem 8 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save pds sem 8 For Later
You are on page 1
/ 110
Search
Fullscreen
SEM - 8 (COMPUTER) (As per Revised Syllabus w.e.f 2015 - 2016)POS Semester ~8 Topper's Solutions Topper's Solutions ven In search of Another Topper ‘There are many existing paper solution available in market, but Topper’s Solutions is the one which students will always prefer if they refer... ;) Topper’s Sobutions is not just paper solution, it includes many other important questions which are important from examination point of view. Topper’s Solutions are the solution written by the Toppers for the students to become the upcoming Topper of the Semester. Ithas been said that “Action Speaks Louder than Words” So Topper's Solutions works on same principle, Diagrammatic representation of answer is considered to be easy & quicker to understand, So our major focus is on diagrams & representation of how answers should be answered in examinations, ‘Why Topper’s Solution: * Point wise answers which are easy to understand & remember. Diagrantmatic representation for better understanding. oe Additional important questions from university exams point of view. Covers almost every important question. In search of another topper. * “Education is Free.... But its Technology used & Efforts utilized which we charge” ‘Mt takes lot of efforts for searching out each & every question and transforming it into Short & Simple Language. Entire Topper’s Solutions Team is working out for betterment of students, do help us. “Say No to Photocopy... ‘With Regards, ‘Topper’s Solutions Tear.POS Semester ~8 Topper's Solutions ---- Parallel and Distributed Systems (PDS) ---- 2,_| Pipeline Processing 3 23-24 3.__| Synchronous Parallel Processing 29 8-9 4 | Introduction to Distributed Systems 36 70 5. | Communication 8 Ti-12 6. _| Resource and Process Management 54 16-17 7._| Synchronization 70 22-23 & | Consistency and Replication 85 10 9, | Distributed File Systems 89 12-13 ---- Marks Distributio. 1. | Introduction 10 - 25 Pipeline Processing 35 20 25 15 3. _| Synchronous Parallel Processing 10 10 05 10 4 | Introduction to Distributed Systems 10 15 05 10 5. | Communication 10 10 15 10 6. | Resource and Process Management 10 25 20 10 Synchronization 20 20 30 20 Consistency and Replication 10 10 10 10 9.__| Distributed File Systems 0 10 10 20 = | Repeated Questions - 2 6 35POS Semester ~ 8 Topper's Solutions ---- Analysis by Topper's Solutions Team ---- Last Minute Preparation: Engineering is a notoriously demanding field of study. Being successful in engineering exams requires a systematic and focused approach, In order to do wel, you will need to learn how to prepare for semester exam in engineering. Have you have alzeady given up thinking, “What the hell I ean do at this moment? Tomorrow is exam!” Think again! You are engineering student & last night studies are every engineering student's epitome. “We engineers are knosm for our creativity" Don't Worry entire Topper’s Solutions Team is working out for betterment of students, Here are some techniques about Parallel & Distributed Systems (PDS) Subject. > Howto score first 40 marks: ‘Study any one of the below set and make sure you can easily attempt any questions from below chapters included in particular set. SEr-1 * Chapter Name ‘Weightage (Marks) 4. | Introduction to Distributed Systems. 10 6 [Resource and Process Management. 16-17 * Chapter Name ‘Weightage (Marks) 6 | Resource and Process Management 9) | Distributed File Systems.POS Semester ~ 8 Topper's Solutions > Howto score next 20 marks: Study the following 3 chapters. * Chapter Name Weightage (Marks) 1 introduction 13-4 5 [Communication nie12 8. | consistency and Replication 10 Note: Chapter No. 3 (Synchronous Parallel Processing) is not included because it has low priority (5-10 Marks). If you want to score good marks, study ALL Chapters. Please Note: The Above Analysis is suggest by Topper’s Solutions Team. Don’t be completely dependent on it. It may change as per University of Mumbai Guidelines. Copyright © 2016 - 2018 by Topper’s Solutions Allrights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed “Attention: Permissions Coordinator,” at the address below. Contact No: 7507531198 Email ID:
[email protected]
Website: www.ToppersSolutions.com1 | Introduction Semester -8 Topper's Solutions CHAPTER - 1: INTRODUCTION Qi] Explain Data Flow computers with example. Ans: [5M - May16 & Dect7] DATA FLOW COMPUTERS: 1. Data Flow Computer is one of the type of computer systems. 2. Indata flow computer, an instruction is executed whenever the operands are available. 3. Itdoes not have a program counter. 4. Indata flow computers, the program are graphically represented by Data Flow Graphs. 5. Itis used in parallel computing. Data Flow Graphs: 1. It is a graphical representation of a program or instructions. 2, ‘The nodes in the graph represents the operators. 3. The directed arcs represents the movement between the nodes. 4. Anarcis labelled with a token to indicate thatiit contains the data, 5. A token is generated on the output of a node. This process is also known as firing of the node, Example: 1. Consider the following set of instructions: A=B+C D=E+F G=BtC H=C/E 2. This instructions can be executed in many different sequences without affecting the data. 3. Data flow graph is shown below in figure 1.1. 4. The nodes n:, mz, ns, and ne can fire simultaneously generating outputs A, G, Hand D. Figure 4.4: Data Flow Graph. Page ofan1 | Introduction Semester 8 Topper's Solutions el Ans: PARALLEL PROGRAMMING MODEL: Explain the various types of Parallel Programming Models? [5M - Dect7] : Parallel programming model is an abstraction of parallel computer architecture. 2. programming model is the system that a programmer sees and users while developing a parallel program. 3. Parallel programming model are above the hardware and memory architectures. Figure 1.2 shows types of parallel programming models. Parallel Programming Model shared ssuge Threads Memory Model Passing Model —-Model'_ Parallel Model Figure 1.2: Types of parallel programming models. 1 Shared Memory Model: - Shared memory is based on control parallelism than cn data parallelism. > Inthe shared memory model, multiple processes execute on different processors independently. > But they share a common memory space. - > Due to any processor activity, if there is any change in any memory location, it is visible to the rest ofthe processors. > Figure 1.3 represents shared memory model. i Figure 1.3: Shared Memory Model. 7 ‘Advantages: - Process-communication overhead is negligible. > Iris very easy to learn. Disadvantages; _ > Itisnot portable. 2 > Managing data locality is very dificult. Page 2 of 102 —| Introduction Semestor 8 Toppers Solutions M1) Message Passing Model: > Message passing is the most commonly used parallel programming approach in distributed memory systems. > Im this model, alt the processors have their own local memory unit and they exchange data — through a communication network. > The data transfer between the processes is achieved by send and receive message. > Itrequires co-operation between every process. > There must bea receive operation for every send operation. : > Figure 14 represents message passing model. seo. sd = Seto : same. Figure 1.4: Message Passing Model. Advantages: > The data can be stored anywhere. > Cammunication between processes is simple. . > Programmers should take care that there is a receive function for every send function. ‘As compared to parallel shared-memory code, message-passing code generally needs more software overhead. Mm) Threads Mode: A thread is defined as a short sequence of instructions, within a process. > Different threads can be executed on same processor ot on different processor. If the threads are executed on same processor, then the processor switches between the threads ina random fashion. : Ifthe threads are executed on different processors, they are executed simultaneously. ‘The threads communicate through global memory. Figure 1.5 represents Threads model using one and ‘wo processors, Page 3 of 102 7Semester ~8 ‘Topper's Solutions re en = P| rwli20 ama ‘ = , rome Figure 1.5: Threads Model using one and two processor. Advantages: > Programmer need not have to worry about parallel processing. Disadvantages: > Care must be taken that no two threads update the shared resources simultaneously. IV) Data Parallel Model: > Data Parallelism is one of the simplest form of parallelism. > Here data setis organized into a common structure. > — Iteould bean array. > Many programs apply same operation on different parts of the common structure. > Suppose the task is to add two arrays of 100 elements store the resultin another array. > Ifthere are four processor then each processor can do 25 additions. > Figure 1.6 represents data parallel model. nex 100) * [100] ‘Z[100) Processor Processor 2 | | Processors Processor 4 For(1=0;1<25; 144) in) = X10) + YIN) For (1 25;1<50;1+4) 20) = x00 + YO For(1=50;1< 75:14) 2g = x10 + YIN) For (1=75;1<100;1+4) "au = x(a + YU) Figure 1.6: Data Parallel Model. Page 4 of 021 | Introduction Semester ~8 Topper's Solutions > Easier to write the program, we can have the statement to add two arrays like, Z= X + Y. Disadvantages: > Data parallelism is not possible, ifthe array element operations depends on each other. Q3]__ Explain in brief any three classification of parallel Architecture. Ans: [10M - Decs6] PARALLEL ARCHITECTUR! 1. Parallel Architecture extends the traditional computer architecture with a communication architecture, 2. The architecture of parallel processors can be classified as shown in figure 1.7. Parallel Architecture >, General Purpose Special Purpose Pipeline _Asynchrowous Data Flow Array systole ‘Neural Architecture Multi-processors Computers Processors Arrays Network Figure 1.7: Classification for Parallel Architecture. 1) Pipeline Architecture: > Pipeline isa set of data processing elements connected in series, where the output of one element is the input of the next one. > The elements ofa pipeline are often executed in parallel. : > Figure 1.8 shows phases of pipeline architecture. > It includes Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF) and Execution (EX). > Phases of pipeline architecture are independent of each other, so they can perform simultaneously. Instruction Instruction Fetch Decode Figure 1.8: Phases of Pipeline Architecture, Page ofto2 71 | Introduction Semester ~8 ‘Topper's Solutions 1 ronous Multi-processors: v Itis also known as conventional multiprocessors. > Asynchronous Multiprocessors system are based on multiple CPU's and memory banks. > Asynchronous multiprocessors includes: > Time Shared Common Bus; + Itis called as shared memory multiprocessors. = It can consists of more than one memory module, + Here the bus is replaced by switch. + Asswitch is used to converta memory to a CPU at an instance of time. Memory 1 Memory 2 Memory 1 ‘Switch cput cruz : pun + In message based multiprocessor, each CPU is associated with a memory module. + The CPU can communicate with each other through a connection network. put cpu2 pun Memory 1 Memory 2 Memory n [ Connection Network > Hybrid Approach: + Hybrid approach is @ combination of shared memory and message passing architectures. * Acommon bus architecture is used to access globa! memory and disk i/o. + Connection network is used to handle processor memory traffic. Page 6 of 021 | Introduction Semester ~8 Topper's Solutions = 7 . epua cpu2 run 4 te Memory. Memory > Memory a - — Connection Network Momory 1 Memory 2 Memory n > Cluster Based Computing: + Inclustering based computing, different nodes are connected through an interconnection network. : + Anode comprised of a Processor (P), Memory (M), 1/0 and Memory Buses (MB) and a Network Interface Unit (NIU). 1/0 Bridg 1/0 Bridge Interconnection Network MI) PataFlow Computers: > Refer Qa. IV) ArrayProcessors: > Array Processor is also known as Synchronous Multiprocessor. > — Itincludes multiple processing logical units > This logical units are known as processing elements. > Itcan operate in parallel. : > Figure 1.9 represents the array processor. Page 7 of 02 :1 | Introduction Semester - 8 Topper's Solutions Data Bus PE: Processing Element Inter PE Connection Network Figure 1.9: Array Processor. ¥) —Sustolic Arrays: > systolic Arrays are pipelines operating in multiple dimensions. > Itcan consists ofa set of interconnected processing elements (PE). - > Information flow is between PES in a pipelined fashion. > Communication with memory and 1/0 occurs at the boundary PEs. : > Figure 1.10 represents Systolic Architecture. > PE; canread from memory. > PEacanwrite into memory. Figure 1.10: Systolic Architecture, * Note: We have provided 5 Classifications, only three is asked in exam. Write according to it. Page Boftce :1} Introduction Semester ~ 8 Topper's Solutions Q4] Discuss in detail the various performance metrics in parallel computing Ans: [s0M ~ Deew7} PERFORMANCE METRICS FOR PARALLEL APPLICATIONS ‘There are a number of metrics, the best known are: > Speedup. > Bificiency. > Redundancy. : > Utilization. > Quality, D Speedup: Speedup isa measure af performance. It measures the ratio between the sequential execution time and the parallel execution time. _ gals Tp > Where, T (8) is the sequential execution time and T (P) is the parallel execution time. Example: Adding n numbers on an n processor hypercube: n T; = O(n), = en S=0 5 = O(n), T, = O(log n), aa MN) Efficiency: : > Efficiency is a measure of the usage of the computational resources. > It measures the ratio between performance and the resources used to achieve that performance. AA Ppl, Where, Sis the speedup for P processors. Example: Efficiency of adding n numbers on an n-processor hypercube.1 | Introduction Semester - 8 Topper's Solutions I) Redundancy: > Redundancy measures the increase in the required computation when using more processors. > It measures the ratio between the number of operations performed by the parallel execution and by the sequential execution. OC) R(p)= o0) > Where, 0 (1) is the total number of operations performed with 1 processor and 0 (p) is the total number of operations performed with p processors. IV) Utilization: Utilization isa measure ofthe good use of the computational capacity It measures the ratio between the computational capacity utilized during execution and the capacity that was available. U(p) = R(p)x E(p) V) Quality: a Quality is a measure of the relevancy of using parallei computing. (py = SLPxEtv) R(p) PERFORMANCE METRICS FOR PROCESSORS: ‘Some of the best known metrics to measure performance of a processor architecture: > > v ‘MAPS: Millions of Instructions per Second. ELOPS: Floating p ‘SPECint: processor performance on integer arithmetic, Operations per Second. ;PEC (Standard Performance Evaluation Corporation) benchmarks that evaluate ‘SPECfp: SPEC benchmarks that evaluate processor performance on floating point operations. Whetstone: Synthetic benchmarks to assess processor performance on floating point operations. Dhrystone: Synthetic benchmarks to assess processor performance on integer arithmetic. Page 10 of 021 | Introduction Semester ~8 ‘Topper's Solutions Q5] How Pipeline Architecture is different from Array Processor architecture Ans: [5M - Dees PIPELINE, ARCHITECTURE: 1. Pipelines a set of data processing elements connected in series, where the output of one element isthe input of the next one. 2, The elements of a pipeline are often executed in parallel. 3. Pipelining is a process of arrangement of hardware elements of the CPU such that its overall performance is increased. 4, Figure 1.11 shows phases of pipeline architecture. 5, It includes Instruction Fetch (IF), Instruction Decode (1D), Operand Fetch (OF) and Execution (EX). 6. Phases of pipeline architecture are independent of each other, so they can perform simultaneously. : Instrvtion Fetch Decode Figure 1.11: Phases of Pipeline Architecture. ARRAY PROCESSORS: 1. Array Processor is also known as Synchronous Multiprocessor. 2. Itincludes multiple processing logical units. 3. This logical units are known as processing elements. 4, Itcan operate in parallel, 5. Figure 1.12 represents the array processor. = il yo ET OM som a] eB] eS =e T } T ‘PE: Procesting Element : Figure 1.12: Array Processor. Page « of 102 :1| Introduction Semester ~8 Topper's Solutions DIFFERENCE BETWEEN PIPELINE ARCHITECTURE AND ARRAY PROCESSOR ARCHITECTURE 1 Parallel means simultaneous processing of a task on different set of processor to obtain result in fast manner. ‘This can be achieved by a set of computers connected in a network or processing task on a computer having multiple processors. Later method requires processor to access data from a shared memory. Array processors widely known as Vector processor corresponds to CPU Design in which CPU is implemented with instructions to work upon a one-dimensional arrays of data called as vectors. ‘These designs are typically referred as SIMD architectures, ‘Thus Vector processor is implemented by designing ISA of the processor to work on 1-D arrays of vectors. Page 12 of 1022 | Pipeline Processing Semester ~8 Topper's Solutions CHAPTER - 2: PIPELINE PROCESSING : Qu] Whatis the basic task of scheduler? Define i) Latency. ii) Initiation Rate. iii) Stage Utilization and iv) Forbidden Latency. Ans: [5M -May16] MEDULER: A scheduler is a software product. Itallows an enterprise to schedule and track tasks. ‘These units of work include running a security program or updating software. ‘The basic task of scheduler is to select one from the possible initiations in a pipeline system. Itis used to provide high performance. oa pe Te Figure 2.1: Reservation Table. LATENCY: 1. Latency is no. of time units between two initiations 2. In figure 2.1, the latency at Sz is 5 (te ~ti) and Ss Is 4 (ty~ts) INITIATION RATE: 1. _ Initiation Rate is average no. of initiations per clock unit. 2 Itis.a prime measure of performance ofa pipeline system. . 3. The larger the initiation rate, faster is the operation of the system. ‘STAGE UTILIZATION: 1. Stage Utilization is average no. of initiations in a stage. 2, Itis another measure of performance of a pipeline system. 3. In figure 2.1, the number of initiations in S1 is 1, Szand Ss is 2 and Ss1s 4. FORBIDDEN LATENCY: 1. Forbidden Latency isa set used to construct a collision vector. 2. The forbidden set is shown in figure 2.1 as (0, 1,2,3,4, 6} Page of 02 :2 | Pipeline Processing Semester - 8 Topper's Solutions Q2]_ Whatis an interlock? Explain the following three different classes of hazards: (i) Control Hazards. ii) Resource hazards. Gii) Operand hazards. Q3]_ Write a note on Pipeline Hazards. Ans: [Q2 | 10M — May16] & [Q3 | 10M — Dect6] INTERLOCK: 1. In non-pipelined system, the instruction starts executing, only after its previous instructioa completes its execution. 2, Inpipelined system, these instructions are overlapped. 3. The dependency of one instruction over the other causes hazards. 4, Interlock technique is used to detect and resolve the hazards. : 5, Itisahardware technique. 6. An interlock is a feature that makes the state of two mechanisms or functions mutually dependent. 7. Figure 2.2 shows the example of interlock. : Figure 2.2:Example of Interlock. 8 As shown in figure 2.2, bubble condition is known as interlock. PIPELINE HAZARDS: - 1. Inaninstruction processing pipeline, the instructions are executed overlapped. = 2, The control system must be designed such that, though the instructions are executed other than 7 the given order, the behaviour of the program should not be changed. Page tof 02 =2 | Pipeline Processing Somestee-8 Topper's Solitons 3. The problems that occur during the working of a pipeline is generally termed as hazards or : pipeline hazards. Pipeline Hazards are situations that prevent the next instruction in the instruction stream from executing in its designated clock cycle. 5. Hazards reduce the performance from the ideal speedup gained by pipelining. CLASSES OF HAZARDS: 3 Control Hazards: It is also known as branch hazards. Itis mostly caused by branches. Control hazards occur when we don’t know which instruction to execute next. Itcan cause a greater performance loss, It is cause by jump instructions. vvvvvy Strategies for dealing with control hazards are: + Stall. + Flush, Mm) Resource Hazards: Wtisalso known as structural hazards. It occurs when two or more instructions uses the same resources. It is usually caused due to non-availability of the resources. For example, non-availability of adder. vvvvy Strategy for dealing with resource hazards is to have a separate caches for instructions and data. . I) Operand Hazards: s Its also known as data hazards. When two instructions read an operand simultaneously the there exists no problem, But when any one or both of them write to an operand, then it can cause a hazard. Due to this, the output of the program may change. It occurs when any operand is accessed at modified by two or more instructions, vvvvyy There are three situations in which a data hazard can occur: + Read After Write (RAW), a true dependency. + Write After Read (WAR), an anti-dependency. * Write After Write (WAW), an output dependency. Page 5 of 102 i2| Pipeline Processing Semester ~ 8 Topper's Solutions Q4] Explain different types of Pipeline Hazards and the techniques used to eliminate those hazards Qs] How pipeline hazards are classified? Discuss data hazard in detail and list the techniques used to eliminate data hazard ‘Ans: [Q4 | 10M — Dect7] & [Q5 | 10M — May17] PIPELINE HAZARDS: Refer Q3. CLASSES OF HAZARDS: Refer Q3. RESOLVING PIPELINING COMPLICATIONS: In order to resolve or remove data hazards effectively we can follow these effective ways. 1) Instructions Reordering: > Re-ordering technique is very simple and efficient way to remove some data hazards that occur during execution instruction in pipelined. > Many cases occur where reordering may affect the execution because some time order of the execution matter. > Followingis an example of instruction containing data hazard or data dependency. > Example: 1: R8ER7XR7 I: RTE RB+R3 I: R#@R5-RO > There exists dependency between instruction I and instruction Il because value of register RB become invalid during pipelined execution and this dependency can be eliminated very efficiently by re-ordering technique as follows. > Re-ordered Instructions: I RB ER7XR7 Ik RAE RS-RO Mk R7 © RB+RE > Now each instruction can proceed independently without any dependency. Page 6 fon2| Pipeline Processing Semester ~8 ‘Topper's Solutions W) Data Forwarding or bypassing: : > Data forwarding also known as bypassing. > Its an efficient way to solve data hazards in pipelined instruction execution. > In the data forwarding or bypassing technique, normal processor is updated with special hardware, 7 > An this technique, the result of one stage Is forwarded before complete execution of particular instruction, > Where the resultis require itis directly pass to that pipeline stage. > Inthe forwarding there isno restriction from which stage data s transfert next every next stage. : For example data is passed from EX/MEM pipeline register to ALU stage of other pipeline or data, is forward through instruction decode stage to instruction execution stage directly. > Example: I: ADD R3,R2,R1 I SUBR4,R3,RS > Inthis example here is a dependency between ADD and SUB instruction. % Inthe Ast instruction register R3 is written and in the 2nd instruction register R3 is read. > Here hazard occur if instruction Il is complete before 1st instruction, Time (clock cycles) 1 : n IF HOR EX imem! wei s L i 7 JADD R3,R2,R1L= ff g 4 o SUBR4R3,R5 UP HIRE I 1 : iti q i i : r . > Firstinstruction will be in executing stage when second instruction will be decoded. - v Although the destination operand and source operand of both instruction is same. So to remove this hazard, data is forward from the EX/MEM pipeline register of ADD instruction to Sub instruction ALU stage. 1) Pipeline stalls > Data hazards can also be removed by inserting stalls or alter the normal flow of execution. > Stallsare inserted to skip one stall cycle and instruction is waiting until other same instruction or depended instruction complete or data hazard is chance is leave. The simplest way to fix the hazard is to stall the pipeline. : Stalling involves blocking flow of instructions unt the result is ready to be used. Figure 2.3 shows pipeline stall, Page 7 f022 | Pipeline Processing Semester 8 Topper’ Soetions WW) > v Time (clock cycles) 1 a tlaoo [fF 6 o| seq r a ¢ |Targetinst. Figure 2.3: Pipeline Stall. Compiler based Scheduling: Compiler based scheduling is also a technique that is used to remove hazard efficiently. Compiler first detects the Hazards then analyzes the instruction where dependencies or data hazard occur, NOP or bubbles are inserted by the compiler between these instructions that has dependencies. Example: Here is an example of compiler based scheduling technique. 1: LWR2,0(R4) Te MULR2,R2,R2 Mi: SWR2,0(R4) Inthis example many dependencies exist, compiler inserts bubbles or no operation instruction as follows. 1 LWR2,0(R4) Nop Ti: MULR2,R2,R2 NoP NoP Ii: SWR2,0(R4) So by inserting NOPs data hazards can be solved easily. Register Renaming: Pipelined issue of Data hazards can be solved through register renaming that is used to remove false data dependencies b/w instructions in running state. Register operands of instructions are renamed. Register renaming can reduce the impact of WAR and WAW dependencies. WAR and WAW both are data hazards, Page Bofte22 | Pipaline Processing Semester ~ 8 Topper's Solutions Q6] Explain a method of Dynamic Instruction scheduling for minimizing hazards Ans: [5M — Dect] DYNAMIC INSTRUCTION SCHEDULING 1. Data hazards in a program cause a processor to stall 2. With static scheduling the compiler tries to reorder these instructions during conipile time to reduce pipeline stalls 3. With dynamic scheduling the hardware tries to rearrange the instructions during run-time to reduce pipeline stalls. 4, major limitation of the pipelining techniques is that they use in-order instruction issue, fan instruction is stalled in the pipeline, no later instructions can proceed. Thus, if there is a dependency between two closely spaced instructions in the pipeline, it will stall. 7. Forexample: Divb FO, F2, Fa ‘ADDD F10, FO, F8 SUBD F12, F8, Fla 8 SUBD instruction cannot execute because the dependency of ADD on DIVD causes the pipeline tostall. 9, YetSUBD is not data dependent on anything in the pipeline. 10. This is a performance limitation that can be eliminated by not requiring instructions to execute inorder. 11. Toallow SUBD to begin executing, we must separate the instruction issue process into two parts: checking the structural hazards and waiting for the absence of a data hazard, 12. Wecan still check for structural hazards when we issue the instruction; thus, we still use in order instruction issue. 13. However, we want the instructions to begin execution as soon as their data operands are available. 14. Thus, the pipetine will do out-of-order execution, which implies out-of-order completion. 15. Inintroducing out-of-order execution, we have essentially split the ID pipe stage into two stages: a. Issue: Decode instructions, check for structural hazards; b. Read operands: Wait until no data hazards, then read operands. 16. An instruction fetch proceeds with the issue stage and may fetch either into a single-entry latch or into a queue; instructions are then issued from the latch or queue. 17, The BX stage follows the read operands stage, just as in the DLX pipeline. 18. As in the DLX floating-point pipeline, execution may take multiple cycles, depending on the operation. Page 19 of to22 | Pipeline Processing Semester ~8 Topper's Solutions 19. Thus, we may need to distinguish when an instruction begins execution and when it completes execution; between the two times, the instruction isin execution. 20. This allows multiple instructions to be in execution at the same ime. 21, Dynamic scheduling includes score boarding and tomasulo's algorithm. 1) Scoreboarding: 1. Scoreboarding is a technique for allowing instructions to execute out of order when there are sufficient resources and no data dependencies. 2, Itisnamed after the CDC 6600 scoreboard, which developed this capability. 3, The goal of a scoreboard is to maintain an execution rate of one instruction per clock cycle (when there are no structural hazards) by executing an instruction as early as possible. 4, Thus, when the next instruction to execute is stalled, other instructions can be issued and executed if they do not depend on any active or stalled instruction, 1) Tomasulo’s Approach: 1, Tomasulo’s Approach is another scheme to allow execution to proceed in the presence of hazards developed by the IBM 360/91 floating-point unit. 2. This scheme combines key elements of the Scoreboarding scheme with the introduction of register renaming, Q7l_ Explain a pipelined multiplication using Digit Products of Fixed Point Multiplication Pipeline. Ans: [10M ~ May16] FIXED POINT MULTIPLICATION PIPELINE USING DIGIT PRODUCTS: 1 A pipelined multiplier based on the digit products can be designed using digit product generation logic and the digit adders. Consider the example for decimal multiplication. Let the two numbers be 25 and 35. ‘The partial products of the digits of the numbers 25 and 35 are filled in a 2.x 2 matrix as shown in Figure 2.4. Forn digit numbers matrix size will be n xa. ‘The elementin the i row and the jt coiumn holds the product of two digits a; and by of numbers Aand B respectively. ‘The numbers formed out of these digit product are added as illustrated in the Figure 2.2 to form the product of A and B. Page 20 of 1022 | Pipeline Processing Semester —8 Topper's Solutions Pp NAA - ‘Add the number along the lagonals 1 58 +06 2 5 se Figure 2.4: Illustration of Multiplication using Digit Product. 8 Based on the principles of multiplication as shown in figure 24, a pipelined multiplier is presented in figure 2.5. 9. Since the numbers are binary, digit products Py are given by a and by, 10. The multiplier architecture shown in figure 2.4 are quite general and binary bits @i and bj could be replaced by digits of any radix. Oigt Proust Generate Figure 2.5: Multiplier based on Digit Products. Page 24 of 02 i2 | Pipeline Processing Semester ~8 Topper's Solutions 11. FP multiplication involves the following three major steps. a. Multiplication of fractions b, Addition of exponents. Normalization of the result. Q8]__ Define various pipeline performance measures. Ans: [5M - Dect6} Various pipeline performance measures are shown in figure 2.6 below. Pipeline Performance Measures EMicieney Speedup ‘Throughput optimal Pipe Segmentation Figure 2.6: Performance Measures in Pipeline. 1D. Efficiency: > Efficiency is the ratio of energy used while execution othe total energy. > ficiency in pipeline is given by ee Gmtn-Dn (tay > ‘Where ‘m’ are the instructions and ‘n’ are no. of stages. > Energy used =m xn > Total Energy =(m+n-1)xn 1) Speedup: > Speedup is the ratio of the time taken by a non-pipelined system to that of pipelined system. Speedup in pipeline is given by: mn &* Gena > Time taken by non-pipelined system =n xm. > Time taken by pipelined system = (m+n 1) m1) Throughput: > Throughputis defined as the number of tasks that completes execution in one unit of time. > Throughput in pipeline is given by: mn men Dts v Where ts is the clock time. Page 22 of 1022 | Pipeline Processing Semester ~ 8 Topper's Solutions W) optimal Pipe Segmentation: > tis the task of dividing the pipe into different stages. > Optimal Pipe Segmentation in pipeline is given by rk mt Dee the time to execute an a non-pipelined system, > Where oT + ‘Disthe latch delay. + ‘isthe cost. the constant. Qo] Explain with example Amdahl's law for measuring speed up performance of parallel systems Quo] State and prove Amdaht’s Law to compute speedup of parallel computers. From experiment it was verified that 70% of execution time was spent on parallel execution. What is the maximum speedup that can be obtained with 16 processors? Ans: [Q9 | 5M- Dec16] & [Q10 | 5M - Mayz7] “AMDAHL'S LAW: 1. Amdahl's Law is a law governing the speed up performance of parallel system. 2. Itisa formula used to fin the maximum improvement possible by improvinga particular part of : asystem. 3. Inparallel computing, Amdah’s law is mainly used to predict the theoretical maximurn speedup : for program processing using multiple processors. It is named after Gene Amdahl, a computer architect from IBM and the Amdahl Corporation. 8. Amdahl's law can be formulated the following way: 1 Ss ne 6. Where f= sequential fraction for a given program & is no of threads. Proolt : > Assuming that total time isT, then the sequential component of this time will be fx T. = > The parallelizable fraction of time is therefore (1 -)xTT. Page 25 of 1022| Pipeline Processing Semester -8 Topper's Solutions > The time (1 ~ f) x T can be reduced by employing n processors to operate in parallel to give the time as (1 -f)xT/n, > This time cannot be reduced further. > The total time taken by the parallel computer thus, is at least fx T + (1 -) x T/n, while the sequential processor takes time T. > The speedup S is limited thus by: Ss. Tf +0. 1 ss————_ f+0-fin > Figure 2.7 shows the example of Amdaht's law for measuring speed up performance of parallel systems. ‘Amdaht's Law ‘speeuup : “TER SERREREEREG Figure 2.7: Example of AmdahI's law. EXAMPLE: From experiment it was verified that 70% of execution time was spent on parallel execution. What is the maximum speedup that can be obtained with 16 processors? Given: P = 0.70 af=1-070=030 16 ‘To Find: Maximum Speed Page 24 of 022 | Pipeline Processing Semester 8 ‘Topper's Solutions ‘Solution: Amdahl's law can be formulated the following way: 1 Ss—aH pep . oD 1 G03) 030 + G=830) Therefore, 1/ (0.3 + 0.04375) = 2,909 Qu} Mlustrate the parallel Algorithm for matrix multiplication and compare the performance of this algorithm with sequential matrix multiplication algorithm Ans: [10M — May17] PARALLEL ALGORITHM FOR M: MULTIPLICATION A matrix is a set of numerical and non-numerical data arranged in a fixed number of rows and column, 2. Matrix multiplication isan important multiplication design n parallel computation. 3. Let consider the implementation of matrix multiplication for parallel algorithm on communication networks like mesh. 4. Mesh have higher network connectivity so they allow faster algorithm than other networks like ring network. Mesh Neswork: > Atopology where a set of nodes form a p-dimensional grid is called a mesh topology. - > Here,all the edges are parallel tothe grid axis and all the adjacent nodes can communicate among : themselves. Total number of nodes = (number of nodes in row) x (number of nodes in column) > Amesh network can be evaluated using the following factors: = Diameter. * Bisection width, ‘Matrix Multiplication Using Mesh Network: 7 > Consider a 2D mesh network SIMD model having wraparound connections. Page 25 of 1022| Pipeline Processing Semester -8 Topper's Solutions > Now we will design an algorithm to multiply two n x n arrays using n? processors ina particular amount of time. > Matrices A and B have elements ay and by respectively. Processing element PEs represents ay and by > Arrange the matrices A and B in such a way that every processor has a pair of elements to multiply. > The elements of matrix A will move in left direction and the elements of matrix B will move in upward direction. > These changes in the position ofthe elements in matrix A and B present each processing element, PE, a new pair of values to multiply. Stagger two matrices. > Calculate all products, aik x bli > Calculate sums when step 2 is complete. Example: er be Procedure Matrinults Begin for k= 2 to mi for all Pij; where 4 and 3 ranges from i ton Afi is greater than k then rotate a in left direction end at ig 3 4s greaver than x then rotate b in the upward direction ena if for all Pij ; where i and 3 lies between 7 and n compute the product of @ and b and store it ine for k= 1 to nl step 2 for all Pi;} where 4 and 3 ranges from 1 ton rotate @ in left direction rotate b in the upward direction cmctax End BL ale B2] _ [Al1A2+B1C2 A1B2+B1D2 D1. C2 D2. C1A2+D1C2 C1B2 +D1Dz2. Page b of022 | Pipeline Processing Semester 8 Topper's Solutions COMPARISON ON PERFORMANCE OF SEQUENTIAL V/S PARALLEL ALGORITHM: oo moe me Figure 2.8: comparison between sequential and parallel algorithm. > Theperformance of these algorithms can be analyzed by considering the number of comparisons, average running time and speed up. > Figure 2.8 shows the number of comparisons performed. Itshows that the parallel algorithm performs better over sequential algorithm, due to the use of parallelism. Qu2] A machine is run on many applications the instruction mix is collected. Loads/Store are 10%, Integer add/sub 15%, FP add/sub 50%, FP multiply divide 5% and others 5% and branches 15%. The clock cycles consumed by these instructions are: Loads 2, Integer add/ sub 1, FP add/sub 5, FP multi divide 20, others 1, Find which component of the architecture requires enhancement first, After incorporating the enhancement which makes clock eycles requirements as = 2. Find the overall Speed? Ans: [10M - May16] ‘The table 2.1 illustrates the problem. Table 2.1 ILoad/Store [integer Aad/Sub FP Add/Sub (FP Mul/Div (Branch ‘others = frotal Page 27 of 02 i2.| Pipeline Processing Semester - 8 ‘Topper's Solutions Tofind: Overall Speed. Solution: Clock Per Instruction (CPI) is given by total frequency / total no. of clock cycles. (cl) = 405/100 = 4.05 (Original CPI) As given, FP Add/Sub/Mul Div requires 2 clock cycles. So the CPI is given by: CPL =(20+ 15+ ((50+5)*2)+15+5) / 100... Since 50 & 5 are FP component) = 165/100 = 1.65 (After Enhancement) ‘Thus the Overall Speed is given by = CPI (Original) CPI (After Enhancement) =4.05/ 1.65 ‘Therefore, Overall speed = 24545 Page 28 of 10251 Synchronous Parallel Provesing Semester ~ 8 Tapper's Solations CHAPTER - 3: SYNCHRONOUS PARALLEL PROCESSING Qt] What is SIMD Architecture? Explain with example SIMD Mesh Connected Architecture @2] Give one example that can be solved effectively with an SIMD architecture Ans: [Q1| 10M - May16] & [Q2 | 10M — Dec16] iS SIMD stands for Single Instruction, Multiple Data. Itis a type parallel computers in Flynn's taxonomy. Single Instruction: All processing unit execute same instruction at any given clock cycle. Multiple Data: Each processing unit can operate on a different data element. Itis used in vector supercomputers. SIMD ARCHITECTURE: 1. Figure’3.1 shows the typical SIMD Architecture. 2, InSIMD Architecture, the processor operates synchronously. 3. Aglobal clockis used to ensure lockstep operation. Shared Memory Data Streams Instruction Streams Control Unit Figure 3.1: SIMD Architecture. ‘SIMD Example: Add two matrices C= A+B Say we have two matrices A and B of order 2 and we have 4 processors, i. we wish to calculate: c11=A11+B11 21 =A21 +821 c12=A12+ B12 22 =A22+ B22 The same instruction (add the two numbers) is sent to each processor, but each processor receives different data. Page 29 of 10231 Synchronous Parallel Processing Semester ~ 8 Topper's Solutions ‘SIMD MESH CONNECTED ARCHITECTURE: 1, Example of SIMD Mesh Connected Architecture is shown ir Figure 3.2. 2, In SIMD Mesh Connected Architecture, each Processing Element (PE) is connected to four - adjacent PEs. 3. Ttincludes 4 four ports for communication. 4. ‘The port are named as left, right, top and bottom port. 5. Ifnetworkhas N rows and N columns of PEs, then the connection ofthese ports is as follows: 6 ForanyPE (i,j) Qsi,jsN-1 a. LPORTis connected to PE (i (j- 1) mod N) b. RPORT is connected to PE (i, (+1) mod N) € TPORTis connected to PE ((i- 1) mod N,j) 4. BPORTis connected to PE ((i+1) mod N,j) 1 To PEs, To PEs, To PEs,2 t To PEs,5 To PEy,3 To PEo,9 = | PEoo | re: | eo] re | => => To PE;,5 > | PE “bEelet fe. Sd To PE, = PE20 = | P| | | = |e | - To pre 3 To ae 0 ree Jes | ee | | | || Jr. PEpo J» PE J» PEp.2 To PEo,3 Figure 3.2: SIMD Mesh Connected Architecture Example. Page 30 of 02 ie3.1 Synchronous Parallel Processing Semester - 8 Topper's Solutions Qs] Explain Matrix Multiplication on SIMD Ans: {10M - Deet7] MATRIX MULTIPLICATION ON SM 1. Amatrixis a set of numerical and non-numerical data arranged in a fixed number of rows and column, SIMD stands for single instruction multiple data SIMD Matrix multiplication is an important multiplication design in parallel computation. SIMD Matrix Multiplication Algorithm is one of the widely used algorithm. We have considered a 2 mesh network SIMD madel having wraparound connections. Let A and B be two matrices with sizen xn and C be the result matrix. Matrices A and B have elements ay and by respectively. Processing element PEy represents ay and by. Per annnrwn Arrange the matrices A and B in such a way that every processor has a pair of elements to multiply. 10. The elements of matrix A will move in left direction and the elements of matrix B will move in upward direction, 11. These changesin the pasition of the elements in matrix A and B present each processing element, PE, a new pair of values to multiply. 12, Tomultiply two nxn matrices, on a sequential computer, it takes O (n*) time complexity. STEPS IN ALGORITHM: Distribute i row of matrix A and i** column of matrix B to PE| where 1
my Ww) v vp vy vin) vvy Reliability is an attribute of any computer-related component that consistently performs according to its specifications, Distributed Systems should be reliable than centralized systems. Reliability includes: = Fault Avoidance: The system should be designed in such a way that the occurrence of faultis minimized, + Fault Tolerani in the occurrence of a fault the system should be able to continue functioning. + Fault Detection and Recovery: Hardware and software mechanism should be in place to detect and correct the faults. Flexibility: Flesibitity is considered asthe ability which can be easily modified. It includes: + Ease of modification: It should be easy to incorporate changes in the system. + Ease of enhancement: it should be easy to add new functionality into the system. ‘The performance should be atleast as good as a centralized system. Scalability: A distributed system should be scalable with respect to the growth of nodes and users in the system. Heterogeneity: A heterogeneous system consists of interconnected sets of dissimilar hardware or software or both, the system should be designed in such a way that it should cope with the heterogeneous environment, Security: Security is one of the most difficult jobs in a dstrityuted environment. But thas to be achieved. It includes: * Confidentiality: Protection against disclosure to unauthorized person. + Integrity: Protection against corruption and alteration. = Availabilit Keep the resources accessible. ‘Openness: Itis also known as Directness. ‘The distributed system should be open. ‘An open distributed system is a system that offers services according to standard rules. It is used to describe syntax and semantics of services used. Page 37 of 024 | Introduction to Dis. Systems Semester ~ 8 Topper's Solutions Q4]l_ What are the different models of middleware? Ans: [5M - May16] Middleware is computer software that provides services to software applications beyond those available from the operating system. = ‘MODELS OF MIDDLEWARi 1) Client Server Model: > Client Server Model is most widely used Model in Middleware. > Itis used for communication between processors. > —_Inthis model, one process acts as a server while all other processes acts as a clients. > Clients request for the services. > Server provides the services to clients. > Figure 4.1 shows client server model. client Figure 4.1: Client Server Model. 1) Vertical Distribution Model: Itis also known as Multi-Tier Model It is an extension of client server model. This model includes multiple servers. The client request is directed to first server. This requestis proceed to next server, until the final server is reached. vvvyvvy Figure 4.2 shows Vertical Distribution Mode. Database Server Reply Request ‘Application Server Reply Request lent : Figure 4.2: Vertical Distribution Model. Page 38 of 102 i4 | ntroduction fo Dis. Systems Semester ~8 Topper's Solutions mm > > > vVvVyy Horizontal Distribution Horizontal Distribution Model is used to improve scalability and reliability. It involves replicating a server's functionality over multiple computers. In this model, each server machine contains a complete copy of all hosted web pages and client's, requests are passed on to the servers. Figure 4.3 shows horizontal distribetion model, Front end iesalie Requests Replicated web servers each = Handledin Containing the same web pages quests Round robin fashion Figure 4.3: Horizontal Distribution Model. Peer-to-P. Peer-to-Peer Model is a decentralized communication model. In this model, each node functions as both a client and server. It can request the services as well as send a respond to the request. Example of Peer-to-Peer Model is Collection of PCs in an office or home. Figure 4.4 shows the Peer-to-Peer Model. Figure 4.4: Peer-to-Peer Model, Page 39 of 02 b.4 | Introduction to Dis, Systems Semester ~8 Topper's Solutions Vv) Hybrid Model: : > Hybrid Model can be combination of any of the above models. > Some of the examples of Hybrid Models are: + Super-peer networks: It is combination of client server and peer-to-peer model. Example is BitTorrent. + Edge-server networks: In edge server networks, servers are placed at the edge of the internet. Example is at Internet Service Provider (ISP), the home users access the nearby ‘edge servers instead of the original servers. * Note: The above answer is written for 10 Marks. Minimize the answer for 5 Marks as per the understanding, Qs] _ Explain in brief the software concept of distributed systems Ans: [10M — Dect6} SOFTWARE CoNcEPT: Software concept in distributed systems includes: D istributed ing System: > Distributed Operating System are referred as Loosely Coupled Systems. > Distributed Operating System is a model where distributed applications are running on multiple computers linked by communications. > —_Adistributed operating system is an extension of the network operating system. It supports higher levels of communication and integration of the machines on the network. 2 > Figure 4.5 shows the example of Distributed Operating System. Machine A Machine Machine ¢ . Distributed applications Distributed operating Sytem Services Kernel Kernet ornel ‘Network : Figure 4.5: Distributed Operating System. Page of aa4 | Introduction to Dis, Systems Semester — 8 ‘Topper's Solutions Goal: To hide and to manage hardware resources. tributed Operating Systems provide the following advantages: Sharing of resources. Reliability Communication, Computation speedup. ‘Network Operating System: Network Operating System are referred as Tightly Coupled Systems. ‘An operating system that provides the connectivity among a number of autonomous computers {s called a Network Operating System. It includes special functions for connecting computers and devices into a \ocal-area network (LAN) or Inter-network, ‘Some popular network operating systems are Windows NT/2000, Linux, Sun Solaris, UNIX, and IBM 08/2. Figure 4.6 shows the example of Network Gperating System. Machine A Machine B Machine ¢ Distributed applications ‘Network 0S Network 05 ‘Network OS Services Services Services Kernel Kernel Kernel Network Figure 4.6: Network Operating System. Goal: To offer local services to remote clients. Network Operating Systems provide the following advantages: 1 2 o 4 Centralized servers are highly stable. Secutity is server managed. Communication. Remote access to servers is possible from different locations. Page 44 of 1024 | Introduction to Dis. Systems Semester ~8 Topper's Solutions : MM) Middleware: - > Middleware is an additional layer at the top of Network Operating System. > Its used to implement general purpose services. > Figure 4.7 shows the example of Middleware Operating System. : Machine A Machine 8 Machine Distributed Applications eed ie Midateware Services ‘NerworicoS ‘Network OS ‘Network OS Kernel Kornel Kernel ‘Notwork Figure 4.7: Middleware Operating System. Goal: To provide distribution transparency. Middleware Services: = Communication Services. = Information System Services. = Control Services. = Security Services. : Page 42 of t02 =4 | Introduction to Di, Systems Semester -8 Toppers Soetions Q6] Describe Architectural Model of Distributed System with neat diagram Ans: tio - Dex} DISTRIBUTED SYSTEM: 1. A distributed system is a collection of independent computers that appear to the users of the = system as a single computer. 2. Example is World Wide Web. ARCHITECTURAL MODEL: D Layered Architecture: > The basic idea for the layered architecture is that all the components are organized in a layered manner, Where component at any layer is allowed to call components at its underlying layer. ‘A fundamental observation is that control generally flows from layer to layer, ie, requests go 2 down the hierarchy whereas the results flow upward. > Figure 4.8 represents layered architecture. Layer N = Layer N= Request Flow espouse Flow i Layer Figure 48: Layered Architecture. M1) Qbiect-based Architecture: > Object based architecture uses Remote procedure call mechanism for communication. > In the object based architecture, each component or abject is connected through a remote procedure call mechanism. > Thus, any object can call to any other object in the system and hence the called object can return data or information to the calling object. > Figure 4.9 represents object-based architecture. Page 43 of t02 :4 | Introduction to Dis. Systems Semester ~ 8 Toppers Solutions mm, I) 2). eee }-—-[D_ ome Figure 4.9: Object-Based Architecture. Data-Centered Architecture: In data-centered architecture, server or database lies at the center of the architecture, Clients are placed around the server. ‘Thus centered server provides data or information to different clients of the system as shown in figure 4.10. Figure 4.10: Data-Centered Architecture. Event-Based Architecture: In event-based architecture, processes basically communicate or connect through the transmission of events, which also carry data or information, ‘The fundamental idea is that processes announce events. After announcement of events, the middleware confirms that only those processes that subscribed to those events will receive them. ‘The main advantage of event-based distributed system is that, processes are loosely coupled or they are simply distributed. Figure 4.11 represents event based architecture. Component Component Tt. Figure 4.11: Event-Based Architecture, Page 44 oft024 | Introduction to Dis, Systems Semester ~ 8 Topper's Solutions ~—- EXTRA QUESTIONS — Distributed Computing System & Models. DISTRIBUTED COMPUTING SYSTEM: 1 istributed system is a collection of independent computers that appear to the user’ of the system asa single computer. 2. Example is World Wide Web. 3. Features of Distributed Computing System: a. Multiprocessor System. b. Processors are geographically apart. Communication is by message passing. 4. Coordination among the processors to the specific task. MODELS: Mini computer model is simple extension of centralized time sharing system. In this model, several mini computers are interconnected by a communication network. > > > Several interactive terminals are connected to each minicomputer. > This networkallowsa user to access remote resources, > In this model, the ferminals which ave interconnected to minicomputer shares the load of resources. > ARPAnetis the example of a minicomputer model. > Figure 4.12 represents Mini Computer Model ee rete 4 Figure 4.12: Minicomputer Model. NW) Workstation Madel: > In this model, several workstations are interconnected to a communication network. > —_ Inthis the terminals does not shares the load of resources. Page sp fa4 | Introduction fo Dis, Systems Semester ~8 Topper's Solutions ™ vvvvy ‘The idea of this model is to interconnect all the workstations by high speed LAN. Example is a company’s office may have several workstation scattered throughout an organization. Figure 4.13 represents Workstation Model. ‘Workstation Workstation Workstation ‘Communication ‘Workstation ra Workstation Workstation Workstation forkstation Model. wre 4: ‘This model is combination of minicomputer model and workstation model. In this model, several workstations and mini computers are interconnected to a communication network, A workstation model isa network of personal workstation each with its own disk and a local file system. Workstation with its own local disk is called as diskful workstation Workstation without a local disk is called as diskless workstation. Minicomputer offers services such as database service and print service. Example: The V system. Figure 4.14 represents Workstation Server Model. Workstation Workstation Workstation Workstation Couaanication Workstation Minicomputer Minicomputer ‘Mintcomputer used as File used as Database - | used as Print ‘Server Server ‘Server Figure 4.14: Workstation Server Model. Page 46 of 024 | Introduction to Dis, Systems Semester ~8 Topper's Solutions Advantages of Workstation-Server model to Workstation model: > > > i) v Cheaper. Backup and hardware maintenance is easier. Flexibility to use any workstation. Processor Pool model: Itis better than workstation model In this model, several terminals and pool of processor are interconnected with a communication network, Processor pool model is used when large amount of computing power is requited for ashort time. Ithas better utilization of processes. ‘The pool of processer consists of large number of microcomputers and minicomputers attached to the network. Each processor in the poo! has its own memory toload and run a system program, Example: Cambridge distributed computing system. Figure 4.15 represents Processor Pool Model. u \ Pootor Processors Figure 4.15: Processor Pool Model. ‘The workstation-server model is the most widely used model. ‘The processor-pool model is used for when you have large number of users and often used to perform jobs needing massive computation. ‘The hybrid model is based on workstation-server model but with the addition of a pool of processors, which can be allocated for computation dynamically. ‘The advantages of both workstation model and processor pool model are combined and thus formed a hybrid model ‘This model Page 47 of t025 | Communication Semester -~8 Topper's Solutions CHAPTER : COMMUNICATION Qi] Explain the concept of Remote Procedure Call Q2] Define a Remote Procedure Call. Explain the working of RPC in detail Ans: [Q1 | 10M - Dec16) & (Q2 | 10M - Mayt7] REMOTE PROCEDURE CALL: 1, Remote Procedure Call is as known as Remote Function Call or a Remote Subroutine Call. 2, It is a protocol in which one program can use to request a service from a program located in another computer on @ network, 3. RPC provides a general IPC protocol that can be used for designing several distributed applications. 4. Features of a RPC for distributed applications are: a. Simple call syntax. b. Familiar semantics Ease of use. 4. Generality. e. Efficiency. GENERIC RPC MoD caller cal (Client Process) (Server Process) Cat Procedure and ‘waitfora reply Poteet Moscone Receives Request and start procedure execution Procedure Executes Send Reply and wait For next request i | ResumeExecution | we? Figure 5.f: Generic RPC Model. 1. Figure 5.1 shows the generic RPC Model. 2. The basicidea of RPCis to make a remote procedure call look transparent. 3. The calling procedure should not be aware that the called procedure is executing on a different machine Page 48 of 025 | Communication Semester ~ 8 Topper's Solations 4, RPCachieve the transparency in analogous way. 7 5. The caller (client process) sends a call (request) message tothe callee (server process) and waits for the reply. 6. The request message contains the remote procedures parameters, among other things. o 7. ‘The server process executes the procedure and then returns the result of procedure execution in a reply message to the client process. 8 Once the reply message isreceived, the result of procedure execution is extracted, and the caller's execution is resumed. 9, Ithas no idea that work was done remotely instead of the local operating system. 10. _ Inthis way transparency is achieved. RPC MODI Figure 5.2 shows the RPC Model. Gent Machine Server Machine Result Packet Figure 5.2: RPC Model. r RP : 1, Toachieve the goal of semantic transparency the implementation of an RPC mechanism is based onthe concept of STUBS, 2. Stubs provide a local procedure call abstraction. The implementation of an RPC mechanism usually involves the following five elements. Page 4g of 102 t5 | Communication Semester ~8 Toppers Solutions Client: The user process that initiates a remote procedure call Client Stub: It is responsible for: On receipt ofa call request from the client, it packs a speeification of the target procedure and the arguments into the message. b. On receipt ofthe result of procedure execution, it unpacks the result and passes it to the lent 6 RPCRuntime: Ithandles transmission of messages across the networkbetween client and server machines including encryption, routing acknowledgement. 7. Server Stub: The job of the server stub is very similar to client stubs. 8 Server: The server executes the appropriate procedure and returns the result Q3]_ Explain Call Semantics of RPC Ans: [10M - Dect7] RPC CALL SEMANTI 1. InRPCthe caller and callee processes can be situated on different nodes. 2. The normal functioning of an RPC may get disrupted due to one or more reasons mentioned below: a. Call message is lost or response message is lost. b,_ The callee node crashes and is restarted. c Thecaller node crashes and is restarted 3. In RPC system the call semantics determines how often the remote procedure may be executed under fault conditions. 4. The different types of RPC call semantics are shown below. [RPC call Semantics May-Be LastOnce lato Many AldeastOnce Exactly Once 1) Possibly or May-Be Call Semantics: > Thisis the weakest semantics. > ItisaRequest Protocol > Itisan Asynchronous RPC > In May-be call semantics, a timeout mechanism is used that prevents the caller from waiting indefinitely for a response from the calle. > This means that the caller waits until a pre-determined timeout period and then continues to execute, Page 50 of 1025 | Communication Semester ~8 Topper's Solutions v vvvvy wy WwW) vrvyvyvs Hence this semantics does not guarantee the receipt of call message nor the execution. ‘This semantics is applicable where the response message is less important, It is Request / Reply protocol. Retransmission based on timeout. After time out, result of ast execution is used by the caller. It issues Orphan Call (crash of caller). Its useful in designing simple RPC. Last-of- Many Call tics: It is similar to last-one semantic except that the orphan calls are neglected using call identifiers. Orphan call is one whose caller has expired due to node crash. To identify each call, unique call dentiiers are used which to neglect orphan calls. ‘When a cal is repeated, itis assigned to a new call identifier and each response message has a corresponding call identifier. A response is accepted only if the call identifier associated with it matches the identifier of the most recent call else itis ignored. This semantics guarantees that the calls executed one or more times but does not specify which results are returned to the caller. Itcan be implemented using timeout based retransmission without considering the orphan calls. This is the strongest and the most desirable call semantics. It is Request / Reply / ACK protocol. No matter how many calls are made, a procedure is executed only once It eiminates the possibility of a procedure being executed more than once irrespective of the number of retransmitted call. ‘The implementation of exactly-once call semantics is based on the use of timeouts, retransmission, call identifiers with the same identifier for repeated calls and a reply cache associated with the callee. - Page 5iofto2 -5 | Communication Semester - 8 Topper's Solutions Q4] Explain stream oriented communication with suitable example. Ans: [10M ~ May16 & 5M - May17] STREAM ORIENTED COMMUNICATION: 1. RPCand Message Oriented Communication are based on the exchange of discrete messages. 2, Timing might affect performance, but not correctness. 3, In Stream Oriented Communication the message content must be delivered at a certain rate, as ‘well as correctly. 4, Example: Music or video. 5. Stream Oriented Communication supports continuous media communication. ited cation > Asynchronous Mode: No restrictions with respect to when data is to be delivered > Synchronous Mode: Define a maximum end-to-end delay for individual data packets > Isochronous Mode: Define a maximum end-to-end delay and maximum delay variance, ‘Stream: 1, Adata stream is a connection-oriented communication facility It supports isochronous data transmission. 3. Some common stream characteristics: a. Streams are unidirectional. b. There is generally a single source. 4, Stream types: a Simple: It consists of a single flow of data (e.g. audio or video) b. Complex: It consists of multiple data flows (eg, stereo audio or combination audio/video) Figure 5.3 shows the implementation of Token Bucket. ‘The token bucket can be easily implemented with a counter. ‘The token is initialized to zero. 1 2 3 4, Each time atoken is added, the counter is incremented by 1. 5. Bach timea unit of data is dispatched, the counter is decremented by 1. 6. If the counter contains zero, the host cannot send any data. Page 520f 1025 | Communication Semester~8 Toppee's Solutions SS = Soa oe — = = “And discarded per — ena see — Be] —
On demand exchanges: Each node broadcasts its state information request message when its ‘state switches from normal to either under load or over load. > Exchanges by polling: The partner node is searched by polling the other nodes on by one until poll limit is reached. V) Priority Assignment Policy: 1, Thepriority ofthe execution oflocal and remote processes at aparticularnode should be planned. = It includes: > Selfish priority assignment rule: In this local process are given higher priority than remote process. > — Altruistic priority assignment rule: Remote processes are given higher priority than local process. > Intermediate priority assignment rule: Priority in this rule is decided depending upon the number of local and remote processes on a node, V) Migration Limiting Policy: 1. This policy determines the total number of times a process can migrate from one node to another. It includes: > Uncontrolled Policy: The remote process is treated as local process. Hence, it can be migrated any number of times. > Controlled Policy: Migration count is used for remote processes. Q2] Code Migration Qs] Describe code migration issues in detail Ans: [Qz2 | 10M — Dec16] & [Q3 | 10M - May17] CODE MIGRATION: In process migration, an entire process has to be moved from one machine to another, But this may be a crucial task, but it has good overall performance. In some cases, a code needs to be migrated rather than the process. Code Migration refers to transfer of program from one node to another. For example: Consider a client server system, in which the server has to manage a big database. ‘The client application has to perform many database operations In such situation, itis better to move part of the client application to the server and the result is. send across the network, ‘Thus code migration isa better option, Page $b ofto26 | Resource and Process Mant Semester ~ 8 Topper's Solutions 9. Code Migration is used to improve overall performance of the system by exploiting parallelism. 10. Example of code migration is shown below in figure 6.2. Server Quon {Service specie) cop 2: Client Server Communication Server ‘Step 1: Client fetches code Figure 6.2: Example of Code Migration. 11. Herethe serveris responsibleto provide the client's implementation, when the dlient binds to the server. 12, The advantage of this approach s that, the client does not need to install all the required software. ‘The software can be moved in as when necessary and discarded when it is not needed, CODE MIGRATION ISSUES: Communication in distributed systems is concerned with exchanging data between processes. 2. Code migration in the broadest sense which deals with moving programs between machines, with the intention to have those programs be executed at the target. 3. In code migration framework, a process consists of 3 segments ie. code segment, resource segment and execution segment. 4 Code segment contains the actual code. 5. Resource segment contalts references to resources needled by the process. 6. Execution segment stores the execution state of a process. 7. Cousider the figure 6.3 of code migration & Where, a. CS: Client-Server, b. REV: Remote evaluation, © CoD: Code-on-demand. 4, MA: Mobile agents. 9. Mobile agents moves from site to site, 10, Code-on-demand is used to migrate part of server to client. 11, Remote evaluation is used to perform database operations involving large amount of data, Page 57 of 026 | Resource and Process Mant Semester ~ 8 ‘Topper's Solutions : Belore execution After execution Client ‘Server Client ‘Server code code - cs state state" LC resource resource code code REV [state =| state resource resource code ‘code cob state | — state™ | resource resource code code ma state || = |[__ stater : resource resource resource resource Figure 6.3: Code Migration. MOBILITY: Weak mobility: ; > Acharacteristics feature of weak mobility is that a transferred program is always started from its Initial state. > Example: Java applets. ‘Strong mobility A characteristics feature of strong mobility is that running process can be stopped, subsequently v ‘moved to another machine and then resume execution where it left off = It includes migration and cloning, ‘Migration: Cloning: Starta clone, and set it in the same execution state. i lave entire object from one machine to the other vvvy Migration can be sender-initiated (e.g, uploading program), receiver-initiated (eg. java applets) : or hybrid. -e Page Bef Le6 | Resource and Process Mant Semester 8 Topper's Solitons Qal Ans: State the desirable features of global scheduling algorithm. [5M ~ Dect6] FEATURES OF GLOBAL SCHEDULING ALGORITHM: D » v oe vgsy v vin Noa priori knowledge ab 7 Most of the time, the prior knowledge of any process is not available. Thus @ good scheduling algorithm must be capable of working without any knowledge of the characteristics of processes. Dynamic in n: In distributed system the load assigned to any node may change dynamically. ‘Thus the scheduling algorithm should be dynamic in nature. m maki In distributed system, the situation Keeps on changing. Thus scheduling algorithm must be capable of making quick decisions about the allocation by analyzing the situation, Balanced system performance and scheduling overhead; Many global scheduling algorithms use the global state information to make process assignment decisions. ‘Thus the scheduling algorithm should provide a near optimal system performance with a 1ninimum of global state information gathering overhead. Aa Unstable process migration results in a process thrashing. So the scheduling algorithm should have stable process migration, Saree A scheduling algorithm must be capable of handling a network with any size. Thus the scheduling algorithm should be scalable to adopt any change. Fa : Ina distributed system, when the node crashes, itshould not affect the performance of the overall system. The scheduling algorithm should be able to handle such situation of fault tolerance. Page 59 of 1026 | Resource and Process Mgnt Semester 8 Topper's Solutions VII) Fairness of Service: > Ima distributed system, there is chance that two users may initiate equivalent processes simultaneously. > The scheduling algorithm should take care of such fair assignment of services. Q5] Compare Load sharing to task assignment and Load balancing strategies for scheduling processes in a distributed system. Ans: [10M ~ May16] COMPARISON BETWEEN LOAD SHARING AND LOAD BALANCING: Table 6.1 shows the comparison between Load Sharing and Load Balancing, ‘Table 6.1: Comparison between Load Sharing and Load Balancing, ‘Load sharing is the ability istribute outgoing. traffic over multiple paths Load balancing is the ability to split the load toward the same destination over multiple paths. ‘Traffic is only shared across different links. ‘Traffic is balanced across different links. Load Sharing is more efficient. Toad Balancing Is less efficient as compared to load sharing. Proper utilization of resources is required. Proper utilization of resources is not required. Tt is necessary to prevent the nodes from being idle, Ttisnotnecessary to prevent the nodes from being idle. Te does not uses round robin fashion. Ttuses round robin fashion. Te cannot performed on packet-by-packet basis. Tt can performed on packet-by-packet basis, Its a static concept. a dynamic concept. is difficult to setup and maintain. Teis easy to setup and maintain. Example of Protocol: eBGP. Example of Protocol: JGP. Page bo oft6 | Resource and Process Mant Semester ~8 Topper's Solutions Q6) Compare and contrast Task Assignment; Load Balancing and Load Sharing approaches Ans: (ioM - Deci71. TASK APPROAGI 1. Intask assignment, each process is viewed as a collection of tasks. 2, ‘These tasks are scheduled to suitable processor to improve performance. 3. ‘This is nota widely used approach because: a. Itrequires characteristics ofall the processes to be known in advance. b. This approach does not take into consideration the dynamically changing state of the system. In this approach, a process is considered to be composed of multiple tasks and the goal is to find an optimal assignment policy for the tasks af an individual process. 5. The following are typical assumptions for the task assignment approach: a. Minimize IPC cost (this problem can be modeled using network flow model) b. Efficient resource utilization. © Quick turnaround time. 4 Abigh degree of parallelism LOAD ~ BALANCING APPROACI ig gt Figure 6.4: Load Balancing Algorithms. 1. The main goal of load balancing algorithms is to balance the workload on all the nodes of the a system. 2. Inthis, the processes are distributed among nodes to equalize the load among all nodes. 3. The scheduling algorithms that use this approach are known as Load Balancing or Load Leveling Algorithins. 4, Load balancing aims to optimize resource use, maximize throughput, minimize response time, x and avoid overload of any single resource. Page br of 08 i6 | Resource and Process Mant Semester ~ 8 Topper's Solutions 5. Load balancing algorithm tries to balance the total system load by’ transparently transferring the workload from heavily loaded nodes to light loaded nodes in an attempt to ensure good overall performance relative to some specific metric of system performance. 6 We cam have the following categories of load batancing algorithms as shown in figure 6.4: D Static: Static Algorithm ignores the current state of the system. Example: Ifanode is heavily loaded, itpicks up a task randomly and transfers ittoa random node. ‘These algorithms are simpler to implement but performance may not be good. ‘+ Algorithms in this class use the processor and process characteristics to allocate processes to nodes. * Probabilistic: ‘+ Algorithms in this class use information regarding static attributes of the systems such as number of nodes, processing capability, ete, Mm) Dynamic: > Use the current state information for load balancing. > There is an overhead involved in collecting state information periodically; they perform better than static algorithms. * System state information is collected by a single node. * This node makes all scheduling decisions. + Distributed: Most desired approach. © Each node is equally responsible for making scheduling decisions based on the local state and the state information received from other sites. ‘+ Cooperative: © Inthese algorithms, the distributed entities cooperate with each other ta make scheduling decisions. © Therefore they are more complex and involve larger overhead than non- cooperative ones. © But the stability of a cooperative algorithm is better than of a non- cooperative one, + Non-Cooperative: © Adistributed dynamic scheduling algorithm. individual entities act as autonomous entities and © In these algorithms, rake scheduling decisions independently of the action of other entities. Page 62 of t026 | Resource and Proces Mant Semester -8 Topper's Solutions LOAD i: 1. Ina distributed system, proper utilization of resources is not required to balance load on all nodes. But it is necessary and sufficient to prevent the nodes from being idle, this is known as Load Sharing, 3. For the proper utilization of resources of a distributed system, it is not required to balance the load on all the nodes. 4, Itis necessary and sufficient to prevent the nodes from being idle while some other nodes have more than two processes. 5, This rectification is called the Dynamic Load Sharing instead of Dynamic Load Balancing. 6. Soinstead of load balancing, load sharing is better. 7. The design of a load sharing algorithms require that praper decisions be made regarding load estimation policy, process transfer policy, state information exchange policy, priority assignment policy, and migration limiting policy. 8 tis simpler to decide about most of these policies in case of load sharing, because load sharing algorithms do not attempt to balance the average workload of all the nodes of the system, 9. Rather, they only attempr to ensure that no node is idle when a node is heavily loaded. 10, The priority assignments policies and the migration limiting policies for load-sharing algorithms are the same as that ofload-balancing algorithms. Q7] Differentiate between Job scheduling and load balancing. Discuss the issues in designing Load Balancing Algorithm {10M — May17] JOB SCHEDULIN 1. Job scheduling is the process of allocating system resources to many different tasks. 7 2. The system handles prioritized job queues that are awaiting CPU time and it should determine which job to be taken from which queue and the amount of time ta be allocated for the job. 3. This type of scheduling makes sure that all fobs are carried out fairly and on time. 4. Most OSs like Unix, Windows, et, include standard job-scheduling abilities. 5. Job scheduling is performed using job schedulers. 6 Job schedulers are programs that enable scheduling and, at times, track computer "batch" jobs, or units of work like the operation of a payralt program. 7. Job schedulers have the ability to start and control jobs automatically by running prepared jab- a control-language statements or by means of similar communication with a human operator, i 8 Inscheduling, many different schemes are used to determine which specific job to run. Page 63 f 102 kL6 | Resource and Process Mant Semester 8 Topper's Solutions 9. Some parameters that may be considered are as follows: a. Job priority. b. Availability of computing resource. Execution time assigned to the user. 4. Number of parallel jobs permitted fora user. Projected execution time. £ Elapsed execution time. & Number of cases of prescribed events LOAD BALANCING: 1. The main goal of load balancing algorithms is to balance the workload on all the nodes of the system. 2, For example computers, a computer cluster, network links, central processing units or disk drives. 3. Load balancing alms to optimize resource use, maximize throughput, minimize response tine, and avoid overload of any single resource. 4, Using multiple components with load balancing instead of a single component may increase reliability through redundancy. DESIGNING ISSUES: 1) Load Estimation Policy: > The first issue in a load balancing algorithm is to decide which method to use to estimate the workload of a particular node. > Estimation of the workload of a particular node is a diffiault problem for which no completely satisfactory solution exists. > Anodes workload can be estimated based on some measurable parameters below: + Total number of processes on the node. + Resource demands of these processes. * Instruction mixes of these processes. «Architecture and speed of the node's processor. Memory Iess Method: It is assumed that all the processes have the same expected remaining service time. Past repeats: Itis assumed that the remaining service time is equal to the time used so far. Distributed Method: If the distributing of service times is known, the associated process's remaining service time is the expected remaining time conditioned by the time already used. Page 64 of t026 | Resource and Process Mant Semester - 8 Topper's Solutions TW) Process transfer policies: > The idea of using this policy is to transfer processes from heavily loaded nodes to lightly loaded nodes. > Most of the algorithms use the threshold policy to decide whether the node is lightly loaded or heavily loaded, > Threshold value is a limiting value of the workload of node which can be determined by: + StaticPolicy: Each node has a predefined threshold value. + Dynamic Policy: The threshold value for a node is dynamically decided. > Below threshold value node accepts processes to execute, > Above threshold value node tries to transfer processes to a lightly loaded node. > Single threshold policy may lead to unstable algorithm. > Toreduce instability double threshold policy has been proposed which is also known as high low policy. > Figure 65 (a) shows single threshold policy and (b) shows double threshold policy. ne Overloaded cn ae Teen Normal Underiaded ao Underoaded o ~» Figure 6.5: Threshold Policy. 1) Location policy: > Location policy determines to which node a process selected for transfer should be sent. > Irinctudes following: + Threshold: ‘+ This policy selects a random node and checks whether the node is able to receive the process then it transfers the process. * Ifthe node rejects the transfer then another node is selected randomly. ‘+ This continues until the probe limitis reached. * Shortest method; ‘+ Inthis m’ distinct nodes are chosen at random and each is polled to determine its load with minimum value. * Bidding meshod: ‘+n this method, nodes contain managers to send processes and contractors to receive processes. Page 65 of 026 | Resource and Process Mgnt Semester ~8 Topper's Solutions : * Itisused to reduce the variance of load only between nodes of the system. IV) State information ex: 7 > Periodic broadcast: _ + Bach node broadcasts its state information after the elapse of T units of time, Broadcast when state changes: * Bach node broadcasts its state information only when a process arrives or departures. > Ondemand exchanges: + Each node broadcasts its state information request message when its state switches from v normal to either under load or over load. > Exchanges by polling: +The partner node is searched by polling the other nodes on by one until poll limit is reached. V) Priority Assi q > The priority ofthe execution of local and remote processes at a particular node should be planned. > Itincludes: + Inthis local process are given higher priority than remote process. + Altruistic 7 . + Remote processes are given higher priority than local process. . diate priority ass 7 ‘© Priority in this rule is decided depending upon the number of local and remote processes ona node, VI) Migration Limiting Policy; > This policy determines the total number of times a process can migrate from one node to another. : > Itincludes: * Uncontrolled: + The remote process is treated as local process. Hence, t can be migrated any number of times. * Controlled: ‘+ Migration count is used for remote processes. Page 66 of 102 =6 | Resource and Process Mant Semester - 8 Topper's Solutions ~- EXTRA QUESTIONS — Qi] Explain Load Sharing. Ans: LOAD SHARING: 1. Ina distributed system, proper utilization of resources is not required to balance load on all nodes. 2, But it is necessary and suffictent to prevent the nodes from being idle, this is known as Load Sharing, 3. Instead of load balancing, load sharing is better. 1. Load sharing algorithms attempt to avoid nodes from being idl. 2. Butts sufficient to know whether a node is busy or idle. 3, Thus these algorithms normally employ the simplest load estimation policy of counting the total number of processes on a node. Mm) Pro ies: . 1. Load sharing algorithms normally use all-or-nothing strategy. 2, This strategy uses the threshold value of all the nodes fixed at one. 3, Anode becomes a receiver node when it has no process, and becomes a sender node when ithas ‘more than one process. 4, To avoid processing power on nodes having zero process, load sharing algorithms uses two threshold values instead of one. = m1) Location Policies; - 1. It decides whether the sencler node or the receiver node of the process takes the initiative to search for suitable node in the system. 2. Teineludes: a. Sender Initiated Location Policy: + Inthis policy, heavily loaded nodes search for lightly loaded nodes. b, Receiver Initiated Location Policy: = In this policy lightly loaded nodes search for heavily loaded nodes. 2 Page 67 of 02 i6 | Resource and Process Mgnt Semester ~ 8 Topper's Solutions IV) State information exchange policies: 1. In load sharing algorithms it is not necessary for the nodes to periodically exchange state information 2. Butneeds to know the state of the other nodes when itis either under loaded or overloaded. 3. Itincludes: a. Broadcast when the state changes. b. Poll when the state changes. Q2] Process migration Ans: PROCESS MIGRATION: 1 Process migration is a specialized form of process management. 2. In process migration, processes are moved from one computing environment to another. 3. The most common application of process migration is in computer clusters where processes are ‘moved from machine to machine. Process migration is the relocation of a process from its source node to another destination node. ‘The way of a process migrates from one node to another is shown in the following figure 6.6. Time Source Node Destination Node erection | rrcesF, Suspended inexecution Execution Resumed Process Py in execution Figure 6.6: Process Migration. Steps: > Process is selected for migration. > Selection of destination node for the process to be migrated. > Transfer of selected process to the destination node. Features: > Transparency. > Minimal Interference. > Bfficiency. > Robustness. Page BB foe6 | Resource and Process Mant Semester ~8 Topper's Solutions 268 m 1. Freezing the process on its source node and restarting it on its destination node. 2. Transferring the process's address space from its source node to its destination node. 3. Forwarding messages meant for the migrant process. 4 Handling communication between cooperating processes that have been separated as a result of process migration. Page 69 of to2Z| Synchronization Semester ~8 Topper's Solutions Qi Ql Qs] Ans: CHAPTER : SYNCHRONIZATION ‘Write a note on Election algorithm. Describe any one Election algorithm in detail with an example ‘What is the requirement of Election algorithm in Distributed Systems? Describe any one Election algorithm in detail with an example [Q1 | 10M — Dec16}, [Q2 | 10M - Dec17] & [Q3 | 10M — Mayz7} ELECTION ALGORITHM: Many algorithms used in distributed systems require a coordinator. In general, all processes in the distributed system are equally suitable for the ro'e. Election algorithms are designed to choose a coordinator. Any process can serve as coordinator. ‘Any process can “call an election”. ‘There is no harm in having multiple concurrent elections. Elections may be needed when the system is initialized, or if the coordinator crashes or retires. Example of election algorithm is Bully Algorithm, ASSUMPTIONS AND REQUIREMENT OF ELECTION ALGORITHM: 1. Every process/site has a unique ID. 2 Example: The network address or a process number. 3. Every process in the system should know the values in the set of ID numbers, although not which processors are up or down. 4, The process with the highest ID rumber will be the new coordinator. 5. Process groups (as with ISIS toolkit or MPI) satisfy these requirements. 6. When the election algorithm terminates a single process has been selected and every process knows its identity. 7. Formalize: every process pi has a variable e, to hold the coordinator's process number. - = andefined or e = P, where P is the non-crashed process with highest id. All processes (that have not crashed) eventually set e, =P. Bully Algorithm: 1. Bully Algorithm was proposed by Garcia-Molina. 2. This algorithm is planned on assumptions that: ‘a, Each process involved within a scenario has a process number that can be used for unique identification. Page 70 of 1027 | Synchronization Semester - 8 Topper's Solutions b, Each process should know the process numbers ofall the remaining processes. ¢. Scenario is synchronous in nature. ‘A process with highest process number is elected as a coordinator. Example: 7 > Process (4) calls an election when itnotices that the coordinator is no longer responding. > Process (4) sends an election message to all higher-numbered processes in the system. % no pracess respond, then Process (4) becomes the coordinator. > Ifa higher-level process (5, 6) responds, it sends process (4) a message that terminates (4)'s role in the algorithm, > Now process (5) now calls an election (iF it has not already done so}. > Repeat until no higher-level process responds. > ‘The last process to call an election “wins” the election. ‘The winner sends a message to other processes announcing itself as the new coordinator. Example is shown in figure 7.1. @ @ © o*, o<° s ‘igure 7.1: Example of Election Algorithm, Q3] Raymond's Tree based algorithm Q4] Discuss Raymond's Tree’ based algorithm of token based distributed mutual exclusion Ans: [Q3 | 10M — Deci6) & 1Q4 | 10M - Mayx7} RAYMOND'S TREE BASED ALGORITHM: 1. Raymond's Tree Based Algorithm is a token based algorithm. 2. InRaymond's Tree Based Algorithm, a directed tree is formed. : 3. Nodes are arranged asa tree, Page 74 of 1027 | Synchronization Semester 8 Topper's Solutions : 4, Every node has a parent pointer. 5. Each node has a FIFO queue of requests, 6. There is one token with the root and the owner of the token can enter the critical section. 7. Figure 7.2 shows the example of Raymond’s Tree Based Algorithm. \ Request ~ Figure 7.2: Raymond's Tree Based Algorithm. As the token moves across nodes, the parent pointers change. 1 Request queve ‘They always point towards the holder of the token as shown in figure 7.3. 10. Itis thus possible to reach the token by following parent pointers. \ Request 2 Request Queve Figure 7.3: Raymond's Tree Based Algorithm, Reauestinga Token: > Thenode adds “set” in its request queve. ' > Forwards the request tothe parent. > The parents adds the request tits request queue. > Ifthe parent does not hold the token and it has not sent any requests to get the token, it sends a request to its parent for the request. > This process continues till we reach the root (holder of the token). Releasing a Token: 2 > Ultimately a request will reach the token holder. > The token holder will wait tll itis done with the critical section. Page rape iL7:\ Synchronization Semester ~ 8 Topper's Solutions > It will forward the token to the node at the head ofits request queue. # Itremoves the entry. * Itupdates its parent pointer, % Any subsequent node will do the following: = Dequeue the head of the queue, ‘= _Ifself" was at the head of ts request queue, then it will enter the critical section. * Otherwise it forwards the token to the dequeued entry. % After forwarding the entry, a process needs to make a fresh request for the token, if it has outstanding entries in its request queue. Q5] Write a Suzuki-Kasami’s Broadcast Algorithm. Explain with example. Ans: [10M ~ May16] SUZUKI-KASAMI'S BROADCAST ALGORITHM: 1, Sumuki-Kasami's Broadcast Algorithm is a token based algorithm. 2. tis used for achieving mutual exclusion in distributed systems. 3. This isa modification to Ricart-Agrawala algorithm. 4, Inthis algorithm a REQUEST and REPLY message are used for attaining the critical section, 5. The process holding the token is the only process able to enter its critical section, 6 Each process maintains an array request. Req [i] denotes the sequence no of the latest request from process j 7. Additionally, the halder of the token maintains an array last. Last [] denotes the sequence number of the latest visit to Critical Section for process j Figure 7.4 shows example of Suzuki-Kasami's Broadcast Algorithm, OO tase req & an irnit] oes req: array[0.n-1] of integer last: array [0-0-1] of integer Figure 7.4: Example of Suzuki-Kasami's Broadcast Algorithm. Page 73 0f 027 | Synchronization Semester ~ 8 Toppers Solutions ALGORITHM: ‘Requesting the critical section (CS); > Ifthe site does not have the token, then it increases its sequence number Req [i] and sends a request (I, sn) message to all other sites (sn= Rea: [i]) When a site S; receives this message, it sets Req, [i] to Max (Req, [i], sn). IfS; has the idle token, then it sends the token to Si, if Req [i] = Last [i] +1 Releasing the CS: > When done with the CS, site Si sets Last [i] = Rea {i] > Forevery site S; whose ID is not in the token queue, it appends its ID to the token queue ifReq) [j] Last [f]+1 > Ifthe queue is not empty, it extracts the ID at the head of the queue and sends the token to that site. Executing the CS: > Site Si executes the CS when it has received the token EXAMPLE: Step 1: Initial state: Process 0 has sent a request to all, and grabbed the token. reesttoono) repltoon9) bevlece00) e090) reesl.0.0.09) reat1.90.00) ‘Step 2: Now 1 & 2 send requests to enter CS rerlt4.400) reptl4.4.00]7 | Synchronization Semester -8 Topper's Solutions Step 3 : Now 0 prepares to exit CS reqe{lA,1,09) reg-ltt.4,00] last=[i 9.0.00} 0,25 reqell,1,0.0) ree-{L4.4.001 Step 4: Now 0 passes token (Qand last) to 1 reqe{t£,1,00] 141,00} req=L1,1,100] reg-ll.1,1.00] Step 5: Now 0.and 3 send requests veg-[2,1,1,4,0] : regel2,4,4.4.0] kst-it.90001 rege(2,2,1,1,0) req f2.4,4,4,0] regl2,1,4,1,0] Step 6: Finally 1 sends token to 2. Page 75 of 027 | Synchronization Semester ~ 8 ‘Topper's Solutions : rept 4.4.40) : repiet.ta) revles.440] 6] Ans: Explain the distributed algorithms for Mutual Exclusion? What are the advantages and disadvantages of it over centralized algorithms? [10M - Mays6] DISTRIBUTED ALGORITHMS: 1, Itisalso known as Ricart-Agarwala's Algorithm. 2. Inthis algorithm, whenever a process wants to enter the critical section it broadcasts a message that it is entering the critical section, 3. This message contains: Process identifier. + Name ofthe critical section = = Aunique timestamp generated by the process for the request message. 4 On receiving a request message the process will do one of the following: = Ifitis currently executing in the critical section it will not reply back = Ifa process is waiting for the critical section, it compares the time stamp of the request ‘message and its own time stamp. If own timestamp is greater (ater) it will reply back, else it won't. : + Ifneither of the above, it will immediately reply back. Example: Already in riticalzeaion : Figure 7.5: Example of Ricart-Agarwala’s Algorithm. Page 76 of 102 =7 | Synchronization Semester -8 Topper's Solutions > Inabove figure 7.5 there are four processes 1, 2,3 & 4. > While process 4s in critical section, processes 1 and 2 want to enter the same critical section. > To get permission from other processes, processes 1 and 2 send request messages with the timestamps 6 and 4 respectively to other processes. Queue ox = Defers sending a replyte " ox ok —o@ 2[2 Defers sending a reply oP & 72 Figure 7.6 > Inabove figure 7.6, since process 4s in the critical section, it does not send a reply message to 1 and 2 and enters them in its queue = > Process 3s currently not interested in the critical section, soit sends OK messages to both 1 and 2 > Process 2 defers sending a reply message to 1 and enters 1 in its queue because the timestamp (4) inits own request message Is less than the timestamp (6) in 1's request message. > But 1 replies to2as the timestamp (6) in its own request message is greater than the timestamp (4) in 2's request message. uowe 2 Tnters cial section Ok ok Exists crticalsection 2 Figure 7.7 Rage 77 fon :7 | Synchronization Semester ~8 ‘Topper's Solutions : > Inabove figure 7.7, when the process 4 exits the critical section, it sends an OK message to all processes in its queue, > Since process 2 has received OK message from all other processes, it enters the critical section. However, process 1 continues to wait since it has not yet received a reply message from the process 2. Enters critical section Exists criticalsection : OK = Figure 7.8 > Inabove figure 7.8, when process 2 exits the critical section, it sends an OK message to 1. % Since process 1 has received a reply message from all other processes, it enters the critical section. ADVANTAGES AND DISADVANTAGES OF IT OVER CENTRALIZED ALGORITHMS: Advantage: > Distribution Algorithm guarantees for Mutual Exclusion, > NoStarvation, > Request are granted in the order in which they are received. > Easy to implement. Disadvantages: > Ifthe Coordinator crashes then the whole system may go down. > Message broadcasting is required when network bandwidth is a luxury. > —_Inalarge system a single coordinator can become a performance bottleneck. Page Bef 2 o7 | Synchronization Semester -~8 Topper's Solutions Q7]__ Explain Lamport's Distributed Mutual Algorithm. ‘Ans: [10M - May17] LAMPORT'S DISTRIBUTED MUTUAL ALGORITH! 1. __Lamport's Distributed Mutual Exclusion Algorithm isa contention-based algorithm for mutual exclusion on a distributed system, 2 Itis a computer algorithm, Itisnon token based algorithm. 4, Lamport was the first to give a distributed routual exclusion algorithm as an illustration of his lock synchronization scheme 5, __ Itisintended to improve the safety in the usage of shared resources. 6. For synchronization of logical clocks, Lamport established a relation termed as happen-before relation. 7, Let Ribe the request set of site Si, ie. the set of sites from which Si needs permission when it wants to enter critical section (C5), 8 InLamport's algorithm, Vi: 1 s1N:: = (S1, $2,..SN}. Every site Si keeps a queue, request. queue i, which contains mutual exclusion requests ordered by their timestamps. 10, Thisalgorithm requires messages to be delivered in the FIFO order between every pair of sites. 11, Bach process maintains request queue. 12, Queue contains mutual exclusion requests, Requesting the critical section; > Process Pi sends request (I, Ti) 0 all nodes. > Itthen places request on its own queue. > Whena process Pj receives a request, it returns a timestamped ack. a > Pireceived a message (ack or release) from every other process with a timestamp larger than Ti. > P'srequest has the earllest timestamp inits queue, Releasing the critical section; > Itremoves the request fram its own queue, > Itthan send a timestamped release message. > Whena process receives a release message: = Itremoves the request for that process from its queue. = This may cause its own entry have the earliest timestamp in the queue, enabling it to access the critical section. Page 79 of 1027 | Synchronization Semester ~ 8 Topper's Solutions Q8] Whats a logic clock? Why are logic clocks required in distributed systems? How does Lamport synchronize logical clocks? Which events are said tobe concurrent in Lamport timestamps Ans: [10M - May17] LOGIC CLOCK: 1. A logical clock is a mechanism for capturing chronological and causal relationships in a distributed system. 2. Distributed systems may have no physically synchronous global clock. 3. Soalogical clock is used. 4, Itallows global ordering on events from different processes in such systems. 5. The first implementation, the Lamport timestamps, was proposed by Leslie Lamport in 1978, 6. In logical clock systems each process has two data structures: logical local time and logical global time 7. Logical local time is used by the process to markiits own events, and logica! global time is the local information about global time. 8, _Aspecial protocol is used to update logical local time after each local event, and logical global time when processes exchange data. 9. Logical clocks are useful in computation analysis, distributed algorithm design, individual event tracking, and exploring computational progress. LAMPORT'S LOGICAL CLOCKS: 1. Inadistributed system, clocks need not be synchronized absolutely. 2. Iftwo processes do not interact, itis not necessary that their clocks be synchronized because the lack of synchronization would not be observable and thus it does not cause problem. 3. It isnot important that all processes agree on what the actual time is, but that they agree on the order in which events occur. 4, Lamport clocks are a simple technique used for determining the order of events in a distributed system. 5, Lamport clocks provide a partial ordering of events - specifically “happened-before” ordering. If there is no "happened-before" relationship, then the events are considered concurrent. Rules of Lamport's Logical Clocks: a. Happened Before Relation; + Ifa &bare events in the same process and a accurs before b, then a > b. + Ifa &b belong to two different processes and a sends message to b, then a> b. + ifa>bandb>cthena>« Page 80 Fa7| Synchronization Semester - 8 Topper's Solutions b. Logical Clocks Concept: + Maintaining a common clock or set of perfectly synchronized clocks difficult. = So, local timestamp is given for happened before relation. EXAMPLE: 0 o eke 2 8 al 50] 36 2 a3) 5 a 66 © Figure 7.9: Event Ordering Example. > Consider three processes 0,1 & 2. > For process Othe time ticked is 6, for 1 its 8 and for 2 its 10. > The clocks run at constant rate but different due to difference in the crystals. > Attime 6, process 0 sends message A to process 1 and fs received at time 16. Time taken for transfers 10. > Similarly process 1 sends message B to process 2 and is received at time 40. Time taken for transferis 16 > Now message Cis send from process 2 to process 1 it takes 16 ticks to reach and similarly message D takes 10 ticks to reach. > This value is certainly impossible and such a situation must be prevented. > Solution for this is Lamport happen before relation, > Since message C left at 64 so it must arrive at 65 or later and similarly, message D left at 69 so it must be arrive at 70 or later. > Thisis shown in figure 7.9 (}. Page &t of 027 | Synchronization Semester ~ 8 Topper's Solutions ~~ EXTRA QUESTIONS — Q1] Clock synchronization: Ans: CLOCK SYNCHRONIZATION: 1. Clock synchronization is a problem from computer science and engineering which deals with the {idea that internal clocks of several computers may differ. 2. Every computer needs a timer mechanism to keep track of current time and also for various accounting purpose. 3. ‘The variance in time is called as clock skew. 4. One major clock synchronization issue in distributed system is that multiple clocks have to be synchronized from time to time. CLOCK SYNCHRONIZATION ALGORITHMS: 1) Cristian's Algorithm: Client To n Request Reply Time server Interrupt handling time 1, Inthismethod, each node periodically sends a message to server. 2. When the time server receives the message it responds with a message‘T, where T is the current time of server node. 3. Assume the clock time of client be To when it sends the message and T, when it receives the message from server. 4. ‘Ty and T; are measured using same clock so best estimate of time for propagation is (T-Ts)/2. 5. When the reply is received at clients node, its clock is readjusted to T + (T1-Ta)/2. ‘Advantage: It assumes that no additional information is available, Disadvantage: It restricts the number of measurements for estimating the value, Page 82 of 1027 | Synchronization Semester ~ 8 Topper's Solutions 1) Berkley algorithm: 3.00 f 3:05 OR" . ee 20 415 ae cle! Be 328 Ts 325 750 305 05 ®) to) te (a) The time daemon asks all the other machines for their clock vatues. (b) The machines answer. (c) The time daemon tells everyone how to adjust their clock. This is an active time Server approach. 2, _Inthis approach, the time server periodically sends a message to all the computers in the group of computers. ‘When this message is received each computer send backs its awn clock value tothe time server. ‘The time server has a prior knowledge of the approximate time required for propagation of a message which is used to readjust the clock values, 5. It then fakes average of clock values ofall the computers 6. The calculated average is the current time to which all clocks should be readjusted, 7. The time server readjust its own clock to this value and instead of sending the current time to other computers it sends the amount of time each computer needs for readjustment. 8 This can be positive or negative value. Q2]_ Token ring algorithm, Ans: TOKEN RING ALGORITHM: 1. Token ring approach is used to achieve mutual exclusion in a distributed system. 2. Here we have a bus network (for eg. Ethernet), 3. logical ring is constructed in which each process is assigned a position in the ring. 4. The ring positions may be allocated in numerical order of network addresses or some other means. 5. It does not matter what the ordering is. Page 83 of to27 | Sychronizatin Semester~ 8 Topper's Soltions 6. All that matters is that each process knows who is next ia line ater itself. 7. When the ring is initialized, process P1 (say) is given a token, 8 The token circulates around the ring. 9. Itis passed from process k to process k+1 in point-to-point messages. 10, When process acquires the token from its neighbor, it checks to see if is attempting to enter a Critical Section (CS). 11. If so, the process enters the CS, does all the work itneeds to, and leaves the section. 12, After ithas exited, it passes the token along the ring, Its not permitted to enter a second CS using the same token. 13. _ Ifa processis handed the token by its neighbor and is not interested in enteringa CS, it just passes italong. 14, Asa consequence, when no processes want to enter any CS, the token just circulates at high speed around the ring, Figure 7.10: Token Ring Algorithm, Advantage: > Nostarvation problem. Disadvantage: > Detecting the lost token and regeneration is difficult, Page 84 of 1028 | Consistency and Replication Semester ~8 Toppee's Solutions CHAPTER -~ 8: CONSISTENCY AND REPLICATION Qi} Explain the need af client centric consistency models as compared to data centric consistency model. Explain any two client centric consistency model. Q2] Discuss and differentiate various clieut-centric consistency models ‘Ans: [Q1 | 10M — Dec16] & [Q2 | 10M - May17] NEED OF CLIENT CENTRIC CONSISTENCY MODELS: 1, Itisone of the type of consistency model in distributed system. 2. System wide consistency is hard, so usually client centric consistency model is more preferable 3, tis easter ta deal with inconsistencies. 4, Using client centric consistency model many inconsistencies can be hidden in cheap way. S. _ Itaims at providing a consistent view on a database. CLIENT CENTRIC CONSISTENCY MODELS: 1 fventual Consistency: ‘Aneventual consistency is a weak consistency model. Itlacks in simultaneous updates. It defines that if updates do not occur for a long period of time, all replicas will gradually become consistent v Eventual Consistency is a lot inexpensive to implement. > Requirements for Eventual Consistency are: + Few read/write conflicts. + Nowrite/write conflicts, * Clients can accept temporary inconsistency. > Example: WWW. M Monotonic Reads: v A data store is sald to offer monotonic read consistency ifthe following condition holds: “Uf process P reads the value of data item x, any successive read operation on x by that process will always return the same value or a more recent one.” Consider a Distributed e-mail database. Ithas distributed and replicated user-mailboxes. Emails can be inserted at any location vvyvy However, updates are prapagated in a lazy (Le. on demand) fashion. Page 85 of to28 | Consistency and Rephation Semester 8 Topper'sSoltions : > Suppose the end user reads his mail in Mumbai. Assume that only reading mail does not affect the : mailbox. > Laterwhen the end user moves to Pune and opens his mail box again, monotonic read consistency assurances thatthe messages that were inthe mailboxin Mumbai will also be in the mailbox when : itis opened in Pune. > Figure 8.1 shows the read operations performed by a single process ‘P’ at two different local copies of the same data store. La: WSK) RE) + WSK) RO) a: W(X) RO) 1 Ws(X,) ROX) @) &) Figure at > Figure 8.1 (a) Demonstrate a monotonic-read consistent data store. > Figure 8.2 (b) Demonstrate a data store that does not provide monotonic reads. TM) Monotonic Writes: > A data store is said to offer monotonic write consistency if the following condition holds: “A.write operation by process P on data item x is completed before any successive write = ‘operation on x by the same process P can take place”, > Consider a software library example. > —_Inseveral cases, updating a library is accomplished by replacing one or more functions. > With monotonic write consistency, assuranceiis given that ifan update is performed on a copy of the library, all previous or earlier updates will be accomplished primarily. > Figure 8.2 shows the write operations performed by a single process ‘P’ at two different local = copies of the same data store. Li: We) La: wstx,) We) La wees) : @ ©) Figure 82 > Figure 8.2 (a) Demonstrate a monotonic-write consistent data store. > Figure 8,2 (b) Demonstrate a data store that does not pravide monotonic-write consistency. : Page Sb ofto2 i8 | Consistency and Replication Semester ~ 8 Toppeer’s Solutions IV) Read Your Writes: > ——_Adatastore is said to offer read your write consistency if the following condition holds: “The effect of a write operation by a process P on a data item x at a focation L will always be seen by a successive read operation by the same process.” > Example: Updating a Web page and guaranteeing that the Web browser shows the newest version instead of its cached copy. > Figure 8.3 (a) Demonstrate a data store that delivers read your writes consistency. > Figure 8.3 (b) Demonstrate a data store that does not delivers read your writes consistency. La WOK) « la: WOK) a W5EK:X:) ROG) ro Ws(X) RG) @) © Figure 83 V) Writes Follow Reads: > Adata store is said to offer write follow read consistency ifthe following condition holds: “A.write operation by a process P on a data item x following a previous read by the same Process, is guaranteed to take place on the same or even a more recent value of x, than the one having been read befor. > Example: Suppose a user first reads an article A then posts a response B. BY requiring writes- follow-reads consistency, B will be written to any copy only after & has been written. > Figure 8.4 (a) Demonstrate a data store that delivers writes follow reads consistency. > Figure 8.4 (b) Demonstrate a data store that does not delivers writes follow reads consistency. Li: WS(K)) ROG) Lis W504) R(K,) wa: WS(X:X.) W(X) WS(X) @ ) Figure 8.4 Page 87 of t028 | Consistency and Replication Semester - 8 Topper's Solutions Qs] Explain the difference between Data Centric and Client Centric Consistency Models. Explain one model of each. Ans: [10M - May16] DIFFERENCE BETWEEN DATA CENTRIC AND CLIENT CENTRIC CONSISTENCY: Table 8.1 shows the difference between Data Centric and Client Centric Consistency. Table 8.1: Difference between Data Centric and Client Centric Consistency. itis used for all client in a system, tis used for individual client. Itdoes not have lack of simultaneous updates. | Ithas lack of simultaneous updates Itis data specific It is client specific. Globally accessible. Not globally accessible. Ttaims to provide system wide consistent view | It aims to provide client specific consistent view on a ona database database. DATA CENTRIC CONSISTENCY MODEL: Sequential Consistency Model: 1. Sequential consistency is an important data-centric consistency model. 2 Itisa slightly weaker consistency model than strict consistency. 3. This model was offered by Lamport in 1979. 4. Ashared memory system is referred to support the sequential consistency model ifall processes see the same order of all memory access operations. 5. Example: Assume three operations read (R1), write (W1), read (R2) performed in an order on a memory address. 6 Then (R1, W1, R2), (R1, R2, W1), (W1, R1, R2) and (R2, W1, R1) are acceptable provided all processes see the same ordering, CLIENT CENTRIC CONSISTENCY MODEL: Refer Q1. Page BB oft029 | Distributed File Systems Semester ~8 Topper's Solutions CHAPTER - 9: DISTRIBUTED FILE SYSTEMS Qt] What are the desirable features of good distributed file systems? Explain file sharing semantic of it. Ans: [10M — Dect6] DESIRABLE FEATURES OF & GOOD DISTRIBUTED FILE SYSTEM: nD ‘Transparency; 1, ‘Transparency refers to hiding detalls from the user. 2. Iteonsists of following types: ‘Structure Transparency: > in multiple fle servers the multiplicity of the file servers should be transparent to the clients of DFS. > Clients should not know the number of locations of the file servers and the storage devices. b, Access Transparency: > The local and remote files should be accessible in the same way. > File system interface should wot be able to distinguish between the local and remote files. Naming Transparency: > Name ofthe file should give no hint ofthe location of the file. > Without changing the filename, the file should be allowed to move from one node to another. 4. Replication Transparency: > Ifa file islocated in multiple nodes, its existing multiple copies should be hidden from the client W) User Mobility: > User should not be forced to work on specific node. > User should have to flexibility to work on different nodes at different times. Mm) Performance; > Performance is the average amount of time required to satisfy the client requests. > This time also includes network communication overhead when the accesses file is remote. > Performance of DFS should be comparable to the performance of Centralized File System. W} Simplicity and ease of use: > Semantics of the DFS should be easy to understand. Page 89 of 24g | Distributed File Systems Semester - 8 Topper's Solutions > vy v) User interface of the filesystem must be simple and the number of commands should be as small as possible. Scalability: DFS grows with time due to expansion of networks by addingtwo or more networks at a common place. DFS should be designed to easily cope up with the growth of nodes and users of the System. High availability: System should continue to function even when partial failures occur. Failure causes temporary loss of service to small groups of users. High available DFS should have multiple independent file servers. Loss of stored data probability should be minimized. User should not face problems on keeping a backup of their files. Data integrity: Concurrent access of data must be properly synchronized using concurrency control mechanism. 1X) Security: > DFS should be secure so as to provide privacy to the users for thelr data. > Necessary Security mechanism must be implemented to keep the data secure, X) Heterogeneity; Heterogeneous DFS provide the flexibility to the users to use different computer platforms for different applications. FILE SHARING SEMANTICS: 1) UNIX Semantics: > —_Inthis semantics, absolute time ordering is performed on all oper: > UNIX semantic is easy to serialize read /write operation. M1) Session Semantics: > Itconsists of following access pattern: = Client opens a file. = Performs read/write operations on file. = Closes the file. session is ase of accessed files between open and close operations. In session semantics all changes made to the file are initially visible only to the client and invisible to other remote processes. Page 90 of 1029 | Distributed File Systems Semester ~8 Topper’s Solutions 1) Immurabl ties: > Itis based on the use of immutable file model. > An immutable file cannot be modified once it has been created > The creator declares the file as sharable so as to make it immutable file. - a) sat anti > Itis based on the transaction mechanist. > —_Atransaction isa setoff operations between a pair of begin-transaction and end-transaction. > Itisa high-level mechanism for controlling concurrent access to shared mutable data. > Itallows partial modification made to the shared data Q2] Andrew file system (AFS) Ans: {20M - Dec16} FILE SYSTEM (AES) ‘The Andrew File System (AFS) isa distributed file system, Itwas developed by Carnegie Mellon University as part ofthe Andrew Project. Originally named "Vice", AFS is named after Andrew Carnegie and Andrew Mellon. Its primary use isin distributed computing, Ituses a session semantics. aa kene AFS supports information sharing on large scale. FEATURES, Andrew File System is designed to: > Handle terabytes of data. © Handle thousands of users. > Workingin WAN Environment. . AFS ARCHITECTURE: 1. Figure 9.1 shows the AFS Architecture. 2, __ARSis divided into two types of nodes: a. Vice Node: Iris dedicated file server. b. Virtue Node: Itis a Client Machines, 3. In VES, the entire file fs copied to the Virtue Node (local machine) from the Vice Node (Server) ‘when opened. 4. When the file is changed - it is copies to the server when dosed. Page 91 of 102g | Distributed File Systems Semester ~8 Topper's Solutions “Tnaparen scoose eevee saver Figure 9.1: AFS Architecture. LIMITATION OF AFS: > Non-availability of services when servers and network components fail. > Scaling problem. Q3] Describe File-Caching schemes Q4] Discuss File caching for Distributed Algorithm Ans: [Qa | 10M - May17] & [Q4 | 10M - Dect7] FILE CACHING: 1. Inorder to improve the file 1/0 performance in centralized time sharing systems, file caching has been implemented and executed in numerous distributed file systems. 2. Main goal of file caching scheme is to retain recently accessed data in main memory. So that repeated access to the same information can be efficiently handled. 4, Inimplementing file-caching scheme, one has to make several key decisions like granularity of cached data 5. Three design issues are involved in file caching which are: n Cache location: > Cache location refers to the place where the cached data is stored. > There exists three possible cache locations in servers DFS ie. server’s main memory, client's disk and client's main memory as shown in figure 9.2. Page 92 of 029 | Distributed File Systems Semester 8 Topper's Solutions © [sex ze] — ® | caearsvise © (Desidess workstation 3) Cache Located in stient's disk, Server's main memory: ‘access cost. Client's main memory: The cache located in a client’s main memory eliminated both network access cost and diskaccess cost. 11) Modification propagation: 1. When the cache is located on clients’ node; a file's data may simultaneously be cached on multiple nodes. Itis possible for caches to become inconsistent when the file data is changed by one of the cients and the corresponding data cached at other nodes are not changed or discarded. 3. variety of approaches is used to handle these issues: a. When to propagate modifications made to a cached data to corresponding fle server? b, How to verify the validity of cached data? 4, Teeonsists ofthe following techniques: Write through scheme: > When cache entry is modified new value is immediately sent to the server for updating the master copy of the file. > —_ Inthisscheme when a cache entry is modified the new value is written only to the cache. > The client just makes a note f the cache entry that has been updated. Page 98 of 1029 | Distributed File Systems Semester 8 Toppee's Solitons > Alte cache entries are collected together and sent to the server later on. > IRs approaches are as follows: «Write on ejecti ' ‘Modified data in the cache is sent to the server when the cache replacement policy has decided to eject it from the client's cache. + Periodic write: ‘+ Here caches scanned at regular intervals. ‘+ And cached data is been modified right from the last scan is sent to the server. ‘+ Modification made to a cached data by a client is sent to the server when the corresponding file is closed by the client. MM) Cache validation schemes: 1. Afile data resides in the cache of multiple nodes. 2, Itbecomes necessary to check if the data cached at the client node is consistent with the master node, 3. Ifitismot then the cached data must be invalidated and the updated version must be fetched from the server. 4, Validation is done in two ways: ‘Client initiated approach: > Inthis method the client contacts the server to check if locally cached datas consistent with the master copy. > File sharing semantics depends on the frequency of the validity check and can be use below approaches: + Check before every access: The main purpose of caching is defeated in this process because the server has to be contacted on every access. + Periodic check: For this method a check is initialized after fixed interval of time. * Check on file open: A client cache entry is validated only when the client open a corresponding file for use. ‘Server initiated approach: > Inthis method a client informs the file server when it opens a file indicating whether the file is being opened for reading, writing or both. > Thefile server keeps a record of which clienthas which file opened and in what mode. > Thusserverkeeps a track of the file usage modes being used by different clients and reacts in case of inconsistency. > Inconsistency occurs when more clients try to open a file in conflicting modes. Page 94 of 1029 | Distributed File Systems Semester ~ 8 Topper’s Solutions > Example: Ifa file is open for reading, other clients may be able to open it to read a file without any problem, but not for writing, > Similarly, a new client must not be allowed to open a file which is already open for writing, When client closes a file it sends intimation to the server along with any modification made to the file, > On receiving intimation the server updates its record of which client has which file open in what mode. Qs] Explain File Accessing Models Ans: [io - Dect) FILE ACCESSING MODELS: Specific client's request for accessing a particular file is serviced on the basis ofthe file accessing ‘model used by the distributed file system. File accessing model depends on the unit of data access and the method used for accessing emote files. 1D UnitofData Access: > Unit of data access refers to fraction of file data that is transferred to and from client as a result of single read write operation. > Itincludes four data transfer models: Unit of Data Transfer File Level BlockLevel —_ByteLevel_ Record Level Filelevel transfer model: > When the operation required file data, the whole file is moved Advantages: + Efficient because network protocal averhead is required only once. + Better scalability because it requires fewer access to file server and reduce server load and network traffic. > Drawbacks isit requires sufficient storage space. Example are amoeba, CFS, Andrew file system. Page 95 of t029 | Distributed File Systems Semester ~8 Topper's Solutions Block level transfer model > File data transfer take place in units of data blocks. > Afile blocks contiguous portion of file and fixed in length. > Advantage is does not required large storage space, > Drawbacks more network traffic and more network protocol overhead. > Poor performance. > Example are Sun microsystem’s NFS, Apollo domain file system. Bytelevel transfer model: > Pile data transfer take place in units of bytes. > Provides maximum flexibility. > Difficulty in cache management. Record level transfer model: > Suitable with structured files. > File data transfer take place in unt of records. > Example: RSS{research storage system) 1) Accessing Remote Files: > One ofthe following model is used when request to access remote file. Remote service model: > Processing of client request is performed at server’s node, > Client request is delivered to server and server machine performs on it and returns replies to dlient. > Request and replies transferred across network as message. > File server interface and communication protocol must be designed carefully so as to minimize the overhead of generating the messages. > Every remote file access results in traffic. Data catching model: > Reduced the amount of network traffic by taking advantage of locality feature > If requested data is not present ically then copied it from server's node to client node and catching there, > LRU is used to keep the cache size bounded. > Cache Consistency problem. Page 96 of 102Question Papers Semester 8 Topper's Solutions ay Q) @) ay Parallel & Distributed System - May 2016 (2) Explain Data Flow computers with example [05] ‘Ans: [Chapter - 1| Page No. 1] (b) Whatis the basic task of scheduler? Define [05] 4) Latency. 11) Initiation Rate. iii) Stage Utilization and iv) Forbidden Latency ‘Ans: [Chapter - 2 | Page No. 13] (6) What are the different models of middleware? [os] Ans: [Chapter ~4 | Page No. 38] (a) Whatare the issues in designinga distributed system? [05] Ans: [Chapter ~ 4 | Page No. 36] {@) Amachine is run on many applications the instruction mix is collected, Loads/Store are 10%, Integer add/sub 15%, FP add/sub 50%, FP multiply divide 5% and othe5% and branches 15%. ‘The clock cycles consumed by these instructions are: Loads 2, Integer add/ sub 1, FP add/sub 5, EP multi divide 20, others 1. Find which component of the architecture requires enhancement first. After incorporating the enhancement which makes clock cycles requirements as 2, Find the overall Speed? [10] ‘Ans: [Chapter~ 2 | Page No. 27] (b) Whatis SIMD Architecture? Explain with example SIMD Mesh Connected Architecture, [10] ‘Ans: [Chapter - 3 | Page No. 29] {2) What is an interlock? Explain the following three different classes of hazards: [10] (i) Control Hazards. (i) Resource hazards. (ili) Operand hazards. ‘Ans: [Chapter -2 | Page No. 14] (b) Explain a pipelined multiplication using Digit Products of Fixed Point Multiplication Pipeline. [10] Ans: [Chapter - 2 | Page No. 20] (2) Explain the difference between Data Centric and Client Centric Consistency Models. Explain ‘one model of each. [10] Ans: {Chapter - 8 | Page No. 88] (b) Explain stream oriented communication with suitable example. [10] Ans: [Chapter - 5 | Page No. 52] Page 97 of 02Question Papers Semester ~8 Topper's Solutions Qs) Q6] (a) Explain the distributed algorithms for Mutual Exclusion? What are the advantages and disadvantages oft over centralized algorithms? [10] Ans: [Chapter ~ 7 | Page No. 76] (0) Write a Suzuki-Kasami's Broadcast Algorithm. Explain with example. [10] Ans: [Chapter 7 | Page No. 73] (2) Compare Load sharing to task assignment and Load balancing strategies for scheduling processes in a distributed system. [10] ‘Ans: [Chapter ~ 6 | Page No. 60] (b) What are the desirable features of good distributed file systems? Explain ile sharing semantic. ofit [10] ‘Ans: [Chapter - 9 | Page No. 89] Page 98 of 102Question Papers Semester ~8 Topper's Solutions Qi) Q] 3) O) Qs) 6) Parallel & Distributed System - Dec 2016 (a) Explain with example Amdahi's law for measuring speed up performance of paralle systems. {051 Ans: [Chapter - 2 | Page No. 23] (b) Define various pipeline performance measures. [05] Ans: [Chapter - 2 | Page No.2} (€)State the goals of distributed system. (05) ‘Ans: [Chapter ~ 4 | Page No. 36] (q) State the desirable features of global scheduling algorithm. {05} Ans: [Chapter - 6 | Page No. 59 (a) Write a note on Pipeline Hazards, [10) ‘Ans: [Chapter - 2 | Page No. 14] {b) Explain in briefany three classification of parallel Architecture. [10] ‘Ans: [Chapter ~ 1 | Page No. 5] (@) Writea note on Election algorithm. [10] ‘Ans: [Chapter ~ 7 | Page No. 70] (b) Explain the concept of Remote Procedure Call. [10] ‘Ans: [Chapter - 5 | Page No. 48] (2) Give one example that can be solved effectively with an SIMD architecture. [10] Ans: [Chapter -3 | Page No. 29] (b) Explain in brief the software concept of distributed systems, [10] Ans: [Chapter - 4 | Page No. 40] (2) Explain the need of client centric consistency models as compared to data centric consistency ‘model. Explain any two client centric consistency model. Ans: [Chapter - 8 | Page No. 85] (b) Explain Load balancing approach in di Ans: [Chapter - 6 | Page No. 54] ributed system. Write short notes on (Any two}: (i) Andrew file system (AFS). Ans: [Chapter ~ 9 | Page No. 91] (ii) Raymond's Tree based algorithm. Ans: [Chapter ~ 7 | Page No.74} (ili) Code Migration, Ans: [Chapter - 6 | Page No. 56] [10] [10] 0) Page 99 of (02,Question Papers Semester ~8 Topper's Solutions Qi) ey Q3] Q4] Q5] Parallel & Distributed System - May 2017 (a) What are the common issues with which the designer of a heterogeneous distributed system must deal? [05] Ans: [Chapter - 4 | Page No. 36] (b) State and prove Amdahl's Law to compute speedup of parallel computers. From experiment twas verified that 70% of execution time was spent on parallel execution. What is the maximum speedup that canbe obtained with 16 processors? [05] ‘Ans: [Chapter ~ 2 Page No. 23] (6) Explain the concept of Processing Elementi SIMD architecture, [05] ‘Ans: [Chapter -3 | Page No. 34] (4) Explain stream oriented communication with an example. [05] ‘Ans: [Chapter - 5 | Page No. 52] {a) Discuss Raymond's Tree based algorithm of token based distributed mutual exclusion. [10] Ans: [Chapter -7 | Page No. 71] (b) How pipeline hazards are classified? Discuss data hazard in detail and list the techniques used to eliminate data hazard. [10] Ans: [Chapter ~2 | Page No. 16] (a) Discuss and differentiate various client-centric consistency models. [10] : [Chapter -8 | Page No. 85] (b) Mlustrate the parallel Algorithm for matrix multiplication and compare the performance of, this algorithm with sequential matrix multiplication algorithm. [10] ‘Ans: [Chapter - 2 | Page No. 25] (a Describe code migration issues in detall [10] Ans: [Chapter -6 | Page No. 56] (b) What is a logic clock? Why are logic clocks required in distributed systems? How does Lamport synchronize logical clocks? Which events are said tobe concurrentin Lamporttimestamps. [10] ‘Ans: [Chapter -7 | Page No. 80] (a) What is the requirement of Election algorithm in Distributed Systems? Describe any one Election algorithm in detail with an example. [10] ‘Ans: [Chapter - 7 | Page No. 70] (b) Define a Remote Procedure Call, Explain the working of RPC in detail [10] Ans: [Chapter - 5 | Page No. 48] Page oo ofQuestion Papers Semester -8 Toppers Sobaions Q6] (a) Describe File-Cashing schemes, fo} Ans: [Chapter ~ 9 | Page No. 85] (0) Differentiate between Job scheduling and load balancing, Discuss the issues in designing Load Balancing Algorithm, fo) ‘Ans: [Chapter - 6 | Page No. 63] Page 101 of 02Question Papers Somester 8 Tapper's Sokions Q Q2] Q3] 4] Qs] 6) Parallel & Distributed System - Dec 2017 (a) How Pipeline Architecture is different from Array Processor architecture, [05] ‘Ans: [Chapter ~ 1 | Page No, 11] (b) Explain the various types of Parallel Programming Models? [05] ‘Ans: [Chapter - 1 | Page No. 2] (0 Explain a method of Dynamic Instruction scheduling for minimizinghazards. [05] ‘Ans: [Chapter - 2 | Page No. 19] (@) Explain Dataflow Computer with examples, [05] Ans: [Chapter ~ 1 | Page No. 1] (a) Explain different types of pipeline Hazards and the cechniques used to eliminate those hazards. [10] ‘Ans: [Chapter - 2 | Page No. 16] (b) Describe Architectural Model of Distributed System with neat diagram. [10] ‘Ans: [Chapter - 4 | Page No. 43] (@) Discuss in detail the various performance metrics in parallel computing [10] ‘Ans: [Chapter ~ 1 | Page No. 9] (0) Explain Lamport’s Distributed Mutwal Algorithm. [10] Ans: [Chapter ~ 7 | Page No. 79] (2) Explain Matrix Multiplication on SIMD. [10] ‘Ans: [Chapter - 3 | Page No. 31] (b) Discuss File caching for Distributed Algorithm, [10] ‘Ans: [Chapter - 9 | Page No. 92] (2) Compare and contrast Task Assignment; Load Balancing and Load Sharing approaches [10] ‘Ans: [Chapter ~ 6 | Page No. 61] (b) Explain call Semantics of RPC. [10] ‘Ans: [Chapter - 5 | Page No. 50] (a) Describe any one Election algorithm in detail with an example. [10] ‘Ans: [Chapter ~ 7 | Page No. 70] (b) Explain File Accessing Models. [10] Ans: [Chapter - 9 | Page No. 95] ‘Page 102 of 102We hope you have like Topper’s Solutions and find it useful. For any suggestion, comments or feedback do contact us at
[email protected]
We are happy to hear you about Topper’s Solutions Wishing You Best Luck, Topper’s Solutions Team gS By taking a Photocopy of our solutions, you may save your 10 Rs. But it will be a great loss of our efforts & time utilized all together to accomplish these solutions and making it available for the betterment of students. The entire Topper’s Solutions Team. is working on it, do help us....!!!! “Den’t pass the solutions to make a Photocopy of it” e
You might also like
Mpi Course
PDF
No ratings yet
Mpi Course
202 pages
Module 5
PDF
No ratings yet
Module 5
138 pages
COA - Unit 4
PDF
No ratings yet
COA - Unit 4
84 pages
ParallelIzation Principles
PDF
No ratings yet
ParallelIzation Principles
40 pages
Lectures5 14
PDF
No ratings yet
Lectures5 14
85 pages
Parallel Programming Models: Sathish Vadhiyar
PDF
No ratings yet
Parallel Programming Models: Sathish Vadhiyar
32 pages
Parallel Programming: Sathish S. Vadhiyar Course Web Page
PDF
No ratings yet
Parallel Programming: Sathish S. Vadhiyar Course Web Page
36 pages
Part 1 - Lecture 3 - Parallel Software-1
PDF
No ratings yet
Part 1 - Lecture 3 - Parallel Software-1
45 pages
24-25 - Parallel Processing PDF
PDF
No ratings yet
24-25 - Parallel Processing PDF
36 pages
Cray-1 (1976) : The World's Most Expensive Love Seat
PDF
No ratings yet
Cray-1 (1976) : The World's Most Expensive Love Seat
18 pages
Module 5
PDF
No ratings yet
Module 5
40 pages
Parallel and Distributed Algorithms
PDF
No ratings yet
Parallel and Distributed Algorithms
65 pages
Parallel Computing
PDF
No ratings yet
Parallel Computing
28 pages
BDS Session 2
PDF
No ratings yet
BDS Session 2
58 pages
Week1 - Parallel and Distributed Computing
PDF
100% (1)
Week1 - Parallel and Distributed Computing
46 pages
Clase01 - Introducción Al Paralelismo
PDF
No ratings yet
Clase01 - Introducción Al Paralelismo
30 pages
Clase01 - Introducción Al Paralelismo
PDF
No ratings yet
Clase01 - Introducción Al Paralelismo
30 pages
Cloud Computing - Lecture 3
PDF
No ratings yet
Cloud Computing - Lecture 3
22 pages
Parallel Processing
PDF
No ratings yet
Parallel Processing
31 pages
Parallel Algorithm - Introduction
PDF
No ratings yet
Parallel Algorithm - Introduction
36 pages
Chapter Six
PDF
No ratings yet
Chapter Six
18 pages
IT105 Midterm Lecture Part1
PDF
No ratings yet
IT105 Midterm Lecture Part1
5 pages
Speedup
PDF
No ratings yet
Speedup
12 pages
Parallel Programming Module 1
PDF
No ratings yet
Parallel Programming Module 1
71 pages
Chapter 7 - Parallel Programming Issues
PDF
No ratings yet
Chapter 7 - Parallel Programming Issues
68 pages
HPC Chapter 1
PDF
No ratings yet
HPC Chapter 1
12 pages
Parallel Computing
PDF
No ratings yet
Parallel Computing
2 pages
Lecture-4 Parallel Programming Model
PDF
No ratings yet
Lecture-4 Parallel Programming Model
14 pages
Tutorial No 1 (Solved)
PDF
No ratings yet
Tutorial No 1 (Solved)
2 pages
Module 1
PDF
No ratings yet
Module 1
14 pages
HPC Module 4
PDF
No ratings yet
HPC Module 4
18 pages
Parallel Computing
PDF
No ratings yet
Parallel Computing
3 pages
Coa Unit 04
PDF
No ratings yet
Coa Unit 04
85 pages
2022 Mid 1
PDF
No ratings yet
2022 Mid 1
4 pages
Lecture 6
PDF
No ratings yet
Lecture 6
37 pages
HPC Parallel
PDF
No ratings yet
HPC Parallel
122 pages
L1.3a HPC Concepts
PDF
No ratings yet
L1.3a HPC Concepts
43 pages
HPC Unit 2
PDF
No ratings yet
HPC Unit 2
72 pages
Screenshot 2024-12-05 at 2.01.32 PM
PDF
No ratings yet
Screenshot 2024-12-05 at 2.01.32 PM
49 pages
HPC Pyq
PDF
No ratings yet
HPC Pyq
11 pages
COA UNIT 5 (AutoRecovered)
PDF
No ratings yet
COA UNIT 5 (AutoRecovered)
14 pages
Parallel Programming
PDF
No ratings yet
Parallel Programming
42 pages
001 - DDS IIIT Jan 10th
PDF
No ratings yet
001 - DDS IIIT Jan 10th
34 pages
High Performance Computing
PDF
No ratings yet
High Performance Computing
8 pages
Parallel VS Distributed Computing
PDF
No ratings yet
Parallel VS Distributed Computing
9 pages
Unit1 2 and 3
PDF
No ratings yet
Unit1 2 and 3
76 pages
PDC Complete Course File
PDF
No ratings yet
PDC Complete Course File
422 pages
PA Midsem
PDF
No ratings yet
PA Midsem
20 pages
HPC Detailed Notes
PDF
No ratings yet
HPC Detailed Notes
5 pages
Pda 1
PDF
No ratings yet
Pda 1
72 pages
LP V Theory and Practical Explanation: o o o o
PDF
No ratings yet
LP V Theory and Practical Explanation: o o o o
96 pages
PDC Architectures
PDF
No ratings yet
PDC Architectures
24 pages
Unit 2.2 Parallel Programming Models
PDF
No ratings yet
Unit 2.2 Parallel Programming Models
23 pages
Module - 4 - Parallel Processing
PDF
No ratings yet
Module - 4 - Parallel Processing
32 pages
1st Ia Preparation
PDF
No ratings yet
1st Ia Preparation
15 pages