1 / 53

Communication

Communication. Chapter 2. Layered Protocols (1). Layers, interfaces, and protocols in the OSI model. Layered Protocols (2). A typical message as it appears on the network. Data Link Layer. Discussion between a receiver and a sender in the data link layer. Client-Server TCP.

astra
Download Presentation

Communication

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. Communication Chapter 2

  2. Layered Protocols (1) • Layers, interfaces, and protocols in the OSI model.

  3. Layered Protocols (2) • A typical message as it appears on the network.

  4. Data Link Layer • Discussion between a receiver and a sender in the data link layer.

  5. Client-Server TCP

  6. Middleware Protocols • An adapted reference model for networked communication.

  7. Remote Procedure Call • Remote Procedure Call (RPC) • Definition: Information can be transported from the caller to the callee in the parameters and can come back in the procedure result. • Problems • Calling and called procedures run on different machine • Executed in different address spaces (more complications) • Passing parameters and results (especially in not identical or typos) • Machine crash or failure when execution

  8. Conventional Procedure Call • fd: an integer indicating a file • buf: an array  using call-by-copy/restore • nbytes: how many bytes to read • Parameter passing in a local procedure call: the stack before the call to read • The stack while the called procedure is active

  9. Client and Server Stubs • Put a different version of read in the client’s library • Client stub • Server-side equivalent of a client stub • Server stub • Principle of RPC between a client and server program.

  10. Steps of a Remote Procedure Call • Client procedure calls client stub in normal way • Client stub builds message, calls local OS • Client's OS sends message to remote OS • Remote OS gives message to server stub • Server stub unpacks parameters, calls server • Server does work, returns result to the stub • Server stub packs it in message, calls local OS • Server's OS sends message to client's OS • Client's OS gives message to client stub • Stub unpacks result, returns to client

  11. Passing Value Parameters (1/2) • Parameter Marshaling • Packing parameters into a message • Steps involved in doing remote computation through RPC

  12. Passing Value Parameters (2/2) • Problems • Different char. representations • IBM mainframe: EBCDIC character code • IBM PC: ASCII character code • Different math. representations • One’s complement vs. two’s complement • Data storing way • Intel Pentium: store numbers from right to left • Sun SPARC: from left to right • How to pass pointers & references a) Original message on the Pentium b) The message after receipt on the SPARC c) The message after being inverted. The little numbers in boxes indicate the address of each byte

  13. Parameter Specification and Stub Generation • Defining the message format is one aspect of an RPC protocol • A standard of data structure representation • An interface consists of a collection of procedure that can be called by a client. • Interface: Interface Definition Language (IDL) • A procedure • The corresponding message.

  14. Extended RPC Models • Performance Concern • RPC message exchange will cost a lot because they reside in different machines. • IPC (local interprocess communication) can overcome this problem since they are used in the same machine. • Doors • A generic name for a procedure in the address space of a server process that can be called by processes colocated with the server. • A similar mechanism is called Lightweight RPC. • A registered door (registered to OS) can be made available to other processes Need OS support!!

  15. Asynchronous RPC (1/2) • To overcome the drawback of RPC client’s waiting. • Asynchronous RPC can be made both either concurrently. • Combining two asyn. RPCs is sometimes referred to as a deferred synchronous RPC. • Note that “one-way RPCs” don’t need server to reply an ACK back to the client.

  16. Example: DCE RPC • DCE (Distributed Computing Environment) • Developed by the Open Software Foundation (OSF) • A middleware system • Initially designed for UNIX, now in VMS and Windows NT • Some famous services of the DCE • Distributed file service • Directory service • Security service • Distributed time service • DCE RPC enables a client to access a remote service by simply calling a local procedure.

  17. Writing a Client and a Server • Using Interface Definition Language (IDL) • IDL files contain • type definitions, constant declarations, and information needed to marshal parameters • Formal definition of what the procedures do • The syntax of the calls • Globally unique identifier for specified interface • Writing client/server DCE RPC (See next page) • First, using uuidgen program to generate a prototype IDL file • Second, editing the IDL file, filling the names of the procedures and their parameters. • Call IDL compiler to generate 3 files: the header file, the client stub, and the server stub • Finally, programmer write the client and server code.

  18. Writing a Client and a Server • The steps in writing a client and a server in DCE RPC.

  19. Binding a Client to a Server • How a client can call a server • It is necessary that the server be registered and prepared to accept incoming calls. • Server location announcement • 1. Locate the server’s machine • 2. Locate the server (i.e., the correct process) on that machine. • The client needs to know an endpoint, (also known as port) which is used by the server’s OS to distinguish incoming messages for diff. processes. • In DCE, a table of (server, endpoint)-pairs is maintained on each server machine by a process called DCE daemon. • Client-to-server binding in DCE.

  20. Remote Object Invocation • Object encapsulates data, called the state, and the operations on those data called methods. • Methods are made available through an interface. • The interface and the objects can be placed in different machine. • Client binds to a distributed object (DO), an implementation of the object’s interface, called a proxy. • Skeleton, a server stub, used to unmarshal invocation requests to proper method invocations at the object’s interface at the server.

  21. Compile-time vs. Runtime Objects • A class is a description of an abstract type in terms of a module with data elements and operations on that data. • Compile-time • Advantage: easy to build distributed app. • Drawbacks: the dependency on a particular PL. • Runtime • Advantage: distributed objects had been written. • It’s easy to constructing distributed app. by using objects in different language. • Persistent and Transient Objects • Persistent objects are alive on the server all the time. • Transient objects exist only as long as the server manages the object.

  22. Binding a Client to an Object • (a) Example with implicit binding using only global references • (b) Example with explicit binding using global and local references Distr_object* obj_ref; //Declare a systemwide object referenceobj_ref = …; // Initialize the reference to a distributed objectobj_ref-> do_something(); // Implicitly bind and invoke a method (a) Distr_object* obj_ref; //Declare a systemwide object referenceLocal_object* obj_ptr; //Declare a pointer to local objectsobj_ref = …; //Initialize the reference to a distributed objectobj_ptr = bind(obj_ref); //Explicitly bind and obtain a pointer to the local proxyobj_ptr -> do_something(); //Invoke a method on the local proxy (b)

  23. Static vs. Dynamic RMI • Remote Method Invocation (RMI) • Static invocation • The interfaces of an object are known when the client application is being developed • If interfaces change, the client application must be recompiled. • Dynamic invocation • invoke(object, method, input_parameters, output_parameters); • object: distributed object; method: method to be invoked; input_para: data structure; output_para: data structure • For example • Static: fobject.append(int) • Dynamic: invoke(fobject, id(append), int) has been known returns an id for the method append

  24. Parameter Passing • The situation when passing an object by reference or by value. 2-18

  25. The DCE Distributed-Object Model • Distributed dynamic objects in DCE. • Distributed named objects

  26. Persistence and Synchronicity in Communication (1) • General organization of a communication system in which hosts are connected through a network 2-20

  27. Persistence and Synchronicity in Communication (2) • Persistent communication of letters back in the days of the Pony Express.

  28. Persistence and Synchronicity in Communication (3) • Persistent asynchronous communication • Persistent synchronous communication 2-22.1

  29. Persistence and Synchronicity in Communication (4) • Transient asynchronous communication • Receipt-based transient synchronous communication 2-22.2

  30. Persistence and Synchronicity in Communication (5) • Delivery-based transient synchronous communication at message delivery • Response-based transient synchronous communication

  31. Berkeley Sockets (1) • Socket primitives for TCP/IP.

  32. Berkeley Sockets (2) • Connection-oriented communication pattern using sockets.

  33. The Message-Passing Interface (MPI) • MPI is used in local communication system • Socket, in contrast with MPI, has two drawbacks • Wrong level of abstraction by supporting send and receive primitives. • Using general protocol stacks, TCP/IP • Socket is not suitable for COWs (Cluster of Workstations) or MPPs (Massively Parallel Processors) • MPI is designed for parallel applications • MPI use (groupID, processID) to replace TCP/IP.

  34. The Message-Passing Interface (MPI) • Some of the most intuitive message-passing primitives of MPI.

  35. Message-Queuing Model (1/2) • Also called as Message-Oriented Middleware (MOM) • Intermediate-term storage capacity for messages, without requiring either the sender or receiver to be active during message transmission. • Difference with Berkeley socket and MPI • Applications communicate by inserting messages in specific queues. • A queue can be read only by its associated application, but it is also possible for multiple applications to share a single queue. • Loosely-coupled communication • Like the Internet e-mail system • Allow a process to install a handler as a callback function, which is automatically invoked whenever a message is put into the queue.

  36. Message-Queuing Model (2/2) • Four combinations for loosely-coupled communications using queues.

  37. Message-Queuing Model (2) • Basic interface to a queue in a message-queuing system.

  38. General Architecture of a Message-Queuing System (1/3) • The relationship between queue-level addressing and network-level addressing.

  39. General Architecture of a Message-Queuing System (2/3) • Source queue • Local to the sender • On the same machine or on a machine nearby such as on the same LAN. • Destination queue • Local to the receiver • Queue manager • Interacts directly with the application that is sending or receiving a message • Relays • Special queue managers that operate as routers

  40. General Architecture of a Message-Queuing System (3/3) • The general organization of a message-queuing system with routers.

  41. Message Brokers • The problem of integrating existing and new applications into a single, coherent distributed information system. • Acts as an application-level gateway • To convert incoming messages to a format that can be understood by the destination application. • Simple as a reformatter for messages. • The general organization of a message broker in a message-queuing system.

  42. Example: IBM MQSeries • General organization of IBM's MQSeries message-queuing system.

  43. Channels • Some attributes associated with message channel agents.

  44. Message Transfer (1) • The general organization of an MQSeries queuing network using routing tables and aliases.

  45. Message Transfer (2) • Primitives available in an IBM MQSeries MQI

  46. Data Stream (1/3) • Continuous media • The temporal relationships between different data items are fundamental to correctly interpreting what the data actually means. • Discrete media • The temporal relationships between different data items are not fundamental to correctly interpreting the data. • Data stream • Nothing but a sequence of data units.

  47. Data Stream (2/3) • Asynchronous transmission mode • The data item in a stream are transmitted one after the other, but there are no further timing constraints on when transmission of items should take place. • Synchronous transmission mode • There is a maximum end-to-end delay defined for each unit in a data stream • Isochronous transmission mode • It is necessary that data units are transferred on time. • Data transfer is subject to a maximum and minimum end-to-end delay, also referred to as bounded (delay) jitter.

  48. Data Stream (3/3) • Simple stream • Consists of only a single sequence of data • Complex stream • Consists of several related simple stream, called substreams. • Main problem with multicast streaming is when the receivers have different requirements with respect to the quality of the stream. • Filter

  49. Streams and Quality of Service (QoS) • Quality of Service (QoS) • Time-dependent (and other nonfunctional) requirements are generally expressed as • Flow specification • Bandwidth requirements, transmission rates, delays, etc. • Token bucket algorithm • How the stream will shape its network traffic

  50. Specifying QoS • A flow specification.

More Related