<?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">

]>
<?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="no"?>
<?rfc inline="no"?>
<rfc category="std" docName="draft-sunde-netinf-protocol-bluetooth-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 Bluetooth CL">The NetInf Bluetooth Convergence Layer</title>

		<!-- add 'role="editor"' below for the editors if appropriate -->

		<!-- Another author who claims to be an editor -->

		<author fullname="Linus Sunde" initials="L." surname="Sunde">
			<organization>Uppsala University</organization>

			<address>
				<postal>
					<street></street>
					<!-- Reorder these if your country does things differently -->
					<city>Uppsala</city>
					<region></region>
					<code></code>
					<country>Sweden</country>
				</postal>
				<phone></phone>
				<email>Linus.Sunde.9273@student.uu.se</email>
				<!-- uri and facsimile elements may also be added -->
			</address>
		</author>

		<date 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>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>

		<keyword>Bluetooth</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 a Network of Information (NetInf) convergence layer intended to be used over some Bluetooth protocol providing reliable transmission. A convergence layer handles the transport of NetInf requests and responses. In this convergence layer the common NetInf messages are defined using JavaScript Object Notation (JSON) and Named Data Object (NDO) octet parts, both using length prefixes. While the convergence layer is intended to be used over Bluetooth, any underlying protocol providing reliable transmission could potentially be used.
			</t>
		</abstract>
	</front>

	<middle>
  
		<section title="Introduction">
			<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"></xref>.</t>
		</section>

		<section title="Bluetooth Convergence Layer Specification">
			
			<t>
				This section specifies a NetInf Convergence Layer <xref target="I-D.kutscher-icnrg-netinf-proto" /> intended to be used over Bluetooth. The protocol does not provide reliable transmission. This is assumed to be provided by the underlying Bluetooth protocol, e.g. radio frequency communication (RFCOMM). The Bluetooth convergence layer (BCL) could potentially also be used on top of non-Bluetooth protocols providing the required features (e.g. TCP).
			</t>
			<t>
				The BCL does not provide any means of discovering or selecting which devices to route to. This problem must be handled by the implementation. A Bluetooth connection needs to be established between the sender and the receiver. This connection MAY use RFCOMM <xref target="RFCOMM" />. It MAY be established using the service discovery protocol <xref target="SDAP" /> with the Universally Unique IDentifier <xref target="RFC4122" /> 111a8500-6ae2-11e2-bcfd-0800200c9a66.
			</t>
			<t>
				The response to a request SHOULD be sent back using the same connection (if two-way communication is supported) but an implementation MUST NOT assume that this always is the case.
			</t>
			<t>
				The protocol is built around sending UTF-8 <xref target="RFC3629" /> encoded JSON and NDO octets through a stream providing reliable transmission. All JSON and octet parts MUST be prefixed with their length in bytes. The length prefix MUST be a 32-bit signed integer encoded in two's complement using big endian network byte order.
			</t>
			<t>
				The ni URI scheme <xref target="RFC6920" /> MUST be supported. Other URI schemes MAY be supported.
			</t>
			<t>
				The following names are defined for JSON name/value pairs:
			</t>

			<figure anchor="fig-message-json" title="Bluetooth CL JSON">
				<artwork align="center"><![CDATA[
------------------------------------------------------------------
Name     | Value      | Comments
------------------------------------------------------------------
type     | string     | Message type. MUST be "publish",
         |            | "publish-response", "get", "get-response", 
         |            | "search" or "search-response".
------------------------------------------------------------------
msgid    | string     | Message identifier.
------------------------------------------------------------------
uri      | string     | NDO URI.
------------------------------------------------------------------
hoplimit | number     | Number of times to forward this message.
         |            | Assumed to be 0 if not present.
------------------------------------------------------------------
locators | [string]   | Locators to the NDO.
------------------------------------------------------------------
ext      | object     | Metadata and future extensions. Metadata 
         |            | MUST be an object under the "meta" key if
         |            | present. E.g. "ext":{"meta":{...}}
------------------------------------------------------------------
octets   | true/false | Flag indicating if this JSON is directly 
         |            | followed by the NDO octets (including the 
         |            | length prefix). Assumed to be false if
         |            | not present.
------------------------------------------------------------------
status   | number     | Code indicating the status of a response.
------------------------------------------------------------------
tokens   | [string]   | Tokens used in a SEARCH. MUST contain at        
         |            | least one token.
------------------------------------------------------------------
results  | [object]   | The results of a search. See Section 2.6.
------------------------------------------------------------------
]]>
				</artwork>
				<!-- Change SEARCH-RESP to <xref target="SEARCH-RESP" /> somehow -->
			</figure>
			
			<section title="PUBLISH">
				<t>
					A PUBLISH MUST start with a JSON part (including the associated length prefix). The JSON part MUST include the following name/value pairs:
					<list style="symbols">
						<t>type</t>
						<t>msgid</t>
						<t>uri</t>
					</list>
					Where "type" MUST be "publish" and "uri" MUST be the URI of the NDO being published.
				</t>
				<t>
					The JSON part MAY also include:
					<list style="symbols">
						<t>hoplimit</t>
						<t>locators</t>
						<t>ext</t>
						<t>octets</t>
					</list>
					If "octets" is present and true, the JSON part MUST be followed by the octets of the NDO (including the associated length prefix). If "octets" is not present or false, the JSON part MUST NOT be followed by the octets.
				</t>
			</section>
			
			<section title="PUBLISH-RESP">
				<t>
					A PUBLISH-RESP MUST consist of a single JSON part. The JSON part MUST include the following name/value pairs:
					<list style="symbols">
						<t>type</t>
						<t>status</t>
						<t>msgid</t>
					</list>
					Where "type" MUST be "publish-response".
				</t>
			</section>

			<section title="GET">	
				<t>
					A GET MUST consist of a single JSON part. The JSON part MUST include the following name/value pairs:
					<list style="symbols">
						<t>type</t>
						<t>msgid</t>
						<t>uri</t>
					</list>
					Where "type" MUST be "get".
				</t>
				<t>
					The JSON part MAY also include:
					<list style="symbols">
						<t>hoplimit</t>
					</list>
				</t>
			</section>
			
			<section title="GET-RESP">
				<t>
					A GET-RESP MUST start with a JSON part. The JSON part MUST include the following name/value pairs:
					<list style="symbols">
						<t>type</t>
						<t>status</t>
						<t>msgid</t>
						<t>uri</t>
					</list>
					Where "type" MUST be "get-response" and "uri" MUST be the URI requested NDO.
				</t>
				<t>
					The JSON part MAY also include:
					<list style="symbols">
						<t>locators</t>
						<t>octets</t>
					</list>
					If "octets" is present and true, the JSON part MUST be followed by the octets of the requested NDO. If "octets" is not present or false, the JSON part MUST NOT be followed by the octets.
				</t>
			</section>

			<section title="SEARCH">
				<t>
					A SEARCH MUST consist of a single JSON part. The JSON part MUST include the following name/value pairs:
					<list style="symbols">
						<t>type</t>
						<t>msgid</t>
						<t>tokens</t>
					</list>
					Where "type" MUST be "search".
				</t>
				<t>
					The JSON part MAY also include:
					<list style="symbols">
						<t>hoplimit</t>
					</list>
				</t>
			</section>
			
			<section title="SEARCH-RESP" anchor="SEARCH-RESP">
			
				<t>
					A SEARCH-RESP MUST consist of a single JSON part. The JSON part MUST include the following name/value pairs:
					<list style="symbols">
						<t>type</t>
						<t>status</t>
						<t>msgid</t>
						<t>results</t>
					</list>
					Where "type" MUST be "search-response".
				</t>
				<t>
					Each object in the "results" array represents an NDO considered to match the tokens included in the corresponding SEARCH. If no matching NDOs were found "results" might be empty. The following name/value pairs are defined for the search result objects:			
					<figure anchor="fig-search-result-json" title="Search result JSON">
						<artwork align="center"><![CDATA[
------------------------------------------------------------------
Name     | Value  | Comments
------------------------------------------------------------------
ni       | string | The ni URI of the matching NDO.
         |        | MUST be included.
------------------------------------------------------------------
metadata | object | Metadata belonging to the matching NDO.
         |        | MAY be included.
------------------------------------------------------------------
]]>
						</artwork>
					</figure>
				</t>
			
			</section>

		</section>

		<section title="Security Considerations">
			<t>
				As mentioned in <xref target="I-D.kutscher-icnrg-netinf-proto" /> requesters SHOULD attempt to limit the amount of personally identifying information for privacy reasons. Care should be taken when generating SEARCH tokens and when responding to a SEARCH.
			</t>
			<t>
				Validation of name-data integrity is important. Consider a scenario where the connected Bluetooth devices are a number of smart phones that happen to be in close proximity. The other devices can not be trusted to send the correct data and might even try to send malicious data.
			</t>
			<t>
				In the smart phone case battery life is also something to take into consideration. By requesting data over and over again a requester could intentionally drain the battery of the responder.
			</t>
		</section>

		<section title="IANA Considerations">
			<t>This document has no actions for IANA.</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">
			<!-- Here we use entities that we defined at the beginning. -->
			&RFC2119;

			<reference anchor='RFC3629'>
				<front>
					<title>UTF-8, a transformation format of ISO 10646</title>
					<author initials='F.' surname='Yergeau' fullname='F. Yergeau'>
						<organization />
					</author>
					<date year='2003' month='November' />
					<abstract>
						<t>ISO/IEC 10646-1 defines a large character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems.  The originally proposed encodings of the UCS, however, were not compatible with many current applications and protocols, and this has led to the development of UTF-8, the object of this memo.  UTF-8 has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values.  This memo obsoletes and replaces RFC 2279.</t>
					</abstract>
				</front>
				<seriesInfo name='STD' value='63' />
				<seriesInfo name='RFC' value='3629' />
				<format type='TXT' octets='33856' target='http://www.rfc-editor.org/rfc/rfc3629.txt' />
			</reference>
		
			<reference anchor='I-D.kutscher-icnrg-netinf-proto'>
				<front>
					<title>The NetInf Protocol</title>
					<author initials='D' surname='Kutscher' fullname='Dirk Kutscher'>
						<organization />
					</author>
					<author initials='S' surname='Farrell' fullname='Stephen Farrell'>
						<organization />
					</author>
					<author initials='E' surname='Davies' fullname='Elwyn Davies'>
						<organization />
					</author>
					<date month='February' day='10' year='2013' />
					<abstract><t>This document defines a conceptual protocol and corresponding node requirements for NetInf nodes in a NetInf network.  A NetInf network offers an information-centric paradigm that supports the creation, location, exchange and storage of Named Data Objects (NDOs).  NetInf nodes can provide different services to other NetInf nodes, e.g., forwarding requests for information objects, delivering corresponding response messages, name resolution services etc.  This (abstract) protocol is intended to be run over some "convergence layer" that handles transport issues.  Two "wire" formats are defined, one that uses HTTP for message transfer and one layered on UDP.</t></abstract>
				</front>
				<seriesInfo name='Internet-Draft' value='draft-kutscher-icnrg-netinf-proto-01' />
				<format type='TXT' target='http://www.ietf.org/internet-drafts/draft-kutscher-icnrg-netinf-proto-01.txt' />
			</reference>
			
			<reference anchor='RFC6920'>
				<front>
				<title>Naming Things with Hashes</title>
				<author initials='S.' surname='Farrell' fullname='S. Farrell'>
				<organization /></author>
				<author initials='D.' surname='Kutscher' fullname='D. Kutscher'>
				<organization /></author>
				<author initials='C.' surname='Dannewitz' fullname='C. Dannewitz'>
				<organization /></author>
				<author initials='B.' surname='Ohlman' fullname='B. Ohlman'>
				<organization /></author>
				<author initials='A.' surname='Keranen' fullname='A. Keranen'>
				<organization /></author>
				<author initials='P.' surname='Hallam-Baker' fullname='P. Hallam-Baker'>
				<organization /></author>
				<date year='2013' month='April' />
				<abstract>
				<t>This document defines a set of ways to identify a thing (a digital object in this case) using the output from a hash function.  It specifies a new URI scheme for this purpose, a way to map these to HTTP URLs, and binary and human-speakable formats for these names.  The various formats are designed to support, but not require, a strong link to the referenced object, such that the referenced object may be authenticated to the same degree as the reference to it.  The reason for this work is to standardise current uses of hash outputs in URLs and to support new information-centric applications and other uses of hash outputs in protocols.</t></abstract></front>

				<seriesInfo name='RFC' value='6920' />
				<format type='TXT' octets='54124' target='http://www.rfc-editor.org/rfc/rfc6920.txt' />
			</reference>
		
		</references>

		<references title="Informative References">
			<reference anchor='RFCOMM'>
				<front>
					<title>RFCOMM with TS 07.10 Serial Port Emulation</title>
					<author>
						<organization abbrev="BSIG">
							Bluetooth Special Interest Group
						</organization>
					</author>
					<date year='2012' month='November' day='6' />
					<abstract>
						<t>This document specifies the RFCOMM protocol by specifying a subset of the ETSI TS 07.10 standard, along with some Bluetooth-specific adaptations.</t>
					</abstract>
				</front>
				<format type='PDF' target='https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=263754' />
			</reference>

			<reference anchor='SDAP'>
				<front>
					<title>Service Discovery Application Profile</title>
					<author>
						<organization abbrev="BSIG">
							Bluetooth Special Interest Group
						</organization>
					</author>
					<date year='2001' month='February' day='22' />
					<abstract>
						<t>This document defines the features and procedures for an application in a Bluetooth device to discover services registered in other Bluetooth devices and retrieve any desired available information pertinent to these services.</t>
					</abstract>
				</front>
				<format type='ZIP' target='https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=8697' />
			</reference>

<reference anchor='RFC4122'>

<front>
<title abbrev='UUID URN'>A Universally Unique IDentifier (UUID) URN Namespace</title>
<author initials='P.' surname='Leach' fullname='Paul J. Leach'>
<organization>Microsoft</organization>
<address>
<postal>
<street>1 Microsoft Way</street>
<city>Redmond</city>
<region>WA</region>
<code>98052</code>
<country>US</country></postal>
<phone>+1 425-882-8080</phone>
<email>paulle@microsoft.com</email></address></author>
<author initials='M.' surname='Mealling' fullname='Michael Mealling'>
<organization>Refactored Networks, LLC</organization>
<address>
<postal>
<street>1635 Old Hwy 41</street>
<street>Suite 112, Box 138</street>
<city>Kennesaw</city>
<region>GA</region>
<code>30152</code>
<country>US</country></postal>
<phone>+1-678-581-9656</phone>
<email>michael@refactored-networks.com</email>
<uri>http://www.refactored-networks.com</uri></address></author>
<author initials='R.' surname='Salz' fullname='Rich Salz'>
<organization>DataPower Technology, Inc.</organization>
<address>
<postal>
<street>1 Alewife Center</street>
<city>Cambridge</city>
<region>MA</region>
<code>02142</code>
<country>US</country></postal>
<phone>+1 617-864-0455</phone>
<email>rsalz@datapower.com</email>
<uri>http://www.datapower.com</uri></address></author>
<date year='2005' month='July' />
<keyword>URN, UUID</keyword>
<abstract>
<t>This specification defines a Uniform Resource Name namespace for
      UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally
      Unique IDentifier). A UUID is 128 bits long, and can
      guarantee uniqueness across space and time. UUIDs were originally
      used in the Apollo Network Computing System and later in the Open
      Software Foundation's (OSF) Distributed Computing Environment (DCE),
      and then in Microsoft Windows platforms.</t>
<t>This specification is derived from the DCE specification with the
      kind permission of the OSF (now known as The Open Group).  Information from earlier versions of the DCE specification have been	
      incorporated into this document.</t></abstract></front>

<seriesInfo name='RFC' value='4122' />
<format type='TXT' octets='59319' target='http://www.rfc-editor.org/rfc/rfc4122.txt' />
<format type='HTML' octets='82922' target='http://xml.resource.org/public/rfc/html/rfc4122.html' />
<format type='XML' octets='62931' target='http://xml.resource.org/public/rfc/xml/rfc4122.xml' />
</reference>

		</references>
		
	</back>
</rfc>
