Distributed Systems
-
Upload
benedict-mcleod -
Category
Documents
-
view
15 -
download
0
description
Transcript of Distributed Systems
![Page 1: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/1.jpg)
Distributed Systems
Lecture # 3
![Page 2: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/2.jpg)
Administrivia
• Projects– Design and Implement a distributed file
system
• Paper Discussions– Discuss papers as case studies
![Page 3: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/3.jpg)
Paper Discussions
• Attended by ~40 students• 15% grade (10 + 5)• Paper discussion modeled after program committee
meetings • Each Paper presented by 4 students
– Motivator (context of work)– Presenter– Advocate– Devil’s advocate– Class discussion and vote
![Page 4: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/4.jpg)
Assignments
• Assignments:– One big project
• Teams of 5
– Network File System• Both paper design and implementation• Communication (2 weeks: Design and implement)• Naming (2 weeks: design and implement)• Storage: Multiple users (2 weeks: design and implement)• Reliability (make it work in 3 weeks)
![Page 5: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/5.jpg)
Design Documents
• 400 words: One pager
• Two main sections– What is your design?– What were the alternatives
• Only bullet points– A picture is worth a thousand words
![Page 6: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/6.jpg)
Implementation
• .. then you implement your design
• No copying of code– This is a serious offense!
• Use Java: Lots of existing code and libraries– Code submission at the end of the week– TAs will need to see a demo
![Page 7: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/7.jpg)
Layered Communication
Application
Distributed System (RPC)
Socket
OSTCP/IPUDP/IP
![Page 8: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/8.jpg)
Sun RPC
• What does a Sun RPC request contain?• Wire format
– Xid
– Call or reply
– RPC version
– program #
– program version
– procedure #
– auth bits
– Marshaled arguments
![Page 9: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/9.jpg)
Marshalling: Sun RPC
• Marshaling arguments• "Linearize" data • "Externalize" data: Formats defined by XDR standard
Easy for e.g. int -- same representation, though portable byte-order...Collections? include a length.
Pointers? Pass by value or reference?
• Return Values– How to return?
• IDL: In, Out, INOut
• RMI: Objects– Recursive packing
![Page 10: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/10.jpg)
RPC: Summary
• Synchronous, Blocking• Mimics a procedural call• Involves:
– Data transfer: Marshaling– Thread Migration
![Page 11: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/11.jpg)
RPC Components
Client Server
Stub Skeleton
Client Framework Server Framework
Network
![Page 12: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/12.jpg)
NFS Transparency
• Tension between performance and consistency– Syntax preserved– Not Semantics– File read/write semantics
• Only check on open()• Consistency?
– Events!
• Expose Distribution: Java RMI
![Page 13: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/13.jpg)
Events
• Subscribe/notify
• Asynchronous
• Non-blocking
Subscribe
Notify
![Page 14: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/14.jpg)
Events
• Better performance than polling for larger tasks– Do it, let me know when you are done
• Preferred mode of communication for interactive applications: none-blocking
• But Harder to program– Synchronization– Spaghetti code
![Page 15: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/15.jpg)
Programming Events
Main thread
Events Handler
Subscribe
Notify
![Page 16: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/16.jpg)
Distributed Shared Memory
Int x;x = 10;
Int x;..print x;
X = 10• Consistency?• Deadlock?• DSM abstraction?
• Make it explicit
![Page 17: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/17.jpg)
Tuple-spaces
Tuple-space
• Explicit DSM• Tuple as the atomic data object • Clearly defined semantics for insert/read/peak
![Page 18: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/18.jpg)
Your distributed file system
• What would you use?
Your file system
Java
Operating System
-Client-servercommunication- Naming of files-Storage of files- Consistency- Availability
![Page 19: Distributed Systems](https://reader035.fdocuments.net/reader035/viewer/2022072015/5681303d550346895d95d6cc/html5/thumbnails/19.jpg)
Your file-system
File Server
Remote Client• Communication?• Name Server?
• Directories?• Storage
• Local file-system?• Consistency of data/names• Fault-tolerance