0% found this document useful (0 votes)
25 views

Quiz 2

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Quiz 2

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS406 – Quiz 2

1. A collection of computers are connected together. Components interact with each


other by means of message passing. However, message passing is allowed among
components running on the same operating system only. Additionally, multiple
components provide the same service and users have to specify the service location in
order to get the service. If a particular service fails it cannot be recovered without
users’ knowledge. Can you classify this system as a distributed system? Justify your
answer.
A collection of connected autonomous computers that interact with each
other by means of message passing is a distributed system. In addition, the
system satisfies seven common characteristics including fault tolerance,
heterogeneity and transparency. The given collection of computers only
allows message passing among homogeneous OSs. Service locations need to
be known and fault cannot be resolved without user knowledge. Therefore,
the system does not fully support fault tolerance, heterogeneity and
transparency. Other common characteristics have not been mentioned. So it
is difficult to say that it is not a distributed system. However, we can claim
that it is a distributed system with limited support for fault tolerance,
heterogeneity and transparency. (4 marks)

2. State and discuss the components of a file system. How many lookup calls are needed
to resolve a given pathname for a file that is stored on an NFS server? Justify your
answer.
File system consists of three major components.
flat file service defines operations over file content and assigns UFIDs to newly
created files
Directory service provides mapping between UFIDs and string names(file path
names)
Client module integrates the fat file system and directory service (2 marks)
Number of lookup calls depends on the number path name components.
For example path name with N components needs N lookupcalls
Component by component lookup is carried out due to availability of symbolic
links, mount points and .. in the path names (4 marks) (2 mark)
3. Give a brief account on Domain Name Service. Describe the two name resolution
techniques used in NFS. Which of the two techniques facilitates concurrency and
why?
Domain name Service is the name service used by the Internet
It is a distributed name database which heavily used caching
Databases are generally replicated to improve performance, availability and fault
tolerance.
Its primary functionality is to resolve the IP for a given string name (URL)
Reverse resolution is also supported (2 marks)
In Iterative navigation, client interacts with name servers one by one until the name
is resolved
In IRecursive navigation, the client interacts with one server. If it fails to resolve the
name server forwards the client request to another server. This is done recursively
until the name is resolved
Recursive navigation facilitates concurrency as servers can work on outstanding
jobs while other servers resolve the name.(2 marks)
4. A clock is reading 10:27:54.0 (hr:min:sec) when it is discovered to be 4 seconds fast.
Explain why it is undesirable to set it back to the right time at that point and show
(numerically) how it should be adjusted so as to be correct after 8 seconds has
elapsed.
Since clocks are ever advanced, resetting faster clocks by turning clock hands in
anti-clockwise direction results in wrong time values for events. For example if
two events occur before and after resetting the clock. First event is stamped with
a higher value than the second event. This is wrong as the clock value of the first
event must be lower than the next event. (2 mark)
Clock can be reset by forcing it to run at a slow rate for a fixed amount of time.
Just assume that the clock is set to run at rate c.
Observed incorrect time = Tskew = 10:27:54.0
Correct clock value at this time =10:27:50.0
Correct clock value after 8 seconds =10:27:58.0
incorrect time after 8 seconds = E = 10:28:02.0
Substitute these values to S=c(E-Tskew)=Tskew
10:27:58=c(10:28:02 - 10:27-54) - 10:27:54
Then c = 0.5(2 marks)
5. A client attempts to synchronize with a time server. It records the round-trip times and
timestamps returned by the server in the table below.

Which of these times should it use to set its clock? To what time should it set it?
Estimate the accuracy of the setting with respect to the server’s clock. If it is known
that the time between sending and receiving a message in the system concerned is at
least 10 ms, do your answers change?

Server UTC time Minimum time per message transmission (ms)

S1 11:34:23:235 11

S2 10:58:53:823 9

S3 11:44:43:638 10

S4 10:59:53:835 9

According to the cristian algorithm, server which records the minimum round
trip time needs to be selected and clock is to its UTC time + 0.5*minimum round
trip time
In this example, there are two servers, S2 & S4, with minimum round trip time (9
request + 9 reply = 18ms)
Let's select S2. Then clock is set to 10:58:53:823 + 18/2 ms = 10:58:53:832
Then the lock is accurate to +or- 9 (2 marks)
If the actual minimum round trip is 20=2*10, selected value 18 is smaller than the
minimum.
It is wrong hence the clock needs to be reset.
Therefore, S3 should be selected and clock is set to 11:44:43:638+10=11:44:43:648
Then the lock is accurate to +or- (10-9)=1ms(2 marks)

6. A scheme for implementing at-most-once reliable message delivery uses synchronized


clocks to reject duplicate messages. Processes place their local clock value (a
‘timestamp’) in the messages they send. Each receiver keeps a table giving, for each
sending process, the largest message timestamp it has seen. Assume that clocks are
synchronized to within 100 ms, and that messages can arrive at most 50 ms after
transmission.
(i) When may a process ignore a message bearing a timestamp T, if it has recorded
the last message received from that process as having timestamp T’?
A new message becomes a duplicate if the same message has been received
earlier and time is recorded. therefore, if T < T’ it is rejected(2 marks)
(ii) When may a receiver remove a timestamp 175,000 (ms) from its table? (Hint:
use the receiver’s local clock value.)
The earliest message timestamp that could still arrive when the
receiver’s clock is r is r - 100 - 50. If this is to be at least 175,000 (so that
we cannot mistakenly receive a duplicate), we need r -150 = 175,000, i.e.
r = 175,150. (2 marks)
(iii) Should the clocks be internally synchronized or externally synchronized?
service?
Since the decision making is based on timestamp comparison the accuracy is
canceled out. Therefore, internal synchronization is sufficient. (2 marks)
7. Explain how you could determine whether a given communication system is reliable.
Consider three communication services used in asynchronous distributed systems. In
service A, messages are safely transmitted and may be delayed, and checksums apply
only to headers. In service B, messages may be lost or delivered too fast for the recipient
to handle them, but those that are delivered arrive in order and with the correct contents.
In service C, messages are safely transmitted and may be delayed, and checksums apply
to the entire message. Can these services be described as reliable communication
services? Justify your answer.

Check whether the communication service satisfies validity(message transmission is


safe) and integrity (Message content is not altered). (1 mark)
In service A, validity is ensured even if there could be a delay. Messages could be
corrupted as checksums apply only to headers. Not reliable as integrity is not
guaranteed.(1 mark)
In service B, validity is not ensured as messages may be lost during transmission.
Integrity is satisfied as messages are delivered with correct content. Not reliable
as validity is not guaranteed. (1 mark)
In service C, validity is ensured even if there could be a delay. Integrity is satisfied
as checksums apply to the entire message. Reliable as both integrity and validity
are guaranteed. (1 mark)

You might also like