Design Issue: Frame Processing Model

James M Snell <> Thu, 25 April 2013 22:31 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 79CEA21F8FA4 for <>; Thu, 25 Apr 2013 15:31:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -8
X-Spam-Status: No, score=-8 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_HI=-8]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id CLDbGYzDK1ku for <>; Thu, 25 Apr 2013 15:31:02 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id E71E721F8F33 for <>; Thu, 25 Apr 2013 15:31:01 -0700 (PDT)
Received: from lists by with local (Exim 4.72) (envelope-from <>) id 1UVUfa-00070E-GB for; Thu, 25 Apr 2013 22:29:38 +0000
Resent-Date: Thu, 25 Apr 2013 22:29:38 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtp (Exim 4.72) (envelope-from <>) id 1UVUfQ-0006xT-B8 for; Thu, 25 Apr 2013 22:29:28 +0000
Received: from ([]) by with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <>) id 1UVUfP-0006jJ-Nl for; Thu, 25 Apr 2013 22:29:28 +0000
Received: by with SMTP id o17so3429535oag.32 for <>; Thu, 25 Apr 2013 15:29:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=PXmpZ7mTett6P64vj+WGIRmMb061DkZ8/LO5+qxL+gU=; b=VP3XvECf5NR2Nm+lE5UCuh516PjvHYIxnZoASqPSnJaKW8w/TzBLjwD1PJufCR+CxD bi9bFbjgwchFXhnpwhTxnZCRo2hRiyb9EIdl/GItnDmqs8UIymuuYzfZDAtO+otDFW/f X1Djtz/hiX4cHQsi0TgtpDHm9/D5p77QTbhQPnuIYSWoRY9HxcUFOf5kodDmABRrvZ5w dn6ozfjewb6pJaOsoLPmj2r3xfRZxsx6bzfB8g81ZAGkDimCu4a8kMmcADy9EN5f2kyN 8t0fIDPs7qxkTzWDPo0ynlZz7WUYN41FiiiKgjc7MUzEdypVmHrO0KsTMclVqrCBZCH0 3LIw==
X-Received: by with SMTP id ku5mr5150009obc.22.1366928941744; Thu, 25 Apr 2013 15:29:01 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Thu, 25 Apr 2013 15:28:41 -0700 (PDT)
From: James M Snell <>
Date: Thu, 25 Apr 2013 15:28:41 -0700
Message-ID: <>
To: "" <>
Content-Type: text/plain; charset=UTF-8
Received-SPF: pass client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-3.4
X-W3C-Hub-Spam-Report: AWL=-2.637, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: 1UVUfP-0006jJ-Nl 31e8a0702427aa86143ba1aff925bcdf
Subject: Design Issue: Frame Processing Model
Archived-At: <>
X-Mailing-List: <> archive/latest/17577
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

At the (very real) risk of adding a bit too much formalism to the
Frame processing model, I have noticed a number of areas in the
current -02 draft where references are made to an endpoint being
required to receive and accept frames but being permitted to ignore
them if necessary, etc. There is also a concern over where exactly in
the processing model steps such as header compression state management
ought to occur, whether or not that occurs before sending RST_STREAM
and GOAWAY frames, etc.

In thinking it over, I think it would be very beneficial in the long
term for us to define specific processing levels or tiers for Frames.
Below is a strawman example:

Tier 1: "Session Tier"
  A frame received and parsed. This is where basic validation of the
frame syntax occurs and where state management based on frame
structure (e.g. compressed headers) happens. Any processing errors
that occur here are considered to be Session Errors and will typically
be related to incorrect protocol support, malformed frames, malformed
headers, etc. At this tier, frames are examined individually and not
yet processed as being part of a stream.

Tier 2: "Stream Tier"
  The next tier is to process the frame in context of a stream. This
is where we look at things like whether the frame has a valid known
stream identifier, whether the associated stream is open, half-closed,
closed or whatever. The errors that occur here can be Session or
Stream errors.

Tier 3: "Application Tier"
  The Frame data is passed on for application-level handling. All of
the basic parsing and stream validation has occurred already. This is
where we start applying HTTP specific semantics. The errors that occur
here are typically HTTP level errors with associated HTTP status

Given these tiers, we can then begin speaking in very concrete terms
about what kinds of processing may be required at different points in
the session lifecycle.

For instance:
 - Protocol upgrade negotiation, SETTINGS frames, GOAWAY and flow
control are all handled in Tier 1. None of that ever passes on to
higher tiers.
 - When we say things like, "an endpoint MUST be continue to accept
frames after a RST_STREAM", we're really saying that Tier 1 processing
must still occur, but that frames may not have to be passed on to Tier
 - When we deal with HTTP specific semantics, we assume that all of
the Tier 1 and Tier 2 processing has been dealt with

I believe these layers already informally exist in the model we have,
even if it's not entirely obvious in the current design.

- James