OCTSystem ModelsMain Architectural Models of DSSoftware and hardware service layers in distributed systemsClient-Server ModelA service provided by multiple serversProxy server and cachesA distributed application based on peer processesFigure 10.2: Napster: peer-to-peer file sharing with a centralized, replicated indexVariations on client-server (mobile code)Thin clients and compute serversMobile devices and Spontaneous networkingFundamental ModelsInteraction ModelLamport Clocks (1)Lamport Clocks (2)Lamport Clocks (3)Lamport Clocks (4)Lamport Clocks (5)Lamport Clocks (6)Lamport Timestamps(7)Totally-ordered multicastSlide 23Lamport Clocks and EmailFailure ModelProcesses and channelsOmission and arbitrary failuresSynchronous Model Timing FailuresSecurity ModelObjects and principalsThe enemySecure channelsOCT 1OCTPrinciples From Chapter Two of “Distributed Systems Concepts and Design” Material on Lamport Clocks from “Distributed Systems Principles and Paradigms” by Tanenbaum and SteenOCT 2System Models•Architectural Models Placement of parts and the relationships between them Examples: client-server model peer process model•Fundamental Models Formal description of properties that are common in the architectural models focusing on the dependability characteristics (correctness, reliability, and security)OCT 3Main Architectural Models of DS•Client processes•Server processes •Peer processes – cooperate and communicate in a symmetrical manner to perform a taskOCT 4Software and hardware service layers in distributed systemsApplications, servicesComputer and network hardwarePlatformOperating system MiddlewareMask heterogeneity and provides a convenient programming model to applicationsServices such as communications, data sharing,naming,security, transactions,persistent storage and eventnotificationOCT 5Client-Server ModelServerClientClientinvocationresultServerinvocationresultProcess:Key:Computer:OCT 6A service provided by multiple serversServerServerServerServiceClientClientReplication isused to increaseperformance andavailability andto improvefault toleranceOCT 7Proxy server and cachesClientProxyWeb serverWeb serverserverClientA cache is a store of recently used data objects that is closer than the objects themselves. Caches may be collocated with each client or may be located ina proxy server that can be shared by several clients. This approach mayincrease availability and performance.OCT 8A distributed application based on peer processesCoordinationApplicationcodeCoordinationApplicationcodeCoordinationApplicationcodeNo serverAll processes play a similar roleConsider a distributedwhite board where eachapplication contacts the middleware layer to perform eventnotificationOCT 9Figure 10.2: Napster: peer-to-peer file sharing with a centralized, replicated indexNapster serverIndex1. File location2. List of peersrequestoff ering the f ilepeers3. File request4. File deliv ered5. Index update Napster serverIndexOCT 10Variations on client-server (mobile code)a) client request results in the downloading of applet code Web serverClientWeb serverAppletApplet codeClientb) client interacts with the appletOCT 11Thin clients and compute serversThinClientApplicationProcessNetwork computer or PCCompute servernetworkOCT 12Mobile devices and Spontaneous networkingInternetgatewayPDAserviceMusic service serviceDiscoveryAlarmCameraGuestsdevicesLaptopTV/PC Hotel wirelessnetworkOCT 13Fundamental Models All of the above systems share some fundamental properties: Interaction Model communication takes place with delays and without a universal clock Failure Model correct operation of DS is threatened by various types of faults Security Model the security model defines and classifies forms of attackOCT 14Interaction Model•Two Variants:Synchronous Distributed System The model assumes we can place bounds on time needed for process execution, communication, and clock drift. Asynchronous Distributed Systems assumes we can set no bounds on any of the above (some design problems can be solved even with these assumptions) The internet fits this model well.OCT 15Lamport Clocks (1)Three processes, each with its own clock.P0 P1P206121824303642485460081624324048566472800102030405060708090100ABCDOCT 16Lamport Clocks (2) Lamport defined the “happens-before” relation. The expression a->b is read “a happens before b”. If a and b are two events within the same process and a occurs before b then a -> b is true. If a is the sending of a message by one process and b is the reception of that message by another then a -> b is true. “Happens-before” is transitive. If a->b and b->c then a->c.OCT 17Lamport Clocks (3) We need a way of assigning time values so that all processes (P) agree that: If a->b then C(a) < C(b) with C always increasing never decreasing.OCT 18Lamport Clocks (4) Lamport’s Algorithm LC1: C(i) is incremented before each event happens at P(i) LC2: (a) When a process P(i) send a message m, it piggybacks on m the value t = C(i) (b) On receiving (m,t), a process P(j) computes C(j) = max(C(j), t) and then applies LC1 before timestamping the event receive(m) So, if the “happens-before” relation holds between a and b then C(a) < C(b)OCT 19 Lamport Clocks (5)Three processes, using Lamport’s Algorithm.P0 P1P206121824303642487076081624324048616977850102030405060708090100ABCDOCT 20 Lamport Clocks (6)Adding the process number to eventsP0 P1P20.06.012.018.024.030.036.042.048.070.076.00.18.116.124.132.140.148.161.169.177.185.10.210.220.230.240.250.260.270.280.290.2100.2ABCDOCT 21Lamport Timestamps(7)Update 1 : San Fransisco wants to add $100 to account containing $1000.Update 2: New York wants to add 1% interest to the same account.Result: San Fransisco Data Base holds $1,111 New York Data Base holds $1,110OCT 22Totally-ordered multicast•Assume that messages from the same sender are received in the order that they were sent. Assume all messages arrive and are muticast to every process.•When a process receives a message it puts it into a local queue ordered according to the timestamp in the message (every message has a unique timestamp)•The receiver multicasts an acknowledgement.•Note that the timestamp on the received message will always be lower than the timestamp on the acknowledgement.OCT 23Totally-ordered multicast•All
View Full Document