case study: sun rpc • lightweight rpcs • remote method ... · stream oriented communication •...
TRANSCRIPT
![Page 1: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/1.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Last Class: RPCs and RMI
• Case Study: Sun RPC
• Lightweight RPCs
• Remote Method Invocation (RMI) – Design issues
1
![Page 2: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/2.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Today: Communication Issues
• Message-oriented communication – Persistence and synchronicity – Message queueing systems
• Stream-oriented communication
2
![Page 3: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/3.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Module 1: Persistence and Synchronicity in Communication
• General organization of a communication system in which hosts are connected through a network
2-20
3
![Page 4: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/4.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Persistence
• Persistent communication – Messages are stored until (next) receiver is ready – Examples: email, pony express
4
![Page 5: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/5.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Transient Communication
• Transient communication – Message is stored only so long as sending/receiving
application are executing – Discard message if it can’t be delivered to next server/receiver – Example: transport-level communication services offer
transient communication – Example: Typical network router – discard message if it can’t
be delivered next router or destination
5
![Page 6: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/6.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Synchronicity
• Asynchronous communication – Sender continues immediately after it has submitted the message – Need a local buffer at the sending host
• Synchronous communication – Sender blocks until receives ack from receiving host
• Receipt-based: receiving host acks when message stored in a local buffer
• Delivery-based: receiving host acks when message delivered • Response-based: receiving host asks when message
processed • Six combinations of persistence and synchronicity (why?)
6
![Page 7: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/7.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Persistence and Synchronicity Combinations
a) Persistent asynchronous communication (e.g., email) b) Persistent synchronous communication
2-22.1
7
![Page 8: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/8.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Persistence and Synchronicity Combinations
c) Transient asynchronous communication (e.g., UDP) d) Receipt-based transient synchronous communication
2-22.2
8
![Page 9: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/9.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Persistence and Synchronicity Combinations
e) Delivery-based transient synchronous communication at message delivery (e.g., asynchronous RPC)
f) Response-based transient synchronous communication (RPC)
9
![Page 10: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/10.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Module 2 :Message-oriented Persistent Communication
• Message queuing systems – Support persistent asynchronous communication – Intermediate storage for message while sender/receiver are
inactive – Example application: email
• Communicate by inserting messages in queues • Sender is only guaranteed that message will be
eventually inserted in recipient’s queue – No guarantees on when or if the message will be read – “Loosely coupled communication”
10
![Page 11: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/11.jpg)
Computer Science Lecture 9, page
Message-Queuing Model
11
• 4 combinations of loosely-coupled communications
![Page 12: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/12.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Message-Queuing Model
Primitive Meaning
Put Append a message to a specified queue
Get Block until the specified queue is nonempty, and remove the first message
Poll Check a specified queue for messages, and remove the first. Never block.
Notify Install a handler to be called when a message is put into the specified queue.
12
![Page 13: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/13.jpg)
Computer Science Lecture 9, page
Architecture: Queue Managers and Relays
• Queue manager: interacts with application • Relays use an overlay network
– Only relays (not endpoints) need to know about the network topology and how to route (using partial information if needed)
13
![Page 14: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/14.jpg)
Computer Science Lecture 9, page
Message Brokers
• Message broker: integrating diverse applications – Convert incoming messages so that they can be understood by
destination (format conversion) – Also used for pub-sub systems
14
![Page 15: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/15.jpg)
Computer Science Lecture 9, page
IBM’s WebSphere MQ
• Queue managers manage queues – Connected through message channels
• Message channel agent (MCA) – Checks queue, wraps into TCP packet, send to its associated receiving MCA
15
![Page 16: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/16.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Module 3:Stream Oriented Communication
• Message-oriented communication: request-response – When communication occurs and speed do not affect correctness
• Timing is crucial in certain forms of communication – Examples: audio and video (“continuous media”) – 30 frames/s video => receive and display a frame every 33ms
• Characteristics – Isochronous communication
• Data transfers have a maximum bound on end-end delay and jitter
– Push mode: no explicit requests for individual data units beyond the first “play” request
16
![Page 17: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/17.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Examples
Single sender and receiver
One sender Multiple receivers
17
![Page 18: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/18.jpg)
Computer Science Lecture 9, page
Streams and Quality of Service• Time-dependent requirements are specified as
quality of service (QoS) – Requirements/desired guarantees from the underlying systems – Application specifies workload and requests a certain service
quality – Contract between the application and the system
• Typical properties for Quality of Service – The required bit rate at which data should be transported. – The maximum delay until a session has been set up – The maximum end-to-end delay . – The maximum delay variance, or jitter. – The maximum round-trip delay.
18
![Page 19: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/19.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Specifying QoS: Token bucket
• The principle of a token bucket algorithm – Parameters (rate r, burst b) – Rate is the average rate, burst is the maximum number of packets
that can arrive simultaneously19
![Page 20: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/20.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Enforcing QoS
• Enforce at end-points (e.g., token bucket) – No network support needed
• Mark packets and use router support – Differentiated services: expedited & assured forwarding
• Use buffers at receiver to mask jitter • Packet losses
– Handle using forward error correction – Use interleaving to reduce impact
20
![Page 21: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/21.jpg)
Computer Science Lecture 9, page
Receiver Buffers to Remove Jitter
21
![Page 22: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/22.jpg)
Computer Science Lecture 9, page
Interleaving + FEC for Loss/Errors
• Can also use forward error correction (FEC)
22
![Page 23: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/23.jpg)
Computer Science Lecture 9, page
HTTP Streaming• UDP is inherently better suited for streaming
– Adaptive streaming, specialized streaming protocols • Yet, almost all streaming occurs over HTTP (and TCP)
– Universal availability of HTTP, no special protocol needed • Direct Adaptive Streaming over HTTP (DASH)
– Intelligence is placed at the client
23
Time
128 kbps
256 kbps
512 kbps
Client
http http http http
![Page 24: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/24.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Stream synchronization
• Multiple streams: – Audio and video; layered video
• Need to sync prior to playback – Timestamp each stream and sync up data units prior to
playback • Sender or receiver? • App does low-level sync
– 30 fps: image every 33ms, lip-sync with audio • Use middleware and specify playback rates
24
![Page 25: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/25.jpg)
Computer Science Lecture 9, page
Synchronization Mechanism
25
![Page 26: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/26.jpg)
Computer Science Lecture 9, page CS677: Distributed OS
Multicasting
• Group communication – IP multicast versus application-level multicast – Construct an overlay multicast tree rooted at the sender – Send packet down each link in the tree
• Issues: tree construction, dynamic joins and leaves
26
![Page 27: Case Study: Sun RPC • Lightweight RPCs • Remote Method ... · Stream Oriented Communication • Message-oriented communication: request-response – When communication occurs](https://reader030.vdocument.in/reader030/viewer/2022040600/5e8e6688fecd1578d7621849/html5/thumbnails/27.jpg)
Computer Science Lecture 9, page
Overlay Construction
27