distrubuted system bca tu distrubuted system bca tudistrubuted system bca tu

Dongz3 24 views 58 slides Mar 09, 2025
Slide 1
Slide 1 of 58
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58

About This Presentation

distrubuted system bca tudistrubuted system bca tudistrubuted system bca tudistrubuted system bca tudistrubuted system bca tu


Slide Content

UNIT: 2
Architecture
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
1

•DistributedSystemsarecomposedofvarioushardwareand
software(collectivelycalledcomponents)thatcommunicate
witheachotheronlybytransferofmessages.These
componentsareplacedinsideasinglenetwork.
•So,whenwethinkaboutthearchitecturestylesfor
distributedcomputingthemaintaskwouldbetoensurethat
thesecancommunicate witheachotherovera
communicationnetwork.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
2

2.1 Architectural Styles
•Westartourdiscussiononarchitecturesbyfirstconsideringthelogical
organizationofdistributedsystemsintosoftwarecomponents,alsoreferred
toassoftwarearchitecture.
•Thenotationofanarchitecturalstyleisimportant.Suchastyleis
formulatedintermsofcomponents,thewaythatcomponentsareconnected
toeachother,thedataexchangedbetweencomponentsandfinallyhow
theseelementsarejointlyconfiguredintoasystem.
•Acomponentisamodularunitwithwell-definedrequiredandprovided
interfacesthatisreplaceablewithinitsenvironment.
•Usingcomponentsandconnectors,wecancometovariousconfigurations,
which,intumhavebeenclassifiedintoarchitecturalstyles.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
3

•Severalstyleshavebynowbeenidentified,ofwhichthemost
importantonesfordistributedsystemsare:
1.Layeredarchitectures
2.Object-basedarchitectures
3.Data-centeredarchitectures
4.Event-basedarchitectures
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
4

•Thebasicideaforthelayeredstyleissimple:componentsareorganizedinalayered
fashionwhereacomponentatlayerL;isallowedtocallcomponentsattheunderlying
layerLi:«,butnottheotherwayaround,asshowninFig(a).
•Ankeyobservationisthatcontrolgenerallyflowsfromlayertolayer:requestsgodown
thehierarchywhereastheresultsflowupward.
•Thelayeredarchitectureseparatesthelayersofcomponentsfromeachother,givingita
muchmodularapproach.
•AwellknownexampleforthisistheOSIreferencemodelthatincorporatesthelayered
architecturewheninteractingwitheachofthecomponents.
•Theadvantagesofusingthisapproachisthatthecallalwaysfollowpre-definedpathand
thateachlayercanbeeasilyreplacedormodifiedwithoutaffectingtheentirearchitecture.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
5

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
6

•Object-basedarchitectures,areillustratedinFig.(b).
•Thisarchitecturedoesnothaveasequentialsetofstepsasinlayered.
•Eachcomponentsarereferredasobject,whereeachobjectscaninteract
withotherobjectthroughagivenconnectororinterface.
•Thesearemuchmoredirectwhereallthecomponentscaninteractwith
eachotherthroughadirectcallmethod.
•Notsurprisingly,thissoftwarearchitecturematchestheclient-serversystem
architecture.
•Thelayeredandobjectbasedarchitecturesstillformthemostimportant
stylesforlargesoftwaresystems(BassetaI.,2003).
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
7

•Some popular examples are java
RMI(Remote method invocation)
, web Services and REST
API Calls. This things has
following properties.
❖The architecture style is less
structured.
❖Components=Object
❖Connector=RPC or RMI
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
8

•Data-centeredarchitecturesevolvearoundtheideathatprocessescommunicatethrough
acommon(passiveoractive)repository.
•Itcanbearguedthatfordistributedsystemsthesearchitecturesareasimportantasthe
layeredandobjectbasedarchitectures.
•Thisismorelikeproducerconsumerproblems.The
•Forexample,awealthofnetworkedapplicationshavebeendevelopedthatrelyona
shareddistributedfilesysteminwhichvirtuallyallcommunicationtakesplacethrough
files.Likewise,Web-baseddistributedsystems,arelargelydata-centric:processes
communicatethroughtheuseofsharedWeb-baseddataservices.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
9

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
10

•Inevent-basedarchitectures,processesessentiallycommunicate
throughthepropagationofevents,whichoptionallyalsocarrydata.
•Whenaneventisgenerated,itwillbesentthroughthebusand
respectivenodecanpulltheeventanduse.
•SometimethiseventcouldbedataorevenURLtoresource.
•Itsadvantagesisthatthecomponentscanbeeasilyadd,removeor
modified.Theheterogenouscomponentscancommunicatethrough
anycommunicationprotocol.
•Someexamplesare:publisher-subscribesystem,broadcast,pointto
point,enterpriseservicebus(ESB),etc.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
11

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
12

2.2 System Architecture
•Nowthatwehavebrieflydiscussedsomecommon
architecturalstyles,letustakealookathowmanydistributed
systemsareactuallyorganizedbyconsideringwheresoftware
componentsareplaced.
•Decidingonsoftwarecomponents,theirinteraction,andtheir
placementleadsaninstanceofasoftwarearchitecture,also
calledasystemarchitecture(BassetaI.,2003).
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
13

2.2.1 Client server architecture
•Theclientserverarchitecturehastwomajorcomponents-clientand
server.
•Theserveriswherealltheprocessing,computinganddatahandlingis
happeningandtheclientiswheretheusercanaccesstheservice
andresourcesgivenbyserver.
•Theclientmakerequestandtheserverreply.
•Asonecommondesignfeature,thisarchitecturehascentralized
securitydatabase.Thisdatabasecontainsthesecuritydetails,access
details.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
14

AdvantagesOfClient/Servernetwork:
•AClient/Servernetworkcontainsthecentralized
system.Thereforewecanbackupthedataeasily.
•AClient/Servernetworkhasadedicatedserverthat
improvestheoverallperformanceofthewholesystem.
•SecurityisbetterinClient/Servernetworkasasingle
serveradministersthesharedresources.
•Italsoincreasesthespeedofthesharingresources.
DisadvantagesOfClient/Servernetwork:
•Client/Servernetworkisexpensiveasitrequiresthe
serverwithlargememory.
•AserverhasaNetworkOperatingSystem(NOS) to
providetheresourcestotheclients,butthecostofNOS
isveryhigh.
•Itrequiresadedicatednetworkadministratorto
managealltheresources.
•Ifservercomputerisdownthenwholenetworkwill
affected.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
15

2.2.2 Peer to peer network architecture
•Peer-To-Peernetworkisanetworkinwhichallthe
computersarelinkedtogetherwithequalprivilegeand
responsibilitiesforprocessingthedata.
•Peer-To-Peernetworkisusefulforsmallenvironments,
usuallyupto10computers.
•Peer-To-Peernetworkhasnodedicatedserver.
•Specialpermissionsareassignedtoeachcomputerfor
sharingtheresources,butthiscanleadtoaproblemif
thecomputerwiththeresourceisdown.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
16

AdvantagesOfPeer-To-PeerNetwork:
•Ithassimplearchitectureandeasytoinstall.
•Itislesscostlyasitdoesnotcontainanydedicated
server.
•Ifissuitableforsmallsizednetwork.
•Itiseasytosetupandmaintainaseachcomputer
managesitself.
DisadvantagesOfPeer-To-PeerNetwork:
•InthecaseofPeer-To-Peernetwork,itdoesnotcontain
thecentralizedsystem.Therefore,itcannotbackupthe
dataasthedataisdifferentindifferentlocations.
•Ithasasecurityissueasthedeviceismanageditself.
•Itisnotsuitableforlargesizenetwork.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
17

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
18

2.2.3 Centralized Architecture
•Despitethelackofconsensusonmanydistributedsystemsissues,thereisone
issuethatmanyresearchersandpractitionersagreeupon:thinkingintermsof
clientsthatrequestservicesfromservershelpsusunderstandandmanagethe
complexityofdistributedsystemsandthatisagoodthing.
•Inthebasicclient-servermodel,processesinadistributedsystemaredividedinto
two(possiblyoverlapping)groups.
•Aserverisaprocessimplementingaspecificservice,forexample,afilesystem
serviceoradatabaseservice.
•Aclientisaprocessthatrequestsaservicefromaserverbysendingitarequest
andsubsequentlywaitingfortheserver'sreply.
•Thisclient-serverinteraction,alsoknownasrequest-replybehaviorisshownin
Fig.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
19

Two tier architecture
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
20

•Communicationbetweenaclientandaservercanbeimplementedbymeansofasimple
connectionlessprotocolwhentheunderlyingnetworkisfairlyreliableasinmanylocal-
areanetworks.
•Inthesecases,whenaclientrequestsaservice,itsimplypackagesamessageforthe
server,identifyingtheserviceitwants,alongwiththenecessaryinputdata.Themessage
isthensenttotheserver.
•Thelatter,inturn,willalwayswaitforanincomingrequest,subsequentlyprocessit,and
packagetheresultsinareplymessagethatisthensenttotheclient.
•Usingaconnectionlessprotocolhastheobviousadvantageofbeingefficient.
•Aslongasmessagesdonotgetlostorcorrupted,therequest/replyprotocoljustsketched
worksfine.
•Unfortunately,makingtheprotocolresistanttooccasionaltransmissionfailuresisnot
trivial.Theonlythingwecandoispossiblylettheclientresendtherequestwhenno
replymessagecomesin.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
21

•However,consideringthatmanyclient-serverapplicationsaretargetedtoward
supportinguseraccesstodatabases,manypeoplehaveadvocatedadistinction
betweenthefollowingthreelevels,essentiallyfollowingthelayeredarchitectural
stylewediscussedpreviously:
1.Theuser-interfacelevel
2.Theprocessinglevel
3.Thedatalevel
•Theuser-interfacelevelcontainsallthatisnecessarytodirectlyinterfacewiththe
user,suchasdisplaymanagement.
•Theprocessingleveltypicallycontainstheapplications.
•Thedatalevelmanagestheactualdatathatisbeingactedon.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
22

•Asafirstexample,consideranInternetsearchengine.Ignoringalltheanimated
banners,images,andotherfancywindowdressing,theuserinterfaceofasearch
engineisverysimple:ausertypesinastringofkeywordsandissubsequently
presentedwithalistoftitlesofWebpages.
•ThebackendisformedbyahugedatabaseofWebpagesthathavebeen
prefetchedandindexed.Thecoreofthesearchengineisaprogramthattransforms
theuser'sstringofkeywordsintooneormoredatabasequeries.
•Itsubsequentlyrankstheresultsintoalist,andtransformsthatlistintoaseriesof
HTMLpages.
•Withintheclient-servermodel,thisinformationretrievalpartistypicallyplacedat
theprocessinglevel.Fig.belowshowsthisorganization.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
23

Three tier
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
24

•Thedistinctionintothreelogicallevelsasdiscussedsofar,suggestsanumberof
possibilitiesforphysicallydistributingaclient-serverapplicationacrossseveral
machines.Thesimplestorganizationistohaveonlytwotypesofmachines:
1.Aclientmachinecontainingonlytheprogramsimplementing(partof)theuser-
interfacelevel
2.Aservermachinecontainingtherest,thatistheprogramsimplementingthe
processinganddatalevel
•Inthisorganizationeverythingishandledbytheserverwhiletheclientis
essentiallynomorethanadumbterminal,possiblywithaprettygraphical
interface.Therearemanyotherpossibilities,ofwhichweexploresomeofthe
morecommononesinthissection.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
25

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
26

•Onepossibleorganizationistohaveonlytheterminal-dependentpartoftheuserinterface
ontheclientmachine,asshowninFig.2-5(a),andgivetheapplicationsremotecontrol
overthepresentationoftheirdata.
•Analternativeistoplacetheentireuser-interfacesoftwareontheclientside,asshownin
Fig.2-5(b).Insuchcases,weessentiallydividetheapplicationintoagraphicalfrontend,
whichcommunicateswiththerestoftheapplication(residingattheserver)throughan
application-specificprotocol.Inthismodel,thefrontend(theclientsoftware)doesno
processingotherthannecessaryforpresentingtheapplication'sinterface.
•Continuingalongthislineofreasoning,wemayalsomovepartoftheapplicationtothe
frontend,asshowninFig.2-5(c).Anexamplewherethismakessenseiswherethe
applicationmakesuseofaformthatneedstobefilledinentirelybeforeitcanbe
processed.Thefrontendcanthencheckthecorrectnessandconsistencyoftheform,and
wherenecessaryinteractwiththeuser.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
27

•AnotherexampleoftheorganizationofFig.2:.5(c),isthatofawordprocessorin
whichthebasiceditingfunctionsexecuteontheclientsidewheretheyoperateon
locallycached,orin-memorydata.butwheretheadvancedsupporttoolssuchas
checkingthespellingandgrammarexecuteontheserverside.
•Inmanyclient-serverenvironments,theorganizationsshowninFig.2-5(d)andFig.
2-5(e)areparticularlypopular.Theseorganizationsareusedwherethefilesystemor
database.Essentially,mostoftheapplicationisrunningontheclientmachine,butall
operationsonfilesordatabaseentriesgototheserver.Forexample,manybanking
applicationsrunonanend-user'smachinewheretheuserpreparestransactionsand
such.Oncefinished,theapplicationcontactsthedatabaseonthebank'sserverand
uploadsthetransactionsforfurtherprocessing.
•Fig.2-5(e)representsthesituationwheretheclient'slocaldiskcontainspartofthe
data.Forexample,whenbrowsingtheWeb,aclientcangraduallybuildahugecache
onlocaldiskofmostrecentinspectedWebpages.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
28

2.2.4 Decentralized Architecture
•Inmodernarchitectures(HorizontalDistribution)aclientorserver
maybephysicallysplitupintologicallyequivalentparts,buteachpart
isoperatingonitsownshareofthecompletedataset,thusbalancing
theload.
•Aclassofmodernsystemarchitecturesthatsupporthorizontal
distribution,knownaspeer-to-peersystems
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
29

•Fromahigh-levelperspective,theprocessesthatconstituteapeer-to-peer
systemareallequal.Thismeansthatthefunctionsthatneedtobecarriedout
arerepresentedbyeveryprocessthatconstitutesthedistributedsystem.
•Asaconsequence,muchoftheinteractionbetweenprocessesissymmetric:each
processwillactasaclientandaserveratthesametime(whichisalsoreferredto
asactingasaservant).
•Giventhissymmetricbehavior,peer-to-peerarchitecturesevolvearoundthe
questionhowtoorganizetheprocessesinanoverlaynetwork,thatis,anetwork
inwhichthenodesareformedbytheprocessesandthelinksrepresentthe
possiblecommunicationchannels(whichareusuallyrealizedasTCPconnections).
•Ingeneral,aprocesscannotcommunicatedirectlywithanarbitraryother
process,butisrequiredtosendmessagesthroughtheavailablecommunication
channels.
•Twotypesofoverlaynetworksexist:thosethatarestructuredandunstructured.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
30

Structured p2p system
•The node has to follow the pre-defined structure.
•Everystructurednetworkinherentlysuffersfromthepoorscalabilitydueto
needforstructuremaintenance.
•Ingeneral,thenodesinastructuredoverlaynetworkareformedina
logicalringwithnodesbeingconnectedtothisring.Inthisring,thecertain
nodesareresponsibleforcertainservices.
•Acommonapproachthatcanbeusedtotacklethecoordinationbetween
nodes,istousedistributedhashtable(DHT).Atraditionalhashfunction
convertsauniquekeyintoahashvalues,thatwillrepresentanobjectin
thenetwork.
•Thehashfunctionvalueisusedtoinsertanobjectinthehashtableandto
retrieveit.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
31

•InaDHT,eachkeyisassignedtoa
uniquewheretherandomhasvalue
needtobeofaverylargeaddress
space,inordertoensureuniqueness.
•Hashfunction:takesakeyand
produceauniquehashfunction.
•Mappingfunction:mapthehashvalue
toaspecificnodeinthesystem.
•Lookuptable:returnthenetwork
addressofthenoderepresentedby
theuniquehashvalue.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
32

Unstructured p2p system
•Thereisnospecificstructure.
•Thescalabilityisveryhigh.
•Thesesystemrelyonrandomizedalgorithmsforconstructinganoverlay
network.
•therenofixedpathfornodetonodetransmission.
•Thebasicprincipleisthateachnodeisrequiredtorandomlyselectanother
nodeandcontactit.
❖Leteachpeermaintainapartialviewofthenetwork,consistingof‘n’
othernodes.
❖Eachnode‘p’periodicallyselectanode‘q’fromitspartialview.
❖Pandqexchangeinformationandexchangemembersfromtheir
respectivepartialviews.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
33

2.2.5 Hybrid architecture
•Animportantclassofdistributedsystemsthatisorganizedaccordingtoahybrid
architectureisformedbyedge-serversystems.
•ThesesystemsaredeployedontheInternetwhereserversareplaced"attheedge"of
thenetwork.
•Thisedgeisformedbytheboundarybetweenenterprisenetworksandtheactual
Internet,forexample,asprovidedbyanInternetServiceProvider(ISP).
•Likewise,whereendusersathomeconnecttotheInternetthroughtheirISP,theISPcan
beconsideredasresidingattheedgeoftheInternet.
•Endusers,orclientsingeneral,connecttotheInternetbymeansofanedgeserver.The
edgeserver'smainpurposeistoservecontent,possiblyafterapplyingfilteringand
transcodingfunctions.
•Moreinterestingisthefactthatacollectionofedgeserverscanbeusedtooptimize
contentandapplicationdistribution.
•Thebasicmodelisthatforaspecificorganization,oneedgeserveractsasanorigin
serverfromwhichallcontentoriginates.Thatservercanuseotheredgeserversfor
replicatingWebpages
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
34

Viewing the internet as consisting of a
collection of edge server
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
35

Collaborative distributed systems
•Hybridstructuresarenotablydeployedincollaborativedistributedsystems.
•Themainissueinmanyofthesesystemsistofirstgetstarted,forwhichoftena
traditionalclient-serverschemeisdeployed.
•Onceanodehasjoinedthesystem,itcanuseafullydecentralizedschemefor
collaboration.
•BitTorrentisapeer-to-peerfiledownloadingsystem.
•ItsprincipalworkingisshowninFig.2-14.Thebasicideaisthatwhenanenduser
islookingforafile,hedownloadschunksofthefilefromotherusersuntilthe
downloadedchunkscanbeassembledtogetheryieldingthecompletefile.
•Animportantdesigngoalwastoensurecollaboration.Inmostfile-sharing
systems,asignificantfractionofparticipantsismerelydownloadfilesbut
otherwisecontributeclosetonothing.Tothisend,afilecanbedownloadedonly
whenthedownloadingclientisprovidingcontenttosomeoneelse.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
36

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
37

•Asanotherexample,considertheGlobulecollaborativeContent
DistributionNetwork(CDN).
•Globulestronglyresemblestheedge-serverarchitecturementioned
above.Inthiscase,insteadofedgeservers,endusers(butalso
organizations)voluntarilyprovideenhancedWebserversthatare
capableofcollaboratinginthereplicationofWebpages.
•Initssimplestform,eachsuchserverhasthefollowingcomponents:
•Acomponentthatcanredirectclientrequeststootherservers.
•Acomponentforanalyzingaccesspatterns.
•AcomponentformanagingthereplicationofWebpages.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
38

2.3 Middleware Organizations
•Middlewareoffersgeneralservicesthatsupportdistributedexecutionof
applications.Thetermmiddlewaresuggeststhatitissoftwarepositioned
betweentheoperatingsystemandtheapplication.
•Wewilllimitthediscussiontothemiddlewaresupportofanobject-based
applicationbecausetheconceptsofanobjectmodelideallyreflectthe
characteristicsofdistributedsystems.
•Anobjectencapsulatesstateandbehaviorandcanonlybeaccessedviaawell-
definedinterface.
•Theinterfacehidesthedetailsthatarespecifictotheimplementation,thereby
helpingtoencapsulatedifferenttechnologies.
•Anobjectthereforebecomesaunitofdistribution.Recallthatobjects
communicatewitheachotherbyexchangingmessages.wedefinethefollowing
middlewaretasks:
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
39

Tasksofmiddleware
❖Objectmodelsupport:Middlewareshouldoffermechanismstosupport
theconceptsincorporatedintheobjectmodel.
❖Operationalinteraction:Middlewareshouldallowtheoperational
interactionbetweentwoobjects.Themodelusedisthemethodinvocation
ofanobjectorientedprogramminglanguage.
❖Remoteinteraction:Middlewareshouldallowtheinteractionbetweentwo
objectslocatedindifferentaddressspaces.
❖Distributiontransparency:Fromthestandpointoftheprogram,interaction
betweenobjectsisidenticalforbothlocalandremoteinteractions.
❖Technologicalindependence:Themiddlewaresupportstheintegrationof
differenttechnologies.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
40

•Aswementionedearlier,middlewareisconceptuallylocatedbetweentheapplication
andtheoperatingsystem(seeFigure2.7).
•Becauseanobjectmodelservesastheunderlyingparadigm,theapplicationis
representedasasetofinteractingobjects.
•Eachobjectisexplicitlyallocatedtoahardwareplatform(i.e.,wedonotconsidercases
inwhichanobjectlogicallyextendsbeyondcomputerboundaries).
•Typesofthemiddlewarehidestheheterogeneitythatoccursinadistributedsystem.This
heterogeneityexistsatdifferentplaces:
❖Programminglanguages:Differentobjectscanbedevelopedindifferentprogramming
languages.
❖Operatingsystem:Operatingsystemshavedifferentcharacteristicsandcapabilities.
❖Computerarchitectures:Computersdifferintheirtechnicaldetails(e.g.,data
representations).
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
41

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
42

•Middlewareovercomesthisheterogeneitybyofferingequal
functionalityatallaccesspoints.
•Applicationshaveaccesstothisfunctionalitythroughan
ApplicationProgrammingInterface(API).
•BecausetheAPIdependsontheprogramminglanguagein
whichtheapplicationiswritten,theAPIhastobeadaptedto
theconditionsofeachprogramminglanguagethatis
supportedbythemiddleware
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
43

Architecture vs Middleware
•Whenconsideringthearchitecturalissueswehavediscussedsofar,aquestionthat
comestomindiswheremiddlewarefitsin,middlewareformsalayerbetween
applicationsanddistributedplatforms.
•Animportantpurposeistoprovideadegreeofdistributiontransparency,thatis,toa
certainextenthidingthedistributionofdata,processing,andcontrolfromapplications.
•Whatiscommonlyseeninpracticeisthatmiddlewaresystemsactuallyfollowaspecific
architecturalstyle.
•Forexample,manymiddlewaresolutionshaveadoptedanobject-basedarchitectural
style,suchasCORBA.Others,likeTIBCORendezvousprovidemiddlewarethatfollows
theevent-basedarchitecturalstyle.
•Advantage:Havingmiddlewaremoldedaccordingtoaspecificarchitecturalstylehasthe
benefitthatdesigningapplicationsmaybecomesimpler.
•Disadvantage:Themiddlewaremaynolongerbeoptimalforwhatanapplication
developerhadinmind.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
44

•Althoughmiddlewareismeanttoprovidedistributiontransparency,itis
generallyfeltthatspecificsolutionsshouldbeadaptabletoapplication
requirements.
•Onesolutiontothisproblemistomakeseveralversionsofamiddleware
system,whereeachversionistailoredtoaspecificclassofapplications.
•Anotherapproachthatisgenerallyconsideredbetteristomake
middlewaresystemssuchthattheyareeasytoconfigure,adapt,and
customizeasneededbyanapplication.
•Asaresult,systemsarenowbeingdevelopedinwhichastricterseparation
betweenpoliciesandmechanismsisbeingmade.
•Thishasledtoseveralmechanismsbywhichthebehaviorofmiddleware
canbemodified(SadjadiandMcKinley,2003).UsingInterceptorsand
Adaptivesoftwarearetwopoliciesinthesecondsolution.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
45

Interceptor
•Conceptually,aninterceptorisnothingbutasoftwareconstructthatwillbreaktheusual
flowofcontrolandallowother(applicationspecific)codetobeexecuted.
•Tomakemattersconcrete,considerinterceptionassupportedinmanyobjectbased
distributedsystems.
•Thebasicideaissimple:anobjectAcancallamethodthatbelongstoanobjectB,while
thelatterresidesonadifferentmachinethanA.sucharemote-objectinvocationis
carriedasathree-stepapproach:
1.ObjectAisofferedalocalinterfacethatisexactlythesameastheinterfaceofferedby
objectB.Asimplycallsthemethodavailableinthatinterface.
2.ThecallbyAistransformedintoagenericobjectinvocation,madepossiblethrougha
generalobject-invocationinterfaceofferedbythemiddlewareatthemachinewhereA
resides.
3.Finally,thegenericobjectinvocationistransformedintoamessagethatissent
throughthetransport-levelnetworkinterfaceasofferedbyA'slocaloperatingsystem.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
46

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
47

General approach to adaptive software
•Whatinterceptorsactuallyofferisameanstoadaptthemiddleware.Theneedfor
adaptationcomesfromthefactthattheenvironmentinwhichdistributedapplicationsare
executedchangescontinuously.
•Changesincludethoseresultingfrommobility,astrongvarianceinthequality-of-service
ofnetworks,failinghardware,andbatterydrainage,amongstothers.
•Thesestronginfluencesfromtheenvironmenthavebroughtmanydesignersof
middlewaretoconsidertheconstructionofadaptivesoftware.
•Threebasictechniquestocometosoftwareadaptation:
•1.Separationofconcerns
•2.Computationalreflection
•3.Component-baseddesign
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
48

•Separatingconcernsrelatestothetraditionalwayofmodularizingsystems:separatethe
partsthatimplementfunctionalityfromthosethattakecareofotherthings(knownas
extrafunctionalities)suchasreliability,performance,security,etc.Onecanarguethat
developingmiddlewarefordistributedapplicationsislargelyabouthandlingextra
functionalitiesindependentfromapplications.
•Computationalreflectionreferstotheabilityofaprogramtoinspectitselfand,if
necessary,adaptitsbehavior.Reflectionhasbeenbuiltintoprogramminglanguages,
includingJava,andoffersapowerfulfacilityforruntimemodifications.
•Component-baseddesignsupportsadaptationthroughcomposition.Asystemmayeither
beconfiguredstaticallyatdesigntime,ordynamicallyatruntime.Thelatterrequires
supportforlatebinding,atechniquethathasbeensuccessfullyappliedinprogramming
languageenvironments,butalsoforoperatingsystemswheremodulescanbeloadedand
unloadedatwill.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
49

2.4 Self management in distributed system
The Feedback Control Model
•Therearemanydifferentviewsonself-managingsystems,butwhatmost
haveincommon(eitherexplicitlyorimplicitly)istheassumptionthat
adaptationstakeplacebymeansofoneormorefeedbackcontrolloops.
•Accordingly,systemsthatareorganizedbymeansofsuchloopsare
referredtoasfeedbackControlsystems.
•Feedbackcontrolhassincelongbeenappliedinvariousengineering
fields,anditsmathematicalfoundationsaregraduallyalsofindingtheir
wayincomputingsystems.
•Forselfmanagingsystems,thearchitecturalissuesareinitiallythemost
interesting.Thebasicideabehindthisorganizationisquitesimple,as
showninFig.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
50

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
51

•Thecoreofafeedbackcontrolsystemisformedbythecomponents
thatneedtobemanaged.
•Thesecomponentsareassumedtobedriventhroughcontrollableinput
parameters,buttheirbehaviormaybeinfluencedbyallkindsof
uncontrollableinput,alsoknownasdisturbanceornoiseinput.
•Althoughdisturbancewilloftencomefromtheenvironmentinwhich
adistributedsystemisexecuting,itmaywellbethecasethat
unanticipatedcomponentinteractioncausesunexpectedbehavior.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
52

There are essentially three elements that form the feedback
control loop.
•First,thesystemitselfneedstobemonitored,whichrequiresthatvarious
aspectsofthesystemneedtobemeasured.
•Inmanycases,measuringbehavioriseasiersaidthandone.
•Forexample,round-tripdelaysintheInternetmayvarywildly,andalso
dependonwhatexactlyisbeingmeasured.
•Insuchcases,accuratelyestimatingadelaymaybedifficultindeed.
•MattersarefurthercomplicatedwhenanodeAneedstoestimatethelatency
betweentwoothercompletelydifferentnodesBandC,withoutbeingable
tointrudeoneithertwonodes.
•Forreasonsasthis,afeedbackcontrolloopgenerallycontainsalogical
metricestimationcomponent.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
53

•Anotherpartofthefeedbackcontrolloopanalyzesthemeasurementsand
comparesthesetoreferencevalues.
•Thisfeedbackanalysiscomponentformstheheartofthecontrolloop,asitwill
containthealgorithmsthatdecideonpossibleadaptations.
•Thelastgroupofcomponentsconsistofvariousmechanismstodirectlyinfluence
thebehaviorofthesystem.
•Therecanbemanydifferentmechanisms:placingreplicas,changingscheduling
priorities,switchingservices,movingdataforreasonsofavailability,redirecting
requeststodifferentservers,etc.
•Theanalysiscomponentwillneedtobeawareofthesemechanismsandtheir
(expected)effectonsystembehavior.Therefore,itwilltriggeroneorseveral
mechanisms,tosubsequentlylaterobservetheeffect.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
54

•Aninterestingobservationisthatthefeedbackcontrolloopalsofitsthe
manualmanagementofsystems.Themaindifferenceisthattheanalysis
componentisreplacedbyhumanadministrators.
•However,inordertoproperlymanageanydistributedsystem,these
administratorswillneeddecentmonitoringequipmentaswellasdecent
mechanismstocontrolthebehaviorofthesystem.
•Itshouldbeclearthatproperlyanalyzingmeasureddataandtriggeringthe
correctactionsmakesthedevelopmentofself-managingsystemsso
difficult.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
55

Example: System monitoring with Astrolabe
•weconsiderAstrolabe(VanRenesseetaI.,2003),whichisasystemthatcansupport
generalmonitoringofverylargedistributedsystems.
•Inthecontextofself-managingsystems,Astrolabeistobepositionedasageneraltoolfor
observingsystemsbehavior.Itsoutputcanbeusedtofeedintoananalysiscomponentfor
decidingoncorrectiveactions.
•Astrolabeorganizesalargecollectionofhostsintoahierarchyofzones.
•Thelowest-levelzonesconsistofjustasinglehost,whicharesubsequentlygroupedinto
zonesofincreasingsize.
•Thetop-levelzonecoversallhosts.EveryhostrunsanAstrolabeprocess,calledanagent,
thatcollectsinformationonthezonesinwhichthathostiscontained.
•Theagentalsocommunicateswithotheragentswiththeaimtospreadzoneinformation
acrosstheentiresystem.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
56

•Eachhostmaintainsasetofattributesforcollectinglocalinformation.Forexample,a
hostmaykeeptrackofspecificfilesitstores,itsresourceusage,andsoon.
•Onlytheattributesasmaintaineddirectlybyhosts,thatis,atthelowestlevelofthe
hierarchyarewritable.
•Eachzonecanalsohaveacollectionofattributes,butthevaluesoftheseattributesare
computedfromthevaluesoflowerlevelzones.
•ConsiderthefollowingsimpleexampleshowninFig.withthreehosts,A,B,andC
groupedintoazone.EachmachinekeepstrackofitsIPaddress,CPUload,availablefree
memory.andthenumberofactiveprocesses.
•Eachoftheseattributescanbedirectlywrittenusinglocalinformationfromeachhost.At
thezonelevel,onlyaggregatedinformationcanbecollected,suchastheaverageCPU
load,ortheaveragenumberofactiveprocesses.
9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
57

9/27/2020
BCA (T.U.) Distributed System
By: Er. Nabin Adhikari
58