<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5222 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5222.xml">
<!ENTITY RFC5031 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5031.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-wei-paws-database-discovery-01" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="Abbreviated Title">PAWS Database Discovery</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Xinpeng Wei" initials="X.W." surname="Wei">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street></street>

          <!-- Reorder these if your country does things differently -->

          <city></city>

          <region></region>

          <code></code>

          <country></country>
        </postal>

        <phone>+86 134 3682 2355</phone>

        <email>weixinpeng@huawei.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Lei Zhu" initials="L.Z" role="" surname="Zhu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street></street>

          <!-- Reorder these if your country does things differently -->

          <city></city>

          <region></region>

          <code></code>

          <country></country>
        </postal>

        <phone>+86 139 1015 7020</phone>

        <email>lei.zhu@huawei.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <date month="April" year="2013" />

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>PAWS</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document provides a Database Discovery mechanism for PAWS. By this mechanism the master device gets the available WSDBs with which it should communicate as well as the regulatory domain information. The mechanism is based on the LoST protocol .</t>
    </abstract>
  </front>

  <middle>
  
  
<section title="Introduction">

	<section anchor="Motivations" title="Motivations">
	<t>In the PAWS protocol, the master device queries the database for available spectrum, but the device MUST determine the URL for the database before it can send any PAWS messages. Brief discussions of database discovery can be found in <xref target = "PAWS RQMTS" /> and <xref target="PAWS PROTOCOL" />.</t>
	<t>Several different choices can be taken for the device to determine the appropriate URL(s) for connection. There are some possible methods for this purpose (not all methods are included here): (1) the manufacturer or the user of device can manually pre-configure statically the URL(s) of one or more databases that is available for the device to query white space spectrum (e.g. the device and database have agreements with each other.), for example, if the device is to be used in US, it will be configured with the database of US, and then it directly connects to the database in US, or if the device is to be used in several countries it can be configured with different database for each country ; (2) or the device can be configured by certain provisioning process after attaching to operator's network. </t>
	<t>But in some scenarios the methods above may not work well. For example, to pre-configure a device, the user has to know the available database(s) that can be used in the regulatory domain, and it may be inconvenient to do so especially when the device is moved to a different regulatory domain. So a dynamic database discovery mechanism is provided here, and the mechanism can be used independently or cooperate with other methods, e.g. device can first connect to the configured or provisioned databases, if that fails then the device can use the dynamic mechanism to find out available databases. </t>
	<t>Besides, it is possible that some databases are not available any more or some new databases are setup, the pre-configuring and provisioning method may not cope with it very well.</t>
	<t>The mechanism discussed in this memo will be provided as an OPTIONAL method as described in <xref target="PAWS PROTOCOL" >PAWS PROTOCOL</xref>.</t>
	</section>

	<section anchor="Mechanism overview" title="Mechanism overview">
	<t>The dynamic database discovery mechanism provided here is used by a device to discover the available white space databases for its current location and related regulatory domain information. </t>
	<t>In the discovery procedure, the URL for the database SHOULD be obtained from an authorized and authenticated entity. The master device provides its current geo-location information to the entity in a Database Discovery Request message, and the entity will return a list of available databases and the regulatory body that has jurisdiction over the master device's location. </t>
	<t>When the master device gets the information about available database and regulatory body, it can choose the proper database for querying white space spectrum by PAWS procedures.</t>
	<t>The database discovery mechanism is based on LoST protocol <xref target="RFC5222" />.</t>
	</section>

	<section anchor="Brief introduction of LoST" title="Brief introduction of LoST">
	<t>LoST (Location-to-Service Translation Protocol) is an XML-based protocol for mapping service identifiers and geodetic or civic location information to service contact URLs. </t> 
	<figure  anchor="fig:1" title="An overview of procedures in LoST protocol">
<artwork><![CDATA[
  +-----------+                          +-----------+                                            
  |LoST Client|                          |LoST Server|                                            
  +------.----+                          +------.----+                                            
         |                                      |                                                 
         |   Request(Location info,service id)  |                                                 
         |------------------------------------->|                                                 
         |                                      |                                                 
         |                    +---------------------------------+          
         |                    |Mapping location and serivice id |           
                              |                                 |           
         |                    |        to service URL(s)        |          
         |                    +---------------------------------+          
         |                                      |                          
         |        Response(Service URL(s))      |                          
         | <----------------------------------- |                          
         |                                      |                          
         |                                      |                          
         |                                      |                          
         |                                      '                                                          
                                 
]]></artwork>

</figure>
	
	<t>The LoST client sends its location information and service type it wants to LoST server to retrieve one or more service URLs.</t>
	<t>The LoST server maintains the mapping relationship between location and service URL, and on receiving request message it maps the location and service identifier in the request to one or more service URLs that can offer the service in the location.</t>
	<t>LoST can operate in either recursive or iterative mode, on a request-by-request basis.  In recursive mode, the LoST server initiates queries on behalf of the requester and returns the result to the requester.</t>
	<t>In iterative mode, the server contacted returns a redirection response indicating the next server to be queried if the server contacted cannot provide an answer itself.</t>
	</section>
</section>
  	
<section anchor="Terminology and Conventions" title="Terminology and Conventions">
  	
 
	<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119">RFC2119</xref>.</t>

	<t>The terminology from PAWS: problem statement, use cases and requirements <xref target="PAWS RQMTS">PAWS RQMTS</xref> is applicable to this document.</t>

<t>White Space Database (WSDB)</t>
<t>In the context of white space and cognitive radio technologies, the database is an entity which contains, but is not limited to, current information as required by the regulatory policies about available spectrum at any given location and time, and other types of related (to the white space spectrum) or relevant information.</t>

<t>White Space Database Discovery Server (WSDB DS)</t>
<t>A server function provided to a white space device, the client. The white space device contacts a white space database discovery server to receive the service of discovering or identifying one or more white space databases. The white space database discovery server is a known entity to the white space device, which knows at least a useable internet address for the white space database discovery server. The white space database discovery server takes as input positioning information from the white space device and returns both URLs of white space databases that cover white space device's current location and indication of the regulatory domain governing at the white space device's current location. A single white space database discovery server may have global scope, serving clients located globally.</t>

<t>Service boundary</t>
<t>A service boundary circumscribes the region within which all locations map to the same service URL or set of URLs for a given service. A service boundary may consist of several non-contiguous geometric shapes.</t>

<t>Mapping</t>
<t>Mapping is a process that takes a location and a service identifier as inputs and returns one or more URLs. Those URLs can point either to a host providing that service or to a host that in turn routes the request to the final destination.</t>
<t>Device</t>
<t>The device in this memo is equivalent to the master device described in <xref target="PAWS RQMTS">PAWS RQMTS</xref>.</t>

</section>


<section anchor="System Architecture Description" title="System Architecture Description">
<t>Before the WSD can query a trusted WSDB for a list of available frequencies or channels for use in the white space spectrum, the WSD must first discover the available databases and addresses serving the regulatory domain in which the device is currently located. At power-up the WSD does not reliably know the regulatory domain corresponding to its current location, and therefore does not reliably know with which white space database(s) it can communicate. Furthermore it is essential that the WSD connect with a trusted WSDB for proper operation and indeed regulatory compliance.</t>

<t>The discovery system is based on client-server model; the basic model is shown in Figure 2, where WSDB DB (WSDB Discovery Server) plays the role of LoST server and Master device acts as LoST client.</t>
<figure anchor="fig:2" align="center" title="DB discovery system model">
<artwork><![CDATA[
+----------+                +----------+
| Master   |   <-------->   | WSDB DS  |
+----------+                +----------+
]]></artwork>
</figure>

<t>The WSDB DS takes as input location information from the WSD and returns to the WSD one or more addresses of WSDBs (or WSDB listing servers as appropriate) to the WSD. </t>
<t>For the discovery mechanism to work well, some assumptions have to be considered:</t>
<t>(1) Master device can get its geo-location directly or indirectly. </t>
<t>(2) Master device has gotten the URL (or IP address) of a trusted WSDB DS before starting the discovery procedure.</t>
<t>The URL or IP address of WSDB DS can be found by any method such as DNS, DHCP, manually configuring etc, and it is out of scope of this document.</t>

<t>When the WSD does not have the address of a serviceable WSDB (e.g. at power-up), the WSD sends a Discovery Request message to a WSDB DS. The WSD includes in the Discovery Request information about its current location. The WSDB DS uses this location information to determine the regulatory domain where the WSD is located, and returns a Discovery Response message which includes the address of one or more WSDBs (or WSDB listing server as appropriate) to the WSD. </t>

<t>An overview of procedures of how master device gets available spectrum from WSDB is depicted in Figure 3.</t>
<figure anchor="fig:3" title="An overview of procedures of how master device gets available spectrum from WSDB">
<artwork><![CDATA[
+-----------+                +-----------+             +----------+
|           |                |   WSDB    |             |          |
|    WSD    |                | Discovery |             |   WSDB   |
|           |                |   Server  |             |          |
+-----------+                +-----------+             +----------+
      |                            |                         |     
      |     Discovery Request      |                         |     
      |(location information, etc) |                         |     
      |--------------------------->|                         |     
      |                            |                         |     
      |     Discovery Response     |                         |     
      | (address information, etc) |                         |     
      |<---------------------------|                         |     
      |                            |                         |     
      |                            |                         |     
      | /--------------------------|-----------------------\ |     
      |/                           |                        \|     
      |\                           |         (PAWS)         /|     
      | \--------------------------|-----------------------/ |     
      |                            |                         |     
      |                            |                         |     

]]></artwork>
</figure>

<t>(1) Discovery Request procedure. This message is used by master device to query available WSDB from WSDB DS; it conveys master's location and some other related information to WSDB DS.</t>
<t>(2) Discovery Response procedure. This procedure conveys the regulatory domain and either the address of a listing server or the address of one or more WSDB authorized to provide service where the WSD is physically located to the master device. If spectrum access is not authorized at the WSD physical location, the response will contain an error code and no address information.</t>
<t>(3) After WSDB discovery procedure, the master device can query available white space spectrum from the WSDB using PAWS protocol.</t>

<t>Figure 4 shows at a high level how white space master devices discover a suitable trusted white space database. In this document we describe how the master device may collect the addresses of one or more white space database. Procedures to contact a white space database are specified in <xref target="PAWS PROTOCOL">PAWS PROTOCOL.</xref></t>
<figure anchor="fig:4" title="High level view of white space database discovery">
<artwork><![CDATA[
          +------+                             +-------+
          |Master|                             |WSDB DS|
          +---+--+                             +---+---+
              |                                    |    
              |    Request(location,service id)    |    
              ------------------------------------>|    
              |                                    |    
              |    Response(a list of URLs of DB)  |   
              |<-----------------------------------|    
              |                                    |    
 +----------------------------------------+        |    
 |Select an available DB that can be used |        |    
 |   by master to query for white space   |        |    
 +----------------------------------------+        |    
              |                                    |    
              |                                    |    
              |                                    |    

]]></artwork>
</figure>
<t>In the response message a list of databases that cover the location are included, when a database is included, it only means the location is in its coverage range but not means the master device can get service from the database, because the database may need the master device has service agreement or some other relationship with it. So master device needs to select an available database from the database list.</t>

<t>After master device has selected a available database for service, it can then use the PAWS protocol <xref target="PAWS PROTOCOL">PAWS PROTOCOL</xref> to retrieve the available spectrum for its location. </t>

</section>




<section anchor="Specification" title="Specification">

<t>LoST (Location to Service Translation Protocol) is a protocol for mapping a service identifier (URN) and location information to one or more service URLs and associated information. LoST mapping queries can contain either civic or geodetic location information. LoST queries can be resolved recursively or iteratively.</t>

<t>LoST messages are carried in HTTP and HTTPS protocol exchanges, facilitating use of TLS for protecting the integrity and confidentiality of requests and responses.</t>

<t>This discovery mechanism utilizes LoST to communicate between master device and WSDB DS, the master device acts as LoST client and WSDB DS plays the role of LoST server. The protocol stack is shown in Figure 5. To use LoST for this discovery mechanism, several issues have to be clarified.</t>
<figure anchor="fig:5" align="center"title="Protocol stack for discovery mechanism">
<artwork><![CDATA[
+------------+
|  LoST      +
+------------+
|  HTTPS     +
+------------+
|   TCP      +
+------------+
|    IP      +
+------------+

]]></artwork>
</figure>


	<section title="Issues to be clarified">
		<section anchor="Service Identifier" title="Service Identifier">
		<t>A new service identifier for PAWS database discovery needs to be defined, according to <xref target="RFC5031">RFC5031</xref>, a top-level service and a sub-service are defined here. </t>
		 <texttable anchor="a" title="">
 

          <ttcol align="center">Service</ttcol>

          <ttcol align="center">Description</ttcol>

          <c>paws</c>

          <c>top-level service of PAWS</c>

          <c>paws.discovery</c>

          <c>the PAWS database discovery service</c>
     </texttable>
     <t>So according to the service-identifying labels defined above, the service URN for PAWS database discovery service is as follow: </t>
			<t>urn:service:paws.discovery</t>

		</section>
		<section title="Conveying of regulatory domain ">
		<t>The name of regulatory domain can be conveyed using <![CDATA[<displayName>]]> element in the LoST response message.</t>
		<t>[Note: the format and content of the regulatory domain information are TBD.]</t>

		</section>
		<section anchor="Database administrator information" title="Database administrator information">
		<t>The WSDB DS can return one or more databases to master device, but because the databases are in the form of URL so it may be difficult to decide which one has service agreement with the master device. Here an extension to LoST is needed: for every <![CDATA[<URL>]]> element that used for conveying URL a new attribute (admin) which contains the database's administrator information needs to be added.</t>

		<t>Based on the newly added attribute master device can choose the database that it has agreement with.</t>

		</section>
	</section>
		
	
	<section title="Discovery procedures">
		<section title="Discovery Request procedure">
		<t>The discovery request procedure uses the <![CDATA[<findService>]]> query message of LoST for conveying parameters.
				Master device's location information will be included in the <![CDATA[<location>]]> element. </t>
		<t>The service identifier defined in <xref target="Service Identifier" /> is specified in the <![CDATA[<service>]]> element.</t>

		<t>The following is an example of discovery request procedure message, using geodetic coordinates.</t>
		<figure><artwork>
		<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
   <findService
     xmlns="urn:ietf:params:xml:ns:lost1"
     xmlns:p2="http://www.opengis.net/gml"
     serviceBoundary="value"
recursive="true">
     <location id="6020688f1ce1896d" profile="geodetic-2d">
       <p2:Point id="point1" srsName="urn:ogc:def:crs:EPSG::4326">
          <p2:pos>37.775 -122.422</p2:pos>
       </p2:Point>
     </location>
     <service>urn:service:paws.discovery</service>
   </findService>

		]]></artwork></figure>
		</section>
		
		
		
		<section title="Discovery Response procedure">
		<t>The discovery response procedure uses the <![CDATA[<findServiceResponse>]]> response message of LoST for conveying parameters.</t>

		<t>After receiving the <![CDATA[<findService>]]> query message, the WSDB DS will map the location information and service identifier to one or more available WSDBs' URL.</t>

		<t>Then in the <![CDATA[<findServiceResponse> ]]>message, a list of WSDBs' URL and regulatory domain that has jurisdiction over the current location will be conveyed to master device. The regulatory domain is contained in <![CDATA[<displayName>]]> element.</t>

		<t>The service boundary of the WSDB can also be included in the response message to indicate the region for which the service URL returned would be the same as in the actual query. Or a service boundary reference can be returned to master device, and master device retrieve service boundary by this reference as needed. Next time when the master device powers up, if its location is within the service boundary it then may use the WSDB retrieved before.</t>

		<t>An example of discovery response procedure message is shown as follow:</t>
		<figure><artwork>
		<![CDATA[
 <?xml version="1.0" encoding="UTF-8"?>
   <findServiceResponse xmlns="urn:ietf:params:xml:ns:lost1"
     xmlns:p2="http://www.opengis.net/gml">
     <mapping
       expires="2013-05-01T01:44:33Z"
       lastUpdated="2012-11-01T01:00:00Z"
       source="authoritative.example"
       sourceId="7e3f40b098c711dbb6060800200c9a66">
       <displayName xml:lang="en">
         Federal Communications Commission
       </displayName>
                 <serviceBoundary profile="geodetic-2d">
            <p2:Polygon srsName="urn:ogc:def::crs:EPSG::4326">
              <p2:exterior>
                <p2:LinearRing>
                  <p2:pos>37.775 -122.4194</p2:pos>
                  <p2:pos>37.555 -122.4194</p2:pos>
                  <p2:pos>37.555 -122.4264</p2:pos>
                  <p2:pos>37.775 -122.4264</p2:pos>
                  <p2:pos>37.775 -122.4194</p2:pos>
                </p2:LinearRing>
              </p2:exterior>
            </p2:Polygon>
          </serviceBoundary>
       <service>urn:service:paws.discovery</service>
      
       <uri admin="admin1">database1.example1.com</uri>
       <uri admin="admin2">database2.example2.com</uri>
     </mapping>
     <path>
       <via source="resolver.example"/>
       <via source="authoritative.example"/>
     </path>
     <locationUsed id="6020688f1ce1896d"/>
   </findServiceResponse>
		]]></artwork></figure>
		</section>
		
		
		<section title="Recursion and Iteration">
		<t>If the WSDB DS can not provide available WSDB for master device, then it may wish other WSDB DS to serve the master device's query request. In LoST, recursion and iteration patterns are provided for this purpose.</t>

		<t>In recursive mode, the LoST server initiates queries on behalf of the requester and returns the result to the requester.</t>

		<t>In iterative mode, the server contacted returns a redirection response indicating the next server to be queried if the server contacted cannot provide an answer itself.</t>

		</section>
		
	</section>

</section> 


<section title="Security Considerations">
<t>TBD.</t>
</section>


<section title="IANA Consideration">
<t>Registration of service URN for PAWS database discovery service. </t>
		 <texttable anchor="b" title="">
 

          <ttcol align="center">Service</ttcol>

          <ttcol align="center">Description</ttcol>

          <c>paws</c>

          <c>top-level service of PAWS</c>

          <c>paws.discovery</c>

          <c>the PAWS database discovery service</c>
     </texttable>
</section>

<section anchor="Acknowledgements" title="Acknowledgements">
   <t>Thanks to my colleagues for their sincerely help and comments when
   drafting this document.</t>
</section>


  </middle>


  <back>
  

    <references title="Normative references">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     &RFC2119; 
     &RFC5222;
     &RFC5031;
      
    </references>

		<references title="Informative References">

      <reference anchor="PAWS RQMTS">

        <front>
          <title>Protocol to Access White Space database: PS, use cases and rqmts</title>
        <author initials='S' surname='Probasco' fullname='Scott Probasco'>
            <organization />
        </author>

        <author initials='B' surname='Patil' fullname='Basavaraj Patil'>
            <organization />
        </author>
				<date month='January' day='2' year='2013' />

        </front>
        <seriesInfo name='Internet-Draft' value='draft-ietf-paws-problem-stmt-usecases-rqmts-12' />
        
      </reference> 
        
      <reference anchor="PAWS PROTOCOL">

        <front>
          <title> Protocol to Access Spectrum Database</title>
        <author initials='V.C.' surname='Chen' fullname='Vicent Chen'>
            <organization />
        </author>

        <author initials='S.D.' surname='Das' fullname='Subir Das'>
            <organization />
        </author>
        <author initials='L.Z.' surname='Zhu' fullname='Lei Zhu'>
            <organization />
        </author>
        <author initials='P.M.' surname='McCann' fullname='Peter McCann'>
            <organization />
        </author>
				<author initials='J.M.' surname='Malyar' fullname='John Malyar'>
            <organization />
        </author>
				<date month='December' day='18' year='2012' />

        </front>
        <seriesInfo name='Internet-Draft' value='draft-ietf-paws-protocol-01' />
        
      </reference>   
         

    </references>


  </back>
</rfc>
