0% found this document useful (0 votes)
178 views19 pages

DC SEM8 Com BH Sample Notes

The document provides information about remote procedure calls (RPC) in distributed systems. It defines RPC as a technique that allows a program to execute a procedure in a different address space as if it were a local procedure call. It describes the basic RPC architecture including client, client stub, RPC runtime, server stub, and server. It explains the process of an RPC call, where the client stub communicates with the RPC runtime to send a request to the server stub and return the response.

Uploaded by

Nabeel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views19 pages

DC SEM8 Com BH Sample Notes

The document provides information about remote procedure calls (RPC) in distributed systems. It defines RPC as a technique that allows a program to execute a procedure in a different address space as if it were a local procedure call. It describes the basic RPC architecture including client, client stub, RPC runtime, server stub, and server. It explains the process of an RPC call, where the client stub communicates with the RPC runtime to send a request to the server stub and return the response.

Uploaded by

Nabeel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

A quality product by

BrainheatersTM

pp
A
s
er
Bh.Notes: DC
at

Computer Semester 8
he
in

A series of Important Concepts/Questions


highly recommended for MU Exam
ra
B

‘C’ SCHEME - 2022-2023

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
Q1. Explain Goals/Features of Distributed Systems. (P4 - Appeared 1
Time) (5-10 Marks)
Ans: The four important goals that should be met for an efficient distributed
system are as follows:
1. Connecting Users and Resources:
● The main goal of a distributed system is to make it easy for users to

pp
access remote resources and to share them with others in a
controlled way.
● It is cheaper to let a printer be shared by several users than buying

A
and maintaining printers for each user.
● Collaborating and exchanging information can be made easier by
connecting users and resources.

s
2. Transparency:

er
It is important for a distributed system to hide the location of its
process and resource. A distributed system that can portray itself
at
as a single system is said to be transparent.
● The various transparencies need to be considered are access,
he

location, migration, relocation, replication, concurrency, failure and


persistence.
● Aiming for distributed transparency should be considered along
in

with performance issues.


3. Openness:
ra

● Openness is an important goal of a distributed system in which it


offers services according to standard rules that describe the syntax
B

and semantics of those services.


● Open distributed system must be flexible making it easy to
configure and add new components without affecting existing
components. An open distributed system must also be extensible.
4. Scalable:

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
● Scalability is one of the most important goals which are measured
along three different dimensions.
● First, a system can be scalable with respect to its size which can
add more users and resources to a system.
● Second, users and resources can be geographically apart.
● Third, it is possible to manage even if many administrative
organisations are spanned.

pp
Features/Characteristics of Distributed System
The features are as follows:
1. Resource Sharing

A
● The main important feature of this system is that it allows users to
share resources.

s
● Moreover, they can share resources in a secure and controlled
manner.

er
Resources can be of any type. For example, some common
resources which are shared can be printers, files, data, storage, web
at
pages, etc.
2. Openness
he

● This means that the services which the system provides are openly
displayed through interfaces.
Moreover, these interfaces provide only the syntax of the services.
in


● For example, the type of functions, their return types, parameters,
etc. These interfaces use Interface Definition Languages (IDL).
ra

3. Concurrency
● It means that several tasks take place at different nodes of the
B

system simultaneously.
● Moreover, these tasks can also interact with each other. It results in
increasing the efficiency of the system.
4. Scalability

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
● It refers to the fact that the efficiency of the system should not
change when more nodes are added to the system.
● Moreover, the performance for the system with 100 nodes should be
equal to the system with 1000 nodes.
5. Fault Tolerance
● It means that the user can still work with the system in the case,
hardware, or software fails.

pp
6. Transparency
● It is the most important feature of the system. The main goal of a
distributed OS is to hide the fact that the resources are being

A
shared.
● Furthermore, transparency means that the user should not know

s
that the resources he is using are shared.
● Moreover, for the user, the system should be a separate individual
unit.
er
at
Q2. What is the role of Middleware in a Distributed System and mention
he

the services provided by it.(P4 - Appeared 1 Time) (5-10 Marks)


Ans: In a distributed system, middleware is a software component that
serves between two or more applications.
in

Middleware usually resides between the operating system and the end
user or end-user application. It provides essential features that the
ra

operating system doesn't offer. The term usually refers to large software
products, such as database managers, transaction monitors, and web
B

servers.

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
pp
A
Middleware can perform numerous functions such as:
● It manages connections to various backend resources. Middleware

s
components can create connection pools to provide fast and
er
efficient access to popular backend databases.
● Second, middleware software can implement logic based on client
at
requirements. For example, the middleware component can detect
that the language header of the client browser making a particular
he

request is set to English. As a result, queries sent to the backend will


adjust to returning only English-based results.
● Third, middleware is essential in concurrency, load balancing, and
in

transaction management. It's scaled up and down to distribute


incoming client requests across multiple servers, virtual machines,
ra

or cloud availability zones.


● Finally, middleware plays an essential role in protecting access to
B

backend resources. It requires a secure connection using


technology such as SSL and a username/password combination or
digital certificate authentication.

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
Q3. Explain RPC model and its types.(P4 - Appeared 1 Time) (5-10
Marks)
Ans: Remote Procedure Call (RPC) is an interprocess communication
technique.
● The Full form of RPC is Remote Procedure Call. It is used for
client-server applications. RPC mechanisms are used when a

pp
computer program causes a procedure or subroutine to execute in
a different address space, which is coded as a normal procedure
call without the programmer specifically coding the details for the

A
remote interaction.
● This procedure call also manages low-level transport protocols,
such as User Datagram Protocol, Transmission Control

s
Protocol/Internet Protocol etc. It is used for carrying the message
data between programs.
er
at
he
in
ra
B

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
RPC Architecture
RPC architecture has mainly five components of the program:
1. Client
2. Client Stub
3. RPC Runtime
4. Server Stub
5. Server

pp
Following steps take place during the RPC process:
1. Step 1) The client, the client stub, and one instance of RPC runtime
execute on the client machine.

A
2. Step 2) A client starts a client stub process by passing parameters
in the usual way. The client stub stores within the client’s own

s
address space. It also asks the local RPC Runtime to send back to
the server stub.
3.
er
Step 3) In this stage, RPC is accessed by the user by making regular
Local Procedural Cal. RPC Runtime manages the transmission of
at
messages between the network across client and server. It also
performs the job of retransmission, acknowledgment, routing, and
he

encryption.
4. Step 4) After completing the server procedure, it returns to the
server stub, which packs (marshalls) the return values into a
in

message. The server stub then sends a message back to the


transport layer.
ra

5. Step 5) In this step, the transport layer sends back the result
message to the client transport layer, which returns a message to
B

the client stub.


6. Step 6) In this stage, the client stub marshalls (unpack) the return
parameters, in the resulting packet, and the execution process
returns to the caller.

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
Types of RPC:
Callback RPC: In a Callback RPC, a P2P (Peer-to-Peer)paradigm opts
between participating processes. In this way, a process provides both
client and server functions which are quite helpful. Callback RPC’s features
include:
● The problems encountered with interactive applications that are
handled remotely

pp
● It provides a server for clients to use.
● Due to the callback mechanism, the client process is delayed.
● Deadlocks need to be managed in callbacks.

A
● It promotes a Peer-to-Peer (P2P) paradigm among the
processes involved.

s
RPC for Broadcast: A client’s request that is broadcast all through the
network and handled by all servers that possess the method for handling
er
that request is known as a broadcast RPC. Broadcast RPC’s features
include:
at
● You have an option of selecting whether or not the client’s
request message ought to be broadcast.
he

● It also gives you the option of declaring broadcast ports.


● It helps in diminishing physical network load.
Batch-mode RPC: Batch-mode RPC enables the client to line and separate
in

RPC inquiries in a transmission buffer before sending them to the server in


a single batch over the network. Batch-mode RPC s features include:
ra

● It diminishes the overhead of requesting the server by sending


them all at once using the network.
B

● It is used for applications that require low call rates.


● It necessitates the use of a reliable transmission protocol.

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
Q4. Difference between Message and Stream-Oriented
Communication.(P4 - Appeared 1 Time) (5-10 Marks)
Ans:

Message oriented Stream oriented communication


communication

pp
UDP (user datagram protocol) TCP (transmission contact
uses manage oriented protocol) uses stream oriented
communication communication

A
Data is sent by application in Data is sent with no particular
discrete packages called structure.

s
messages. er
Communication is connection Communication is oriented,
at
less, data is sent without any connection established before
setup. comm.
he

It is unreliable best effort delivery It is reliable, data acknowledged.


without acknowledgement.
in

Re transmission is not performed. Lost data is reframed


automatically.
ra

Low overhead. High overhead.


B

No flow control. Flow control using sent protocol like


sliding

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
Transmission speed is very high Transmission speed is lower as
as compared to stream-oriented. compared to message oriented.

Suitable for applications like Suitable for applications like e-mail


audio, video where speed is systems where data must be
critical than loss of messages. persistent through delivery late.

pp
Q5. Explain Rica-Agarwala’s non-token based algorithm.(P4 -
Appeared 1 Time) (5-10 Marks)

A
Ans: Ricart–Agrawala algorithm is an algorithm for mutual exclusion in a
distributed system proposed by Glenn Ricart and Ashok Agrawala. This

s
algorithm is an extension and optimization of Lamport’s Distributed Mutual
er
Exclusion Algorithm. Like Lamport’s Algorithm, it also follows a permission
based approach to ensure mutual exclusion.
at
In this algorithm:
● Two types of messages ( REQUEST and REPLY) are used and
he

communication channels are assumed to follow FIFO order.


● A site sends a REQUEST message to all other sites to get their
permission to enter a critical section.
in

● A site sends a REPLY message to another site to give its permission


to enter the critical section.
ra

● A timestamp is given to each critical section request using


Lamport’s logical clock.
B

● Timestamp is used to determine priority of critical section requests.


Smaller timestamp gets high priority over larger timestamp. The
execution of critical section requests is always in the order of their
timestamp.
Algorithm:

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
● To enter Critical section:
○ When a site Si wants to enter the critical section, it sends a
timestamped REQUEST message to all other sites.
○ When a site Sj receives a REQUEST message from site Si, It
sends a REPLY message to site Si if and only if
■ Site Sj is neither requesting nor currently executing
the critical section.

pp
■ In case Site Sj is requesting, the timestamp of Site Si‘s
request is smaller than its own request.
Otherwise the request is deferred by site Sj.

A
● To execute the critical section:
○ Site Si enters the critical section if it has received the REPLY

s
message from all other sites.
● To release the critical section:

er
Upon exiting the site Si sends a REPLY message to all the
deferred requests.
at
Message Complexity:
Ricart–Agrawala algorithm requires invocation of 2(N – 1) messages per
he

critical section execution. These 2(N – 1) messages involves


● (N – 1) request messages
(N – 1) reply messages
in


Drawbacks of Ricart–Agrawala algorithm:
● Unreliable approach: failure of any one of the nodes in the system
ra

can halt the progress of the system. In this situation, the process will
starve forever.
B

The problem of failure of nodes can be solved by detecting failure


after some timeout.
Performance:
● Synchronization delay is equal to maximum message transmission
time

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
● It requires 2(N – 1) messages per Critical section execution

Q6. Write a short note on- Suzuki-Kasami’s Broadcast Algorithm.(P4 -


Appeared 1 Time) (5-10 Marks)
Ans: If a site without a token needs to enter a CS, broadcast a REQUEST for a
token message to all other sites.

pp
nToken: (a) Queue of request sites (b) Array LN[1..N], the sequence number
of the most recent execution by a site j.
Token holder sends token to requestor, if it is not inside CS. Otherwise, send

A
after exiting CS.
Token holders can make multiple CS accesses.

s
Design issues:
a).Distinguishing outdated REQUEST messages from current REQUEST
messages
er
b) Determining which site has an outstanding request for the CS.
at
Algorithm
Requesting the critical section
he

If the requesting site 5i does not have the token, then it increments its
sequence number, RNi[i], and sends a
REQUEST(i, sn) message to all other sites. (sn is the updated value of RNdi].)
in

When a site 5 j receives this message, it sets RNj[i] to max(RNj[i], sn). If 5 j


has the idle token, then it sends the token to 5 i if RNj [i]=LN[i]+1.Executing
ra

the critical section.


Site 5i executes the CS when it has received the token. Releasing the critical
B

section. Having finished the execution of the CS, site 5 i takes the following
actions:
It sets the LN[i] element of the token array equal to RNdi].
For every site 5 j whose 10 is not in the token queue, it appends its 10 to the
token queue if RNi [j]=LN[j]+1.

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
If token queue is nonempty after the above update, then it deletes the top
site
Example
Step 1: S1 has a token, S3 is in queue.

Site Seq.,Vector RN Token Vect. LN Token Queue

S1 10,15,9 10,15,8 3

pp
S2 10,16,9

A
S3 10,15,9

Step 2: S3 gets token, S2 in queue

s
Site Seq.,Vector RN
er
Token Vect. LN Token Queue

S1 10,16,9
at
S2 10,16,9
he

S3 10,16,9 10,15,9 2

Step 3: S2 gets token, queue empty


in
ra

Site Seq.,Vector RN Token Vect. LN Token Queue

S1 10,16,9
B

S2 10,16,9 10,16,9 <empty>

S3 10,16,9

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
Q7. What is Process Migration? Explain the methods used for this.(P4 -
Appeared 1 Time) (5-10 Marks)
Ans: Process migration is the relocation of a process from its source node
to another destination node. The way a process migrates from one node to
another is shown in the figure below.

pp
A
s
er
at
he

A process can either be migrated before it starts execution on its


source node which is called a non-preemptive process or during
the course of its execution that is known as preemptive process
in

migration.
Methods of Process Migration
ra

The methods of Process Migration are:


1. Homogeneous Process Migration: Homogeneous process migration
B

implies relocating a process in a homogeneous environment where all


systems have a similar operating system as well as architecture. There are
two unique strategies for performing process migration. These are i)
User-level process migration ii) Kernel level process migration.
● User-level process migration: In this procedure, process migration is
managed without converting the operating system kernel.

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
User-level migration executions are more simple to create and
handle but have usually two issues: i) Kernel state is not accessible
by them. ii) They should cross the kernel limit utilizing kernel
demands which are slow and expensive.
● Kernel level process migration: In this procedure, process migration
is finished by adjusting the operating system kernel. Accordingly,
process migration will become more simple and more proficient.

pp
This facility permits the migration process to be done faster and
relocate more types of processes.

A
Q8. Explain Fault Tolerance Mechanism. (P4 - Appeared 1 Time) (5-10
Marks)

s
Ans: Fault Tolerance simply means a system’s ability to continue operating
er
uninterrupted despite the failure of one or more of its components. This is
true whether it is a computer system, a cloud cluster, a network, or
at
something else. In other words, fault tolerance refers to how an operating
system (OS) responds to and allows for software or hardware malfunctions
he

and failures.
● An OS’s ability to recover and tolerate faults without failing can be
handled by hardware, software, or a combined solution leveraging
in

load balancers(see more below). Some computer systems use


multiple duplicate fault tolerant systems to handle faults gracefully.
ra

This is called a fault tolerant network.


B

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
pp
A
Fault tolerant computing may include several levels of tolerance:
● At the lowest level, the ability to respond to a power failure, for

s
example. er
● A step up: during a system failure, the ability to use a backup
system immediately.
at
● Enhanced fault tolerance: a disk fails, and mirrored disks take over
for it immediately. This provides functionality despite partial system
he

failure, or graceful degradation, rather than an immediate


breakdown and loss of function.
● High level fault tolerant computing: multiple processors collaborate
in

to scan data and output to detect errors, and then immediately


correct them.
ra

Fault tolerance software may be part of the OS interface, allowing the


programmer to check critical data at specific points during a transaction.
B

● Fault-tolerant systems ensure no break in service by using backup


components that take the place of failed components
automatically.
These may include:

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
● Hardware systems with identical or equivalent backup operating
systems. For example, a server with an identical fault tolerant server
mirroring all operations in backup, running in parallel, is fault
tolerant.
● By eliminating single points of failure, hardware fault tolerance in
the form of redundancy can make any component or system far
safer and more reliable.

pp
● Software systems backed up by other instances of software. For
example, if you replicate your customer database continuously,
operations in the primary database can be automatically

A
redirected to the second database if the first goes down.
● Redundant power sources can help avoid a system fault if

s
alternative sources can take over automatically during power
failures, ensuring no loss of service.
er
Q9. more questions are available in Brainheaters app….
at

.
he

.
in
ra
B

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
pp
Full module-wise notes with
31+ Q/A is available in

A
Brainheaters App
s
er
at

Download the App Now!


he
in
ra
B

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4
pp
A
s
er
at
he
in
ra
B

Download Brainheaters App - https://bit.ly/Brainheaters_App


Whatsapp Community Link:- https://chat.whatsapp.com/Gp1v0PbkFoG5DkC8Cyqev4

You might also like