Cisco Internet Streamer CDS 2.5 Software Configuration Guide
Creating CDN Selector Files
Downloads: This chapterpdf (PDF - 119.0KB) The complete bookPDF (PDF - 4.65MB) | Feedback

Creating CDN Selector Files

Table Of Contents

Creating CDN Selector Files

Introduction

Creating the CDN Selector XML Configuration File

CDN Selector XML Schema

CDN Selector XML Example


Creating CDN Selector Files


This appendix describes the CDN Selector feature. This appendix consists of the following topics:

Introduction

Creating the CDN Selector XML Configuration File

CDN Selector XML Schema

CDN Selector XML Example


Note CDN Selector is an early field trial (EFT) feature for Release 2.5.7 and later releases. The CDN Selector only supports redirects to the IS CDS for Release 2.5.7 and later releases EFT.


Introduction

The CDN Selector provides a method of performing third-party streaming service selection. The third-party streaming service is selected based on the content type of the client request, the geographic location of the client request, or both.

When CDN Selector is enabled, the Service Router uses the information in the CDN Selector file to determine which third-party streaming service is selected for servicing the client's request. To enable the CDN Selector, see the "Activating a Service Router" section.

The CDN Selector file can be imported or uploaded using the CDN Selector File Registration page. For more information see the "CDN Selector File Registration" section.

Multiple CDN Selector files can be imported or uploaded, but only one is selected as the active CDN Selector file. The CDN Selector file is selected on the SR's Device Activation page. For more information see the "Activating a Service Router" section.

A CDN Selector file is an XML file containing the URL, including directory path, of each third-party streaming service, and the content types and geographic locations criteria for redirecting client requests. If the geographic location is used as the selection criteria, the CDN Selector uses the Geo-Location server to map the client's IP address to the client's country.


Note The geographic location match feature requires at least one Geo-Location server.


When content is requested by a client, the CDN Selector checks the client's IP address and type of content requested with the selection policies defined in the CDN Selector file. If a geographic location is specified, the CDN Selector gets the client's country from the Geo-Location server and finds the selection policy that satisfies that geographic location. For more information on configuring the CDS to communicate with the Geo-Location servers, see the "Configuring Request Routing Settings" section.

The Service Router then sends a 302 redirect to the client with the translated URL for the selected third-party streaming service. Or, if static URL mapping is used, the Service Router sends a 302 redirect to the client with the specified URL. If the Internet Streamer CDS is chosen, the request is handed over to the Request Routing Engine for further processing. If the client request does not meet any of the selection polices criteria and a default CDN is specified in the CDN Selector file, then the client request is redirected to the default CDN.

The CDN Selector file can contain several selection policies for different CDNs. If the client request satisfies more than one policy, the first policy in the CDN Selector file that is satisfied is chosen.

Content Type

Requests for different content type can be routed to different CDNs. Currently, content type is based on the file extensions.

Geographic Location

Requests from different countries can be routed to different CDNs.


Note The country, state, and city names must match what is used by the Geo-Location server. The names are case sensitive.


Creating the CDN Selector XML Configuration File

The CDN Selector file can be created using any ASCII text-editing tool. Table E-1 defines the CDN Selector file elements.

Table E-1 CDN Selector File Elements 

Tag
Element
Description

CDNList

name

Name of the CDN.

translatorUrl

Directory path with the new URL for the third-party service. In Release 2.5.7 and later releases, this is a static URL that maps to another IS CDS. Any request that satisfies the selection policy is redirected to this URL.

CDNGroup

grpName

Name of the CDN group.

CDNName

Name of the CDN that is a member of this CDN group.

SelectionPolicyGroup

A group of selection policies. All policies within the selection policy group must be satisfied for the request to be redirected to the associated CDN.

SelectionPolicyGroup

SelectionPolicy

The selection policy specifies content types and geographic locations, such that if there is a match, the CDNs listed are chosen and the corresponding URL translation is used.

SelectionPolicy

ContentType

Contains the content file extensions that are part of this selection policy.

GeoLoc

Contains the countries that are part of this selection policy.

Note The country must match what is used by the Geo-Location server. The names are case sensitive.

ContentType

Extension

Specifies the content file extension that the client request must match.

GeoLoc

Country

Specifies the name of the country that the client request must originate from.

Order

 

This tag is not supported in the Release 2.5.7 and later releases. If required, you can specify the order in which the CDN groups are selected. This is to enforce an order if there are any overlapping selection policies.

Default

 

Specify the default CDN you want the client requests to be routed to if none of the selection policies are satisfied.



Note The country names must match what is used by the Geo-Location servers. The names are case sensitive.


CDN Selector XML Schema

The XML Schema file describes and dictates the content of the XML file. The CDNSelector.xsd file contains the XML schema.

<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio Developer Edition (Trial) 8.0.1.1926 
(http://www.liquid-technologies.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:documentation> Revision: 1.0 </xs:documentation>
  </xs:annotation>
  <xs:annotation>
    <xs:documentation> Schema used to validate Cisco CDN Selection file </xs:documentation>
  </xs:annotation>
  <xs:simpleType name="ExtensionType">
    <xs:restriction base="xs:string">
      <xs:maxLength value="10" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CityType">
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="64" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="StateType">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="City" type="CityType" />
    </xs:sequence>
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="64" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="CountryType">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="State" type="StateType" />
    </xs:sequence>
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="64" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:simpleType name="OrderType">
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Za-z0-9]{1,64}(, [A-Za-z0-9]{1,64})*" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GeoLocType">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" name="Country" type="CountryType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ContentType">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" name="Extension" type="ExtensionType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SelectionPolicyType">
    <xs:choice>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="ContentType" type="ContentType" />
        <xs:element minOccurs="0" maxOccurs="unbounded" name="GeoLoc" type="GeoLocType" />
      </xs:sequence>
      <xs:element maxOccurs="unbounded" name="GeoLoc" type="GeoLocType" />
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="SelectionPolicyGroupType">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" name="SelectionPolicy" type="SelectionPolicyType" />
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="CDNType">
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Za-z0-9]{1,64}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CDNNodeType">
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="64" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="translatorUrl" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="1024" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="CDNGroupType">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="CDNName" type="CDNType" />
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="SelectionPolicyGroup" 
type="SelectionPolicyGroupType" />
        <xs:element minOccurs="0" name="SelectionPolicy" type="SelectionPolicyType" />
      </xs:sequence>
    </xs:sequence>
    <xs:attribute name="grpName" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="64" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="CDNListType">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" name="CDN" type="CDNNodeType" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="CDNSelector">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" name="Revision" type="xs:string" />
        <xs:element name="CDNList" type="CDNListType" />
        <xs:element maxOccurs="unbounded" name="CDNGroup" type="CDNGroupType" />
        <xs:element minOccurs="0" name="Order" type="OrderType" />
        <xs:element name="Default">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:maxLength value="64" />
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
 
   

CDN Selector XML Example

Following is an example of the CDN Selector XML file. This example provides illustrations of the various elements of the CDN Selector XML file.

<?xml version="1.0" encoding="UTF-8"?>
<!-- CDNSelector Configuration file -->
<CDNSelector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="CDNSelector.xsd">
    <Revision>1.0</Revision>
 
   
<!--CDNList provides the list of CDNs along with the mapping to the HTTP URLs to be queried for 3rd-party URL 
translation -->
    <CDNList>
        <CDN name="cdsis" translatorUrl="cdn1-nwk.com/1234/video" />
        <CDN name="cdsis2" translatorUrl="cdn2-nwk.com" /> 
    </CDNList>
 
   
<!--CDNGroup is a set of CDNs that get chosen depending on the SelectionPolicy configured for each CDNGroup 
-->
    <CDNGroup grpName="CDNGroup1">
    <!-- The set of CDNs in the CDN Group -->
      <CDNName>cdsis</CDNName>
      <SelectionPolicyGroup>
      <!-- The selection policy for the CDNs listed above -->                
          <SelectionPolicy>
          <!--In this Selection Policy if ContentType OR GeoLoc condition is satisfied, cdsis is chosen-->
            <ContentType>
            <!-- The requested file should be HTML -->
                <Extension> html</Extension>
                </ContentType>
                <GeoLoc>
                <!-- The client request should be from China -->
                    <Country name="China" />
                </GeoLoc>
          </SelectionPolicy>
      </SelectionPolicyGroup>
    </CDNGroup>
 
   
    <CDNGroup grpName="CDNGroup2">
      <CDNName>cdsis2</CDNName>
      <SelectionPolicyGroup>
      <!-- All Selection Policy elements must be satisfied for the CDNs listed to be chosen -->
      <!--In this case, request must be from us or Australia AND request must be for jpeg or wmv files.-->
          <SelectionPolicy>
              <GeoLoc>
              <!-- Client request must be from Australia OR United States-->
                    <Country name="Australia"></Country>
                    <Country name="us"></Country>
              </GeoLoc>
          </SelectionPolicy>
          <SelectionPolicy>
              <ContentType>
              <!-- The request must be for jpeg OR wmv files -->
                    <Extension> jpeg </Extension>
                    <Extension> wmv </Extension>
              </ContentType>
          </SelectionPolicy>
      </SelectionPolicyGroup>
    </CDNGroup>
 
   
    <!-- Order is not supported in 2.5.7 or 2.5.9 -->
    <!-- If required, specify the order in which the CDN Groups are processed. Used if there are overlapping 
selection policies -->
    <Order>CDNGroup1, CDNGroup2</Order>
 
    <!-- Specifies the default CDN request are routed to if none of the selection policies are satisfied-->
    <Default>cdsis</Default>
</CDNSelector>