1 / 27

CS603 Communication Mechanisms

CS603 Communication Mechanisms. 14 January 2002. Types of Communication. Shared Memory Message Passing Stream-oriented Communications Remote Procedure Call Remote Method Invocation. Message Passing. Basic model: mailing a letter Package data Has source (from address)

ingo
Télécharger la présentation

CS603 Communication Mechanisms

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. CS603Communication Mechanisms 14 January 2002

  2. Types of Communication • Shared Memory • Message Passing • Stream-oriented Communications • Remote Procedure Call • Remote Method Invocation

  3. Message Passing • Basic model: mailing a letter • Package data • Has source (from address) • Delivered to recipient (to address) • Recipient is informed of delivery and can read at will • Advantages • Low overhead • Simple model • Enables high concurrency

  4. Message Passing (cont.) • Disadvantages • No real programming model • No support for consistency • Stock exercise – let’s build a semaphore

  5. Message Passing: What else do we need to know? • Delivery announcement • Poll • Signal/interrupt • Quality of service • Bandwidth • Latency • Addressing mechanisms • Reliability!

  6. Addressing Mechanisms • Point-to-point • Obvious mechanism • Multicast • Optimization over point-to-point • Broadcast • NOT just optimized point-to-point

  7. Reliability Example:Byzantine Agreement • Introduced as voting problem (Lamport, Shostak, Pease ’82) • A and B can defeat enemy iff both attack • A sends message to B: Attack at Noon! General A General B The Enemy

  8. Byzantine Agreement • Impossible with unreliable networks • Possible if some guarantees of reliability • Guaranteed delivery within bounded time • Limitations on corruption of messages • Probabilistic guarantees (send multiple messages)

  9. CS603Communication Mechanisms 16 January 2002

  10. Types of Communication • Shared Memory • Message Passing • Stream-oriented Communications • Remote Procedure Call • Remote Method Invocation

  11. Types of Reliability • Delivery Guarantees • Always delivered • Time bounds • “Eventual” • Knowledge of delivery • Probabilistic guarantees • Ordering – easy to solve at application end • Message corruption

  12. Interaction of Parameters • Reliability and addressing • All-or-nothing multicast vs. partial delivery No real analog in point-to-point • Broadcast ordering • Quality of Service tradeoffs • Fast unreliable broadcast vs. slow reliable point-to-point

  13. Types of Communication • Shared Memory • Message Passing • Stream-oriented Communications • Remote Procedure Call • Remote Method Invocation

  14. Stream-oriented Communications • Telephone model • Matches some underlying hardware • Easy to implement on message passing model • Advantages: • Higher level programming model • Separation of addressing and sending • Quality of Service easier • “Advance notice” of data transfer • Some reliability “built-in” to model

  15. Stream-oriented communications • Disadvantages • Limited to point-to-point • Multicast, broadcast harder to conceptualize • Lack of flexibility • How to model unordered communications? • Performance • Set-up times

  16. Choosing between streams and message passing • Is there repeated communication between participants? • How much do we know in advance? • Multiple participants? • Is state between communications with each participant important? • Ordering important? • Performance needs?

  17. Types of Communication • Shared Memory • Message Passing • Stream-oriented Communications • Remote Procedure Call • Remote Method Invocation

  18. Remote Procedure Call • Idea: Just like a procedure call • Control passes to new procedure • New procedure is on remote machine • Advantages • Familiar programming model • Procedural abstraction • Encapsulation of function • Simple synchronization • Straightforward implementation?

  19. Implementing RPC • How do we do procedure call? • Push arguments • Push return address • Branch • Remote: • Message with arguments, return address • Send • Wait for response

  20. Implementing RPC:Why isn’t it this easy? • Branch vs. Sending a message • Someone has to be listening! • No shared environment • Global variables • Scope • What about passing pointers? • Naming • How do we handle multiple procedures “waiting” for RPC?

  21. RPC: Disadvantages • No concurrency • Must make concurrency explicit at caller • Spawn thread before calling RPC • One thread waits for return, others continue • Reliability questions • Retry? (at least once semantics) • Time out? (at most once semantics) Handling failures left to application!

  22. RPC vs. Communication-Oriented Protocols • What does RPC give us? • Simple programming model • What do we lose? • Simple concurrency model • Efficiency? • Flexible reliability models

  23. Types of Communication • Shared Memory • Message Passing • Stream-oriented Communications • Remote Procedure Call • Remote Method Invocation

  24. Remote Method Invocation • Object-Oriented RPC • Same basic concept • But some new complications • Objects as arguments • How does remote object “invoke” argument? • Pass code/data to execute argument locally? • Another RMI to run the argument? • Same for results Does it ever end?

  25. Remote Method Invocation • Differences from RPC • Communications overhead? • Can it be language-independent?

  26. CS603Communication Mechanisms 18 January 2002

  27. What is coming • Remote procedure call – specific systems • DCE RPC • Java RMI • SOAP • First project

More Related