Review RPC Information Flow Client caller call return Machine B November 25 2009 Prof John Kubiatowicz http inst eecs berkeley edu cs162 Server callee 11 25 09 Goals for Today return call send Client Packet Stub Handler receive unbundle mbox2 ret vals bundle ret vals Server Stub unbundle args send receive Network Machine A Distributed File Systems bundle args Network CS162 Operating Systems and Systems Programming Lecture 24 mbox1 Packet Handler Kubiatowicz CS162 UCB Fall 2009 Lec 24 2 RPC Details Equivalence with regular procedure call Finish Remote Procedure Call Examples of Distributed File Systems Cache Coherence Protocols for file systems Parameters Request Message Result Reply message Name of Procedure Passed in request message Return Address mbox2 client return mail box 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 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 25 09 Kubiatowicz CS162 UCB Fall 2009 Lec 24 3 Cross platform issues What if client server machines are different architectures or in different languages Convert everything to from some canonical form Tag every item with an indication of how it is encoded avoids unnecessary conversions 11 25 09 Kubiatowicz CS162 UCB Fall 2009 Lec 24 4 RPC Details continued How does client know which mbox to send to Problems with RPC 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 This is another word for naming at network level Static fixed at compile time Dynamic performed at runtime Dynamic Binding Most RPC systems use dynamic binding via name service 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 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 failure kernel bug causes all processes on same machine to fail Some machine is compromised by malicious party Before RPC whole system would crash die After RPC One machine crashes compromised while others keep working Can easily result in inconsistent view of the world Did my cached data get written back or not Did server do what I requested or not What if there are multiple servers Could give flexibility at binding time Answer Distributed transactions Byzantine Commit Choose unloaded server for each new client Could provide same mbox router level redirect 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 25 09 Kubiatowicz CS162 UCB Fall 2009 Lec 24 5 Cross Domain Communication Location Transparency How do address spaces communicate with one another Shared Memory with Semaphores monitors etc File System Pipes 1 way communication Remote procedure call 2 way communication Performance Cost of Procedure call same machine RPC network RPC Means programmers must be aware that RPC is not free Caching can help but may make failure handling complex 11 25 09 Kubiatowicz CS162 UCB Fall 2009 Microkernel operating systems Example split kernel into application level servers File system looks remote even though on same machine App VM Services can be run wherever it s most appropriate Access to local and remote services looks the same CORBA Common Object Request Broker Architecture DCOM Distributed COM RMI Java Remote Method Invocation App file system RPC s can be used to communicate between address spaces on different machines or the same machine Examples of modern RPC systems Lec 24 6 App Windowing Networking Threads Monolithic Structure App RPC File sys windows address spaces threads Microkernel Structure Why split the OS into separate domains Fault isolation bugs are more isolated build a firewall Enforces modularity allows incremental upgrades of pieces of software client or server Location transparent service can be local or remote For example in the X windowing system Each X client can be on a separate machine from X server Neither has to run on the machine with the frame buffer 11 25 09 Kubiatowicz CS162 UCB Fall 2009 Lec 24 7 11 25 09 Kubiatowicz CS162 UCB Fall 2009 Lec 24 8 Distributed File Systems Virtual File System VFS Read File Network Client Data Distributed File System Server Transparent access to files stored on a remote disk Naming choices always an issue Hostname localname Name files explicitly No location or migration transparency Mounting of remote file systems mount kubi jane VFS Virtual abstraction similar to local file system System manager mounts remote file system by giving name and local mount point Transparent to user all reads and writes look like local reads and writes to user e g users sue foo sue foo on server Instead of inodes has vnodes Compatible with a variety of local and remote file systems provides object oriented way of implementing file systems A single global name space every file in the world has unique name Location Transparency servers can change and files can move without involving user 11 25 09 mount coeus sue Kubiatowicz CS162 UCB Fall 2009 mount kubi prog Lec 24 9 VFS allows the same system call interface the API to be used for different types of file systems The API is to the VFS interface rather than any specific type of file system 11 25 09 Administrivia Kubiatowicz CS162 UCB Fall 2009 Simple Distributed File System Final Exam Read RPC Thursday 12 17 8 00AM 11 00AM 105 Stanley Hall All material from the course Return Data Client With slightly more focus on second half but you are still responsible for all the material Two sheets of notes both sides Will need dumb calculator Design reviews Monday Tuesday after Thanksgiving Final Project due on Monday 12 7 There is a lecture on Wednesday Including this one we are down to 4
View Full Document
Unlocking...