Changes

Jump to: navigation, search

Mobile/Janus

1,323 bytes removed, 15:56, 13 August 2014
(almost) complete rewrite
== Overview ==
'''Janus is a compression and privacy proxy ''' with the goal to provide more secure and efficient mobile browsing.
The [https://wiki.mozilla.org/index.php?title=Mobile/Janus#Goals goals section] gives some details on our objectives and the ways we want to achieve them.
The Janus Proxy is currently using the experimental [http://www.chromium.org/spdy/spdy-whitepaper SPDY protocol] but will use the upcoming new [http://tools.ietf.org/html/draft-ietf-httpbis-http2-13 HTTP/2] standard when it is finalized.
The proxy does compress and re-encode media files using techniques described in the [https://wiki.mozilla.org/index.php?title=Mobile/Janus #Features features section]. === Communication Channels ======= Chat ====You can reach the developers of the proxy on the '''#janus''' channel on the Mozilla IRC network.==== Mailing List ====For asynchronous discussions, use the [https://mail.mozilla.org/listinfo/janus-dev janus-dev] mailing list.==== Bug Reports ====The easiest way to report bugs is using the '''Report Bug''' feature on the Janus add-on. That would report your client settings and the additional information you provide to give us enough context to reproduce the issue.Alternatively, you can directly create a project [https://github.com/mozilla/node-janus/issues GitHub issue] to report the problem you've encountered. Please make sure to find provide explicit ''steps to reproduce'' the issue and also note your client configuration and evaluate ways browser version. === Janus Proxy ===The [https://github.com/mozilla/node-janus Janus Proxy source code] is hosted on GitHub. We are using [https://github.com/mozilla/node-janus/issues GitHub issues] to enable track bugs and features. === Firefox (for Android) ===The Janus Proxy requires secure SPDY (soon HTTP/2) proxy support on the browser, which are supported on Firefox 33 and up. Currently (August 2014), the supported Firefox versions are served on the [https://www.mozilla.org/en-US/firefox/channel/#aurora Aurora] or [http://nightly.mozilla.org Nightly] channels. Required '''features''' that Janus depends on are tracked here* {{bug|378637}} - Add support for connecting to HTTP proxy over HTTPS* {{bug|366559}} - Firefox/Gecko should support LZMA as an HTTP transfer-encoding method* {{bug|1010068}} - Disable OCSP on Firefox for Android Known '''issues''' affecting Janus are tracked here* {{bug|1014589}} - Fennec crashes on page load when connected with SPDY proxy* {{Bug|1047485}} - HTTPS sites slow when SPDY proxy in use* {{Bug|1025582}} - CORS request intermittently fails after refreshing page rapidly === Janus Add-On ===To make the configuration of the proxy easier, we provide the [https://github.com/mozilla/janus-addon Janus add-on] for your Firefox (for Android) browser.The add-on settings give you also more efficient mobile browsingcontrol over the desired behavior of the proxy like compression levels and give you access to some experimental features. === Firefox OS ===We are also working on providing support for the proxy on Firefox OS, the progress is being tracked in {{Bug|1041389}}.
== Goals ==
The main goal of the Janus Proxy is to verify whether we can enhance the provide a better mobile browsing experience by achieving '''enhancing privacy''', '''reducing the following improvements in a practical waydownload sizes''' of web content and therefore '''decrease load times''' on slow connections. Here are our objectives:* Increase user privacy ''by encryption''* Reduce radio timebandwidth requirements ''by data compression''* Reduce page load timeson slow connections ''using efficient transfer protocols'' The potential advantages for users are* Reduce bandwidth requirementsEncryption of traffic on insecure WiFi networks* '''Increase user privacy'''mileage on limited data plans* Increase responsiveness for Faster browsing on slow sitesconnections == Features ==To achieve the [https://wiki.mozilla.org/index.php?title=Mobile/Janus#Goals goals], we discuss the features of the Janus Proxy and their implementation statuses in this section.
Ways we hope to accomplish some of these things:=== Transmission Protocol ===* Recompress images to be smaller without noticeable visual impact* Compress text Routing requests through a SPDY proxy does require less open TCP connections (jsmultiplexing), htmldecreases packet sizes (header compression) streams and reduces the number of packets (gzip, bzip2, lzma?header caching)* Caching* Reduce HTTPS round trips* Move safe browsing support compared to the proxy* Link prefetchingHTTP/1.1. Low bandwidth and high latency connections should benefit from this.
=== Image Compression ===
The current trend on the Web shows an increase in average page size, especially due to high-resolution images. Additional image compression and downsizing should decrease the bandwidth requirements and enable faster page loads.
We want to reduce images sizes with no noticeable quality degradation, or with a dynamic quality setting controlled by the user.
 
=== Text Compression ===
We use '''gzip''' and possibly '''xz'''. ''TODO''
 
=== Caching ===
''TODO''
 
=== Safe Browsing ===
''TODO''
 
=== Other ===
Other crazy stuff we could do:
* Man-in-the-middle HTTPS traffic only for images (so they get recompressed) with user consent
* Add support for adaptive streaming (MPEG-DASH) for servers that don't support it. Transcode to lower bitrates.
** Proxy HLS sites as MPEG-DASH
* Opera Mini-like prePre-rendering of pages
Taras crazy stuff:
** server could spdy-push partial files(eg only css that gets used) + zsync of rest of contents so client can request missing pieces for other pages on the website(this can hugely reduce transfer sizes)...If i remember correctly from https://bugzilla.mozilla.org/show_bug.cgi?id=834865 70%+ of css is leftover cruft...Note this might be easier to do having sites be aware of this and bundling a library that supports having css/js broken up into multiple files & supports waiting on missing pieces
== Implementation Research == We've started out implementing the proxy server using Node. It uses existing SPDY and HTTP2 libraries, and is relatively good at dealing with streamed data. Development occurs in GitHub here: https://github.com/mozilla/node-janus We also have a mailing list where folks can talk about all things related to the project: https://mail.mozilla.org/listinfo/janus-dev == Background ==<!--=== HTTP ===''TODO''-->=== Transport Layer Security (TLS) ======= TLS handshake ====<code> '''Time''' [ms] '''Client''' '''Server''' 30 SYN --> 60 <-- SYN ACK 90 ACK --> 120 <-- Certificate 150 ChangeChiperSpec --> 180 <-- ChangeCipherSpec 210 Data --> 240 <-- Data</code><!--=== SPDY ===''TODO'' === WiFi ===''TODO''-->=== 3G/4G ======= LTE Mobile Network ====<code> '''Latency''' [ms] '''Type''' '''Device''' '''RAN''' '''Core Network''' '''Internet''' '''SGW''' '''MME''' '''PGW''' <100 control plane <--> <5 user plane <--> 30-100 backbone <--> variable routing <--> </code> ==== Control Plane Latency ====<code> '''GPRS EDGE HSPA HSPA+ LTE LTE-Advanced''' '''Latency''' [ms] <1000 <1000 <500 <200 <100 <50</code><!--==== Radio Access Network (RAN) ====''TODO'' ==== Radio Resource Controller (RRC) ====''TODO'' ==== Packet Gateway (PGW) ====''TODO'' ==== Serving Gateway (SGW) ====''TODO'' ==== Mobility Management Entity (MME) ====''TODO''-->
=== Image Compression ===
==== Bandwidth is the decisive factor for page load speed ====
Bandwidth gives the upper bound on transmission speed under optimal conditions. In realistic environments, considering the speed of light and the shortcomings of the transmission protocol, ''latency'' is the limiting factor for the maximum throughput.
 
== Tracking Bugs ==
The Node.js based proxy implementation is maintained on GitHub: [https://github.com/mozilla/node-gonzales node-gonzales]. Please use it to report issues and make pull requests.
 
Required '''features''' that Janus depends on are tracked here
* {{bug|378637}} - Add support for connecting to HTTP proxy over HTTPS
* {{bug|366559}} - Firefox/Gecko should support LZMA as an HTTP transfer-encoding method
* {{bug|1010068}} - Disable OCSP on Firefox for Android
 
Known '''issues''' affecting Janus are tracked here
* {{bug|1014589}} - Fennec crashes on page load when connected with SPDY proxy
 
== System Overview ==
Janus is a secure proxy server that accepts requests via the SPDY protocol and serves compressed content directly from its cache, if available.
 
<code>
Browser <-SPDY-> Janus <-HTTP/HTTPS/SPDY-> Web
| |
Proxy <-> Cache <-?-> Compressor <-> Loader
</code>
 
Routing requests through a SPDY proxy does require less open TCP connections (multiplexing), decreases packet sizes (header compression) and reduces the number of packets (header caching) compared to HTTP/1. Low bandwidth and high latency connections should benefit from this.
 
The current trend on the Web shows an increase in average page size, especially due to high-resolution images. Additional image compression and downsizing should decrease the bandwidth requirements and enable faster page loads. To counteract the introduced processing overhead and boost load times for slow pages, we add intermediate caching for the compressed results.
 
== Experimental Setups ==
To evaluate the system, we test each component in isolation first.
We identify third-party systems suitable for integration into the prototype and evaluate them. All qualified systems will be considered for integration or as the base of our final implementation.
 
=== SPDY Proxy ===
Currently, only Google Chrome supports secure SPDY proxies, but it requires valid certificates, which makes it unsuitable for testing. We bypass the missing support by using '''shrpx''' in client mode as a ''forward proxy'', and that way simulate SPDY support on any client.
 
Dependencies:
* Firefox/Fennec
* Spdylay (http://tatsuhiro-t.github.io/spdylay)
* Squid (http://www.squid-cache.org)
* [alternative] Node SPDY proxy (https://github.com/igrigorik/node-spdyproxy)
 
Here are some experimental setups.
 
==== P1 ====
In this setup, we connect a desktop browser via HTTP with a local forwarding proxy, which establishes a SPDY connection with the remote secure SPDY proxy. The secure SDPY proxy connects to a local web proxy to fetch the documents.
 
<code>
Desktop Client <-SPDY-> SPDY Proxy <-HTTP-> Web Proxy <-HTTP-> Web
| | | | |
Firefox <-HTTP-> [shrpx -k -p] --[shrpx -s]-- ----Squid----
</code>
 
==== P2 ====
This setup is similar to P1, but running on a mobile client. This requires either direct secure SPDY proxy support on the mobile browser, or the usage of a local forwarding proxy running on the mobile device.
<code>
Mobile Client <-SPDY-> SPDY Proxy <-HTTP-> Web Proxy <-HTTP-> Web
| | | | |
Fennec <-HTTP-> [shrpx -k -p] --[shrpx -s]-- ----Squid----
</code>
 
=== Compression ===
''TODO''
 
=== Caching ===
''TODO''
== Performance Analysis ==
Let's collect some ideas here how to profile our prototypesthe prototype.
Could be useful:
Confirm
438
edits

Navigation menu