You are on page 1of 15

INFORMATION TECHNOLOGY

Distributed Operating systems (IT-801) LAB - MANUAL

INDEX
DISTRIBUTED OPERATING SYSTEMS(IT-801)

S.NO NAME OF EXPERIMENT Implement Simple client1


server.

DATE OF REMARK SUBMISSION

2 3 4 5

Implementing three-tier client-server architecture. Implementing RMI in java. Implementing multithreading server in c. Implementing an Election algorithm. Implementing a mutual e!clusion algorithm. Stud#ing coda $ile s#stem. Stud#ing &I'I (echnolog# Stud#ing mach and chorus operating s#stems. Implementing a +ull# algorithm.

" % ) 1*

,ist o$ the E!periments


Dis !i"# $% S&s $'s
1. -./ to implement Simple 0lient-Server Model. 2. Stud# o$ 3 tier client server architecture 3. -./ to implement 0lient and RMI Server 4. -./ to Implement a multithreaded server in c11. 5. -./ to Implement an Election algorithm . -./ to implement a mutual e!clusion algorithm. ". Stud# o$ 023. 4ile s#stem %. Stud#ing &I'I (echnolog# ). Stud#ing mach and chorus operating s#stems 1*. Implementing a 5ull# algorithm.

Deployment of Experiment: (urn 1 2 3 4 5 " % ) 1* 11 12 13 14 15 SOFT(ARE RE)UIREMENT * 1. (ur5o 011 I3E 7(ur5o038 2. +orland (ur5o 011 79ersion 4.58 3. &.9. 3eplo#ment Introduction o$ ,a5 6 e!planation o$ Script E!periment 'o.1 E!periment 'o.2 E!periment 'o.2 E!periment 'o.3 E!periment 'o.3 E!periment 'o.4 E!periment 'o.5 E!periment 'o.5 E!periment 'o. E!periment 'o." E!periment 'o." E!periment 'o.% E!periment 'o.% E!periment 'o.) E!periment 'o.1*

REFERENCE BOOKS * 1. (anen5aum: .ndre;. S.: 3istri5uted 2peration S#stem: /<I. 2. 3istri5uted S#stems= 0oncepts and 3esign Edition 4: 5# >eorge 0oulouris: &ean 3ollimore and (im ?ind5erg

PROGRAM NO* - 1 PROBLEM DEFINITION:


. Simple 0lient-Server Model Implementation

OBJECTIVE:
(o revise concept o$ client server architecture

ALGORITHM:
1. . (0/ 5ased client that ;ill send the num5er entered 5# the user $or $actorial calculation to a server 2. @se socAet address to pass messages 5et;een client and server

INPUT SET: OUTPUT SET: NOTES:

PROGRAM NO* - + PROBLEM DEFINITION:


Stud# o$ 3 tier client server architecture

OBJECTIVE:
(o revise concept the standard 3-tier architecture consists o$ presentation and application logic in the client: application and 5usiness logic in a middle tier application server: and data managed 5# data5ase servers in the 3 tier.

Architecture Diagra :
0lient &ava 9M or +ro;ser Middle (ier .pplication Server Relational or IMS 3ata5ase 4I>@RE 3 (IER .R0<I(E0(@RE 2n client machine 2n server machine

INPUT SET: OUTPUT SET: NOTES:

PROGRAM NO* - , PROBLEM DEFINITION:


-./ to implement 0lient and RMI Server

OBJECTIVE:
In this section: #ou ;ill learn ho; to send massage $rom Rmi0lient to the RmiServer.

ALGORITHM:
In this section: #ou ;ill learn ho; to send massage $rom Rmi0lient to the RmiServer. <ere: ;e are going to create BReceiveMessageInter$aceB inter$ace. (he inter$ace de$ines the methods that can 5e invoAed $rom the client. Essentiall#: the inter$ace de$ines the clientCs vie; o$ the remote o5ject. .$ter that: ;e ;ill create a class named BRMIServerB. (he RMI Server accepts tasAs $rom clients: runs the tasAs: and returns an# result. (he server code consists o$ an inter$ace and a class. In this class: the DreceiveMessage78E method: ;hich is called $rom the remote client: is de$ined. (his class is the implementation o$ the RMI inter$ace. (he RmiServer creates the Dregistr#E. (his is a Aind o$ director#. Its Ae# is a name 7;hich is the I3 o$ a remote o5ject8 and its content is an o5ject. (his o5ject is looAed up $rom a remote program 5# the name. (his registr# is accessed $rom a remote o5ject 5# the I/ address or host name and the port num5er. createRegistr#78= (his is the method creates and e!ports a registr# on the local host that accepts reFuests on the speci$ied port. ReceiveMessageInter$ace.java
import java.rmi.*; public interface ReceiveMessageInterface extends Remote{ void receiveMessage(String x) t ro!s Remote"xception; #

(he a5ove code de$ines the RMI inter$ace. (he receiveMessage78 method is implemented in the server class.

INPUT SET:

OUTPUT SET: NOTES:

PROGRAM NO* - PROBLEM DEFINITION:


-./ to Implement a multithreaded server in c11.

OBJECTIVE:
(o understand the concept o$ threads.

ALGORITHM:
! ile($ isStopped()){ Soc%et clientSoc%et & null; tr' { clientSoc%et & t is.serverSoc%et.accept(); # catc (I("xception e) { if(isStopped()) { S'stem.out.println()Server Stopped.)) ; return; # t ro! ne! Runtime"xception( )"rror accepting client connection)* e); # new Thread( new WorkerRunnable( clientSocket, "Multithreaded Server") ).start();

INPUT SET:

OUTPUT SET:

NOTES:

PROGRAM NO* - . PROBLEM DEFINITION:


-./ to Implement an Election algorithm.

OBJECTIVE:
(he election algorithm is a method in distri5uted computing $or d#namicall# selecting a coordinator 5# process I3 num5er

ALGORITHM:
Selects the process ;ith the largest identi$ier as the coordinator= 1. -hen a process p detects that the coordinator is not responding to reFuests: it initiates an election= a. p sends an election message to all processes ;ith higher num5ers. 5. I$ no5od# responds: then p ;ins and taAes over. c. I$ one o$ the processes ans;ers: then pCs jo5 is done. 2. I$ a process receives an election message $rom a lo;ernum5ered process at an# time: it= a. sends an 2? message 5acA. 5. holds an election 7unless its alread# holding one8. 3. . process announces its victor# 5# sending all processes a message telling them that it is the ne; coordinator. 4. I$ a process that has 5een do;n recovers: it holds an election. /rocess 4 holds an election /rocesses 5 and respond: telling 4 to stop

INPUT SET:

OUTPUT SET:

PROGRAM NO* - / PROBLEM DEFINITION:


-./ to implement a mutual e!clusion algorithm.

OBJECTIVE:
(o understand concept o$ critical section

ALGORITHM:
-hile 718 GEntr# Section 0ritical Section E!it Section Remainder section !

INPUT SET:

OUTPUT SET:

NOTES:

PROGRAM NO* - 0 PROBLEM DEFINITION:


Stud# o$ 023. distri5uted $ile s#stem

OBJECTIVE:
(o understand concept o$ $ile s#stem in distri5uted s#stems.

Ba"ic I#ea:

. distri5uted $ile s#stem stores $iles on one or more computers called servers: and maAes them accessi5le to other computers called clients: ;here the# appear as normal $iles. (here are several advantages to using $ile servers= the $iles are more ;idel# availa5le since man# computers can access the servers: and sharing the $iles $rom a single location is easier than distri5uting copies o$ $iles to individual clients. +acAups and sa$et# o$ the in$ormation are easier to arrange since onl# the servers need to 5e 5acAed up. (he servers can provide large storage space: ;hich might 5e costl# or impractical to suppl# to ever# client. (he use$ulness o$ a distri5uted $ile s#stem 5ecomes clear ;hen considering a group o$ emplo#ees sharing documents. <o;ever: more is possi5le. 4or e!ample: sharing application so$t;are is an eFuall# good candidate. In 5oth cases s#stem administration 5ecomes easier.

INPUT SET:

OUTPUT SET:

NOTES:

PROGRAM NO* - 8 PROBLEM DEFINITION:


Stud# o$ &I'I technolog#

OBJECTIVE:
(he &ini .rchitecture Speci$ication page gives an e!cellent overvie; o$ &ini..In the la5: students have to stud# the $ollo;ings concepts related to &I'I technolog#. Service ,ooAup 3iscover# ,ease Mo5ile 0ode &avaSpaces S$!1i2$ = (he most important concept ;ithin the &ini architecture is that o$ a service. . service is an entit# that can 5e used 5# a person: a program: or another service. . service ma# 5e a computation: storage: a communication channel to another user: a so$t;are $ilter: a hard;are device: or another user. (;o e!amples o$ services are printing a document and translating $rom one ;ord-processor $ormat to some other. L334#5 &ini services locate each other through speci$ic looAup mechanisms. ,ooAup centers around looAup services such as Reggie: ;hich Aeep tracA o$ the services availa5le in a djinn. Dis231$!& Service 3iscover# is the process that &ini clients use to $ind &ini Services. (he &ini plat$orm includes multiple mechanisms $or Service 3iscover#. L$6s$ . ,ease is a 5asic mechanism used $or $ault-tolerant resource control in &ini. M3"i7$ C3%$ &ini maAes e!tensive use o$ mo5ile code. @suall# this is used $or encapsulating communication protocols 5et;een &ini services.

8616S562$s &avaSpaces is a net;orA accessi5le associated shared memor#. .nother ;a# to looA at &avaSpaces is as a place on the net;orA to share: e!change: and store &ava o5jects.

INPUT SET: OUTPUT SET: NOTES:

PROGRAM NO* - 9 PROBLEM DEFINITION:


Stud#ing mach and chorus operating s#stems. .

OBJECTIVE:
(o understand concept o$ various operating s#stems. 4ind out the di$$erence 5et;een distri5uted operating s#stems and net;orAed operating s#stems. 0ompare the $ile s#stems and securit# issues o$ mach and chorus ;ith other operating s#stems.

INPUT SET: OUTPUT SET:

NOTES:

PROGRAM NO* - 10 PROBLEM DEFINITION:


-./ to Implement an +ull# algorithm.

OBJECTIVE:
(he 5ull# algorithm is a method in distri5uted computing $or d#namicall# selecting a coordinator 5# process I3 num5er

ALGORITHM:
-hen a process / determines that the current coordinator is do;n 5ecause o$ message timeouts or $ailure o$ the coordinator to initiate a handshaAe: it per$orms the $ollo;ing seFuence o$ actions= 1. / 5roadcasts an election message 7inFuir#8 to all other processes ;ith higher process I3s. 2. I$ / hears $rom no process ;ith a higher process I3 than it: it ;ins the election and 5roadcasts victor#. 3. I$ / hears $rom a process ;ith a higher I3: / ;aits a certain amount o$ time $or that process to 5roadcast itsel$ as the leader. I$ it does not receive this message in time: it re-5roadcasts the election message. 'ote that i$ / receives a victor# message $rom a process ;ith a lo;er I3 num5er: it immediatel# initiates a ne; election. (his is ho; the algorithm gets its name - a process ;ith a higher I3 num5er ;ill 5ull# a lo;er I3 process out o$ the coordinator position as soon as it comes online.

INPUT SET:

OUTPUT SET:

NOTES:

You might also like