Re: Design: Ignored Unknown Frame Types and Intermediaries

Yoav Nir <ynir@checkpoint.com> Tue, 14 May 2013 09:49 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2438D21F901D for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 14 May 2013 02:49:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.078
X-Spam-Level:
X-Spam-Status: No, score=-10.078 tagged_above=-999 required=5 tests=[AWL=0.519, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q2FSmjljynoA for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 14 May 2013 02:48:58 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 44F4121F901B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 14 May 2013 02:48:57 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UcBpa-0002rK-Am for ietf-http-wg-dist@listhub.w3.org; Tue, 14 May 2013 09:47:38 +0000
Resent-Date: Tue, 14 May 2013 09:47:38 +0000
Resent-Message-Id: <E1UcBpa-0002rK-Am@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <ynir@checkpoint.com>) id 1UcBpJ-0002pT-CJ for ietf-http-wg@listhub.w3.org; Tue, 14 May 2013 09:47:21 +0000
Received: from smtp.checkpoint.com ([194.29.34.68]) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <ynir@checkpoint.com>) id 1UcBpD-0007Eu-Vv for ietf-http-wg@w3.org; Tue, 14 May 2013 09:47:21 +0000
Received: from DAG-EX10.ad.checkpoint.com ([194.29.34.150]) by smtp.checkpoint.com (8.13.8/8.13.8) with ESMTP id r4E9kLXk015990; Tue, 14 May 2013 12:46:21 +0300
X-CheckPoint: {51920609-0-1B221DC2-1FFFF}
Received: from IL-EX10.ad.checkpoint.com ([169.254.2.54]) by DAG-EX10.ad.checkpoint.com ([169.254.3.48]) with mapi id 14.02.0342.003; Tue, 14 May 2013 12:46:20 +0300
From: Yoav Nir <ynir@checkpoint.com>
To: Roberto Peon <grmocg@gmail.com>
CC: James M Snell <jasnell@gmail.com>, Martin Thomson <martin.thomson@gmail.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Thread-Topic: Design: Ignored Unknown Frame Types and Intermediaries
Thread-Index: AQHOTlx/8z1i47QzLki5Jx/qYX4EwpkAy5cAgADeoYCAAKa9AIAABPcAgADs9oCAACuRgIAAD0gAgAAHqACAAAsDgIAAr7AA
Date: Tue, 14 May 2013 09:46:19 +0000
Message-ID: <DC5B5985-D15C-47EA-90B0-5AABF540BC04@checkpoint.com>
References: <CABP7Rbfko48A0yAceDeHfQKR7S6aW7AAAqCZroaZzTScTooOvw@mail.gmail.com> <09C78900-966B-46B0-AB97-1394FD05849A@checkpoint.com> <CAP+FsNe2L2aZbDhM4OiWmh7b7f0HkrVfGwa6aKkD2ohNNKJHxg@mail.gmail.com> <2124BAB0-8FF1-4D6D-BBD8-F042B1EA5F7B@checkpoint.com> <CABP7Rbf+H=WarqFaV0UM5On-3FkYAspkC4OBzh1HE6EpQow94w@mail.gmail.com> <CAP+FsNd3260xnQG8JU3UQkkSwaVhVgwkDPPcR02W_W0q12+HFw@mail.gmail.com> <CABkgnnXJRHu_LsD+Fq9dTNi9Sqfmj0GQMBGO9QzZy6DCfxSJAQ@mail.gmail.com> <CAP+FsNdoZNOV2JxHgVHorp94QC0+KGOrYpVdi5FoZ8jAEsGd5g@mail.gmail.com> <CABP7Rbck4xCib9py+AqUHY=SgCoGz+Jw5-yLjzCFhQ_RbpLJQg@mail.gmail.com> <CAP+FsNcGYVwM3n3Vcttw-H8a3_vCrG5ysH-mTODBhFyioXcK6Q@mail.gmail.com>
In-Reply-To: <CAP+FsNcGYVwM3n3Vcttw-H8a3_vCrG5ysH-mTODBhFyioXcK6Q@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.31.20.245]
x-kse-antivirus-interceptor-info: scan successful
x-kse-antivirus-info: Clean
x-cpdlp: 11a68a584eb4a05a6c360a17d0917d1c82ea2cb7c3
Content-Type: multipart/alternative; boundary="_000_DC5B5985D15C47EA90B05AABF540BC04checkpointcom_"
MIME-Version: 1.0
Received-SPF: permerror client-ip=194.29.34.68; envelope-from=ynir@checkpoint.com; helo=smtp.checkpoint.com
X-W3C-Hub-Spam-Status: No, score=-6.3
X-W3C-Hub-Spam-Report: AWL=-0.636, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.629
X-W3C-Scan-Sig: lisa.w3.org 1UcBpD-0007Eu-Vv 92937fbaebb6fc6b99f1ce6a9e27314a
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Design: Ignored Unknown Frame Types and Intermediaries
Archived-At: <http://www.w3.org/mid/DC5B5985-D15C-47EA-90B0-5AABF540BC04@checkpoint.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17986
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Roberto

The beauty of extensions as opposed to protocol versions, is that it's easier to run several of these experiments at once.

So it's great that you can have versions "HTTP/2.1NewFlowControlModel" and "HTTP/2.1DynamicPriorities" and "HTTP/2.1NewHeadersFormat", but then the server can only choose one of these experiments. And the safest route for middleboxes to take will be to force the protocol down to the HTTP/2.0 which they understand. That may be what we want firewalls to do, but other proxies may not be affected by some of these.

But I agree that we should limit what non-version-changing extensions are allowed to do. We should require that if the extension is either ignored by the recipient or removed by a middlebox, no harm would be done (except the new functionality not working)

Yoav

On May 14, 2013, at 2:15 AM, Roberto Peon <grmocg@gmail.com<mailto:grmocg@gmail.com>> wrote:

Everything in the middle would have had its chance to do something when the initial negotiation goes through its end-to-end route.

Using DATA frames with a format that the intermediary doesn't understand (many of them do examine content) doesn't guarantee that the session will work properly either.

A RST_STREAM is insufficient if any modification to shared state has occurred. It still requires that the client or server keep state about when it should not use these unknown opcodes when speaking to an endpoint from a specific network (since the client likely roams amongst different typologies these days).

Things that wouldn't cause session-level problems, nor stream-level problems if removed:

  *   An unknown opcode which provides a more detailed hint about prioritization
  *   An unknown opcode which provides data about the state of the browser cache
  *   An unknown opcode which provides data about connection-state, number of connections, etc.
  *   An unknown opcode which points out when flow control is blocked

The above are examples of things I'm saying should be allowed in a known version of the protocol, and which are fine to remove/ignore if not understood.


The section below contains examples of things which shouldn't be allowed in a known version of the protocol, but should be fine in some variant of it if all parties agree to it.
Things that would obviously cause session-level problems if removed:

  *   An unknown opcode which touches on flow control
  *   An unknown opcode which modifies compression state
  *   An unknown opcode which reserves/assigns/changes stream IDs
  *   An unknown opcode which closes multiple streams.

These I'm not sure about either way. I've already had the displeasure of dealing with things that cause stream-level problems, and I'm not excited about the prospect of having to figure this out (second hand, as it usually happens as some tiny segment of the populace is having problems and the percentage of them who actually *tell* you about it small, and then those who are willing to help you debug it is even smaller...).

Things that wouldn't cause session-level problems, but would cause stream-level problems if removed:

  *   An unknown opcode which indicates that byte ranges come out of order (and which specifies that order)
  *   An unknown opcode which indicates that the encoding type has changed.
  *   An unknown opcode which indicates that the rest of the payload is being sent uncompressed or compressed (when it was the opposite before).

As I've said before, I believe that this should be a living protocol, and not ossified. That does imply that both experimentation needs to be accommodated and that successful experimentation becomes interoperable.

ALPN and NPN work/worked because their addition to TLS caused no failure when ignored or not understood. Now that we have ALPN and NPN, and now that using a new version is so amazingly easy in comparison to what it was before, it makes sense to use that fact to reduce complexity instead of falling into the same trap that HTTP fell into w.r.t. extensions and unused features. I believe that this will allow for more experimentation, more quickly, and much faster standardized interop than will extensions that require significant work and complexity to deal with failure scenarios.


-=R


On Mon, May 13, 2013 at 3:35 PM, James M Snell <jasnell@gmail.com<mailto:jasnell@gmail.com>> wrote:
On Mon, May 13, 2013 at 3:08 PM, Roberto Peon <grmocg@gmail.com<mailto:grmocg@gmail.com>> wrote:
> I believe that, if one does remove/ignore such frames the session may not be
> as optimal as it might otherwise be, but the rule, by definition, precludes
> the use of anything which would hinder interop if emitted, but then ignored
> by the receiver.
> The rule is that one MUST NOT send a frame if its removal would cause
> session corruption/termination/problems.
> So, can you provide an example? :)
>

The challenge with this is that the sender may know what it and the
origin server supports, it will generally have absolutely no clue what
everything in the middle supports... this means the default position
would be: don't ever send anything other than the core frame types,
which kills the whole point of allowing extensibility in the first
place (and yes, I know your position on extensibility ;-) ...).

In the worse case, what you'll end up with are implementations that
use DATA frames to tunnel (hack) their extension stuff through..
(because they know those will make it thru). We see that anti-pattern
repeated time and time again with things like X-Post-Method-Override,
DNS TXT records, SOA POST tunneling, Deletes-using-GET or POST
methods, etc. I'd rather not encourage similar abuse here.

>
> I think the version string is the most robust way to ensure that an
> intermediary does the right thing-- If an intermediary sees a version string
> it doesn't recognize, it simply doesn't allow the negotiation of that
> variant.

Imo, Having a rule that says either forward everything or forward
nothing achieves the same result, without the need for any additional
"negotiation".

> This is more simple because the lack of an explicit negotiation for this
> will lead to either:
> 1) implementations which ignore the spec, since their mission is to provide
> security and consistency
> 2) Clients, servers, and proxies all maintaining a heuristic and
> table/history about when and why sessions were terminated when a not
> standardized opcode was
>  I don't want to have to have maintain a table of endpoints which have sent
> me some error-code or terminated my session because I included an unknown
> opcode type (that would be pretty complicated). This would have to be done
> for both sides, for that matter.
>

Such a table would not be necessary. If my user agent sends a
particular extension frame and a middlebox responds with a
RST_STREAM('UNSUPPORTED_FRAME') then I just move on and either try
something else or give up. Otherwise, if the middlebox forwards those
frames on, things just work. There's no reason to terminate the
session, just cancel the stream within the session. There's also no
reason to keep any kind of table for what frame types work or don't...
you either use it and it doesn't work, or you use it and it does.

- James

> I'd prefer to say that an intermediary MUST NOT touch things in the session
> which it does not recognize if it doesn't know the version, but allowed the
> version to be negotiated, and it MAY remove things it doesn't know from a
> session when the version is one which is fully specified.
>
> That allows the intermediary to simply not negotiate things it doesn't like
> on a per-connection basis, instead of having to have this complex cache of
> 'this feature doesn't work when X,Y,Z'.
>
> James has pointed out that a reverse proxy may still have some difficulties
> with this, assuming it wishes to support an unknown extention, but, I think
> that trade (no longer requiring clients and servers to have to worry about
> this, while having the proxy continue to worry about it) is reasonable.
>
> -=R
>
>
>
> On Mon, May 13, 2013 at 2:13 PM, Martin Thomson <martin.thomson@gmail.com<mailto:martin.thomson@gmail.com>>
> wrote:
>>
>> On 13 May 2013 11:37, Roberto Peon <grmocg@gmail.com<mailto:grmocg@gmail.com>> wrote:
>> > James:
>> > Can you construct a case where, if you follow the rule spelled out in my
>> > earlier email, you fail to achieve interop (because I can't)?
>>
>> It's trivially possible to construct a scenario where this happens,
>> but only if you don't write down a "MUST ignore" rule.  Once the rule
>> is in place, then you are constraining future extensibility.  A "MUST
>> ignore" rule is the easiest rule to get right, but there are other
>> models you can use.
>>
>> > The rule is, essentially:
>> > If a party to the communication ignores (or removes) something it don't
>> > understand, that must not screw up the session.
>>
>> The ignore/remove distinction is very important.  You can't
>> selectively remove; it's all or nothing.  Either remove everything you
>> don't know about or leave it all in.
>>
>> This consideration, along with James' hop-by-hop question does suggest
>> a relatively simple way out:
>>
>> All unsupported/unknown frames that have a non-zero stream identifier
>> MUST be ignored.  If a stream is forwarded by an intermediary, all
>> unsupported/unknown frames MUST either be forwarded or removed; an
>> intermediary MUST NOT selectively forward unsupported frame types.
>> Unsupported/unknown frames with a zero stream identifier MUST be
>> ignored and MUST NOT be forwarded.
>>
>> > That implies that, when you add anything that must be interpreted, it
>> > then
>> > must be declared in the version string (i.e. new version) and thus
>> > agreed
>> > upon by both parties up front, and if you don't negotiate that other
>> > version, you don't get to add frames whose removal would screw up the
>> > session.
>>
>> Yeah, we addressed that early on.  If you want to guarantee that the
>> other guy is going to support something, either work out how to agree
>> in-session (with those ignored frames) or negotiate a new protocol.
>
>



Email secured by Check Point