Infosphere: A Midterm Update on Infopipes Calton Pu Professor and John P. Imlay, Jr. Chair in Software Georgia Institute of Technology 2003 Calton Pu and Georgia Institute of Technology Infosphere Ubiquitous Computing Plenty of computers (Moore’s Law) Are everywhere, all connected, almost free Know Everything 5 IT Expeditions in 1999 (e.g., MIT’s Oxygen) Information is where value is Paying distributed applications (DL, EC) Cheap disks connected by cheap bandwidth Infosphere 2 Problem: too many sources, too much information Internet: Information Jungle Infosphere Infopipes Clean, Reliable, Timely Information, Anywhere Digital Earth Personalized Filtering & Info. Delivery Sensors Infosphere 3 • Freeway Surveillance • 80+ PTZ Cameras • 500+ VDS Cams • Many info sources • Potential direct input • Instrumented cars • Trucks and others Infosphere 4 RT Traffic Optimization Central traffic control scenario Car navigational system registers route Control sends back detailed traffic info/estimate When rerouting: register the new route Peer-to-peer scenarios Taxi/delivery trucks exchange information Opposite direction cars know what’s ahead Infosphere 5 Emergency Response Increasing importance after 9/11, Iraque Proactive planning, handling, response Hurricanes, tornados, presidents, etc Real-time observation and forecasting of exact route for “big events” Get out of harm’s way, get back to help A few minutes can make a big difference Infosphere 6 Infopipes: Backbone of Infosphere Active Control High Bandwidth Long Latency Infopipe Composition Personalized Filtering survivable Quality Annotations Syntax, semantics, QoS ? Property preserving Preserved Information Quality composition of Infopipes Timely delivery of high quality fresh information Infosphere 7 Infopipe Abstraction Syntax, semantics, QoS requirements Component Infopipes Ends: Typespec, property specifications Middle: processing, buffering, active Composition of Infopipes End-to-end QoS property preservation Infosphere 8 Goals for ISL/ISG ISL – Infopipe Specification Language Simple description for Infopipes Support datatypes Support serial composition QoS requirements ISG – Infopipe Stub Generator Generate datatypes, communication stubs Support multiple communication layers Support multiple implementation languages Infosphere 9 Infopipe Internals Information flow driven Middle method by hand ISG generates the rest XML parser Stub Consumer-end Infosphere XML $a $b Infopipe XML Middle method void func (a, b) { … c = a + b; } Stub XML XML generator Producer-end XML $c 10 Infopipe Software Architecture ISL Spec GUI XIP Spec ECho Multi-stage translators Java RMI Sockets CORBA A/V Stream Infosphere 11 Multi-Stage Translation XIP Spec XIP + build Fill Repository Repository Custom Translators <build> commands XIP assembly XIP+ XSLT Translators Templates Apply templates XIP + code (w/jpt) Aspects Execut. Source AXpect weaver XIP + woven code XSLT Translators Write Files C ECho Java Sockets Infosphere C Sockets 12 Demo Scenario Big-picture image stream UAV video UAV video Subsample Color Reduction Window Filter Reduce Rate – 2x UAV video Subsample Color Reduction Team video Reduce Rate – 10x Infosphere Mobile Command Receiver controls signals through remote data reduction Window Filter Reduce Rate – 2x Team video 13 Demo Application – Sensor Streams in Wired and Wireless Environments Multiple Wireless Media Command Post Wired Media Infosphere 14 Ptolemy Design Tool Infosphere 15 UAV: datatype, filter, pipe Infosphere 16 XML description Infosphere 17 Ptolemy => ISL/XIP Infosphere 18 XIP => Gen code Infosphere 19 Multiple Language/API Bindings Infosphere 20 Generating Multiple Languages Infosphere 21 Code Generation & Compilation Infosphere 22 UAV Sender Infosphere 23 UAV Receiver: Adaptation + Control Interface Infosphere 24 Scaling Filter Infosphere 25 Scaling + B/W Infosphere 26 Encryption (Symmetric) Infosphere 27 JPEG (factor of 1/25) Infosphere 28 Infopipe and Software Eng. QoS/QoI support implemented with AOP QoS dimensions: performance, security, etc Performance monitoring, recording, adjusting Feedback-based QoS maintenance Monitoring at each stage of information flow Make adjustments when QoS exception raised Infosphere 29 XIP Benefits Extensible XML intermediate representation Several abstract machines, custom code Datatypes, Filters, Pipes, Serial composition Easy addition of AXpect Good XML software tools XSLT Modularity (xsl:include) Meta programming through templates Leveraging future XML tool development Infosphere 30 An Aspect Pointcut: selects joinpoint in XIP from generated code Joinpoint: Added in aspect, or from generated code <xsl:template match="//filledTemplate[@name=$pipename][@inside=$inside]//jpt:pipe-middle"> struct timeval base; struct timeval end; <jpt:time-process> // take timing here gettimeofday(&amp;base,NULL); <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> gettimeofday(&amp;end,NULL); usec_to_process = (end.tv_sec - base.tv_sec )*1e6+(end.tv_usec - base.tv_usec); Infosphere fprintf(stdout,"Time to process: %ld\n", usec_to_process); </jpt:time-process> 31 </xsl:template> AXpect Weaver Aspect XIP Code Generation WSLA Aspect Weaver Source Code ISG XIP specification has apply-aspect commands Aspects are XSLT, operate on XIP + generated code Aspects can refer to outside XML (e.g. WSLA) for Infosphere additional data Source code: C, C++, Java 32 An AOP Experiment Infopipe: Image stream sender to receiver Receiver has CPU usage limits Aspects build on top of other aspects (e.g. CPU usage computation requires timing info) Rate control aspect governs receiver CPU usage through sender rate adjustment Aspect code accounts for 348 of 1135 NCLOC (31%) Aspects affect 9 of 14 generated files Infosphere 33 Specialization of Infopipes Specialization of Infopipes Tools: Tempo-C and Java partial evaluator Goal: reduce interpretation of data (2nd example later) Producers PBIO/XML parser Infosphere Consumer Stub Middle Method 1 Stub PBIO/XML parser Producer PBIO/XML PBIO/XML generator parser Stub Middle Middle Method 1 Method 2 Consumers Stub Stub Middle Method 2 Stub PBIO/XML generator PBIO/XML generator 34 Infopipe Further Details Connector Stub Port Middle Port Stub Connector • Middle : Pipe’s processing module • Port : Communication endpoint abstraction • Stub : Data marshalling • Connector : Communication runtime, Handles connection info Infosphere 35 Pipe Connectors … Middle Port Stub Connector Connector Stub Port Middle … Each port can be plugged with different types of stubs and connectors Currently we have 3 types Infosphere Socket connector IPC(unix pipe) connector Function connector 36 Replugging (Same Machine) Middle Port Socket Socket Stub Connector IPC IPC Stub Connector Socket Socket Port Connector Stub Middle IPC IPC Connector Stub Infosphere 37 Replugging (Same Process) Pipe 1 … Middle1 Port IPC IPC Stub Connector … Infosphere Pipe 2 Middle1 Port IPC IPC Port Middle2 … Connector Stub Function Middle2 Stub … •Pipe 1, 2 are collapsed into one pipe •Pipe 1 loads Pipe 2’s middle code dynamically 38 Port Code Example Same Interface: pipeSource->outPorts[“out1”]->push(item); Port::push(item) { lock(stub); // for replugging synchronization stub->push(item); unlock(stub); } StubSocket::push(item) { marshal(item, buf); conn->send(buf); } ConnSocket::send(buf) { send(sock, buf); } Infosphere StubIPC::push(item) { marshal(item, buf); conn->send(buf); } ConnIPC::send(arg) { write(pipe_fd, arg); } StubFunction::push(item) { nextPipe->middle ->process(item); } 39 Benchmark Results Send 8 byte data (in the same machine) Socket IPC Function 41.7 us 12.6 us 1.8 us (Manually specialized) Specialization cost Socket->IPC 1127.6 us IPC->Function 1045.7 us Infosphere 40 Project Summary Infopipe: Distributed information flows ISL, GUI, XIP ISG and software engineering tools AOP and AXpect Specialization of Infopipes End-to-end QoS properties Performance, maintainability, scalability Infosphere 41 Fresh Information On the World Infosphere 42