1 / 20

Distributed Systems

Distributed Systems. Lecture #1: Remote Communication. Communication. Communication across address spaces Local Remote Same Rules apply Transparency Fault-isolation Consistency. Overview. Mechanism Message Passing Abstractions Message Passing Synchronous: Procedure Calls

Download Presentation

Distributed Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Systems Lecture #1: Remote Communication

  2. Communication • Communication across address spaces • Local • Remote • Same Rules apply • Transparency • Fault-isolation • Consistency

  3. Overview • Mechanism • Message Passing • Abstractions • Message Passing • Synchronous: Procedure Calls • Asynchronous: Events • Coupled: Shared Memory • De-coupled: Tuple-spaces

  4. Layered Communication Application Distributed System (RPC) Socket TCP/IP UDP/IP OS

  5. Local Communication • How would 2 processes communicate? • Message Passing: Sockets • Shared Memory: Files • Procedural call (across address space)? • Ever used local RPC? • Heard of OLE? COM?

  6. RPC Enables Modularization • Clients and Servers • Better software engineering • Well-defined interfaces between • Client • Service provider • Fault-isolation • Client failure does not affect the server • Centralized consistency management • Security • Scalable Performance: Server not constrained by client

  7. Local RPC • Transparency! • Makes sense? • Issues: • What transpires in a subroutine call?

  8. RPC Components Client Server Stub Skeleton Client Framework Server Framework Network

  9. (Local) RPC Issues • Transfer of control and data across address spaces • Binding • Data Marshalling • Thread Migration • Synchronization

  10. Remote RPC • Same Issues • BUT transparency makes sense? • To what degree? • Modularization • Fault-isolation • But masking? • Failure may be partial • Time? • Consistency • Scalable Performance?

  11. Case Study: Sun RPC • Used in NFS • What does an RPC system consist of? 1. Standards for wire format of RPC msgs and data types. XDR, XML 2. Library of routines to marshal / unmarshal data. 3. Stub generator, Client: marshal, invoke, wait, unmarshal reply. For server: unmarshal arguments, invoke server function, marshal reply. 4. Server framework: Dispatch each call message to correct server stub. 5. Client framework: Give each reply to correct waiting thread / callback. 6. Binding: how does client find the right server?

  12. Sun RPC • What does a Sun RPC request contain? • Wire format • Xid • Call orreply • RPC version • program # • program version • procedure # • auth bits • Marshalled arguments

  13. 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

  14. RPC: Summary • Synchronous, Blocking • Mimics a procedural call • Involves: • Data transfer: Marshaling • Thread Migration

  15. 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

  16. Events • Subscribe/notify • Asynchronous • Non-blocking Subscribe Notify

  17. 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

  18. Programming Events Main thread Subscribe Notify Events Handler

  19. Distributed Shared Memory Int x; x = 10; Int x; .. print x; • Consistency? • Deadlock? • DSM abstraction? • Make it explicit X = 10

  20. Tuple-spaces Tuple-space • Explicit DSM • Tuple as the atomic data object • Clearly defined semantics for insert/read/peak

More Related