vADC Docs

Content Optimization across Equatorial Boundaries

by on ‎04-01-2013 12:00 AM (2,187 Views)

We’re really excited to present a preview of our next big development in content aware application delivery.  Riverbed’s Stingray Aptimizer technology prepares your content for optimal delivery over high-latency networks; our soon-to-be announced Latitude-aware Content Optimization will further optimize it for correct rendering in the client device, no matter where the observer is relative to the content origin.

Roadmap disclaimer: This forward looking statement is for information purposes only and is not a commitment, promise or legal obligation to deliver any new products, features or functionality.  Any announcements are conditional on successful in-the-field tests of this technology.

"Here comes the science bit"

polarity changes.png

Individual binary digits have rotational symmetry and can survive transmission across equatorial boundaries intact.  Layer 1 encoding schemes such as Differential Manchester Encoding are similarly immune to polarity changes and protect on-the-wire data against these effects as far as layer 4, ensuring TCP connections operate correctly.  However, layer 7 content suffers from an inversion transformation when generated in one hemisphere and observed in the other.

Our solutions has been tested against a number of websites, including our own (https://splash.riverbed.com - see attachment below) with a good degree of success.  In its current beta state, you can try it against other sites (YMMV).

Getting started

If you haven’t got a Stingray Traffic Manager handy, download and install the Developer Edition.

Proxying a website to test the optimization

The following instructions explain how to proxy splash.riverbed.com.  For a more general overview, check out Getting Started - Load-balancing to a website using Stingray Traffic Manager.

  • Create pool named splash pool, containing the node splash.riverbed.com:443.  Ensure that SSL decryption is turned on.


  • Create a virtual server named splash server, listening on an available port (e.g. 8088), HTTP protocol (no SSL).  Configure the virtual server to use the pool splash pool, and make sure that Connection Management -> Location Header Settings -> location!rewrite is set to ‘Rewrite the hostname…’.

Applying the optimization

Now we’ll apply our content optimization.  This optimization is implemented by way of a response rule:


$ct = http.getResponseHeader( "Content-Type" );


# We only need to embed client-side trafficScript in HTML content


if( !string.startsWith( $ct, "text/html" ) ) break;



# Will this data cross the equatorial boundary?


# Edit this test if necessary for testing purposes


$serverlat = geo.getLatitude( request.getLocalIP() );


$clientlet = geo.getLatitude( request.getRemoteIP() );


if( $serverlat * $clientlat > 0 ) break;



$body = http.getResponseBody();



# Build client-side TrafficScript code


$tsinterpreter="PHNjcmlwdCBzcm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cik7DQogICBpZiggYy5sZW5ndGggKSBjLmVhY2goIGZ1bmN0aW9uKCkgeyB0MSggJCh0aGlzKSApIH0gKTsNCiAgIGVsc2UgZS5hZGRDbGFzcyggImxvb2ZsaXJwYSIgKTsNCn0NCg==";


$sub2="ZnVuY3Rpb24gdDIoIGUgKSB7DQogICAkKCJwLGxpLGgxLGgyLGgzLGg0LGg1LGg2LGltZyx0ZCxkaXY+YSIpLmFkZENsYXNzKCAibG9vZmxpcnBhIiApOw0KICAgJCgiZGl2Om5vdCg6aGFzKGRpdixsaSxoMSxoMixoMyxoNCxoNSxoNixpbWcsdGQsYSkpIikuYWRkQ2xhc3MoICJsb29mbGlycGEiICk7DQp9DQo=";


$cleanup="PC9zY3JpcHQ+";


$exec = string.base64decode( $tsinterpreter ) .


   string.base64decode( $sub0 ) .


   string.base64decode( $sub1 ) .


   string.base64decode( $sub2 ) .


   string.base64decode( $cleanup );



# Invoke client-side code from JavaScript; edit to call $sub0, $sub1 or $sub2


$call = '<script type="text/javascript">


// Call client-side subroutines 0, 1 or 2


$(function() { TrafficScriptCallSub( 0 ) } );


</script>';



$body = string.replace( $body, "<head>", "<head>".$exec.$call );


http.setResponseBody( $body );




Remember this is just in beta, and any future release is conditional on successful deployments in the field.  Enjoy, share and let us know how effectively this works for you.

Comments
by aidan.clarke
on ‎04-01-2013 05:45 PM

Excellent - I just deployed this on my test rig and it works great...

I have been looking for something a little easier to deploy to achieve similar results as the method I used previously here.  This will do *just* the trick...

Thanks to Owen Garrett for all his hard work... I know this one will be a key feature that helps customers take up Stingray Traffic Manger...

by npl
on ‎04-02-2013 08:55 PM

You guys had me at:

Individual binary digits have rotational symmetry and can survive transmission across equatorial boundaries intact.