Ds Interaction Styles
Ds Interaction Styles
• Introduction
• Layered protocols and middleware
• Remote Invocation
• (Remote) Procedure calls
• (Remote) Method invocation
• Message Oriented Middleware (MOM)
• Streaming
Interaction styles / communication models
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
5
Communicating entities and paradigms
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Types (qualities) of communication
• Units of information:
• Memory/storage
• discrete: structured units,
• transient: interaction requires
independent and complete
sender and receiver to ‘execute’
at same time • streaming: basic units; no further
communication structure
• persistent: interaction (data)
remains while sender and • Connection
receiver disappear • Connection-oriented
• Synchronization • Connection-less
• asynchronous: sender/caller does • Reliability
not wait or block; • Delivery of message guaranteed
• synchronous: caller blocks till • Time dependence
interaction acceptance
• temporal relationships, typically
− several different synchronization points,
see next slide with streaming
• buffered: limited difference • synchronous: bounded delay
between #calls and #responses • isochronous: bound minimum and
maximum delay (i.e., jitter)
Synchronization and message storage
Middleware
received and/or received
Protocol stack
submitted (OSI or TCP/IP) submitted
possibly buffered
notification of message arrival
arrived arrived
SaP SaS
SaD
stored
Network with storage
Persistent communication (storage location)
Message is submitted
and stored either at
A’s location or by the
middleware
Transient communication
submits
notification
Space and time coupling
in distributed systems
Referentially-
Coupled (TvS)
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Space and time coupling
in distributed systems
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Agenda
• Introduction
• Layered protocols and middleware
• Remote Invocation
• (Remote) Procedure calls
• (Remote) Method invocation
• Message Oriented Middleware
• Streaming
Interaction starting point
• Process • Thread
(“program in execution”) • operates in an address space
• defines a data space – i.e., in a process; several threads
− Virtualization of the memory may share that space
• unit of resource management • has an associated execution
− defines ownership of state
resources – place where it is in the code (PC)
− concurrency transparency – stack image and return addresses
of function calls,
• unit of deployment
– values of processor registers
(distribution)
• unit of concurrency
− together with a software
component – virtualization of the processor
• Interfaces:
• provided to layer above
• required from layer below
Layers, interfaces, and protocols in the OSI model.
• OSI protocols:
• are in fact hardly used
• in particular, session and
presentation layer often
absent, sometimes a
middleware layer takes their
place
• OSI reference:
• widely accepted
Although we may think IP is all there was...
Transport
Layer Security
Headers:
Identify destination endpoint
Characterize payload
Checksum
A typical message as it appears on the network. Note that only link layer messages ever “exist”
Layering and middleware
• Programming interface :
API for this service
• IP/everything tendency
– goal in the layering: connect diverse applicationsN
everything N x M
– UDP, TCP/IP as basic
interoperability N+M divergence
• Two interfaces:
– Application ↔ middleware
– network protocol between devices
• Introduction
• Layered protocols and middleware
• Remote Invocation
• (Remote) Procedure calls
• (Remote) Method invocation
• Message Oriented Middleware
• Streaming
Procedure/method call
from: http://msdn.microsoft.com/en-us/library/dd465153.aspx
The client stub must be aware of, or discover, the location of the server.
Steps in calling an RPC
• Marshalling of data
• Definition of the RPC protocol
• How to deal with parameters
• The development process to include RPCs into a
program
• frameworks
• RPC server infra structure, server discovery, binding
time
• again, a framework
• Semantics under partial failures
• Synchronization (alternatives)
Need for marshalling
In Python (pickle module) these activities are considered the same, in Java
(class implements java.io.Serializable ) not.
Protocol
message Person {
required string user_name = 1;
optional int64 favourite_number = 2;
repeated string interests = 3;
}
Taken from:
https://martin.kleppmann.com/2012/12/05/schema-evolution-in-avro-protocol-buffers-thrift.html
RPC parameter passing
• Reference parameters:
• address space problem
• copy/restore
− just copy for in- and restore for out-parameters
• remote reference mechanism
− …additional RPC(s) for complex data structures?
− …migrate code towards data rather than using RPCs?
− what to do with concurrency?
• DCE Framework
• tooling for supporting RPC-based client & server design
• provided services
− DCE/RPC (remote procedure calls),
− DCE/DFS (distributed filesystem)
− timing service
− directory service (for lookup and discovery)
− authentication service
• Server machines
• run a ‘daemon’
• A directory machine
• runs a directory
service that stores
(service, server)-pairs
• A server process:
• registers itself with the daemon and obtains an endpoint (a ‘port’)
• registers itself together with the identity of the machine on which it
runs with the directory
• A client process:
• finds an appropriate server machine
• finds the server endpoint through the daemon
• calls the RPC
Partial failure of RPC
One-way RPC
caller continues
immediately, even
without waiting
for acceptance
• Introduction
• Layered protocols and middleware
• Remote Invocation
• (Remote) Procedure calls
• (Remote) Method invocation
• Message Oriented Middleware
• Streaming
Plumbing elements: proxy, stub, skeleton
• Proxy:
• a component that acts on behalf of another component, implementing the
same interface
• capable of implementing filtering policies (e.g. which requests to pass on)
and sometimes caching
• typically, ‘proxy’ refers to a client side entity (representing the server); a
‘reverse proxy’ is placed at a server side
• Stub:
• (originally): an empty interface implementation
• (RPC/RMI): client stub: transparently implements an interface for a
remote object; responsible for the messaging (also called: proxy)
server stub (or skeleton): transparently perform the calls of a client stub
and handles the messaging
• Example:
• a HTTP proxy server acts on behalf of a user and filters requests
− i.e., it is a client to an origin server
Plumbing elements: adapter, broker
• Parameters,
• pass local
objects by
value/result
• and remote
objects by
reference
• Introduction
• Layered protocols and middleware
• Remote Invocation
• (Remote) Procedure calls
• (Remote) Method invocation
• Message Oriented Middleware
• Streaming
Message Oriented Middleware
Typical behavior
• each application its own queue
• queues can only be read by
their associated application
• applications communicate by
sending messages to each
other queues
• temporal-decoupling
• 4 communication states
• Diverse applications
• hence, diverse
message formats
• conversion required
− perhaps taking
application know-
ledge into account
− rules for conversion
needed
• JMS
• AMQP
• More service oriented
• RabbitMQ see https://www.rabbitmq.com/getstarted.html
Agenda
• Media streaming
• temporal relationships between data
items play a crucial role
− e.g. audio (mono, stereo), video,
audio + video;
− 20 sec difference in channels
distorts stereo;
− 80 msec difference is acceptable for audio – video (asymmetric, lip-synchronization)
• Synchronous transmission mode: bounded end-to-end delay (= bounded latency)
• Isochronous transmission mode: bounded inter-packet delay (= bounded jitter)
• Buffering
• smooths delay variation
• Priority routing
• reduces latency and jitter
• Flow control (both route and rate)
• Resolution and quantization scaling
• resolution: pixels per frame
• quantization: bits per pixel
• improves throughput
• Quality modes
• multiple streams, e.g., least significant bits in separate stream
• mode decides which streams are sent,
• in general, a combination of QoS-levels per quality aspect