1 / 38

COMP 655: Distributed/Operating Systems

COMP 655: Distributed/Operating Systems. Summer 2011 Dr. Chunbo Chu Week 2, 3: Communication. Agenda. 6:00 - 6:30, system summary presentation 6:30 - 8:00, Lab 1 8:00 - 8:15, Break 8:15 – 9:30, Communication Wrap up. Communication essentials. Communication patterns

jared
Télécharger la présentation

COMP 655: Distributed/Operating 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. COMP 655:Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 2, 3: Communication Distributed Systems - COMP 655

  2. Agenda • 6:00 - 6:30, system summary presentation • 6:30 - 8:00, Lab 1 • 8:00 - 8:15, Break • 8:15 – 9:30, Communication • Wrap up Distributed Systems - COMP 655

  3. Communication essentials • Communication patterns • Communication structure: OSI reference model and TCP/IP coverage • Major middleware communication services • RPC • RMI • http • I hate to wait … • Message passing • (skip) Streams Distributed Systems - COMP 655

  4. Communication patterns Producer Consumer query response Distributed Systems - COMP 655

  5. Communication patterns with broker Consumer 1 Producer 1 Subscription service Consumer 2 Producer 2 Consumer 3 query Server 1 Request broker Client 1 query response Server 2 Client 2 response Server 3 Distributed Systems - COMP 655

  6. Communication patterns -other variations • Blocking or non-blocking • Connection-based or connectionless • Transient or persistent Examples: • blocking transient query-response == RPC • non-blocking persistent producer/consumer == message queuing Distributed Systems - COMP 655

  7. A note about blocking • Blocking communication blocks the thread that makes the call • Other work may continue in other threads in the same process • More about threads and processes next week Distributed Systems - COMP 655

  8. Communication essentials • Communication patterns • Communication structure: OSI reference model and TCP/IP coverage • Major middleware communication services • RPC • RMI • http • I hate to wait … • Message passing Distributed Systems - COMP 655

  9. OSI Reference Model TCP/IP HTTP, FTP, … 2-1 not used not used TCP, UDP connectionless IP e.g. Ethernet sending bits Distributed Systems - COMP 655

  10. Layered Protocols • A typical message as it appears on the network.

  11. Middleware Protocols 2-5 RPC RMI Distributed Systems - COMP 655

  12. Where does http fit? • Originally, it looked like an application-level protocol, where the application was fetching and viewing HTML pages • As the Web has matured, it has been used increasingly as middleware. • It’s the foundation for • Web applications • Web services Distributed Systems - COMP 655

  13. Communication essentials • Communication patterns • Communication structure: OSI reference model and TCP/IP coverage • Major middleware communication services • RPC • RMI • http • I hate to wait … • Message passing Distributed Systems - COMP 655

  14. RPC is all about • Allowing a client to make a procedure call that is processed on a remote machine • Without the client’s having to care (much) Distributed Systems - COMP 655

  15. 2.3 0.98 Ordinary procedure call process caller callee (callee is atanh) Distributed Systems - COMP 655

  16. Conventional Procedure Call Parameter passing in a local procedure call: the stack before the call to read. (b) The stack while the called procedure is active.

  17. 0.98 0.98 client stub server stub message Atanh, 0.98 RPC: call the procedure across a network client process server process caller callee network Distributed Systems - COMP 655

  18. 2.3 2.3 client stub server stub message OK, 2.3 RPC: call the procedure across a network client process server process caller callee network Distributed Systems - COMP 655

  19. RPC Summary • client stub pretends to be the callee client process server process • server stub pretends to be the caller • caller and callee are written as if they were on the same machine caller callee client stub server stub • location transparency!! (almost) network Distributed Systems - COMP 655

  20. Warning: passing parameters and results can be tricky Distributed Systems - COMP 655

  21. Question • Parameter passing mechanisms • By value • By reference • By value-results • … Distributed Systems - COMP 655

  22. Passing Value Parameters (1) Distributed Systems - COMP 655

  23. Passing Value Parameters (2) • Original message (JILL, 5) on the Pentium (little endian) • The message after receipt on the SPARC (big endian) • The message after being inverted. The little numbers in boxes indicate the address of each byte Number is backwards String is backwards Distributed Systems - COMP 655

  24. Distributed Systems - COMP 655

  25. Conclusion from the byte order problem • You have to explicitly define your interfaces. • This problem is one of the fundamental motivators for the use of Interface Definition Languages (IDL) • WSDL, OMG IDL, … • Passing value parameters is a key component of access transparency. Distributed Systems - COMP 655

  26. Interface definition Interface definitions are critical factors in • Openness • Flexibility • Access transparency • Enabling proxy construction in middleware Distributed Systems - COMP 655

  27. Activity – what can go wrong?(with an RPC) Brainstorm things that can go wrong when a program on machine A tries to make an RPC to a server on machine B Network A B Distributed Systems - COMP 655

  28. Pick the top three • The instructor will pick some of the failures you brainstormed • Multi-vote on the ones in whose solutions you are most interested • You will use the top three vote-getters in the next activity Distributed Systems - COMP 655

  29. Activity – what could you do about it? Brainstorm approaches to dealing with the top three failure modes Network A B Distributed Systems - COMP 655

  30. Communication patterns -reminder Parameters: • Query-response or producer-consumer • Blocking or non-blocking • Connection-based or connection-less • Persistent or transient Examples: • blocking transient query-response == RPC • non-blocking persistent producer/consumer == message queuing Distributed Systems - COMP 655

  31. Finding the server or peer • In all cases, the process that initiates a communication has to find the process it wants to communicate with • The address could be in • Source code (simplest, least flexible) • Configuration file • A network directory service (requires client to know a name for a server) (e.g. DNS) • A series of directories (e.g. LDAP, then RMI Registry) • Interaction with the directory is usually blocking request/response Distributed Systems - COMP 655

  32. Communication essentials • Communication patterns • Communication structure: OSI reference model and TCP/IP coverage • Major middleware communication services • RPC • RMI • http • I hate to wait … • Message passing Distributed Systems - COMP 655

  33. Focus on Remote Objects • Here, object == state + methods + interface • Usually, only the interface is distributed • “Remote objects” refers to approaches in which, for each object there is some server where all of it state resides Distributed Systems - COMP 655

  34. Distributed Objects • Common organization of a remote object with client-side proxy. 2-16 Distributed Systems - COMP 655

  35. Basic Java RMI Interface.class _Stub.class * • Server registers its name and remote object • Client gets reference (a stub)  to remote object from rmiregistry • Client calls server Client 2. rmiregistry** 3. * = not needed if Client and Server are both Java 1.5 or newer 1. Server ** = RMI Registry can be a separate process or an object inside the Server process. If separate, must be on same machine. Interface.class _Skel.class * Distributed Systems - COMP 655

  36. Passing objects around … • In RMI, parameters and return values can be object references • If the parameter refers to a local object, do you copy the object or pass only a reference? • If the parameter refers to a remote object, what do you pass? Distributed Systems - COMP 655

  37. Local, remote objects in Java RMI • Local objects are passed by value • Remote objects by reference • Passing a remote object by reference means passing a proxy by value Distributed Systems - COMP 655

  38. Parameter Passing in RMI Distributed Systems - COMP 655

More Related