<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="info" docName="draft-bittau-tcpinc-bcp-00">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc private=""?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<front>
<title abbrev="tcpinc-api">Best current practices for TCP-ENO configuration</title>

<author initials="A." surname="Bittau" fullname="Andrea Bittau">
<organization>Stanford University</organization>
<address>
<postal>
<street>353 Serra Mall, Room 288</street>
<city>Stanford, CA</city>
<code>94305</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>bittau@cs.stanford.edu</email>
<uri></uri>
</address>
</author>
<author initials="D." surname="Giffin" fullname="Daniel B. Giffin">
<organization>Stanford University</organization>
<address>
<postal>
<street>353 Serra Mall, Room 288</street>
<city>Stanford, CA</city>
<code>94305</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>dbg@scs.stanford.edu</email>
<uri></uri>
</address>
</author>
<author initials="D." surname="Mazieres" fullname="David Mazieres">
<organization>Stanford University</organization>
<address>
<postal>
<street>353 Serra Mall, Room 290</street>
<city>Stanford, CA</city>
<code>94305</code>
<country>US</country>
<region></region>
</postal>
<phone></phone>
<email>dm@uun.org</email>
<uri></uri>
</address>
</author>
<date year="2016" month="March" day="2"/>

<area>Internet</area>
<workgroup></workgroup>
<keyword>tcp</keyword>
<keyword>encryption</keyword>


<abstract>
<t>TCP-ENO negotiates encryption of TCP connections, protecting legacy
applications and protocols from passive eavesdropping.  TCP-ENO
generally falls back to unencrypted TCP when not supported by both
endpoints or the network.  Nonetheless, certain middlebox behavior
could cause TCP connections to fail entirely in conjunction with
TCP-ENO.  This document specifies conventions for servers against
which TCP-ENO machines can test network paths for TCP-ENO
compatibility, and describes the best current practice for enabling
TCP-ENO only when it is unlikely to cause connection failure.
</t>
</abstract>

</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>The TCP Encryption Negotiation Option (TCP-ENO)
<xref target="I-D.ietf-tcpinc-tcpeno"/> permits hosts to negotiate encryption of a
TCP connection.  TCP-ENO is designed to fail by reverting to
unencrypted TCP.  Such behavior is necessary for incremental
deployment, and is no worse than the status quo in which there is no
TCP-layer encryption.  However, one outcome worse than the status quo
would be for TCP-ENO connections to fail completely where unencrypted
connections would work.  Fortunately, if TCP-ENO is not supported by
both endpoints, or if middleboxes strip the ENO option from packets,
then implementations simply revert to unencrypted TCP upon receiving a
SYN or initial ACK segment without an ENO option.  This fallback
approach also applies to interception proxies <xref target="RFC3040"/>, which
typically terminate TCP connections and hence will not include ENO in
their SYN segments if they do not know about it.
</t>
<t>However, given that the goal of TCP-ENO is to encrypt previously
plaintext traffic, there is always the possibility that a middlebox
performing deep packet inspection could shut down connections when the
ciphertext does not resemble an expected higher-level application
protocol such as HTTP.  Such middleboxes would cause TCP-ENO
connections to fail.  This document describes a technique for probing
the network so as to enable TCP-ENO only in places where middleboxes
do not induce such failures.  TCP-ENO configuration
<xref target="I-D.bittau-tcpinc-api"/> can then be used to avoid such failures.
</t>
</section>

<section anchor="tcpeno-probing-protocol" title="TCP-ENO probing protocol">
<t>Hosts can determine whether or not a network path breaks TCP-ENO with
the help of an external server.  A precedent for probing middlebox
behavior is the STUN protocol <xref target="RFC5389"/>, which applications use to
characterize NAT.  STUN relies on having a known, publicly-accessible
server beyond any locally administered middleboxes.
</t>
<t>Like STUN, TCP-ENO probing requires a known external server running an
agreed upon protocol.  This should be done using HTTP as the protocol,
and responding to the path <spanx style="verb">/tcp-eno/session-id</spanx> with a response of
type <spanx style="verb">text/plain</spanx>.  Upon successful TCP-ENO negotiation, servers
should reply with the string &quot;encrypted &quot; followed by a lower-case
hexadecimal encoding of the tcpcrypt session ID followed by a newline.
For connections on which TCP-ENO fails, the same path should return
the string &quot;unencrypted\n&quot; (with no session ID).
</t>
</section>

<section anchor="configuration" title="Configuration">
<t>STUN is typically invoked by applications that require peer-to-peer
communication to decide whether they can accept incoming connections.
For TCP-ENO, which affects all TCP connections, it makes more sense to
probe for network compatibility at the time network interfaces are
configured by DHCP <xref target="RFC2131"/>, stateless address autoconfiguration
<xref target="RFC4862"/>, or other mechanisms.  Many DHCP implementation already
provide hooks through which such probes can be configured.
</t>
<t>Upon interface configuration, a host should probe a known external
server to request <spanx style="verb">/tcp-enno/session-id</spanx>.  If the request works with
TCP-ENO disabled but hangs or resets with TCP-ENO enabled, then
TCP-ENO should be disabled for the host.  Otherwise, if the probe
succeeds, then even if it returns &quot;unencrypted&quot;, TCP-ENO should be
enabled (for the possible benefit of local connections), as
middleboxes may simply be stripping off the option.
</t>
<t>Hosts should perform the above probe twice, using both port 80 and a
different port, we suggest 8080, on the same server.  Given the
prevalence of interception proxies on port 80, port 80 may experience
entirely different failure modes from other ports.  If the port 80
probe fails, TCP-ENO should be disabled for port 80.  If the other
probe fails, TCP-ENO should be disabled entirely.
</t>
</section>

<section anchor="security-considerations" title="Security considerations">
<t>The proposed mechanism allows an attacker to convince hosts to disable
TCP-ENO, which makes subsequent eavesdropping easier.  However, this
is but one of several ways attackers have to downgrade TCP-ENO
connections.  Until TCP-level encryption has been more widely deployed
and applications authenticate the session ID, TCP-ENO's protection
will primarily be against passive eavesdroppers anyway.
</t>
<t>Servers providing ENO path testing will have knowledge of where
machines are using TCP-ENO, which has potential privacy implications.
</t>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.bittau-tcpinc-api.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tcpinc-tcpeno.xml"?>
</references>
<references title="Informative References">
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2131.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3040.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4862.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5389.xml"?>
</references>

</back>
</rfc>
