aos assignment 1 answers

11
AOS Assignment 1 Answers 1. A distributed system organized as middleware. Explain 2. Why is it sometimes so hard to hide the occurrence and recovery from failures in a distributed system? ( from Exercise of chapter-1 3. We argued that distribution transparency may not be in place for pervasive systems. This statement is not true for all types of transparencies.Give an example.( from Exercise of chapter-1 4. We already gave some examples of distributed pervasive systems: home systems, electronic health-care systems, and sensor networks. Extend this list with more examples. ( from Exercise of chapter-1) 5. Explain Network time Protocol with the help of diagram. 6. What is the different type of Distributed Systems? Write short note. 7. Explain Clock synchronization by giving suitable example and diagram 8. Explain Berkeley Algorithm with the help of diagram. 9. How vector clock are used for clock synchronization Explain with diagram 10. Suppose that two processes detect the demise of the coordinator simultaneously and both decide to hold an election using the bully algorithm. What happens?

Upload: others

Post on 23-Apr-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AOS Assignment 1 Answers

AOS Assignment 1 – Answers

1. A distributed system organized as middleware. Explain

2. Why is it sometimes so hard to hide the occurrence and recovery from failures in a distributed

system? ( from Exercise of chapter-1

3. We argued that distribution transparency may not be in place for pervasive systems. This

statement is not true for all types of transparencies.Give an example.( from Exercise of chapter-1

4. We already gave some examples of distributed pervasive systems: home systems, electronic

health-care systems, and sensor networks. Extend this list with more examples. ( from Exercise

of chapter-1)

5. Explain Network time Protocol with the help of diagram.

6. What is the different type of Distributed Systems? Write short note.

7. Explain Clock synchronization by giving suitable example and diagram

8. Explain Berkeley Algorithm with the help of diagram.

9. How vector clock are used for clock synchronization Explain with diagram

10. Suppose that two processes detect the demise of the coordinator simultaneously and both

decide to hold an election using the bully algorithm. What happens?

Page 2: AOS Assignment 1 Answers

Q1 Answer:

If its organized as a middleware that mean , it is responsible for all the contents .

The middleware layer extends over multiple machines and offers each application the same interface.

Q2 Answer:

its impossible to detect a server is actually down, or that it is simply slow in responding. other case a system may have to report that the service is not available, but in fact, the server is available but it just slow.

Q3 Answer:

Think of migration transparency. In many pervasive systems, components are mobile and will need to re-establish connections when moving from one access point to another Preferably, such handovers should be completely transparent to the user. Likewise, it can be argued that many other types of transparencies should be supported as well. How ever, what should not be hid-den is a user is possibly accessing resources that are directly coupled to the user's current environment.

Q4 Answer:

There are so many more examples such as large scale wireless mesh network in cities , and it is

provide the services like internet access .

Other thing is systems for habitat monitoring (as in wildlife resorts), electronic jails by which

offenders are continuously monitored, large-scale integrated sports systems.

Page 3: AOS Assignment 1 Answers

Q5 Answer:

*A common approach in many protocol, developed by Cristina in (1989) why ?

to let client contact a time server.

*And it has a propagation delays :

Ѳ = (𝑻𝟐−𝑻𝟏)+(𝑻𝟑−𝑻𝟒)

𝟐

*Diagram:

Getting the current Time from a time server.

Q6 Answer:

There are three main types of distributed system:

1-Clustring Computing System: it become popular when the price and performance ratio personal

computers and workstation improved.

And it is used for parallel on programming in which single program is running on multi machines.

2- grid computing system: high degree of heterogeneity, no assumption are made concerning

hardware, OS, network etc.

Time takes from

server to computer

Server

Computer

αTReq

Request from computer to server

αTRes

response from server to computer

Time takes from

computer to server

Page 4: AOS Assignment 1 Answers

It has issue that resource from different organization are brought together to allow collaboration of a

group of people or companies.

And it has five layers : Applications, collective , connectivity, Resource and fabric layer.

3- Distributed Pervasive System:

It has requirements :1- Embrace contextual change. 2- Encourage ad hoc compositions.

3- Recognize sharing the default.

Q7 Answer:

In Clock Synchronization if one machine has a WWV receiver , the goal becomes keeping all the other

machines synchronized to it .

And it is has two types of algorithm : 1- Network Time Protocol . 2- Berkeley Algorithm.

Q8 Answer:

In Berkeley algorithm time server is active , polling all the machines from time to time to ask what is

the time in that . after answering it will compute the average for the time and tell them to change

their time depending on the new one .

Page 5: AOS Assignment 1 Answers

Q9 Answer:

In vector clock the order of process is not necessary , and it is constructed by letting each

process maintain a vector , depending on two priority :

1-VCJ[i] it leads to the number of events that have been occurred in Pi. Or we can say that it is

the local logical clock in process Pi.

2- if VCj [U] = k , then Pi will know that the event here is k that have been occurred in Pj .

Q10 Answer:

Each process will get election massages , but it will ignore the second one from that , then the

election will processed as usual .

Page 6: AOS Assignment 1 Answers

AOS Assignment 2 – Answers

1. List four design issues for which the concept of concurrency is relevant.

2. What is the basic requirement for the execution of concurrent processes?

3. List three degrees of awareness between processes (Process interaction) and briefly define

each.

4. What is the distinction between competing processes and cooperating processes?

5. List the three control problems associated with competing processes and briefly define each.

6. What is the difference between remote access model and upload/download model?

7. Explain cluster based distributed file system with neat diagram.

8. What is the difference between NFS version 3 and NFS version 4 with respect to Remote

procedure call (RPC)

9. Illustrate the importance of naming in NFS with neat diagram.

10. What is the importance of file locking in distributed system? And write all lock operation of

NFS version 4.

Page 7: AOS Assignment 1 Answers

Q1 Answer:

1- Process Control blocks used for making OS keep tracking all various processes . 2- Allocate and deallocate various resources for each active process by the OS .

in time, which multiple processes want access the same resource 3- The OS must protect the data and physical resources of each process against

unintended interference by other processes. This involves techniques that relate to memory, Files, and Input / Output devices.

4- The functioning of a process, and the output it produces, it should be independent of the speed at which its execution is carried the relative to the speed of other concurrent processes.

Q2 Answer:

The ability of enforcing the mutual exclusion , and that mean all other process from a Course will be exclude one process only for that ability.

Q3 Answer:

1- Process unware of each other: The relationship between them is competition because they are working on different locations and times .

2- Process indirectly aware of each other: The relationship is cooperation by sharing that mean they must have an amity between them , because they are running on same process.

3- Process directly aware of each other: They have a cooperation by communication , also they must having an amity between them because they are working on same activity.

Page 8: AOS Assignment 1 Answers

Q4 Answer: The distinction in competing is that both of process are on different location and time , so they should have a competition between them , only one should win . About cooperating , both are on same process or may have the same activity so they should be friendly for working together . Q5 Answer: 1- Mutual Exclusion : Two or more process want to access the same single , non-shareable resource , e.g. Printer .

2- Deadlock : we have two process and two resource , and both Processes want to access both resource also , to performing their functions , firstly we will let P1 share with R2 and P2 share with R1 . but, P1 will waiting for R1 until its finished and P2 also will waits for R2 .

3-Starvation : if we suppose that we have four processes and each if them want to access the resource , and we know that they should access periodic . and all are access the resource except P4 , it should wait for P1 until its finished , then it will be allowed to access .

Q6 Answer: * Remote Access model : Is a file declared only on server , and the client is sending the commands to done the work.

* Upload/Download Model: Client downloading the files and work on it then , write it back on the server .

This type is more advantageable because it is simple and has good performance .

Page 9: AOS Assignment 1 Answers

Q7 Answer: Server cluster is used for parallel applications , the associated file system

is adjusted accordingly , one of the technique is file striping technique ,

in that one file is crossing multiple servers .

The idea is to : distribute a large file by multiple servers , and that makes it bring different parts in parallel positions .

The file stripping it may not be effective tool , but it is more appropriate to partition the files system , and store different file on different servers simply . but , no partitioning for single files on multiple servers

Q8 Answer: In version 3 when the message is sent , firstly check the file if its there look up then replay , read the file , finally end .

So there are three operations on one file , each one in different step , so that makes a draw back , increasing the time.

In version 4 all the operation is on the same time , look up , open and read .

And that makes it faster and better than V3 .

Page 10: AOS Assignment 1 Answers

Q9 Answer: In hierarchal way we have firstly , Name space then , Directory (it is such as a file), and the last is sub directory (inside the directory). We have many cases:

1- First point , directory and sub directory are same in all the three cases But the name space is different . 2- We can copy cope all the three directory , sub directory and namespace from server to

client and from server to server but we can’t copy from client to client .

Page 11: AOS Assignment 1 Answers

Q10 Answer: It is required in clients and server architecture with stateless sever , we have to add the facilities for the synchronization to share the files and all this is for making usage of lock manager , and It used to test whether a conflicting is existing or not . Lock operation used to delete the lock file form ,Renew is for renew the requesting from client to server. Write lock is important to generate exclusive access for part of file . All these operations are used for request a read or write lock .