You are on page 1of 3

TECHNICAL UNIVERSITY OF KENYA

SCHOOL OF COMPUTING AND INFORMATION TECHNOLOGY


B. TECH COMMUNICATION AND COMPUTER NETWORKS
SCCJ/01450/2019;
SHARIFF ODIWUOR OLUOCH
DISTRIBUTED SYSTEMS CAT

1. (a)Briefly discuss Clock synchronization.


Clock synchronization in distributed systems is the process of coordinating the clocks of multiple nodes
or computers, so that all of them share the same time. This is important so that they can exchange data
without any issues.
The physical clocks are used to adjust the time of nodes. Each node in the system can share its local time
with other nodes in the system. The time is set based on UTC (Universal Time Coordination). UTC is
used as a reference time clock for the nodes in the system.
The clock synchronization can be achieved by 2 ways:
i. External and Internal Clock Synchronization.
External clock synchronization is the one in which an external reference clock is present. It is used as a
reference and the nodes in the system can set and adjust their time accordingly.
ii. Internal clock synchronization is the one in which each node shares its time with other nodes
and all the nodes set and adjust their times accordingly.

(b)With aid of a diagram, differentiate between Remote Method Invocation (RMI) and
Remote Procedure Call (RPC).
RPC and RMI are the mechanisms which enable a client to invoke the procedure or method from the
server through establishing communication between client and server. The common difference
between RPC and RMI is that RPC only supports procedural programming whereas RMI
supports object-oriented programming.

Basis for comparison RPC RMI


Support Procedural programming Object-oriented programming
Parameter Ordinary data structures are Objects are passed to remote
passed to remote procedures. methods.
Efficiency Lower than RMI More than RPC and supported
by modern programming
approach (i.e., Object-oriented
paradigms)
Overheads More Less comparatively
In-out parameters are Yes Not necessarily
mandatory.
Provision of ease of High Low
programming

(c)Consider a simple server that carries out client requests without accessing other servers.
Explain why it is generally not possible to set a limit on the time taken by such a server to
respond to a client request.
Standalone servers typically do not have the capability to set a limit for response times to clients
because they are not connected to other systems. This means that they cannot detect when a client
request is taking too long to be responded to and take corrective action. In order to set a limit for time
taken by standalone servers to respond to client requests, they would have to be integrated with other
systems that can monitor response time and act accordingly.

(d)Explain the following Algorithms.


(i). Ring algorithm.
This algorithm applies to systems organized as a ring (logically or physically). In this algorithm we
assume that the link between the process is unidirectional and every process can message to the process
on its right only. Data structure that this algorithm uses is active list, a list that has a priority number of all
active processes in the system. 
Algorithm –
If process P1 detects a coordinator failure, it creates new active list which is empty initially. It sends
election message to its neighbor on right and adds number 1 to its active list.
If process P2 receives message elect from processes on left, it responds in 3 ways:
(I) If message received does not contain 1 in active list, then P1 adds 2 to its active list and forwards the
message.
(II) If this is the first election message it has received or sent, P1 creates new active list with numbers 1
and 2. It then sends election message 1 followed by 2.
(III) If Process P1 receives its own election message 1 then active list for P1 now contains numbers of all
the active processes in the system. Now Process P1 detects highest priority number from list and elects it
as the new coordinator.

(ii)Bully election algorithm


Election algorithms choose a process from a group of processors to act as a coordinator. If the coordinator
process crashes due to some reasons, then a new coordinator is elected on other processor. Election
algorithm basically determines where a new copy of the coordinator should be restarted. Election
algorithm assumes that every active process in the system has a unique priority number. The process with
highest priority will be chosen as a new coordinator. Hence, when a coordinator fails, this algorithm
elects that active process which has highest priority number. Then this number is sent to every active
process in the distributed system. We have two election algorithms for two different configurations of a
distributed system. 

(e) Discuss different types of security threats in any distributed system and measures taken
against them.
There are multiple types of security threats, including malware, phishing, social engineering,
ransomware, hacking, and denial-of-service attacks.
To protect against security threats, it is important to ensure that all computers, servers, and data
storage devices are kept up-to-date with the latest security patches and antivirus software. It is also
important to use secure passwords, encrypt data, and use secure protocols when sending sensitive
data over a network. Additionally, it is important to educate users on good security practices, such as
avoiding clicking on suspicious links and not responding to email phishing scams.

You might also like