blob: c9c2d66c91462be5e53a1da66e319863001360c6 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Traffic Router &mdash; Traffic Control 1.5 documentation </title>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/theme_overrides.css" type="text/css" />
<link rel="top" title="Traffic Control 1.5 documentation" href="../index.html"/>
<link rel="up" title="Traffic Control Overview" href="index.html"/>
<link rel="next" title="Traffic Monitor" href="traffic_monitor.html"/>
<link rel="prev" title="Traffic Ops" href="traffic_ops.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="/" class="icon icon-home"> Traffic Control
<img src="../_static/tc_logo.png" class="logo" />
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../basics/index.html">CDN Basics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../basics/content_delivery_networks.html">Content Delivery Networks</a></li>
<li class="toctree-l2"><a class="reference internal" href="../basics/http_11.html">HTTP 1.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="../basics/caching_proxies.html">Caching Proxies</a></li>
<li class="toctree-l2"><a class="reference internal" href="../basics/cache_revalidation.html">Cache Control Headers and Revalidation</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Traffic Control Overview</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="traffic_ops.html">Traffic Ops</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Traffic Router</a></li>
<li class="toctree-l2"><a class="reference internal" href="traffic_monitor.html">Traffic Monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="traffic_stats.html">Traffic Stats</a></li>
<li class="toctree-l2"><a class="reference internal" href="traffic_portal.html">Traffic Portal</a></li>
<li class="toctree-l2"><a class="reference internal" href="traffic_server.html">Traffic Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="traffic_vault.html">Traffic Vault</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin/index.html">Administrator&#8217;s Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_ops_install.html">Installing Traffic Ops</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_ops_config.html">Configuring Traffic Ops</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_ops_using.html">Using Traffic Ops</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_ops_extensions.html">Managing Traffic Ops Extensions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_monitor.html">Traffic Monitor Administration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_router.html">Traffic Router Administration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_stats.html">Traffic Stats Administration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_server.html">Traffic Server Administration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/traffic_vault.html">Traffic Vault Administration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/quick_howto/index.html">Quick How To Guides</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Developer&#8217;s Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../development/traffic_ops.html">Traffic Ops</a></li>
<li class="toctree-l2"><a class="reference internal" href="../development/traffic_router.html">Traffic Router</a></li>
<li class="toctree-l2"><a class="reference internal" href="../development/traffic_monitor.html">Traffic Monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="../development/traffic_stats.html">Traffic Stats</a></li>
<li class="toctree-l2"><a class="reference internal" href="../development/traffic_server.html">Traffic Server</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../faq/index.html">FAQ</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../faq/general.html">General</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq/development.html">Development</a></li>
<li class="toctree-l2"><a class="reference internal" href="../faq/administration.html">Running a Traffic Control CDN</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Traffic Control</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Traffic Control 1.5</a> &raquo;</li>
<li><a href="index.html">Traffic Control Overview</a> &raquo;</li>
<li>Traffic Router</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/overview/traffic_router.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="traffic_monitor.html" class="btn btn-neutral float-right" title="Traffic Monitor">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="traffic_ops.html" class="btn btn-neutral" title="Traffic Ops"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<div role="main" class="document">
<span class="target" id="reference-label-tc-tr"></span><div class="section" id="traffic-router">
<span id="index-0"></span><h1>Traffic Router<a class="headerlink" href="#traffic-router" title="Permalink to this headline"></a></h1>
<p>Traffic Router&#8217;s function is to send clients to the most optimal cache. Optimal in this case is based on a number of factors:</p>
<ul class="simple">
<li>Distance between the cache and the client (not necessarily measured in meters, but quite often in layer 3 network hops). Less network distance between the client and cache yields better performance, and lower network load. Traffic Router helps clients connect to the best performing cache for their location at the lowest network cost.</li>
<li>Availability of caches and health / load on the caches. A common issue in Internet and television distribution scenarios is having many clients attempting to retrieve the same content at the same time. Traffic Router helps clients route around overloaded or down caches.</li>
<li>Availability of content on a particular cache. Reusing of content through cache HITs is the most important performance gain a CDN can offer. Traffic Router sends clients to the cache that is most likely to already have the desired content.</li>
</ul>
<p>Traffic routing options are often configured at the Delivery Service level.</p>
<div class="line-block">
<div class="line"><br /></div>
</div>
<div class="section" id="arrow-delivery-service">
<span id="rl-ds"></span><h2><img alt="arrow" src="../_images/fwda1.png" /> Delivery Service<a class="headerlink" href="#arrow-delivery-service" title="Permalink to this headline"></a></h2>
<blockquote>
<div><p>As discussed in the basic concepts section, the EDGE caches are configured as reverse proxies, and the Traffic Control CDN looks from the outside as a very large reverse proxy. Delivery Services are often referred to a reverse proxy remap rule. In most cases, a Delivery Service is a one to one mapping to a FQDN that is used as a hostname to deliver the content. Many options and settings regarding how to optimize the content delivery, which is configurable on a Delivery Service basis. Some examples of these Delivery Service settings are:</p>
<ul class="simple">
<li>Cache in RAM, cache on disk, or do not cache at all.</li>
<li>Use DNS or HTTP Content routing (see below).</li>
<li>Limits on transactions per second and bandwidth.</li>
<li>Protocol (http or https).</li>
<li>Token based authentication settings.</li>
<li>Header rewrite rules.</li>
</ul>
<p>Delivery Services are also for use in allowing multi-tenants to coexist in the Traffic Control CDN without interfering with each other, and to keep information about their content separated.</p>
</div></blockquote>
<div class="line-block">
<div class="line"><br /></div>
</div>
</div>
<div class="section" id="arrow-localization">
<span id="rl-localization"></span><h2><img alt="arrow" src="../_images/fwda1.png" /> Localization<a class="headerlink" href="#arrow-localization" title="Permalink to this headline"></a></h2>
<blockquote>
<div>Traffic Router uses a JSON input file called the <em>coverage zone map</em> to determine what <em>cachegroup</em> is closest to the client. If the client IP address is not in this coverage zone map, it falls back to <em>geo</em>, using the maxmind database to find the client&#8217;s location, and the geo coordinates from Traffic Ops for the cachegroup.</div></blockquote>
<div class="line-block">
<div class="line"><br /></div>
</div>
<p>Traffic Router is inserted into the HTTP retrieval process by making it DNS authoritative for the domain of the CDN delivery service. In the example of the reverse proxy, the client was given the <code class="docutils literal"><span class="pre">http://www-origin-cache.cdn.com/foo/bar/fun.html</span></code> url. In a Traffic Control CDN, URLs start with either <code class="docutils literal"><span class="pre">tr.</span></code> or <code class="docutils literal"><span class="pre">edge.</span></code>, for HTTP or DNS content routing respectively. These names are configurable via properties files within the Traffic Router installation.</p>
<div class="line-block">
<div class="line"><br /></div>
</div>
</div>
<div class="section" id="arrow-dns-content-routing">
<span id="rl-dns-cr"></span><span id="index-1"></span><h2><img alt="arrow" src="../_images/fwda1.png" /> DNS Content Routing<a class="headerlink" href="#arrow-dns-content-routing" title="Permalink to this headline"></a></h2>
<blockquote>
<div>For a DNS delivery service the client receives a URL with a hostname beginning with <code class="docutils literal"><span class="pre">edge.</span></code> (e.g. <a class="reference external" href="http://edge.dsname.cdn.com/foo/bar/fun.html">http://edge.dsname.cdn.com/foo/bar/fun.html</a>). When the LDNS server is resolving this <code class="docutils literal"><span class="pre">edge.dsname.cdn.com</span></code> hostname to an IP address, it ends at Traffic Router because it is the authoritative DNS server for <code class="docutils literal"><span class="pre">cdn.com</span></code> and the domains below it, and subsequently responds with a list of IP addresses from the eligible caches based on the location of the LDNS server. When responding, Traffic Router does not know the actual client IP address or the path that the client is going to request. The decision on what cache IP address (or list of cache IP addresses) to return is solely based on the location of the LDNS server and the health of the caches. The client then connects to port 80 on the cache, and sends the <code class="docutils literal"><span class="pre">Host:</span> <span class="pre">edge.dsname.cdn.com</span></code> header. The configuration of the cache includes the remap rule <code class="docutils literal"><span class="pre">http://edge.dsname.cdn.com</span> <span class="pre">http://origin.dsname.com</span></code> to map that edge name to an origin hostname.</div></blockquote>
<div class="line-block">
<div class="line"><br /></div>
</div>
</div>
<div class="section" id="arrow-http-content-routing">
<span id="rl-http-cr"></span><h2><img alt="arrow" src="../_images/fwda1.png" /> HTTP Content Routing<a class="headerlink" href="#arrow-http-content-routing" title="Permalink to this headline"></a></h2>
<blockquote>
<div><p>For an HTTP delivery service the client receives a URL with a hostname beginning with <code class="docutils literal"><span class="pre">tr.</span></code> (e.g. <a class="reference external" href="http://tr.dsname.cdn.com/foo/bar/fun.html">http://tr.dsname.cdn.com/foo/bar/fun.html</a>), the LDNS server resolves this <code class="docutils literal"><span class="pre">tr.dsname.cdn.com</span></code> to an IP address, but in this case Traffic Router returns its own IP address. The client opens a connection to port 80 on the Traffic Router&#8217;s IP address, and sends:</p>
<div class="highlight-python"><div class="highlight"><pre>GET /foo/bar/fun.html HTTP/1.1
Host: tr.dsname.cdn.com
</pre></div>
</div>
<p>Traffic Router uses an HTTP 302 to redirect the client to the best cache. For example:</p>
<div class="highlight-python"><div class="highlight"><pre>HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location: http://atsec-nyc-02.dsname.cdn.com/foo/bar/fun.html
Content-Length: 0
Date: Tue, 13 Jan 2015 20:01:41 GMT
</pre></div>
</div>
<p>The information Traffic Router can consider when selecting a cache in this case is much better:</p>
<ul class="simple">
<li>The client&#8217;s IP address (the other side of the socket).</li>
<li>The URL path the client is requesting, excluding query string.</li>
<li>All HTTP 1.1 headers.</li>
</ul>
<p>The client follows the redirect and performs a DNS request for the IP address for <code class="docutils literal"><span class="pre">atsec-nyc-02.dsname.cdn.com</span></code>, and normal HTTP steps follow, except the sending of the Host: header when connected to the cache is <code class="docutils literal"><span class="pre">Host:</span> <span class="pre">atsec-nyc-02.dsname.cdn</span></code>, and the configuration of the cache includes the remap rule (e.g.``http://atsec-nyc-02.dsname.cdn <a class="reference external" href="http://origin.dsname">http://origin.dsname</a>.com``).</p>
<p>Traffic Router sends all requests for the same path in a delivery service to the same cache in a cache group using consistent hashing, in this case all caches in a cache group are not carrying the same content, and there is a much larger combined cache in the cache group.</p>
</div></blockquote>
<p>In many cases DNS content routing is the best possible option, especially in cases where the client is receiving small objects from the CDN like images and web pages.</p>
<p>Traffic Router is redundant and horizontally scalable by adding more instances into the DNS hierarchy using NS records.</p>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="traffic_monitor.html" class="btn btn-neutral float-right" title="Traffic Monitor">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="traffic_ops.html" class="btn btn-neutral" title="Traffic Ops"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'1.5',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>