150 likes | 280 Views
MetaSockets Run-Time Support for Adaptive Communication Services. S. M. Sadjadi, P. K. McKinley, E. P. Kasten Software Engineering and Networking Systems Laboratory Department of Computer Science and Engineering Michigan State University www.cse.msu.edu/sens. Motivations.
E N D
MetaSocketsRun-Time Support for Adaptive Communication Services S. M. Sadjadi, P. K. McKinley, E. P. Kasten Software Engineering and Networking Systems Laboratory Department of Computer Science and Engineering Michigan State University www.cse.msu.edu/sens
Motivations • Mobile computing applications must adapt to the dynamic situations related to several cross-cutting concerns including: • Quality of Service • Security • Energy Consumption • Fault Tolerance • Solution? • Adaptive Middleware.
Our Approach • RAPIDware Project: • Addresses the design of adaptive software. • Adaptive Java (AJ): • An extension to Java that provides language constructs and compiler support for developing adaptive software (previously done). • MetaSockets: • An adaptable communication component developed in AJ as the heart of our Adaptive Middleware.
Adaptive Java Background • Adaptable Component Model: • Component: the basic building block that can be equated to adaptable classes (composed of invocations). • Meta-Object Protocol: a set of meta-level primitives (refractions and transmutations).
Adaptive Java Background (cont.) • Three-Dimensional Interfaces: • Invocations: normal component imperative operations. • Refractions: operations for inspecting components. • Transmutations: operations for modifying components. • Component Absorption and Metafication: AJ MetaMulticastSocket Meta-Compnent refraction base-level method replaced invocation base-level invocation transmutation insertFilter() receive() send() send() send() close() getStatus() joinGroup() close() close() leaveGroup() removeFilter() Java MulticastSocket AJ SendMSocket Base-Component
MetaSocket Internal Architecture MetaSendMSocket Internal Architecture: MetaRecvMSocket Internal Architecture: getStatus() getStatus() FP LP get() put() put() get() Fltr Fltr put() get() Filter Pipeline Filter Pipeline LP FP put() get() receive() joinGroup() leaveGroup() close() send() close() MT MT joinGroup() close() close() receive() send() SS RS insertFilter() removeFilter() insertFilter() removeFilter() invocation FP: firstPacketBuffer Fltr: Filter dependency refraction LP: lastPacketBuffer SS: SendMSocket packet flow direction thread transmutation MT: MetaSocketThread RS: RecvMSocket
MetaSocket Absorption Code public component SendMSocket absorbs java.net.MulticastSocket { /* constructor */ public SendMSocket(...) { setBase(new java.net.MulticastSocket(...)); } /* invocations */public invocation void send(...){ base.send(...); }public invocation void close(){ base.close(); } }
MetaSocket Metafication Code public component MetaSendMSocket metafy SendMSocket { /* constructor */ public MetaSendMSocket(SendMSocket sendMSocket) {setBase(sendMSocket); } /* invocation that "replaces" the send() invocation in SendMSocket */ public invocation void send(...) { ... firstPacketBuffer.put(packet); ... } /* refractions */ public refraction byte[] getStatus() { return filterPipeline.getStatus(); } /* transmutations */ public transmutation void insertFilter(int position, Filter filter) { ... filterPipeline.add(position, filter); ... } public transmutation Filter removeFilter(int position) { ... return filterPipeline.remove(position); } /* private fields */ private java.util.Vector filterPipeline = new java.util.Vector(); PacketBuffer firstPacketBuffer = new PacketBuffer(); }
. . . MetaSocket Evaluation • Audio Streaming Application (ASA) • MetaSocket is used instead of MulticastSocket • Live audio stream from a desktop to multiple iPAQs • Physical experiment configuration: Audio Stream Wireless Receivers Access Point Wired Sender
ASA Components Interaction invocation refraction and transmutation LP thread Decision Maker (DM) AL Dependency Event propagation PB Reflection FD Component Loader Event Mediator Trader PB Filter Pipeline NL FP Player MT RS AL: RecvAppLossDetector FD: FECDecoder Wireless Network Wired Network NL: RecvNetLossDetector
ASA Components • Decision Maker: a optional component that controls all the non-functional behavior of the subcomponents in its container component, according to its rule-base. • Component Loader: a unique component in an address space that loads components from a trader, according to a set of policies. • Trader: a server that works as yellow pages and replies to component requests. • Event Mediator: Supports asynchronous interaction among decoupled components using a publisher-subscriber pattern. • Player: plays the incoming audio stream.
Block Erasure Code Operation • Wireless networks produce dynamic and location dependent packet loss because of signal strength, interference, antenna alignment. • 802.11b MAC layer does not provide link-level acknowledgement for multicast frames. • FEC can be used to improving reliability by introducing redundancy into the data channel.
Forward Error Correction Filters • MetaFECEncoder: a component in AJ that absorbs a FECEncoder class. • MetaFECDEcoder: a component in AJ that absorbs a FECDecoder class. getSrcPacketBuffer() getDstPacketBuffer() getNK() getSrcPacketBuffer() getDstPacketBuffer() getNK() FilterMismatchEvent FECMismatchNKEvent FE FD` start() stop() start() stop() setSrcPacketBuffer() setDstPacketBuffer() setNK() setSrcPacketBuffer() setDstPacketBuffer() setNK() (a) MetaFECEncoder (b) MetaFECDecoder dependency refraction invocation FE: FECEncoder FD: FECDecoder event propagation path transmutation thread
MetaSocket Performance Evaluation • FEC Filters inserted automatically at time 8, when loss rate exceeds 30%. • FEC Filters removed automatically at time 45, when loss rate drops below 10%. • Inserted again at time 60. • Removed again at time 80.
Conclusions and Future Directions • Conclusions: • Adaptive Java provides language support for run-time adaptation. • Experiments show that MetaSockets are an effective means to QoS-oriented adaptation. • Future Directions: • A MetaSocket is only one type of adaptable components. Any AJ component can be metafied and adapted at run time. • Other cross-cutting concerns (security, power consumption, and fault-tolerance) can be addressed with AJ components. • Acknowledgements: • This work was supported in part by the U.S. Office of Naval Research under Grant No. N00014-01-1-0744, and in part by National Science Foundation grants CDA-9617310, NCR-9706285, CCR-9912407, EIA-0000433, and EIA-0130724. • Special thanks to Dr. Kurt Stirewalt for his contribution to this work.