<?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">
]>
<?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 category="info" docName="draft-dolson-plus-middlebox-benefits-00" ipr="trust200902">
 <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    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="Middlebox Benefits">Benefits of Middleboxes to the Internet</title>

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

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

    <author fullname="David Dolson" initials="D." surname="Dolson">
      <organization>Sandvine</organization>
      <address>
        <postal>
          <street>408 Albert Street</street>
          <!-- Reorder these if your country does things differently -->
          <city>Waterloo</city>
          <region>ON</region>
          <code>N2L 3V3</code>
          <country>Canada</country>
        </postal>
        <phone>+1 519 880 2400</phone>
        <email>ddolson@sandvine.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Juho Snellman" initials="J." surname="Snellman">
      <organization>Sandvine</organization>
      <address>
        <postal>
          <street>Seestrasse 5</street>
          <!-- Reorder these if your country does things differently -->
          <code>8002</code>
          <city>Zurich</city>
          <country>Switzerland</country>
        </postal>
        <email>jsnellman@sandvine.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date year="2017" />

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

   <workgroup>Internet Engineering Task Force</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>plus</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>At IETF97, at a meeting regarding the Path Layer UDP Substrate (PLUS) protocol,
        a request was made for documentation about the benefits
        that might be provided by permitting middleboxes to have some
        visibility to transport-layer information.</t>
     <t>This document summarizes benefits provided to the Internet by
        middleboxes -- intermediary devices that provide functions
        apart from normal IP routing between a source and destination host
        <xref target="RFC3234"/>.</t>
     <t>RFC3234 defines a taxonomy of middleboxes and issues in the 
        internet circa 2002. Most of those middleboxes utilized or modified
        application-layer data.
        This document will focus primarily on devices that observe
        and act on information found in the transport layer, most
        commonly TCP at this time.</t>
     <t>A primary goal of this document is to provide information
        to working groups developing new transport protocols, in
        particular the PLUS and QUIC working groups, to aid understanding of
        what might be gained or lost by design decisions.</t>
   </abstract>
 </front>

 <middle>
   <section title="Introduction">
     <t>From <xref target="RFC3234">RFC3234</xref>, "A middlebox is
        defined as any intermediary device performing functions other than
        the normal, standard functions of an IP router on the datagram path
        between a source host and destination host."</t>
     <t>Middleboxes are usually (but not exclusively) deployed at locations
        permitting observation of bidirectional traffic flows.
        This is typically at the point a stub network connects to the internet:
        <list style="symbols">
          <t>Where a residential or business customer connects to the service provider.</t>
          <t>Where a mobile home gateway connects to the internet.</t>
        </list>
      </t>
     <t>The QUIC working group and PLUS BoF are debating the
        appropriate amount of information that end-points should
        expose to on-path network middleboxes and human operators.
        This document itemizes a variety of features provided by middleboxes
        and by ad hoc analysis performed by operators using packet analyzers.</t>
     <t>Many of the techniques described in this document require stateful
        analysis of transport streams.  A generic state machine is
        described in <xref target="I-D.trammell-plus-statefulness"/>.</t>
     <t>Although many middleboxes observe and manipulate application-layer content
        they are out of scope for this document, the aim being to describe
        benefits of transport-layer features. Application-layer
        content should be encrypted and/or authenticated, whereas we hope
        to provide motivation to make transport connections managable from the network.</t>

     <section title="Requirements Language">
<!-- TODO: remove this section? -->
       <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>
   </section>

   <section anchor="section_measurements" title="Measurements">
     <t>A number of measurements can be made by network devices that are
        either in-line with the traffic (responsible for forwarding) or
        receiving off-line copy of traffic from a tap or file capture.
        These measurements can be used either in automated systems, or
        for manual network troubleshooting (e.g.,
        using packet analysis tools such as Wireshark). The automated
        devices can further be classified as monitoring devices that compute
        these metrics for large amounts of connections and generate
        aggregated reports from them, and active devices that make
        decisions on how to handle specific packets based on these
        metrics.</t>
     <t>Long-term trends in these measurements can aid an operator
        in capacity planning. Short-term anomalies in these measurements
        can identify network breakages, attacks in progress or
        misbehaving devices/applications.</t>
     <section title="Packet Loss">
       <t>Network problems and under-provisioning can be detected if
          packet loss is measurable. TCP packet loss can be detected
          by observing gaps in sequence numbers, retransmitted sequence
          numbers, and SACK options. Packet loss can be detected per
          direction.</t>
       <t>Gaps indicate loss upstream of the tap point; retransmissions
          indicate loss downstream of the tap. Selective acknowledgements (SACKs) can be used to
          detect either form of packet loss (although some care needs to
          be taken to avoid mis-identifying packet reordering as packet
          loss), and to distinguish between upstream vs. downstream losses.
       </t>
       <t>Packet loss measurements on both sides of the measurement point
       are an important component in precisely diagnosing insufficiently
       dimensioned devices or links in networks. Additionally since
       packet losses are one of the two main ways for congestion to manifest,
       packet loss is an important measurement for any middlebox that needs to make
       traffic handling decisions based on observed levels of congestion.</t>
     </section>
     <section title="Round Trip Times">
       <t>A TCP packet stream can be used to measure the round-trip time
       on each side of the measurement point. During the connection
       handshake, the SYN, SYNACK, and ACK timings can be used to establish
       a baseline RTT in each direction. Once the connection is established,
       the RTT between the server and the measurement point can only reliably
       be determined using TCP timestamps. On the side between the measurement
       point and the client, the exact timing of data segments and ACKs can
       be used as an alternative. For this latter method to be accurate when
       packet loss is present, the connection must use selective
       acknowledgements.
       </t>
       <t>In many kinds of networks, congestion will show up as queueing,
          and congestion-induced packet loss will only happen in
          extreme cases. RTTs will also show up as a much smoother signal
          than the discrete packet loss events. This makes RTTs a good
          way to identify individual subscribers for whom the network is
          a bottleneck at a given time, or geographical sites (such as
          cellular towers) that are experiencing large scale congestion.
       </t>
       <t>The main limit of RTT measurement as a congestion signal is the
       difficulty of reliably distinguishing between the data segments
       being queued vs. the ACKs being queued.</t>
     </section>
     <section title="Measuring Packet Reordering">
       <t>If a network is reordering packets of transport connections,
          caused perhaps by ECMP misconfiguration (e.g., described in
          <xref target="RFC2991"/> and <xref target="RFC7690"/>)
          the end-points may react as though packet loss is occurring and
          retransmit packets or reduce forwarding rates.
          It is therefore beneficial to be able to diagnose packet
          reordering from within a network.</t>
       <t>For TCP, packet reordering can be detected by observing
          TCP sequence numbers per direction. See, for example
          a number of standard packet reordering metrics in <xref target="RFC4737"/>
          and informational metrics in <xref target="RFC5236"/>.</t>
     </section>
     <section title="Throughput and Bottleneck Identification">
       <t>Although throughput to or from an IP address can be measured without
          transport-layer measurements, the transport layer provides clues
          about what the end-points were attempting to do.</t>
        <t>One way of quickly excluding the network as the bottleneck
          during troubleshooting is to check whether the speed is limited by
          the endpoints. For example the connection speed might instead
          be limited by suboptimal TCP options, the sender's congestion
          window, the sender temporarily running out of data to send,
          the sender waiting for the receiver to send another request,
          or the receiver closing the receive window.
        </t>
        <t>
          This data is also useful for middleboxes used to measure network
          quality of service. Connections, or portions of connections,
          that are limited by the endpoints do not provide an accurate
          measure of network's speed, and can be discounted or completely
          excluded in such analyses.
        </t>
     </section>
     <section title="DDoS Detection" anchor="section_ddos_detection">
       <t>When an application or network resource is under attack, it
          is useful to identify this situation from the network perspective,
          upstream of the attacked resource.</t>
       <t>Although detection methods tend to be proprietary,
          DDoS attack detection is fundamentally one of:
          <list style="symbols">
            <t>detecting protocol violations by tracking the
               transport-layer state machine or application-layer messaging; or</t>
            <t>anomaly detection by noticing atypical traffic patterns taken from measurements.</t>
          </list></t>
       <t>Two trends in protocol design will make DDoS detection more difficult:
          <list style="symbols">
            <t>the desire to encrypt transport-layer communication and sequence numbers;</t>
            <t>the desire to avoid statistical fingerprinting by adding entropy in various forms.</t>
          </list></t>
       <t>Those desires assist in the worthy goal of improved privacy,
          but also serve to defeat DDoS detection.</t>
     </section>
     <section title="Packet Corruption">
       <t>One notable source of packet loss is packet corruption. This
       corruption will generally not be detected until the checksums
       are validated by the endpoint, and the packet is dropped. This
       means that detecting the exact location where packets are lost
       is not sufficient when troubleshooting networks. It should also
       be possible to find out where packets are being corrupted. IP and
       TCP checksum verification allows a measurement device to correctly
       distinguish between upstream packet corruption and normal
       downstream packet loss.</t>
       <t>QUIC and PLUS designers should consider whether a middlebox
          will be able to detect corrupted or tampered packets.</t>
     </section>
     <section title="Application-Layer Measurements">
       <t>Network health may also be gleaned from application-layer diagnosis. E.g.,
        <list style="symbols">
         <t>DNS response times and retransmissions by correlating answers to queries.</t>
         <t>Various protocol-aware voice and video quality analysis.</t>
        </list>
        Could this type of information be provided in a transport layer?</t>
     </section>
   </section>

   <section title="Actions">
     <t>This section describes features provided by in-line devices
        that modify, discard, delay, or prioritize traffic.</t>
     <section title="NAT">
       <t>Network Address Translators (NATs) allow multiple devices to share a public
          address by dividing the transport-layer port space among the devices.</t>
       <t>NAT behavior recommendations are found for UDP in BCP 127 
          <xref target="RFC4787"/> and for TCP in BCP 142 <xref target="RFC7857"/>.</t>
     </section>
     <section title="Firewall">
       <t>Firewalls are a pervasive and essential component of
          making a network secure.  Arguably many users within
          various types of organizations would not have been
          granted internet access if not for firewalls.</t>
       <t>An important aspect of firewall policy is differentiating
          internally-initiated from externally-initiated communications.
          <list>
            <t>For TCP, this is easily done by tracking the TCP state
               machine. Furthermore, the ending of a TCP connection
               is indicated by RST or FIN flags.</t>
            <t>For UDP, the firewall
               can be opened if the first packet comes from an internal
               user, but the closing is generally done by an idle timer
               of arbitrary duration, which might not match the
               expectations of the application.</t>
          </list> </t>
       <t>A firewall functions better when it can observe the
          protocol state machine, described generally by
          <xref target="I-D.trammell-plus-statefulness">
          Transport-Independent Path Layer State Management</xref>.
          </t>
     </section>
     <section title="DDoS Scrubbing">
       <t>In the context of a distributed denial-of-service (DDoS) attack,
          the purpose of a scrubber is to discard attack traffic while
          permitting useful traffic.</t>
       <t>When attacks occur against constrained resources, there is
          obviously a huge benefit in being able to scrub well.</t>
       <t>Futhermore, this is solely a task for an on-path network device because
          neither end-point of a legitimate connection has any control over
          the source of the attack traffic.</t>
       <t>Source-spoofed DDoS attacks can be mitigated at the source using
          BCP 38 (<xref target="RFC2827"/>),
          but it is more difficult if source address filtering cannot be applied.</t>
       <t>In contrast to devices in the core of the Internet,
          middleboxes statefully observing bidirectional transport connections
          can reject source-spoofed TCP traffic based on inability to provide sensible
          acknowledgement numbers to complete the three-way handshake.
          Obviously this requires middlebox visibility into transport-layer
          state machine.</t>
       <t>Middleboxes may also scrub on the basis of statistical classification:
          testing how likely a given packet is legitimate. As protocol
          designers add more entropy to headers and lengths, this test
          becomes less useful and the best scrubbing strategy becomes random drop. </t>
     </section>
     <section title="Performance-Enhancing Proxies">
       <t>Performance-Enhancing Proxies (PEPs) can improve network performance by
          improving packet spacing or generating local acknowledgements,
          and are most commonly used in satellite and cellular networks.
          Transport-Layer PEPs are described in section 2.1.1 of
          <xref target="RFC3135"/>.</t>
       <t>PEPs allow central deployment of congestion control
          algorithms more suited to the specific network, most commonly
          use of delay-based congestion control. More advanced TCP PEPs
          deploy congestion control systems that treat all of a single
          subscriber's TCP connections as a single unit, improving
          fairness and allowing faster reaction to changing network
          conditions.</t>
       <t>Local acknowledgements generated by PEPs speed up TCP slow start
          by splitting the effective latency, and allow for retransmissions
          to be done from the PEP rather than from the actual sender, saving
          downlink bandwidth on retransmissions. Local acknowledgements
          will also allow a PEP to maintain a local buffer of data
          appropriate to the actual network conditions, whereas the actual
          endpoints would often send too much or too little.</t>
     </section>
     <section title="Bandwidth Aggregation">
       <t>The Hybrid Access Aggregation Point (HAAP) is a middlebox that allows
          customers to aggregate the bandwidth of multiple access technologies
          <xref target="I-D.zhang-banana-problem-statement"/>.</t>
       <t>One of the approaches uses MPTCP proxies to divide the traffic along
          multiple paths. The MPTCP proxy operates at the transport layer while
          being located in the operator's network.</t>
     </section>
     <section title="Prioritization">
       <t>Bulk traffic may be served with a higher latency than interactive traffic
          with no reduction in throughput. This fact allows a middlebox function
          that improves response time in interactive applications by prioritizing
          interactive transport connections over bulk traffic transport connections.
          E.g., gaming traffic may be prioritized above email or software updates.
          </t>
     </section>
     <section title="Measurement-Based Shaping">
       <t>Basic traffic shaping functionality requires no
       transport-layer information. All that is needed is a way of
       mapping each packet to a traffic shaper quota. For example,
       there may be a rate limit per 5-tuple or per subscriber IP address. However,
       such fixed traffic shaping rules are wasteful as they end up
       rate limiting traffic even when the network has free resources
       available.</t>

       <t>More advanced traffic shaping devices use transport layer
       metrics described in <xref target="section_measurements"/> to
       detect congestion on either a per-site or per-user level, and
       use different traffic shaping rules when congestion is
       detected. This type of device can overcome limitations
       of down-stream devices that behave poorly (e.g., by excessive
       buffering or sub-optimzally dropping packets).</t>
     </section>
   </section>

<!-- No acknowledgements yet
   <section anchor="Acknowledgements" title="Acknowledgements">
     <t>TODO: acknowledge someone.</t>
   </section>
-->

   <!-- Possibly a 'Contributors' section ... -->

   <section anchor="IANA" title="IANA Considerations">
     <t>This memo includes no request to IANA.</t>

   </section>

   <section anchor="Security" title="Security Considerations">
     <!--All drafts are required to have a security considerations section.  See RFC3552 -->
     <section title="Confidentiality">
       <t>This document intentionally excludes middleboxes that observe or manipulate
          application-layer data.</t>
       <t>The benefits described in this document can all be implemented without
          violating confidentiality. However, there is always the question of
          whether the fields and packet properties used to achieve these 
          benefits may also be used for harm.</t>
       <t>In particular, we want to ask what confidentiality is lost by
          exposing transport-layer fields beyond what can be learned by
          observing IP-layer fields.</t>
       <t>Sequence numbers: an observer can learn how much data is transferred.</t>
       <t>Start/Stop indicators: an observer can count transactions for some applications.</t>
       <t>Device fingerprinting: an observer may be more easily able to identify a device
          type when different devices use different default field values or options.</t>
     </section>
     <section title="Active Attacks">
       <t>Being able to observe sequence numbers or session identifiers may make
          it easier to modify or terminate a transport connection. E.g., observing
          TCP sequence numbers allows generation of a RST packet that terminates
          the connection. However, signing transport fields mitigates this attack.
          The attack and solution are described for the TCP authentication option <xref target="RFC5925"/>.</t>
     </section>
     <section title="More Information Can Improve Security">
        <t>Proposition: network maintainability and security can be improved by
           providing firewalls and DDoS mechanisms with some
           information about transport connections.
           In contrast, it would be very difficult to secure a network
           in which every packet appears unique and filled
           with random bits.</t>
        <t>For denial-of-service (DoS) attacks on bandwidth, the receiving end-point
           is usually on the wrong side of the constrained network link.
           This fact makes it seem reasonable to give some clues to allow
           a middlebox device to help out before the constrained link.</t>
        <t>E.g., in a blind attack, an attacker cannot receive data from the target
           of the attack (section 4.6.3.2 of <xref target="RFC3552"/>). In the case
           of TCP, the blind attacker cannot complete the three-way handshake.</t>
        <t>In the balance, some features providing the ability to mitigate/filter attacks and fix broken networks
           will improve security vs. the scenario when all packets are completely opaque.</t>
     </section>
   </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="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     &RFC2119;
     <?rfc include="reference.RFC.4787.xml"?>
     <?rfc include="reference.RFC.7857.xml"?>
     <?rfc include="reference.RFC.4737.xml"?>
     <?rfc include="reference.RFC.2827.xml"?>
     <?rfc include="reference.RFC.3552.xml"?>
     <?rfc include="reference.RFC.5925.xml"?>

   </references>
   <references title="Informative References">
     <?rfc include="reference.I-D.trammell-plus-statefulness.xml"?>
     <?rfc include="reference.I-D.zhang-banana-problem-statement.xml"?>
     <?rfc include="reference.RFC.2991.xml"?>
     <?rfc include="reference.RFC.3234.xml"?>
     <?rfc include="reference.RFC.5236.xml"?>
     <?rfc include="reference.RFC.7690.xml"?>
     <?rfc include="reference.RFC.3135.xml"?>
   </references>

<!--
   <section anchor="app-additional" title="Additional Stuff">
     <t>This becomes an Appendix.</t>
   </section>
-->
 </back>
</rfc>
