Unformatted text preview:

Review Distributed Applications Network Receive Send CS162 Operating Systems and Systems Programming Lecture 24 Message Abstraction send receive messages Already atomic no receiver gets portion of a message and two receivers cannot get same message Interface Distributed File Systems Mailbox mbox temporary holding area for messages Includes both destination location and queue Send message mbox Send message to remote mailbox identified by mbox November 26 2007 Prof John Kubiatowicz http inst eecs berkeley edu cs162 Receive buffer mbox Wait until mbox has message copy into buffer and return If threads sleeping on this mbox wake up one of them Two phase commit distributed decision making First make sure everyone guarantees that they will commit if asked prepare Next ask everyone to commit 11 26 07 Review Distributed Decision Making Discussion Why is distributed decision making desirable Fault Tolerance A group of machines can come to a decision even if one or more of them fail during the process Simple failure mode called failstop different modes later After decision made result recorded in multiple places Kubiatowicz CS162 UCB Fall 2007 Lec 24 2 Goals for Today Byzantine Agreement Remote Procedure Call Examples of Distributed File Systems Cache Coherence Protocols Undesirable feature of Two Phase Commit Blocking One node can tie up the others Alternative There are alternatives such as Three Phase Commit which don t have this blocking problem What happens if one or more of the nodes is malicious Malicious attempting to compromise the decision making Question is it possible to make a good decision despite the presence of malicious nodes 11 26 07 Kubiatowicz CS162 UCB Fall 2007 Lec 24 3 Note Some slides and or pictures in the following are adapted from slides 2005 Silberschatz Galvin and Gagne Slides on Testing from George Necula CS169 Many slides generated from my lecture notes by Kubiatowicz 11 26 07 Kubiatowicz CS162 UCB Fall 2007 Lec 24 4 Byzantine General s Problem General Malicious Att ack Cannot solve Byzantine General s Problem with n 3 because one malicious player can mess up things ack Retreat Attack at Retre k Attac Lieutenant The commanding general must send an order to his n 1 lieutenants such that IC1 All loyal lieutenants obey the same order IC2 If the commanding general is loyal then all loyal lieutenants obey the order he sends General Retreat Lec 24 5 Original algorithm has messages exponential in n Newer algorithms have message complexity O n2 One from MIT for instance Castro and Liskov 1999 Use of BFT Byzantine Fault Tolerance algorithm Allow multiple machines to make a coordinated decision even if some subset of them n 3 are malicious 11 26 07 Kubiatowicz CS162 UCB Fall 2007 Client caller call return Machine B Request response message passing under covers Stub provides glue on client server Server callee Client stub is responsible for marshalling arguments and unmarshalling the return values Server side stub is responsible for unmarshalling arguments and marshalling the return values Marshalling involves depending on system Converting values to a canonical form serializing objects copying arguments passed by reference etc Lec 24 7 11 26 07 return call bundle args send Client Packet Stub Handler receive unbundle mbox2 ret vals bundle ret vals Server Stub unbundle args send receive Kubiatowicz CS162 UCB Fall 2007 Network Machine A Implementation Lec 24 6 RPC Information Flow Better option Remote Procedure Call RPC Calls a procedure on a remote machine Client calls remoteFileSystem Read rutabaga Translated automatically into call on server fileSys Read rutabaga Distributed Decision Request Must wrap up information into message at source Must decide what to do with message at destination May need to sit and wait for multiple messages to arrive Kubiatowicz CS162 UCB Fall 2007 Attack Lieutenant Lieutenant Lieutenant Lieutenant Retreat Retreat Remote Procedure Call Raw messaging is a bit too low level for programming 11 26 07 Attack With f faults need n 3f to solve problem One General n 1 Lieutenants Some number of these f can be insane or malicious Kubiatowicz CS162 UCB Fall 2007 General Various algorithms exist to solve problem Lieutenant Byazantine General s Problem n players 11 26 07 Attack Network Att Attack ta ck Impossibility Results Lieutenant k tac At At Byzantine General s Problem con t mbox1 Packet Handler Lec 24 8 RPC Details RPC Details continued How does client know which mbox to send to Equivalence with regular procedure call Need to translate name of remote service into network endpoint Remote machine port possibly other info Binding the process of converting a user visible name into a network endpoint Parameters Request Message Result Reply message Name of Procedure Passed in request message Return Address mbox2 client return mail box This is another word for naming at network level Static fixed at compile time Dynamic performed at runtime Stub generator Compiler that generates stubs Input interface definitions in an interface definition language IDL Contains among other things types of arguments return Output stub code in the appropriate source language Code for client to pack message send it off wait for result unpack result and return to caller Code for server to unpack message call procedure pack results send them off Cross platform issues Name service provides dynamic translation of service mbox Why dynamic binding Access control check who is permitted to access service Fail over If server fails use a different one What if there are multiple servers Could give flexibility at binding time Could provide same mbox router level redirect Convert everything to from some canonical form Tag every item with an indication of how it is encoded avoids unnecessary conversions Kubiatowicz CS162 UCB Fall 2007 Most RPC systems use dynamic binding via name service Choose unloaded server for each new client What if client server machines are different architectures or in different languages 11 26 07 Dynamic Binding Lec 24 9 Choose unloaded server for each new request Only works if no state carried from one call to next What if multiple clients Pass pointer to client specific return mbox in request 11 26 07 Problems with RPC Kubiatowicz CS162 UCB Fall 2007 Lec 24 10 Administrivia Non Atomic failures Different failure modes in distributed system than on a single machine Consider many different types of failures User level bug causes address space to crash Machine


View Full Document

Berkeley COMPSCI 162 - Lecture 24 Distributed File Systems

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Loading Unlocking...
Login

Join to view Lecture 24 Distributed File Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 24 Distributed File Systems and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?