<?xml version="1.0" encoding="US-ASCII"?>
<!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 RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC5234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml">
<!ENTITY RFC6920 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6920.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
<!ENTITY I-D.ni-params SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.hallambaker-decade-ni-params.xml">
<!ENTITY I-D.netinf-proto SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.kutscher-icnrg-netinf-proto.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 comments="yes"?>
<?rfc inline="yes"?>
<rfc category="exp" docName="draft-ahlgren-icnrg-netinf-cache-control-00" ipr="trust200902"
     submissionType="independent">
  <!-- 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="NetInf Routing">NetInf Protocol Extensions for Cache Control</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Bengt Ahlgren" initials="B." surname="Ahlgren"
	    role="editor">
      <organization>SICS</organization>

      <address>
        <postal>
          <street>Isafjordsgatan 22</street>

          <!-- Reorder these if your country does things differently -->

          <city>Kista</city>

          <region></region>

          <code>SE-16429</code>

          <country>Sweden</country>
        </postal>

        <phone></phone>

        <email>bengta@sics.se</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="B&ouml;rje Ohlman" initials="B." surname="Ohlman">
      <organization>Ericsson</organization>

      <address>
        <postal>
          <street>F&auml;r&ouml;gatan 6</street>

          <!-- Reorder these if your country does things differently -->

          <city>Kista</city>

          <region></region>

          <code>SE-16429</code>

          <country>Sweden</country>
        </postal>

        <phone></phone>

        <email>borje.ohlman@ericsson.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>


    <date year="2014" />

    <!-- 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>IETF</area>

    <workgroup>Network Working Group</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>Network of Information</keyword>

    <keyword>Information centric networking</keyword>

    <keyword>NetInf</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 defines NetInf protocol extensions for
	controlling caching behaviour.  This includes bypassing
	caches, asking to not return data, setting expiration time for
	objects, and marking objects as non-cacheable.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><cref source="editor">Text in double square brackets (like this) is
      commentary.</cref></t>

      <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 RFC 2119. <xref target="RFC2119" /></t>

      <t>Syntax definitions in this memo are specified according to
      ABNF <xref target="RFC5234" />.</t>

      <t>This document describes extensions to the NetInf protocol
      <xref target="I-D.kutscher-icnrg-netinf-proto" /> for
      controlling the object caching behaviour from client requests
      (NetInf GET) and by publishers (NetInf PUBLISH).</t>

      <t>The extensions have several uses.  For example, they enable a
      publisher to provide dynamic data that is recomputed at certain
      intervals.  To be useful, the object name must be able to handle
      dynamic data.  The extensions also enable the implementation of
      a NetInf counterpart to the IP program "ping".</t>

      <t><cref source="editor">Ideally, the extensions in this
      specification should be defined independently of NetInf
      convergence layer (CL), but that currently seems
      impossible.</cref></t>

    </section>

    <section title="Fromorigin extension for NetInf GET">

      <t>"Fromorigin" is an extension parameter for the NetInf protocol
      message GET.  The latter is defined in Section 5.1 of the NetInf
      protocol specification <xref
      target="I-D.kutscher-icnrg-netinf-proto" />.  The purpose of the
      parameter is to enable a client to ask for an NDO to be served from
      an origin server, and thus that the NDO is not served from a
      NetInf cache.  The concept of an "origin server" for an NDO
      needs to be defined more precisely, but the intention is that
      this is a server that has received and accepted a NetInf PUBLISH
      message for the NDO with a so called "full put", that is,
      including the actual NDO content data, or that it is a server
      that makes the NDO available, for instance by PUBLISH:ing the
      existence of the NDO to a NetInf name resolution server.</t>

      <section title="Syntax">

        <t>The "fromorigin" parameter MUST be encoded in a json
        key-value field named "fromorigin" in the "ext" parameter of
        the GET message.  Its data type MUST be boolean with the
        following interpretation of the values:
	<list style='hanging'>
          <t hangText="true">The client issuing the GET is requesting
          that the named NDO be served from an origin server (and thus
          not from a cache).</t>
	  <t hangText="false">The client issuing the GET is not
	  requesting any special processing.  The NDO can be served
	  from a cache or origin server.  This is the normal, default,
	  case when the parameter is not present in the GET
	  message.</t>
	</list></t>

	<t>An example is shown in <xref target="fig:fromorigin-flag"
	/>.</t>

	<figure anchor="fig:fromorigin-flag"
		title="Example fromorigin parameter">
          <artwork><![CDATA[
    ext = { "fromorigin": true }
]]></artwork>
	</figure>
      </section>

      <section title="Processing">

	<t>A NetInf node that receives a GET message with the
	"fromorigin" parameter set to true, SHOULD modify its
	processing of the request as follows.</t>

	<t>If the NetInf node has a copy of the NDO named in the GET
	message, but it is not an origin server for the NDO, it SHOULD
	ignore that copy and proceed with any other processing of the
	GET request, including forwarding to another node.</t>

	<t>This extension opens up a possibility for a DDOS attack
	which the publisher of the data has no control over.  See
	further discussion in <xref target="sec:security" />.</t>

      </section>
    </section>

    <section title="Nodata extension for NetInf GET">

      <t>"Nodata" is an extension parameter for the NetInf protocol
      message GET.  The latter is defined in Section 5.1 of the NetInf
      protocol specification <xref
      target="I-D.kutscher-icnrg-netinf-proto" />.  The purpose of the
      parameter is to enable a client to check whether an NDO is
      available without receiving a copy of the NDO.</t>

      <section title="Syntax">

        <t>The "nodata" parameter MUST be encoded in a json key-value
        field named "nodata" in the "ext" parameter of the GET
        message.  Its data type MUST be boolean with the following
        interpretation of the values:
	<list style='hanging'>
          <t hangText="true">The client issuing the GET is requesting
          that the NDO data is not sent back in response, but rather
          just a status response indicating whether the NDO
          exists.</t>
	  <t hangText="false">The client issuing the GET is not
	  requesting any special processing.  This is the normal,
	  default, case when the parameter is not present in the GET
	  message.</t>
	</list></t>

	<t>An example is shown in <xref target="fig:nodata-flag"
	/>.</t>

	<figure anchor="fig:nodata-flag"
		title="Example nodata parameter">
          <artwork><![CDATA[
    ext = { "nodata": true }
]]></artwork>
	</figure>
      </section>

      <section title="Processing">

	<t>A NetInf node that receives a GET message with the "nodata"
	parameter set to true, MUST modify its processing of the
	request as follows.</t>

	<t>If the NetInf node has a copy of the NDO named in the GET
	message, it MUST NOT include the NDO data in the GET-RESP
	message, but rather only include URI locators as specified in
	Section 5.1 of <xref target="I-D.kutscher-icnrg-netinf-proto"
	/>.</t>

      </section>


    </section>

    <section title="Expires NDO metadata">

      <t>"Expires" is an NDO metadata field that can be specified by
      the publisher of an NDO.  "Expires" contains the time delta from
      current, publishing, time to when the publisher regards the NDO
      as expired, and thus wants any cached copies of the NDO to be
      regarded as invalid.  The metadata is stored together with the
      actual NDO data as discussed in Section 5.2 of <xref
      target="I-D.kutscher-icnrg-netinf-proto" />.</t>

      <t>The "expires" NDO metadata is specified by publishers in the
      PUBLISH message as part of the "meta" field in the json-encoded
      "ext" parameter.  When the NDO is returned in a GET-RESP
      message, the "expires" metadata is supplied as part of the
      affiliated data to the NDO in the application/json MIME
      part.</t>

      <t>There are multiple issues with this kind of parameter.  A
      time delta, as currently specified, depends on that nodes can
      decrement the value with reasonable accuracy.  An alternative or
      complement would be to add a parameter with absolute expiration
      time.  That solution depends on reasonable accurate timekeeping.
      Another alternative is to add the publishing time.  The exact
      solution is for further study and experimentation.</t>

      <section title="Syntax">

	<t>The "expires" NDO metadata MUST be specified as an json
	key-value field with the name "expires".  Its data type MUST
	be of type integer.  It specifies the time delta as number of
	seconds.</t>

	<t><cref source="editor">Perhaps use RFC3339 format instead?
	Durations in its Appendix A from ISO8601?</cref></t>

	<t>In the NetInf PUBLISH message, the "expires" key-value
	field is contained in a "meta" key-value field in the "ext"
	parameter as specified in Section 6.1 of <xref
	target="I-D.kutscher-icnrg-netinf-proto" />.  An example is
	shown in <xref target="fig:expires-publish" />.</t>

	<figure anchor="fig:expires-publish"
		title="Example expires metadata in PUBLISH message">
          <artwork><![CDATA[
    ext = { "meta": { "expires": 3600 } }
]]></artwork>
	</figure>

	<t>In the NetInf GET-RESP message, the "expires" key-value
	field is contained in the application/json component of the
	message body as part of the "metadata" key-value field as
	specified in Section 6.1 of <xref
	target="I-D.kutscher-icnrg-netinf-proto" />.</t>

      </section>

      <section title="Processing">

	<t>A NetInf node receiving a NetInf GET message for an NDO
	that is present in its cache SHOULD check the NDO's metadata
	for an "expires" key-value field.  The node SHOULD to the best
	of its ability determine whether the expiration time has
	passed.  If the expiration time has passed, it SHOULD
	disregard the cached copy and continue with any other
	processing of the GET message, including the possibility to
	forward the message to another node.</t>

	<t>A NetInf node receiving a NetInf PUBLISH message containing
	object data ("full-ndo-flag") and the "expires" key-value
	field in the NDO metadata, SHOULD keep the key-value field
	with the NDO as affiliated data.  This is normal processing as
	specified in Section 6.1 of <xref
	target="I-D.kutscher-icnrg-netinf-proto" />.</t>

	<t>A NetInf node responding with a NetInf GET-RESP containing
	the NDO object octets, SHOULD include any "expires" key-value
	field metadata associated with the NDO in the application/json
	body part.  This is also normal processing as specified in
	Section 6.1 of <xref target="I-D.kutscher-icnrg-netinf-proto"
	/>.</t>

	<t>A NetInf node receiving a NetInf GET-RESP message
	containing the NDO object octets, SHOULD keep any "expires"
	key-value field metadata associated with the NDO.  This
	applies both if the node forwards the GET-RESP back to another
	requester, and if the node decides to keep this NDO in its
	local cache.  This is normal processing as specified in
	Section 6.1 of <xref target="I-D.kutscher-icnrg-netinf-proto"
	/>.</t>

      </section>

    </section>

    <section title="Nocache NDO metadata">

      <t>"Nocache" is an NDO metadata field that can be specified by
      the publisher of an NDO.  "Nocache" is a boolean value that when
      set to true, inhibits caching of the NDO by NetInf nodes.  The
      metadata is stored together with the actual NDO data as
      discussed in Section 5.2 of <xref
      target="I-D.kutscher-icnrg-netinf-proto" />.</t>

      <t>The "nocache" NDO metadata is specified by publishers in the
      PUBLISH message as part of the "meta" field in the json-encoded
      "ext" parameter.  When the NDO is returned in a GET-RESP
      message, the "nocache" metadata is supplied as part of the
      affiliated data to the NDO in the application/json MIME
      part.</t>

      <section title="Syntax">

	<t>The "nocache" NDO metadata MUST be specified as an json
	key-value field with the name "nocache".  Its data type MUST
	be of type boolean.  When set to "true", the publisher
	indicates that this NDO should not be cached.  When set to
	"false", the default if not present, indicates that NetInf
	nodes may cache the NDO object data.</t>

	<t>In the NetInf PUBLISH message, the "nocache" key-value
	field is contained in a "meta" key-value field in the "ext"
	parameter as specified in Section 6.1 of <xref
	target="I-D.kutscher-icnrg-netinf-proto" />.  An example is
	shown in <xref target="fig:nocache-publish" />.</t>

	<figure anchor="fig:nocache-publish"
		title="Example nocache metadata in PUBLISH message">
          <artwork><![CDATA[
    ext = { "meta": { "nocache": true } }
]]></artwork>
	</figure>

	<t>In the NetInf GET-RESP message, the "nocache" key-value
	field is contained in the application/json component of the
	message body as part of the "metadata" key-value field as
	specified in Section 6.1 of <xref
	target="I-D.kutscher-icnrg-netinf-proto" />.</t>

      </section>

      <section title="Processing">

	<t>A NetInf node receiving a NetInf PUBLISH message containing
	object data ("full-ndo-flag") and the "nocache" key-value
	field in the NDO metadata, MUST keep the key-value field
	with the NDO as affiliated data.  This is normal processing as
	specified in Section 6.1 of <xref
	target="I-D.kutscher-icnrg-netinf-proto" />.</t>

	<t>A NetInf node receiving a NetInf GET-RESP message containing an
	NDO with the "nocache" key-value field set to true,
	MUST NOT keep a copy of the NDO in its cache.</t>

	<t>A NetInf node responding with a NetInf GET-RESP message containing
	the NDO object octets, MUST include any "nocache" key-value
	field metadata associated with the NDO in the application/json
	body part.  This is also normal processing as specified in
	Section 6.1 of <xref target="I-D.kutscher-icnrg-netinf-proto"
	/>.</t>

      </section>


    </section>

    <section title="Applications">

      <t>The extensions described in this document can be used for
      several purposes.  Some of them are described in this
      section.</t>

      <section title="NetInf ping">

	<t>A kind of "NetInf ping" can be implemented, with which the
	reachability of a certain NDO can be checked.  A client issues
	a NetInf GET request with the "nodata" extension.  If a valid
	response is received, the NDO is reachable.  The request can
	be combined with the "fromorigin" extension, so that the
	request is not satisfied when a cached copy is encountered,
	but rather forwarded to an origin publisher for the NDO.  The
	client can with this combination check the reachability of the
	NDO at the publisher or origin server.</t>

      </section>

      <section title="Dynamically generated data">

	<t>Two kinds of dynamically generated data can be created by
	publishers using the "expires" and "nocache" NDO metadata.  To
	be useful, dynamically generated data should not use names
	including the content hash in the name, since new, different,
	data then necessarily results in a new name.  A scheme that
	ensures name-data integrity using signatures is rather
	needed.</t>

	<t>Using "nocache" means that all requests for that particular
	NDO name will reach the origin publisher, which then
	dynamically can create the data when the request arrives.</t>

	<t>Using "expires" means that the NDO can be cached for a
	certain time duration.  The publisher can then regularly
	update the NDO with new data.</t>

      </section>

    </section>

    <section title="Security Considerations" anchor="sec:security">
      <t>fromorgin - opens for dos attacks on origin servers
      (especially when not together with nodata)</t>

      <t><cref source="editor">This section needs much more
      work!</cref></t>

    </section>

    <section title="Acknowledgements">
      <t> Ericsson and SICS colleagues in Center for Networked Systems
      at SICS, the EFRAIM project, and partners in the former EU FP7
      project SAIL.</t>

    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">

      &RFC2119;

      &RFC5234;

<!--
      &RFC6920;

      &I-D.ni-params;
-->
      &I-D.netinf-proto;

    </references>

<!--
    <references title="Informative References">

      <reference anchor="ref.netinf-db2">
	<front>
	  <title>NetInf Content Delivery and Operations</title>
	  <author fullname="SAIL Project" surname="SAIL"/>
          <date month="May" year="2012" />
	</front>
        <seriesInfo name="SAIL Project Deliverable D-3.2" value="" />
      </reference>

      <reference anchor="ref.netinf-db3">
	<front>
	  <title>Final NetInf Architecture</title>
	  <author fullname="SAIL Project" surname="SAIL"/>
          <date month="Nov" year="2012" />
	</front>
        <seriesInfo name="SAIL Project Deliverable D-3.3" value="" />
      </reference>

    </references>
-->

  </back>
</rfc>
