Review RPC Information Flow Client caller call return Machine B November 26 2008 Prof John Kubiatowicz http inst eecs berkeley edu cs162 Server callee 11 26 08 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 25 mbox1 Packet Handler Kubiatowicz CS162 UCB Fall 2008 Lec 25 2 RPC Details continued How does client know which mbox to send to 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 Finish Remote Procedure Call Examples of Distributed File Systems Cache Coherence Protocols for file systems 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 What if there are multiple servers 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 08 Kubiatowicz CS162 UCB Fall 2008 Lec 25 3 Could give flexibility at binding time 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 26 08 Kubiatowicz CS162 UCB Fall 2008 Lec 25 4 Problems with RPC 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 Answer Distributed transactions Byzantine Commit Performance Cost of Procedure call same machine RPC network RPC Means programmers must be aware that RPC is not free 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 RPC s can be used to communicate between address spaces on different machines or the same machine Services can be run wherever it s most appropriate Access to local and remote services looks the same Examples of modern RPC systems CORBA Common Object Request Broker Architecture DCOM Distributed COM RMI Java Remote Method Invocation Caching can help but may make failure handling complex 11 26 08 Kubiatowicz CS162 UCB Fall 2008 Lec 25 5 11 26 08 Kubiatowicz CS162 UCB Fall 2008 Microkernel operating systems Distributed File Systems Read File Network Example split kernel into application level servers File system looks remote even though on same machine App App file system VM App Windowing Networking Threads Monolithic Structure App RPC File sys windows Client address spaces threads Server Transparent access to files stored on a remote disk Naming choices always an issue Hostname localname Name files explicitly Microkernel Structure No location or migration transparency Mounting of remote file systems 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 Kubiatowicz CS162 UCB Fall 2008 Data Distributed File System Why split the OS into separate domains 11 26 08 Lec 25 6 Lec 25 7 mount kubi jane 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 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 26 08 mount coeus sue Kubiatowicz CS162 UCB Fall 2008 mount kubi prog Lec 25 8 Virtual File System VFS Simple Distributed File System Read RPC Return Data Client C RP e t i Wr K AC Server cache Client VFS Virtual abstraction similar to local file system Instead of inodes has vnodes Compatible with a variety of local and remote file systems provides object oriented way of implementing file systems 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 26 08 Kubiatowicz CS162 UCB Fall 2008 Lec 25 9 Remote Disk Reads and writes forwarded to server Use RPC to translate file system calls No local caching can be caching at server side Advantage Server provides completely consistent view of file system to multiple clients Problems Performance Going over network is slower than going to local memory Lots of network traffic not well pipelined Server can be a bottleneck 11 26 08 Administrivia read f1 V1 read f1 V1 cache read f1 V1 F1 V1 Client read f1 V1 One week from today 5 30 8 30 10 Evans All material up to next Monday lectures 13 26 Includes virtual memory One page of handwritten notes both sides Final Exam Lec 25 10 Use of caching to reduce network load MIDTERM II Wednesday December 3th Kubiatowicz CS162 UCB Fall 2008 18th December 8 00 11 00am Bechtel Auditorium Covers whole course except last lecture Two pages of handwritten notes both sides Final Topics Any suggestions write f1 OK read f1 V2 cache F1 V2 Read RPC Return Data C RP e it Wr K AC Server cache F1 V2 F1 V1 Client Idea Use caching to reduce network load In practice use buffer cache at source and destination Advantage if open read write close can be done locally don t need to do any network traffic fast Problems Failure Client caches have data
View Full Document
Unlocking...