Understanding Networked Applications: A First Course Chapter 12 by David G. Messerschmitt Understanding Networked Applications: A First Course Communication services by David G. Messerschmitt Example communication services • Messages • Queuing and multiplexing • Message with reply – Remote method invocation • Conversation • Broadcast Understanding Networked Applications 3 A First Course Some objectives • Allow modules to interact in the same way across different hosts as on a single host • Make it easier to develop applications by capturing common generic needs • Support a range of applications with distinct needs Understanding Networked Applications 4 A First Course Message • The smallest unit of information meaningful to the sender and recipient – Recipient must be ready and listening • Directs or informs the recipient – Pure push model • Employs a send-receive protocol Understanding Networked Applications 5 A First Course Supporting deferred applications • Queuing – Queuing allows a message to be sent even though the recipient is not waiting – The message sits in a queue somewhere in the infrastructure until it is actively retrieved by the recipient – Combines send-receive and request-reply protocols Understanding Networked Applications 6 A First Course Participants in message with queuing Sender Recipient Send/ receive Queue Sender can send message whenever it wants Request/ response Recipient can access message whenever it wants Infrastructure Understanding Networked Applications 7 A First Course Multiplexing • Multiplexing – Allows recipient to receive messages from two or more senders – How are the senders identified? – Presumes queuing: what if two messages are sent simultaneously? – Supported by Message Oriented Middleware (MOM) Understanding Networked Applications 8 A First Course Multiplexing and queuing Sender1 Recipient Sender2 Mux & queue Recipient deals with one message at a time even if coming from many senders Infrastructure Understanding Networked Applications 9 A First Course Example application: workflow Receiving Administrative Purchasing assistants Workers Understanding Networked Applications 10 A First Course What message is not • Delivery may not be guaranteed • No shared context of messages from same sender to recipient – Application is free to create that context on its own – Messages may not be delivered in the same order as sent Understanding Networked Applications 11 A First Course Message with reply • Service couples two messages: – Request and coupled response message – Sender freed of burden of associating response • Requests information or a service – Pure pull model • Immediate – Recipient presumes sender is waiting for reply and responds as quickly as possible Understanding Networked Applications 12 A First Course RMI method: parameters return_values Method invocation An action object-oriented programming is called a method method: parameters return_values Remote method invocation (RMI) Understanding Networked Applications 13 A First Course Sender is blocked waiting for response method: parameters -> return_values Client object Server object method,parameters Blocked: can’t do anything else Computes method() returns Time = Blocked waiting for response Understanding Networked Applications = Working on request 14 A First Course Comparison Sender Recipient Sender Send/receive Queue Recipient Send/receive Message waiting Request/ response Request/ response = Work on message or request = Blocked waiting for response Understanding Networked Applications 15 A First Course Conversation • Two-way exchange of messages • Messages in one direction are influenced by messages in the other • To maintain conversation – Messages should be delivered reliably – Messages should be delivered in the same order as sent – No coupling of replies with messages Understanding Networked Applications 16 A First Course Session protocol A session typically provides guaranteed ordered delivery to maintain proper context Establish Conversation Disestablish Understanding Networked Applications 17 A First Course Some advantages of sessions • Aids application by managing a shared context for a conversation – Identification, ordering, reliable delivery • Reduces overhead – Example: only one name server query • Security (Chapter 8) • Quality of service (Chapter 11) Understanding Networked Applications 18 A First Course Examples • What are examples of applications that would naturally leverage: – – – – Messages? Queuing and multiplexing? Message with reply? Conversation? Understanding Networked Applications 19 A First Course Multimedia record-storeplayback Audio coder Audio decoder Record Storage Playback One (big) Storage message Video coder Understanding Networked Applications Video decoder 20 A First Course Streaming multimedia Audio coder Audio decoder Video coder Video decoder Understanding Networked Applications 21 A First Course A session supports streaming multimedia Accumulate audio in message Send message Time Receive message Playback audio in message Delay Understanding Networked Applications 22 A First Course Delay and latency Message latency = time from sending of message until it is received in its entirety Time Delay = time elapsing between an event (or series of events) and its (their) representation Understanding Networked Applications 23 A First Course Relationship of delay and latency Latency Time Delay Delay = latency (of network) + message accumulation time If delay is important, keep the messages short! Understanding Networked Applications 24 A First Course