30
Middleware Design • Goals identify the issues for middleware design in wireless and mobile environments An illustrative middleware framework Detailed design for an image transcoding proxy and application session handoff

Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Middleware Design

• Goals identify the issues for middleware design in

wireless and mobile environments An illustrative middleware framework Detailed design for an image transcoding proxy

and application session handoff

Page 2: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Middleware Definition

• RFC2768: Def 1: those services found above the transport

(I.e. over TCP/IP) layer set of services but below the application environment (i.e., below application-level APIs)

Def 2: a reusable, expandable set of services and functions that are commonly needed by many applications to function well in a networked environment.

• Industry usage: Software gateway (“glue”) between two apps

Page 3: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Issues for Middleware Design

• Legacy systems and protocols• Diverse networks (wireline, indoor &

outdoor wireless)• Network dynamics: congestion, link errors,

failures, attacks• Device and platform heterogeneity• User mobility• Thin-client support• Large number of users and devices

Page 4: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Some middleware design goalsfor wireless and mobile devices

• Improve user experience across heterogeneous devices (e.g. PDAs, laptops, desktops) e.g. transcoding (adaptive content delivery)

• Provide new services for heterogeneous devices e.g. application state migration

• Minimal change to the existing infrastructure and applications: may add/change a few more “boxes”

• Adaptation to network dynamics (induced by mobility and wireless links)

• Scalable and secure service• Service availability (in the presence of failures,

attacks and large user population)

Page 5: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Transcoding middleware service

• Client variations along 3 dimensions: Network variation

• bandwidth, latency and error behavior

Hardware variation• screen size/resolution, color/grayscale bit depth, memory, CPU

Software variation• Applications for specific MIME types (PDF, PS, PPT, AVI, etc.)

• Codecs for specific encodings (H263, JPEG, etc.)

• Transcoding goals: Reduce latency experienced by user

• Reduce image’s color depth, resolution to get smaller file

Provide access to new types of content• PDF text, Speech text

Page 6: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Transcoding design issues

• Design issues for adapting to variation: How: Datatype-specific

lossy compression mechanisms: distillation & refinement based on (MIME) type of data

Where: at the content server or at a proxy

When: static or on-demand

Page 7: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Distillation and refinement

• Main idea: high-level semantic types (MIME types) dictate datatype-specific operations Images: can discard color info, high-frequency

components, or pixel resolution Video: additionally include frame rate reduction Formatted text: can discard some formatting information

• Datatype-specific distillation: highly lossy, datatype-specific compression that preserves most of the semantic content of a data object while adhering to a particular set of constraints

• Datatype-specific refinement: fetching some part (possibly all) of a source object at increased quality, possibly the original representation

Page 8: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Choices to handle client variations • Server ignores variations:

low-end clients may suffer

• Server use the most basic types & minimal graphics: high-end client suffers

• Servers provide multiple formats: used today by major websites (ESPN, Amazon, Yahoo) need to categorize clients into discrete classes

• Progressive encodings: typically assume that all parts of the encoded documents

are equally important

• On-demand distillation and refinement: generate on-the-fly based on client characteristics

Page 9: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

An Adaptive-Proxy Based Middleware Design Framework

• Three-tier model: client – proxy – server• A programming model for proxy-based

design: TACC Transformation: distillation, filtering, format

conversion, etc. Aggregation: collect and collate data from

various sources Caching: both original and transformed content Customization: user-customized service (user

profiling, adaptive service to each user’s needs or device characteristics)

Page 10: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Why do we need a proxy ?• Advantages for servers:

Servers concentrate on serving high quality content, rather than having to keep multiple versions

Servers do not pay the costs required to do on-demand distillation

• Advantages for clients: Low-end clients can rely on the proxy to optimize

content from servers designed for high-end clients Client communicates with a single logical entity—proxy,

allowing the client to manage bandwidth at the application level

• Advantages for both: Pushing the complexity away from both clients and

servers by relocating it into the network infrastructure Distillation and refinement can be offered as a value-

added service by a service provider

Page 11: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

A Scalable Cluster-based Infrastructure

• Address three issues: incremental scalability, 24X7 availability, and cost effectiveness

• A cluster based architecture for scalable network services Exploit the strength of cluster computing Cluster-based servers

• BASE data semantics: basically available, soft state, eventual consistency.

Page 12: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Cluster architecture

Front-end

Load-balancer

Workstation

cluster

Webserver

Page 13: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Why do we need clusters?

• Scalability: well-suited for networking service workloads that are highly

parallel Clusters can grow incrementally over time

• High availability: Natural redundancy due to the independence of the nodes Hot upgrade: disable a node and upgrade it in place

• Commodity building blocks: Use low-end, high-volume PCs rather than high-end, low-

volume machines

• Bad thing about clusters: Administration; component and system replication (software

should decompose into loosely coupled modules); partial failures; shared state

Page 14: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

An example: adaptive transcoding proxy

• Web server transcoding proxy web browser• Proxy architecture:

Content analysis Adaptive transcoding policies: when and how much to

transcode Transformation modules: text modification, images

decode & compress

• Key design goal: Improve latency experienced by user at heterogeneous

devices fixed quality or fixed delay

Page 15: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Design

• Two scenarios: Store-and-forward image transcoding Streamed image transcoding

• Two main issues: Whether to transcode How much to transcode

Page 16: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

How to decide whether to transcode?

• Dp = transcoding delay, S = orig size, Sp = transcoded size

• w/o transcoding: 2*RTTpc + 2*RTTsp + S / min(Bpc, Bsp)

• w/transcoding: 2*RTTpc + 2*RTTsp + Dp + S / Bsp + Sp/Bpc

• If Bpc < Bsp, proxy-based transcoding useful when: Dp + S/Bsp < (S-Sp)/Bpc

• How to predict transcoding delay?

BpcBsp

clientproxyserver

Page 17: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Details for store-and-forward image transcoding

• Prediction Transcoded image’s output size in bytes: high correlation

between output size and the image area (number of pixels) linear interpolation

Prediction of transcoding delay: approximated by linear function of the input image area

• Policies: Fixed-quality transcoder: if (transcoding = feasible),

transcode according to user’s parameter vector Fixed-delay transcoder: if(transcoding=feasible), search

space of transcoding parameters to find optimal set that maximizes quality subject to the given response time, transcode using the optimal parameters

Page 18: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Transcoding internal stages

• Determine target parameters In-band or out-of-band data Use HTTP headers Use a client profile and/or network conditions

• Download data and characterize it E.g. get image’s type, resolution, and color depth

• Apply heuristics and policies How to match data’s characteristics to target parameters? Multi-dimensional constraint satisfaction

• Execute the transcoding Typically can use off-the-shelf software

Page 19: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Streamed image transcoding

• Perform transcoding under two stability conditions: No buffer overflow Output transmission link is not saturated

Page 20: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Another middleware service:Application session handoff

• We want continuous access to our data across these machines

• Middleware software will integrate data across devices for immediate access to information anytime,

anywhere

• Move applications across multiple computers

Page 21: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

More application session handoff

• Applications will have session state discrete data multimedia, streaming data

• Application session handoff: application’s state will move automatically and seamlessly across devices

• Data will be transcoded for each device

Page 22: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Broad view of system

Application Server

High Bandwidth Network

Middleware Cluster

Wireless Network

Clients

Page 23: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Application session handoff in action

Legacy Multimedia DBMS

Page 24: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Middleware design issues for ASH

• Client must incorporate application-layer library code to participate with proxy

• Protocol gateway client proxy : custom control protocol +

application-specific protocol Proxy server: HTTP, SMTP, RTP, etc.

• Service discovery

• Data consistency protocols

• Scalability across cluster of proxies

• PKI-based security

Page 25: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Summary

• Middleware provides improved user experience or additional functionality

• Middleware runs within limits of existing legacy system or protocols

• New functionality typically implemented at a proxy

• Clustering provides scalability for proxy services

Page 26: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed
Page 27: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Goals for Middleware Design• Minimal change to the existing infrastructure and

applications: may add/change a few more “boxes”• Adaptation to network dynamics (induced by mobility

and wireless links)• Support for heterogeneous devices (e.g. laptop, desktop,

pocket PC, palm-devices)• Customized service (e.g., adaptive content delivery)• Scalable and secure service• Portability: seamless migration across computing

platforms• User-friendly design• Service availability (in the presence of failures, attacks

and large user population)

Page 28: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

On-demand dynamic distillation

• Issues to address: client variations along 3 dimensions: Network variation: bandwidth, latency and error behavior Hardware variation: screen size and resolution, color or

grayscale bit depth, memory, CPU power Software variation: application-level data encodings, etc.

• Design principles for adapting to variation: Datatype-specific lossy compression mechanisms:

distillation and refinement based on semantic type of the data

On the fly adaptation: compute a desired representation of a typed object on demand

Complexity away from both clients and servers: done at an intermediate proxy

Page 29: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

Sharing semantics• Traditional transactional database model: ACID

(atomicity, consistency, isolation, and durability) strongest semantics at the highest cost and complexity No guarantee for availability Suited for e-commerce transaction, billing users,

maintaining user profile info etc.

• Many users/services prefer availability rather than strong consistency or durability: Stale data can be temporarily tolerated as long as all copies

of data eventually reach consistency after a short time Soft state: can be used to improve performance Approximate answers are preferred if delivered quickly

compared to exact but slow answer

Page 30: Middleware Design Goals o identify the issues for middleware design in wireless and mobile environments o An illustrative middleware framework o Detailed

BASE semantics

• BASE: basically available, soft state, eventual consistency Handle partial failures in clusters with less

complexity and cost Trading consistency for simplicity Trading consistency for availability Use of soft state to allow each watcher process to

detect that its peer is alive (rather than mirroring the peer’s state), be able to restart its peer (rather than take over its peer’s duties)