<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 PUBLIC '' "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6920 PUBLIC '' "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6920.xml">
<!ENTITY I-D.kutscher-icnrg-netinf-proto PUBLIC '' "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-kutscher-icnrg-netinf-proto-01.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<rfc ipr="trust200902" category="exp" docName="draft-ahlgren-icnrg-netinf-live-video-00">
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc iprnotified="no" ?>
<!-- <?rfc compact="yes" ?> -->
<?rfc strict="yes" ?>
<?rfc notedraftinprogress="yes" ?>

<front>
<title abbrev="NetInf Live Video">
NetInf Live Video Specification
</title>

<author initials="B." surname="Ahlgren" fullname="Bengt Ahlgren">
<organization abbrev="SICS">SICS Swedish ICT</organization>
<address>
<postal>
<street>Box 1263</street>
<city>Kista</city> 
<code>SE-164 29</code>
<country>SE</country>
</postal>
<phone>+46703141562</phone>
<email>bengta@sics.se</email>
<uri>http://www.sics.se/people/bengt-ahlgren</uri>
</address>
</author>

<author initials="B." surname="Ohlman" fullname="Börje Ohlman">
<organization>Ericsson</organization>
<address>
<postal>
<street></street>
<city>Kista</city> 
<code>SE-164 80</code>
<country>SE</country>
</postal>
<phone>+46705193187</phone>
<email>borje.ohlman@ericsson.com</email>
<uri></uri>
</address>
</author>

<author initials="A. M." surname="Malik" fullname="Adeel Mohammad Malik">
<organization>Ericsson</organization>
<address>
<postal>
<street></street>
<city>Kista</city> 
<code>SE-164 80</code>
<country>SE</country>
</postal>
<phone>+46725074492</phone>
<email>adeel.mohammad.malik@ericsson.com</email>
<uri></uri>
</address>
</author>


<date month="December" year="2015" />
<workgroup>ICN Research Group</workgroup>
<keyword>RFC</keyword>
<keyword>Request for Comments</keyword>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>ICN</keyword>
<keyword>NetInf</keyword>
<keyword>Live Video</keyword>

<abstract>
<t>
  This document specifies how the NetInf information-centric network
  service can be used for transport of live video streaming.  To
  illustrate this it describes a prototype system that was developed
  to be used at "events with large crowds", e.g., sports events.  The
  specification defines how the used video format is mapped to NetInf
  named data objects (NDOs). It also describe how NetInf messages are
  used to transfer the NDOs.
</t>

</abstract>

</front>

<middle>

<section title= "Introduction" anchor="introduction">

  <t>
    This specification documents how a prototype NetInf-based <xref
    target="Dannewitz2013" /> live video streaming system makes use
    of the NetInf information-centric network (ICN)
    service.  The prototype has been field-tested and demonstrated at
    numerous occasions <xref target="Malik2015a" /> <xref
    target="Malik2015b" />.  The Android client software that is part
    of the prototype system has been made available on <eref
    target="https://sourceforge.net/projects/netinf/">Sourceforge</eref>
    as open source with an Apache 2.0 license.
  </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 <xref
    target="RFC2119">RFC 2119</xref>.
  </t>

</section> <!-- Introduction -->


<section title= "System Architecture" anchor="system">

<t> <xref target="fig_sys_arch"/> shows the architecture of the NetInf live video streaming system. Users can record and publish video streams at a live event and at the same time other users can watch the streams live. The architecture also facilitates streaming to a device anywhere on the internet so that users not present at the venue can also publish or play streams.
</t>

<figure title="System architecture" anchor="fig_sys_arch">
	<preamble></preamble>
	<artwork src='layers.png' alt='[picture of layers only]'>
+---------------------------------------------------------------+
| NetInf Core Network                                           |
|                   +--------+                                  |
|                   | NetInf |                     +-----+      |
|           +-------+ Router +-------+             | NRS |      |
|           |       +--------+       |             |     |      |
|           |                        |             +-----+      |
|       +---+----+              +----+---+                      |
|       | NetInf |              | NetInf |                      |
|       | Router |              | Router +---------+            |
|       +---+----+              +--------+         |            |
|           |                                      |            |
+---------------------------------------------------------------+
            |                                      |
            |                        +--------------------------+
 XXXXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXX  | NetInf      |            |
 X                                X  | Access +----+---+        |
 X             Internet           X  | Network| NetInf |        |
 X                                X  | at     | Router |        |
 XXXXXXX+XXXXXXXXXXXXXXXX+XXXXXXXXX  | event  ++------++        |
        |                |           | venue   |      |         |
        |                |           |         |      |         |
 XXXXXXX+XXXXXXX  XXXXXXXXXXXXXXXXX  |  +------+-+  +-+------+  |
 X WiFi Access X  X Mobile Access X  |  | NetInf |  | NetInf |  |
 XXXXXXX+XXXXXXX  XXXX+XXXXXX+XXXXX  |  | Router |  | Router |  |
        |             |      |       |  +----+---+  +----+---+  |
        |             |      |       |       |           |      |
        |             |      |       |  XXXXX+XXXXXXXXXXX+XXX   |
      +-+-+         +-+-+    |       |  X    WiFi Access    X   |
      | P |         | P |    |       |  XXXXXXX+XXXXXX+XXXX+X   |
      +---+         +---+    |       |         |      |    |    |
                             |       | +---+ +-+-+  +-+-+ ++--+ |
                             +---------+ R | | P |  | R | | P | |
  R:   Recording client              | +---+ +---+  +---+ +---+ |
  P:   Playing client                |                          |
  NRS: Name Resolution Service       +--------------------------+

	</artwork>
	<postamble></postamble>
</figure>

<t>
Recording and playing clients at the event venue can connect to the system using local WiFi or mobile internet (3G/4G). Before a client can start publishing or playing, it first connects to a NetInf router. Consequently this router acts as the first hop NetInf node for the client. Clients on local WiFi at the event venue connect to a NetInf router in the local access network. Clients on the internet connect to a NetInf router in the NetInf core network.
</t>

<t>
The NetInf core network hosts a Name Resolution Service (NRS). This service is responsible for resolving object names into locators. It also provides search function for the registered Named Data Objects (NDOs).
</t>

<t>
ICN employs ubiquitous caching. Therefore every NetInf router in the architecture is coupled with a local cache. These routers cache NDOs on-path and serve them to corresponding GET requests when there is a cache hit. This ensures that clients are served data from the local network (if the data is cached) and that the edge links (like the one between the NetInf access network and the NetInf core network as seen in <xref target="fig_sys_arch"/>) are not choked with traffic.

</t>

</section> <!--  System -->


<section title= "Video Format" anchor="format">

  <t>
  The transport of video chunks using NetInf described in this
  specification can be used for video with any type of encoding.
  As an example we describe the mpeg4/H.264 encoding used at
  the above referenced events.
  </t>
  
  <t>
  When transporting video over an best effort network, such an ICN network,
  there are two main goals: to minimize the delay and to avoid
  rebuffering events. Unfortunately the means to achieve these goals
  are conflicting. Small buffers are needed to minimize delay, large
  buffers are needed to minimize the risk of rebuffering.
  </t>

  <t>
  At the events referenced above the video generated by
  the recording device were encoded using
  H.264/AVC video format and had the mime type "video/avc".
  The video is split into chunks so that each chunk fits into an NDO.
  Chunking is done at I-frames in order to ensure that video chunks are
  independent of each other. The H.264 encoded chunks are packaged
  into MP4 containers.
  The frame rate and I-frame intervals are configurable.
  The parameters can be tweaked to achieve different tradeoffs
  between the playback latency and the NDO header overhead.
  The I-frame interval controls the size of the generated video
  chunks. A typical setting of 30 fps and 2 seconds,
  respectively, was used with the largest available 16:9 resolution
  less than 864x480, resulting in a video data rate of about 1 Mbps.
  Each chunk corresponds, in this case, to a video playout of 2 seconds.
  To avoid rebuffering the playing application buffers of video data
  was typically set to 10 seconds.
  </t>

</section> <!--  Format -->


<section title= "Video Transport using NetInf Protocol" anchor="transport">

<t>
  This section describes how NetInf named data objects (NDOs) are
  created from the video chunks in the previous section, and how the
  NDOs are made available to clients using the NetInf protocol <xref
  target="I-D.kutscher-icnrg-netinf-proto"/> with extensions for
  subscriptions using the NetInf SUBSCRIBE and NOTIFY messages.  As
  described in the NetInf protocol specification, a NetInf NDO
  consists of the object's data and, optionally, associated
  JSON-encoded meta-data.
</t>

<t>
  Two kinds of NetInf NDOs are created for a video stream: one
  carrying the video chunks, and another carrying a "header", or
  manifest, that describes the stream of video chunks.  The latter is
  described in the next section.
</t>


<section title="Video chunk NDOs">

  <t>
    Each video chunk is turned into one NetInf NDO.  The bytes of the
    video chunk are directly put into the data content of the NDO.
  </t>

  <t>
    The following meta-data items MUST be supplied with video chunk
    NDOs:
    <list style="hanging" hangIndent="18">
      <t hangText="chunk_number">
	The sequence number of the chunk in the video starting with
	zero.  (Integer)
      </t>
      <t hangText="video_name">
	The name (ni hash <xref target="RFC6920" />) of the video
	stream header NDO encoded with
	the URL-SAFE variant of BASE64 without padding.  (ASCII
	string)
      </t>
      <t hangText="start_time">
	The starting time of the chunk in microseconds since the start
	of the video.  (Long integer)
      </t>
      <t hangText="duration">
	The duration of the video chunk in microseconds.  (Long
	integer)
      </t>
      <t hangText="signature">
	A digital signature for the chunk.  The signature is an RSA
	signature on the SHA-256 hash of the content as defined in the
	PKCS #1: RSA Cryptography Standard.  The result is BASE64
	encoded without padding or wrapping, using the URL-SAFE
	encoding variant.  (ASCII string)
      </t>
    </list>
  </t>

</section>



<section title="Publishing video chunk NDOs">

  <t>
    Video chunk NDOs are published using NetInf PUBLISH as described
    in the NetInf protocol specification <xref
    target="I-D.kutscher-icnrg-netinf-proto"/>.  The JSON-encoded
    meta-data is supplied as a "meta" item of the "ext" parameter in
    the PUBLISH message.
  </t>

  <t>
    In addition, a NetInf NOTIFY message MUST be sent for each
    successfully published video chunk.  The NOTIFY message contains
    the ni URI <xref target="RFC6920" /> of the stream header NDO and
    the ni URI of the just
    published video chunk NDO.  It also contains the sequence number
    and signature of the video chunk NDO.
  </t>

  <t>
    The destination for both of these messages is normally a
    designated next-hop NetInf router for the client.  How the client
    finds this destination is out of scope for this specification.
  </t>

</section>


<section title="Receiving video chunk NDOs">

  <t>
    Clients that wish to receive video chunks MAY register to receive
    the above notifications using the NetInf SUBSCRIBE extension.
    They will then receive the NetInf NOTIFY, and can then issue a
    NetInf GET to retrieve the newly published video chunk.
  </t>

</section>

</section> <!--  Transport -->


<section title= "Video Manifest" anchor="manifest">

<t>
  This section describes the video stream header and how it is encoded
  and published as a NetInf NDO.
</t>

<section title="Video stream header NDOs">

  <t>
    Each video stream MUST be described and identified by publishing a
    stream header NDO.  It contains various information about the
    stream and a public key that can be used by clients to verify the
    authenticity of the video chunk NDOs.  The hash part the NetInf
    "ni" name of the header NDO is used to name the video stream.
    That hash is included as meta-data of the video chunk NDOs.
  </t>

  <t>
    The NDO data (content) MUST be constructed by concatenating the
    bytes of the following items in binary form:
    <list style="hanging" hangIndent="18">
      <t hangText="MAGIC">
	The ASCII character sequence "ENS0".
      </t>
      <t hangText="Public key length">
	Four-byte integer with the length of the public key.  (Note:
	needs to be network byte order/big endian, but the
	implementation likely uses little endian.)
      </t>
      <t hangText="Public key">
	The public key for the stream encoded according to X.509 ASN.1
	SubjectPublicKeyInfo.
      </t>
      <t hangText="Contents">
	Any additional data provided by the client. (optional)
      </t>
    </list>
  </t>

  <t>
    The following JSON-encoded meta-data MUST be included with header
    NDOs:
    <list style="hanging" hangIndent="18">
      <t hangText="title">
	A title for the video stream as provided by the client.
	(ASCII string)
      </t>
      <t hangText="description">
	A descriptive text provided by the client.  (ASCII string)
      </t>
      <t hangText="region">
	A short text description of the location where the video is
	recorded.  (ASCII string)
      </t>
      <t hangText="stream-start">
	The time of the start of the stream in Unix time in
	milliseconds.  (Long integer)
      </t>
    </list>
  </t>

  <t>
    The following JSON-encoded meta-data SHOULD be included with
    header NDOs:
    <list style="hanging" hangIndent="18">
      <t hangText="stream-end">
	The time of the end of the stream in Unix time in
	milliseconds.  The NDO SHOULD be updated with this item when
	the recording has completed.  (Long integer)
      </t>
      <t hangText="gps-x">
	The X coordinate (longitude) of the location of the recorded
	video in degrees.  (Double floating point number)
      </t>
      <t hangText="gps-y">
	The Y coordinate (latitude) of the location of the recorded
	video in degrees.  (Double floating point number)
      </t>
    </list>
  </t>
</section>


<section title="Publishing video header NDOs">

  <t>
    Video header NDOs are published using NetInf PUBLISH as described
    in the NetInf protocol specification <xref
    target="I-D.kutscher-icnrg-netinf-proto"/>.  The JSON-encoded
    meta-data is supplied as a "meta" item of the "ext" parameter in
    the PUBLISH message.
  </t>

</section>


<section title="Browsing available video streams">

  <t>
    Clients can use the NetInf SEARCH message to collect information
    about the published video stream headers, and with the result
    populate a browser listing in the user interface.  The user can
    with that choose a video to play.
  </t>

</section>

</section> <!--  Manifest -->


<!--
<section title= "Discussion and Future Direction" anchor="discussion">

</section>
-->


<section title="Security Considerations" anchor="sec_security">

  <t>
    TBD
  </t>

</section> <!-- Security -->

  <section title="Acknowledgements">
    <t>The work behind and the writing of this document are
    supported by the activity `14082 Networks for Future Media
    Distribution' within EIT Digital (formerly EIT ICT labs).</t>
  </section>

<!--
<section title= "">
</section> 
-->

</middle>

<back>

  <references title="Normative References">

    &I-D.kutscher-icnrg-netinf-proto;
    &RFC2119;
    &RFC6920;

  </references>

  <references title="Informative References">

    <reference anchor="Dannewitz2013">
      <front>
	<title>Network of Information (NetInf) - An
	Information-Centric Networking Architecture</title>
	<author initials="C." surname="Dannewitz" fullname="Christian Dannewitz" />
	<author initials="D." surname="Kutscher" fullname="Dirk Kutscher" />
	<author initials="B." surname="Ohlman" fullname="Börje Ohlman" />
	<author initials="S." surname="Farrell" fullname="Stephen Farrell" />
	<author initials="B." surname="Ahlgren" fullname="Bengt Ahlgren" />
	<author initials="H." surname="Karl" fullname="Holger Karl" />
	<date month="April" year="2013" />
      </front>
      <seriesInfo name="Computer Communications"
		  value="36 (7). pp. 721-735. ISSN 0140-3664" />
    </reference>

    <reference anchor="Malik2015a">
      <front>
	<title>Experiences from a field test using ICN for live video
	streaming</title>
	<author initials="A. M." surname="Malik" fullname="Adeel Mohammad Malik" />
	<author initials="B." surname="Ahlgren" fullname="Bengt Ahlgren" />
	<author initials="B." surname="Ohlman" fullname="Börje Ohlman" />
	<author initials="A." surname="Lindgren" fullname="Anders Lindgren" />
	<author initials="E." surname="Ngai" fullname="Edith Ngai" />
	<author initials="L." surname="Klingsbo" fullname="Lukas Klingsbo" />
	<author initials="M." surname="Lång" fullname="Magnus Lång" />
	<date day="3" month="July" year="2015" />
      </front>
      <seriesInfo name="Proc." value="Workshop on Multimedia Streaming in Information-Centric Networks, in conjunction with ICME 2015, Turin, Italy" />
    </reference>

    <reference anchor="Malik2015b">
      <front>
	<title>NetInf Live Video Streaming for Events with Large Crowds (demo)</title>
	<author initials="A. M." surname="Malik" fullname="Adeel Mohammad Malik" />
	<author initials="B." surname="Ahlgren" fullname="Bengt Ahlgren" />
	<author initials="B." surname="Ohlman" fullname="Börje Ohlman" />
	<date month="Sept-Oct" year="2015" />
      </front>
      <seriesInfo name="Proc." value="2nd ACM Conference on Information-Centric Networking (ICN), San Francisco, California, USA" />
    </reference>

  </references>
</back>

</rfc>
