<?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 RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.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="no"?>
<!-- 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="bcp" docName="draft-gomez-lwig-tcp-constrained-node-networks-00"
     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="TCP over CNNs">
    TCP over Constrained-Node Networks
    </title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

 



    <author fullname="Carles Gomez" initials="C.G" surname="Gomez">
      <organization>UPC/i2CAT</organization>

      <address>
        <postal>
          <street>C/Esteve Terradas, 7</street>

          <city>Castelldefels</city>

          <region/>

          <code>08860</code>

          <country>Spain</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>carlesgo@entel.upc.edu</email>

        <uri/>
      </address>
    </author>

    <author fullname="Jon Crowcroft" initials="J.C" surname="Crowcroft">
      <organization>University of Cambridge</organization>

      <address>
        <postal>
          <street>JJ Thomson Avenue</street>

          <city>Cambridge</city>

          <region>CB3 0FD</region>

          <code/>

          <country>United Kingdom</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>jon.crowcroft@cl.cam.ac.uk</email>

        <uri/>
      </address>
    </author>

         <!-- uri and facsimile elements may also be added -->
      

    <date month="October" year="2016"/>

    <!-- 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>APP</area>

    <workgroup>CoRE 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. -->

    <!---->

    <abstract>
      <t> This document provides a profile for the Transmission Control Protocol (TCP) over Constrained-Node Networks (CNNs). The overarching goal is to offer simple measures to allow for lightweight TCP implementation and suitable operation in such environments. 
</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction ">

      <t>The Internet Protocol suite is being used for connecting Constrained-Node Networks (CNNs) to the Internet, enabling the so-called Internet of Things (IoT) <xref target="RFC7228"/>. In order to meet the requirements that stem from CNNs, the IETF has produced a suite of protocols specifically designed for such environments <xref target="I-D.ietf-lwig-energy-efficient"/>. </t>

      <t>At the application layer, the Constrained Application Protocol (CoAP) was developed over UDP <xref target="RFC7252"/>. However, the integration of some CoAP deployments with existing infrastructure is being challenged by middleboxes such as firewalls, which may limit UDP-based communications. This is one of the main reasons why a CoAP over TCP specification is being developed <xref target="I-D.tschofenig-core-coap-tcp-tls"/>. </t>

      <t>On the other hand, other application layer protocols not specifically designed for CNNs are also being considered for the IoT space. Some examples include HTTP/2 and even HTTP/1.1, both of which run over TCP by default <xref target="RFC7540"/><xref target="RFC2616"/>. TCP is also used by non-IETF application-layer protocols in the IoT space such as MQTT and its lightweight variants <xref target="MQTTS"/>. </t>

      <t>This document provides a profile for TCP over CNNs. The overarching goal is to offer simple measures to allow for lightweight TCP implementation and suitable operation in such environments.</t>

      <section title="Conventions used in this document">
        <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"/></t>
      </section>
   
    </section>


    

<section title="Characteristics of CNNs relevant for TCP">
      <t>Constrained nodes are characterized by significant limitations on processing, memory, and energy resources <xref target="RFC7228"/>. The first two dimensions pose constraints on the complexity and on the memory footprint of the protocols that constrained nodes can support. The latter requires techniques to save energy, such as radio duty-cycling in wireless devices <xref target="I-D.ietf-lwig-energy-efficient"/>, as well as minimization of the number of messages transmitted/received (and their size).</t>


      <t>
Constrained nodes often use physical/link layer technologies that have been characterized as 'lossy'. Many such technologies are wireless, therefore exhibiting a relatively high bit error rate. However, some wired technologies used in the CNN space are also lossy (e.g. Power Line Communication).</t>

      <t>
Some CNNs follow the star topology, whereby one or several hosts are linked to a central device that acts as a router connecting the CNN to the Internet. CNNs may also follow the multihop topology <xref target="RFC6606"/>.</t>

    </section>



    <section title="TCP over CNNs">
   
     <section title="Maximum Segment Size (MSS)">

      <t>Some link layer technologies in the CNN space are characterized by a short data unit payload size, e.g. up to a few tens or hundreds of bytes. For example, the maximum frame size in IEEE 802.15.4 is 127 bytes.
      </t>

      <t>6LoWPAN defined an adaptation layer to support IPv6 over IEEE 802.15.4 networks. The adaptation layer includes a fragmentation mechanism, since IPv6 requires the layer below to support an MTU of 1280 bytes <xref target="RFC2460"/>, while IEEE 802.15.4 lacked fragmentation mechanisms. 6LoWPAN defines an IEEE 802.15.4 link MTU of 1280 bytes <xref target="RFC4944"/>. Other technologies, such as Bluetooth LE <xref target="RFC7668"/>, ITU-T G.9959 <xref target="RFC7428"/> or DECT-ULE <xref target="I-D.ietf-6lo-dect-ule"/>, do support link layer fragmentation. By exploiting this functionality, the adaptation layers to enable IPv6 over such technologies also support an MTU of 1280 bytes.  </t>

      <t>In order to avoid IP layer fragmentation, the TCP MSS MUST NOT be set to a value greater than 1220 bytes in CNNs. (Note: IP version 6 is assumed.) In any case, the TCP MSS MUST NOT be set to a value leading to an IPv6 datagram size exceeding 1280 bytes.</t>
     </section>
     <section title="Window Size">
      <t>As per this document, the TCP window size MUST have a size of one segment. This value is appropriate for simple message exchanges in the CNN space, reduces implementation complexity and memory requirements, and reduces overhead (see section 3.6).</t>
      <t>A TCP window size of one segment follows the same rationale as the default setting for NSTART in <xref target="RFC7252"/>, leading to equivalent operation when CoAP is used over TCP. </t>
     </section>

     <section title="RTO estimation">
      <t>Traditionally, TCP has used the well known RTO estimation algorithm defined in <xref target="RFC6298"/>. However, experimental studies have shown that another algorithm such as the RTO estimator defined in <xref target="I-D.bormann-core-cocoa"/> (hereinafter, CoCoA RTO) outperforms state-of-art algorithms designed as improvements to RFC 6298 for TCP, in terms of packet delivery ratio, settling time after a burst of messages, and fairness (the latter is specially relevant in multihop networks connected to the Internet through a single device, such as a 6LoWPAN Border Router (6LBR) configured as a RPL root) <xref target="Commag"/>. In fact, CoCoA RTO has been designed specifically considering the challenges of CNNs, in contrast with the RFC 6298 RTO. Therefore, as per this document, CoCoA RTO SHOULD be used in TCP over CNNs. Alternatively, implementors MAY choose the RTO estimation algorithm defined in RFC 6298. One of the two RTO algorithms MUST be implemented.</t>

     </section>

     <section title="Keep-alive and TCP connection lifetime">
      <t>In CNNs, a TCP connection SHOULD be kept open as long as the two TCP endpoints have more data to exchange or it is envisaged that further segment exchanges will take place within an interval of two hours since the last segment has been sent.  A greater interval MAY be used in scenarios where applications exchange data infrequently.</t>

      <t>TCP keep-alive messages <xref target="RFC1122"/> MAY be supported by a server, to check whether a TCP connection is active, in order to release state of inactive connections. This may be useful for servers running on memory-constrained devices. </t>

      <t>Since the keep-alive timer may not be set to a value lower than two hours [RFC1122], TCP keep-alive messages are not useful to guarantee that filter state records in middleboxes such as firewalls will not be deleted after an inactivity interval typically in the order of a few minutes <xref target="RFC6092"/>. In scenarios where such middleboxes are present, alternative measures to avoid early deletion of filter state records (which might lead to frequent establishment of new TCP connections between the two involved endpoints) include increasing the initial value for the filter state inactivity timers (if possible), and using application layer heartbeat messages. </t>

     </section>

     <section title="Explicit congestion notification">
      <t>Explicit Congestion Notification (ECN) <xref target="RFC3168"/> MAY be used in CNNs. ECN allows a router to signal in the IP header of a packet that congestion is arising, for example when queue size reaches a certain threshold. If such a packet encapsulates a TCP data packet, an ECN-enabled TCP receiver will echo back the congestion signal to the TCP sender by setting a flag in its next TCP ACK. The sender triggers congestion control measures as if a packet loss had happened. In that case, when the congestion window of a TCP sender has a size of one segment, the TCP sender resets the retransmit timer, and will only be able to send a new packet when the retransmit timer expires <xref target="RFC3168"/>. Effectively, the TCP sender reduces at that moment its sending rate from 1 segment per RTT to  1 segment per default RTO.</t>

      <t>ECN can reduce packet losses, since congestion control measures can be applied earlier than after the reception of three duplicate ACKs (if the TCP sender window is large enough, which will not happen as per section 3.2 of this document) or upon TCP sender RTO expiration <xref target="RFC2884"/>. Therefore, the number of retries decreases, which is particularly beneficial in CNNs, where energy and bandwidth resources are typically limited. Furthermore, latency and jitter are also reduced. </t>

      <t>ECN is also appropriate in CNNs, since in these environments transactional type interactions are a dominant traffic pattern. Exploiting other possible congestion signals such as the reception of three duplicate ACKs would require the use of greater TCP window sizes than the one specified in this document. </t>

     </section>

     <section title="TCP options">
      <t>Because this specification mandates a TCP window size of one segment, the following TCP options MUST NOT be supported in CNNs: Window scale <xref target="RFC1323"/>, TCP Timestamps <xref target="RFC1323"/>, and Selective Acknowledgements (SACK) <xref target="RFC2018"/>. Other TCP options SHOULD NOT be used, in keeping with the principle of lightweight operation. </t>

     </section>

     <section title="Explicit loss notifications">
      <t>There has been a significant body of research on solutions capable of explicitly indicating whether a TCP segment loss is due to corruption, in order to avoid activation of congestion control mechanisms <xref target="ETEN"/> <xref target="RFC2757"/>. While such solutions may provide significant improvement, they have not been widely deployed and remain as experimental work. In fact, as of today, the IETF has not standardized any such solution. </t>

     </section>

    </section>

     
   <section anchor="Security" title="Security Considerations">
      <t>TBD</t>
    </section>

    <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <!-- Possibly a 'Contributors' section ... -->

    
    <section anchor="ACKs" title="Acknowledgments">
      <t>Carles Gomez has been funded in part by the Spanish Government (Ministerio de Educacion, Cultura y Deporte) through the Jose Castillejo grant CAS15/00336. His contribution to this work has been carried out  during his stay as a visiting scholar at the Computer Laboratory of the University of Cambridge.</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">
      
      <?rfc include='reference.RFC.1122.xml'?>

      <?rfc include='reference.RFC.1323.xml'?>

      <?rfc include='reference.RFC.2018.xml'?>

      <?rfc include='reference.RFC.2119.xml'?>

      <?rfc include='reference.RFC.2460.xml'?>

      <?rfc include='reference.RFC.2616.xml'?>

      <?rfc include='reference.RFC.2884.xml'?>

      <?rfc include='reference.RFC.2757.xml'?>

      <?rfc include='reference.RFC.3168.xml'?>

      <?rfc include='reference.RFC.4944.xml'?>

      <?rfc include='reference.RFC.6092.xml'?>

      <?rfc include='reference.RFC.6298.xml'?>

      <?rfc include='reference.RFC.6606.xml'?>

      <?rfc include='reference.RFC.7228.xml'?>

      <?rfc include='reference.RFC.7252.xml'?>

      <?rfc include='reference.RFC.7428.xml'?>

      <?rfc include='reference.RFC.7540.xml'?>

      <?rfc include='reference.RFC.7668.xml'?>
      
    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      <?rfc include='reference.I-D.ietf-lwig-energy-efficient'?>

      <?rfc include='reference.I-D.ietf-6lo-dect-ule'?>

      <?rfc include='reference.I-D.tschofenig-core-coap-tcp-tls'?>

      <?rfc include='reference.I-D.bormann-core-cocoa'?>

      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     <reference anchor="Commag">
        <front>
            <title>CoAP Congestion Control for the Internet of Things</title>
            <author>
            <organization>A. Betzler, C. Gomez, I. Demirkol, J. Paradells</organization>
            </author>
            <date year="2016" month="IEEE Communications Magazine, June"/>
        </front>
     </reference>
     <reference anchor="ETEN">
        <front>
            <title>Explicit transport error notification (ETEN) for error-prone wireless and satellite networks</title>
            <author>
            <organization>R. Krishnan et al </organization>
            </author>
            <date year="2004" month="Computer Networks"/>
        </front>
     </reference>
    
     <reference anchor="MQTTS">
        <front>
            <title>MQTT-S: A Publish/Subscribe Protocol For
Wireless Sensor Networks</title>
            <author>
            <organization>U. Hunkeler, H.-L. Truong, A. Stanford-Clark </organization>
            </author>
            <date year="2008"/>
        </front>
     </reference>
      
    </references>

    <!-- -->
  </back>
</rfc>
