communication in distributed systems. communication in distributed systems based on low level...

Download Communication in Distributed Systems. Communication in Distributed Systems based on low level message passing offered by underlying network Three popular

Post on 26-Dec-2015




0 download

Embed Size (px)


  • Slide 1
  • Communication in Distributed Systems
  • Slide 2
  • Communication in Distributed Systems based on low level message passing offered by underlying network Three popular models of communication: Remote Procedure Calls (RPC) Message-oriented Middleware (MOM) Data Streaming, discussion of SCTP, 3GPP Sending data to multiple receivers or Multicasting
  • Slide 3
  • Interprocess Communication is part of the Client/Server Computing Model A client is an application or a process that requests a service from some other application or process. A server is an application or a process that responds to a client request. Both client/server applications perform specialized functions in a distributed computing environment. Intraprocess communication used between homogeneous systems. Example : using named pipes, named queues, shared memory etc Focus of this presentation is Interprocess Communication
  • Slide 4
  • In between the end users and large pool of computing resources, many applications act as both a client and a server, depending on the situation. Interprocess communication is necessary to communicate between heterogeneous systems Protocols govern the format, contents and meaning of messages
  • Slide 5
  • Two main types of Protocols: Connection-oriented: Sender and receiver establish a connection and negotiate the protocol to use before exchanging data. At the end of commiunication, terminate or release the connection. An example: TCP Connectionless: No connection is set up in advance. Sender transmits message when ready. An example: UDP
  • Slide 6
  • Main differences between connection-oriented and connectionless protocols: 1. Connection-oriented is reliable, while the other is not. 2. Connection-oriented is fully duplex 3. Connection-oriented is byte-stream service with no structure 4. Error checking an essential component of unreliable connectionless protocol 5. Connectionless protocol transfers packets of data and uses a protocol port address to specify receiver process
  • Slide 7
  • Slide 8
  • Lower-Level Protocols Implemented in physical layer and data link layer of the stack. Groups data bits into frames and adds a pattern called checksum at either end of frame Network layer chooses best path from sender to receiver by routing Transport Protocols TCP UDP Higher Level Protocols FTP HTTP
  • Slide 9
  • Middleware Protocols: Examples are Authentication and Authorization protocols, commit protocols in transaction databases Middleware protocols support high level communication services Protocols that allow a process to call a procedure or invoke an object on a remote machine transparently. An example RPC/RMI Protocols that support the setting up and synchronizing of streams for transferring real-time data such as multimedia applications. An example: SCTP Protocols that support reliable multicast services to a WAN
  • Slide 10
  • Application Middleware Transport Network Data Link Physical Network Application Protocol Middleware Protocol Transport Protocol Network Protocol Data Link Protocol Physical Protocol 6 5 4 3 2 1 Protocol Stack
  • Slide 11
  • Types of Communication Persistent communication: Message submitted for transmission stored by communication middleware as long as it takes to deliver it to the receiver. Neither sending application nor receiving application need to be executing. Transient communication: Message stored by communication system only as long as sending and receiving application are executing. Asynchronous communication: Sender continues immediately after submitting message for transmission. Message temporarily stored by middleware on submission. Synchronous communication: Sender blocks until message received and processed and receiver returns acknowledgement.
  • Slide 12
  • Remote Procedure Calls Remote procedure calls can simplify the way IPCs are conducted through the network. Client applications use the client side network API to call RPCs. Server side of the network API turns the RPCs into local function calls. Return value being transmitted back to the client application again through the network. The OSI layers are transparent to the client application, as if it is making a local function call. The RPC provided by Windows enable applications that use RPC to communicate with applications running with other operating systems that support DCE (Distributed Computing Environment). RPC automatically supports data conversion to account for different hardware architectures and for byte-ordering between dissimilar environments.
  • Slide 13
  • Synchronous RPC Operation: Process on machine A calls procedure on machine B, the calling process on A is suspended and execution of the called procedure takes place on B. Information is transported from caller to callee in the parameters and comes back in the procedure result No message passing visible to programmer Client and Server stubs are used Client stub takes its parameters and packs them into a message (parameter marshalling) and sends them to the server stub
  • Slide 14
  • Parameter Passing: Passing Value Parameters Client stub takes parameters and puts them in the message. It also puts the name or number of the procedure to be called in the message When message arrives at server, server stub examines the message to see which procedure is needed and then makes appropriate call. Stub takes the result and packs it into a message. Message is sent back to client stub. Client stub unpacks the message to extract the result and returns it to waiting client procedure
  • Slide 15
  • Passing Reference Parameters Pointers and references passed by copying the data structure such as array into message and sent to server Server stub calls server with a pointer to this array Server makes changes using this pointer that also affects the message buffer inside server stub Server finishes its work, original message sent back to client stub which copies it back to the client. This is similar to copy/restore.
  • Slide 16
  • Asynchronous RPC: Client continues immediately after issuing RPC request and receiving acknowledgement from server, it is not blocked. Server sends immediately a reply or acknowledgement to the client the moment RPC request is received Server then calls requested procedure One-way RPC: Client does not wait for even an acknowledgement from server. Reliability not guaranteed as client has no acknowledgement from server. Deferred synchronous RPC is a combination of two asynchronous RPCs, where client polls the server periodically to see whether results are available yet rather than server calling back the client.
  • Slide 17
  • Message-Oriented Communication RPC assumes that receiver process is executing at the time a request is issued Message-oriented communication such as message-queuing systems is therefore needed to allow processes to exchange information even if one party is not executing at the time the communication is initiated. Message-oriented-model (MOM) offered by transport layer, as part of middleware solution
  • Slide 18
  • Berkeley Sockets Sockets interface introduced in 1970s in Berkeley Unix Standardizes the interface of the transport layer to allow programmers the use of messaging protocols through simple set of primitives Another interface XTI stands for X/Open Transport Interface, also formerly called Transport Layer Interface (TLI) developed by AT&T Sockets and XTI similar in their model of network programming but differ in their set of primitives Socket forms an abstraction over the communication end point to which an application can write data that are sent over the underlying network and from which incoming data can be read. Servers execute the first four primitives in table When calling the socket primitive, the caller creates a new communication end point for a specific transport protocol. Internally, the OS reserves resources to accommodate sending and receiving messages for the specific protocol.
  • Slide 19
  • Bind primitive associates a local address with a newly-created socket. For example, server should bind the IP address of its machine together with a known port # to a socket Binding tells the OS that the server wants to receive messages only on the specified address and port Listen primitive is called only in the case of connection-oriented communication. It is a nonblocking call that allows the local OS to reserve enough buffers for a specified # of connections that the caller is willing to accept A call to accept primitive blocks the caller until a connection request arrives. When the request arrives, the local OS creates a new socket with same properties as the original one and returns it to caller. Server can wait for another connection request on the original socket Connect primitive on client requires that the caller specifies the transport level address to which a connection request is to be sent Client is blocked until a connection is set up, after which info can be exchanged using send/receive Closing the connection is symmetric as both server and client call the close primitive
  • Slide 20
  • PrimitiveMeaning SocketCreate a new communication end point BindAttach a local address to a socket ListenAnnounce willingness to accept connections AcceptBlock caller until connection request arrives ConnectActively attempt to establish a connection SendSend some data over the connection ReceiveReceive some data over the connection CloseRelease t


View more >