distributed (operating) systems -communication in distributed systems

Download Distributed (Operating) Systems  -Communication in Distributed Systems

Post on 21-Mar-2016

43 views

Category:

Documents

5 download

Embed Size (px)

DESCRIPTION

Distributed (Operating) Systems -Communication in Distributed Systems-. Fall 2011 Kocaeli University Computer Engineering Department. Communication in Distributed Systems. Communication is done through message passing - PowerPoint PPT Presentation

TRANSCRIPT

Distributed (Operating) Systems -Architectures-

Distributed (Operating) Systems -Communication in Distributed Systems- Fall 2011Kocaeli University Computer Engineering DepartmentCommunication inDistributed SystemsCommunication is done through message passingExpressing communication through message passing is harder than using primitives based on shared memory

Remote Procedure CallsTransparency but poor for passing referencesIdeal for client server applicationsMessage-oriented CommunicationStream-oriented CommunicationContinuous mediaRemote Method InvocationRMIs are essentially RPCs but specific to remote objectsSystem wide references passed as parameters

2Communication Between ProcessesUnstructured communicationUse shared memory or shared data structuresStructured communicationUse explicit messages (IPCs)Distributed Systems: both need low-level communication support (why?)Communication: unstructured (involves using shared-memory) and structured (message passing)

3Types of Communication -1Transient CommunicationA message is stored by the communication system only as long as the sending and the receiving application are executingTypically all transport level communication is transient communicationPersistent CommunicationA message that has been submitted for transmission is kept by middleware as long as it takes to deliver it to the receiverReceiving application dont need to be executing when the message when the message is submittedTypes of Communication -2Asynchronous CommunicationSender continues immediately after it has submitted its message for transmissionIt means, message is temporarily stored in middleware upon submissionSynchronous CommunicationSender is blocked until its request is known to be acceptedThree pointsSender informs message is deliveredMiddleware informs message is deliveredSender informs with the response after processingTypes of Communication -3Connection-oriented (telephone)TCPConnectionless (mailbox dropping a letter)IP, UDPA connection-oriented transport layer protocol, such as TCPA connectionless network layer protocol (such as IP)

6Persistence and Synchronicity in Communication

Similar to the figure in the text book Figure4-47PersistencePersistent communicationMessages are stored until (next) receiver is readyExamples: email, pony express

Messages are stored until the next receiver is ready to receive that message

Network buffers are not persistent they are transient

8Transient CommunicationTransient communicationMessage is stored only so long as sending/receiving application are executingDiscard message if it cant be delivered to next server/receiverExample: transport-level communication services offer transient communicationExample: Typical network router discard message if it cant be delivered next router or destinationEx chatting

9SynchronicityAsynchronous communicationSender continues immediately after it has submitted the messageNeed a local buffer at the sending hostSynchronous communicationSender blocks until message is stored in a local buffer at the receiving host or actually delivered to sendingVariant: block until receiver processes the messageSix combinations of persistence and synchronicityAsynchronous comm - nonblockingSynchronous comm - blocking

NOW you have 4 combinationsPersistence x transientAsynchronous x synchronous10Persistence and Synchronicity Combinationsa) Persistent asynchronous communication (e.g., email)b) Persistent synchronous communication

A client senderB server receiver11Persistence and Synchronicity Combinationsc) Transient asynchronous communication (e.g., UDP)d) Receipt-based transient synchronous communication

Transient synchronous classified into three depending on What the acknowledgement tells the senderIf it tells about the receipt d (tells you message reached the destination machine)If it tells about the delivery e (tells you message is accepted by the destination machine) like asynchronous RPCIf it tells about the response f (tells you that the job is processed by the destination machine) synchronous RPC(if I dont tell synch it still means as default synch)

12Persistence and Synchronicity Combinationse) Delivery-based transient synchronous communication at message delivery (e.g., asynchronous RPC)f) Response-based transient synchronous communication (RPC)

Transient synchronous classified into three depending on What the acknowledgement tells the senderIf it tells about the receipt d (tells you message reached the destination machine)If it tells about the delivery e (tells you message is accepted by the destination machine) like asynchronous RPCIf it tells about the response f (tells you that the job is processed by the destination machine) synchronous RPC(if I dont tell synch it still means as default synch)

13Layered Protocols 1Communication messaging rules are defined in protocols

Due to the absence of shared memory, all communication in distributed systems is based on sending and receiving (low-level) messages

Many different agreementsIBMs EBCDIC and ASCIIHow many volts should be used to signal 0How does the receiver know which is the last bitHow can the receiver detect if a message has been damagedLayered Protocols 2ISO/OSI never widely used and are essentially dead.In the OSI model communication is divided up into 7 layersOSI layers were never popular. In contrast, protocols developed for the internet, such as TCO and IP, are mostly usedCommunication ProtocolsThere are some rules that communicating processes must adhere to known as protocolsProtocols are agreements/rules on communicationProtocols could be connection-oriented or connectionless

Layered ProtocolsA typical message as it appears on the network.

Layers -1Physical layerTransmitting 0s and 1sHow many bits per sec transferCan transmission take place in both directionData Link LayerPuts special bit pattern on the start and end of each frameComputing checksumNetwork LayerRouting18Layers -2Transport ProtocolTurns the underlying network into something than an application developer can useMessages from the application is broken into small pieces-packetsWhich packets have been sent, which have been received, which should be retransmittedConnection-oriented: messages arrive in the same order (as in TCP)Connectionless: message can arrive in different order (as in UDP)Another example of transport protocol is RTPThe combination of TCP/IP is now used as a de facto standard for network communicationUDP- Universal Datagram Protocol

TCP is reliableUDP is unreliable19Client-Server TCP

(a)3-wat TCP hand-shakeEnd of 3 TCP connection has been established4-send request5-says I am done

(b)OptimizationDoes not change the semantics

20Layers -3Session LayerEnhanced version if transport layerKeeps track of which party is currently talking and it provides a synchronizationPuts checking points in case of crash going to the last check pointPresentation LayerConcerned with the meaning of the bits Middleware ProtocolsMiddleware: layer that resides between an OS and an applicationMay implement general-purpose protocols that warrant their own layers

OSI Model summaryIn this model, clear distinction between applications, application-specific protocols and general purpose protocols.Application-specific protocolFTPHTTPGeneral-purpose protocolsUseful to many applications but cannot be qualified as transport protocols. These protocols fall into the category of middleware protocols.Middleware Protocols 1Some services are not tied to any specific applications, but instead can be integrated into a middleware system as a general serviceAuthentication protocolsProof of claimed identityAtomicity protocolsWidely applied in transactions Distributed locking protocolsResources can be protected against simultaneous accesses

Middleware Protocols 2Also supports high-level communication servicesRemote Procedure Call (RPC) Message Oriented Middleware (MOM)RTP: Streams for transferring real-time data, such as needed for multimedia applications

Remote Procedure CallsGoal: Make distributed computing look like centralized computingAllow remote services to be called as proceduresTransparency with regard to location, implementation, languageIssuesHow to pass parametersBindingsSemantics in face of errorsProgrammer specific applicationScenario to explain RPC:You know how to write application in a modular wayPartition application into functionsWhy not let programmer write a distributed application using the same abstraction of functions and enable you to distribute that function on multiple machines.That is the essentials of what RPC do

Internally runtime system realize that a call is not to a local procedure. System figures out that the call is made to a remote procedure. Construct the message and sent it to remote server.From the programmer stand point we still call the functions.

Web services are a form of RPCA higher level RPC

26Example of an RPC

No message passing at all is visible to the programmer. Divide programs up and add communication protocolsblah, blah, blah

bar = add(i,j);

blah, blah, blahInt add(int x, int y ) { if (x>100)return(y-2); else if (x>10)return(y-x); else return(x+y);}ClientServerprotocolRPC SemanticsPrinciple of RPC between a client and server program [Birrell&Nelson 1984]

29Other RPC ModelsAsynchronous RPCRequest-reply behavior often not neededServer can reply as soon as request is received and execute procedure laterDeferred-synchronous RPCUse two asynchronous RPCsClient needs a reply but cant wait for it; server sends reply via another asynchronous RPCOne-way RPCClient does not even wait for an ACK from the serverLimitation: reliability not guaranteed (Client does not know if procedure was executed by the serv

View more >