HTTP/1.2 Protocol Extension Protocol

edited by Rohit Khare


  1. Introduction

  2. Requirements

  3. Semantics

    1. Filtering

    2. Negotiation

  4. Syntax

    1. Methods

    2. Protocol:

    3. Accept-Protocol:

    4. Error Codes

  5. Implementation

    1. Disposition Rules

    2. Negotiation Process

    3. Evaluation Process

    4. Applications

  6. Glossary

  7. Sources & Acknowledgements

Preface: this is, even now, a very early document. I expect substantial editing of form and examples. So far, the document is only sufficient for explaining and debating the principles behind the PEP spec.


Abstract This document defines a framework for extending the HTTP server by defining a mechanisms for HTTP agents to specify the protocols a particular HTTP message has been prepared in accordance with, and for HTTP agents to declare facilities available and requests for protocol compliance. This framework does require compliant agents to process extensions, and so applies only to HTTP versions 1.2 and above. (taken from RFC 1651)


Introduction

This specification lays out a plan for extending HTTP to support new web-based messaging protocols. With a clear extension mechanism in place, HTTP will be able to support new kinds of content processing and richer negotiation. In a nutshell:

The Protocol: header indicates that an HTTP agent is acting in accordance with the named protocol in constructing the message, and the receiver (according to the strength and scope of the header), is bound to follow the same protocol, or abort.

This extension system envisions a correspondingly modular software architecture, where specific features (such as synchronous tunneling or digital-signature verification) are implemented by features in the HTTP agent that are invoked directly from the parameters passed within a message compliant with a given protocol.

This system has been motivated by the need to support a multitude of proposed HTTP features in a systematic fashion. The current practice is for a new feature to use a corresponding new header in the HTTP message (as with ``keep-alive'' and Connection:). With the Protocol Extension Protocol, HTTP agents will be able to reuse a standard facility for negotiating which features are available and for encoding the parameters and scope of any protocols that are employed.

Requirements

Scenario planning indicated the following requirements:

A "legally binding" upgrade to the HTTP specification (HTTP/1.2) will ensure that "required" and "refused" mechanisms are obeyed by all parties.

Semantics

There are several key definitions we will be using to specify the semantics: protocol-type, protocol-spec, negotiable-block, scope, and strength [See Glossary].

Filtering

To completely specify how a protocol has been employed in a given message, we need to specify:

We will separate the specification of an instance of an applied protocol-type from the ordering by collecting the ordering information in a header that specifies the exact order, indicating which protocols produce output that has been ignored and which are strictly ordered.

Negotiation

To completely specify how a protocol can been employed in future interactions:

Syntax

There are several syntactic elements PEP adds to HTTP/1.2:

HTTP Methods

HTTP 1.2 will include a new method for working with protocol extensions. In particular, the need for WRAPPED is highlighted by the need to encrypt GET requests.

Wrapped
WRAPPED * HTTP/1.2 indicates that the request is directed at the origin server itself. The server is required to process protocol extensions to the message (if any) before further processing. This request includes an optional entity-body.

Alternative definition (stricter): WRAPPED takes an entity-body of type application/http. After any protocol-extension processing (``unwrapping''), the wrapped HTTP message is presented to the server in place of the original request.

ASIDE: Without ``unwrapping'', how can a particular HTTP server realize that it is the origin server? Should * become a hostname?

Protocol:

This is the mechanism for specifying precisely what protocols a particular message was prepared in compliance with. This requires a syntax for specifying each particular protocol and a sequencing syntax, for which we propose Protocol: and Content-Encoding:, respectively.


Protocol: header parsing

Protocol = "Protocol" ":" word <AVTree>

<AVTree> = *(token ['=' [word ¦ '{' <AVTree> '}']])

Content-Encoding = "Content-Encoding" ":" *(token [','])

Protocol: header required parameters

Protocol: protocol-type scope=__ str=__ id=__ headers={} parameters={}

These are some of the required entries at the top-level of the AVTree structure in Protocol:.

protocol-type
The first word of the line is the name of the agreed-upon protocol. In particular, it may be a full URI, or a path relative to http://www.w3.org/Registry/HTTP-Extensions/.

scope
scope is one of "conn", "route", or "origin" ; the default is "origin". Used to indicate which HTTP agents in a transaction must process Protocol: extensions. Respectively: the immediate counterparty, all subsequent parties, or only the endpoints (the origin server and client in HTTP parlance).

str
strength is one of "req" or "opt" ; the default is "opt". Used to indicate whether an Agent in scope must process this Protocol: extension or can elide it. This meaning is not present in SHTTP, where optional vs required processing is encapsulated in the security recipe.

id
A token. For a Protocol: to indicate its relative ordering, it must use the Content-Encoding: line. A particular protocol, initialized for a particular message and parameter set, is assigned an id, which is used as a reference from C-E.

ASIDE: There is an open question about scope, uniqueness, and longevity of ids: can they be unique in a message, a session, or even predefined in the specs?

headers
A list of headers uniquely associated with this protocol id. This information is used when stripping a Protocol: header, to strip any associated headers that may be necessary.

ASIDE: Problem: field-name is defined in section 4.2 as any character except CTLs or SP, which is not compatible with token, from section 2.2. Is there some reason name-value pairs must begin with token instead of word?

parameters
An AVTree of id-specific parameters, each defined in the protocol-spec.

Multiple Protocol: lines can be concatenated by ',', per RFC 822.

ASIDE: Did we forget to say something about C-E? only one occurrence of each id allowed.


Accept-Protocol:

This is the mechanism for specifying what protocols a particular HTTP agent supports for processing requests and replies. In each direction, an agent can identify a protocol and its degree of preference (optional, required, or refused). Counterparties within scope are bound to take note of refused and required protocols in preparing subsequent communications (replies, or follow-up requests)


Accept-Protocol: header parsing

Accept-Protocol = "Accept-Protocol" ":" word <AVTree>

<AVTree> = *(token ['=' [word ¦ '{' <AVTree> '}']])

Protocol-Compatible= "Protocol-Compatible" ":" '{' word word ("rx" ¦ "tx") '}'

ASIDE: [If there were some sort of token= that should be used, P-C'd be an AVTree. rx= and tx= aren't , and words can't be LHSes]

Accept-Protocol: header required parameters

Accept-Protocol: protocol-type scope=__ rx-str=__ tx-str=__ negotiable={}

These are some of the required entries at the top-level of the AVTree structure in Accept-Protocol:.

protocol-type
The first word of the line is the name of the agreed-upon protocol. In particular, it may be a full URI, or a path relative to http://www.w3.org/Registry/HTTP-Extensions/.

scope
scope is one of "conn", "route", or "origin" ; the default is "origin". Used to indicate which HTTP agents in a transaction this negotiation request is addressed to. Repectively: the immediate counterparty, all subsequent parties, or only the endpoints (the origin server and client in HTTP parlance).

rx-str, tx-str
strength is one of "req", "ref", or "opt" ; the default is "opt". Used to notify subsequent Agents in scope whether this Agent requires, refuses, or accepts the use of the named protocol in either role. This meaning is very similar to its use in SHTTP.

negotiable
An AVTree of well-known negotiable parameters, each defined in the protocol-spec.

An Agent can assert, that to the best of its knowledge, protocol A is substitutable for protocol B in a particular direction by asserting Protocol-Compatibility: {A B (rx ¦ tx)}. This statement can also be used to justify why an Agent has decided to satisfy an obligation for B with an instance of A.


HTTP Error Codes

As described in the Implementation section, there are several new error types associated with PEP.

100 Class
101 Continue Negotiating [Roy] [motivated by multi-step security/authentication protocols] [this may move to 400 or 300 class since 100 class forbids entity-bodies]

200 Class
None. New comments? (e.g. 200 OK (Enciphered, Signed))

400 Class
450 Bad Extension Protocol Request (45y class)

451 Extension Protocol Unknown

452 Extension Refused

453 Bad Extension Protocol Parameters

500 Class
550 Extension Protocol Failure (55y class)

551 Extension Protocol Not Available (à la None Acceptable)

552 Extension Protocol Parameters Not Acceptable

Implementation

The actual binding between syntax and semantics is presented through the interpretation and implementation rules in this section.

Disposition Rules

To strip a Protocol: or Accept-Protocol: header, an agent must remove the particular instance and any HTTP message headers listed in the headers field.

When parsing a Protocol: or Accept-Protocol: line in an HTTP request:

When evaluating a Content-Encoding: line in an HTTP reply or request:

When evaluating a Protocol: line in an HTTP reply or request:

When relaying an HTTP message (e.g. as a proxy):

Negotiation Process

Negotiation using PEP is considerably richer than with the other Accept: mechanism in HTTP/1.x.

Each message that is exchanged between two HTTP agents is part of a negotiation context. When an Accept-Protocol: header is parsed, the corresponding fact is added to that context. It may not be clear at parse-time, though, that there are conflicting or insufficient negotiation goals in the context, and the contradiction (overlapping key-length reject & accept ranges, e.g.) may only appear when the module is executed (453 vs 552).

ASIDE: After checking in on the plans for HTTP/1.1+ proxy syntax, we will have problems pinning down ``negotiation context'' until such time as HTTP/1.x supports voluntary, client-generated session-IDs. It is currently impossible to disambiguate the Accept-Protocol: requests of an AOL proxy from the policy decisions of a particular end-user going through AOL, for example.

Until there is reliable session identification, facts are kept in the context only for up to one previous transaction, so it is still possible to issue changed negotiation parameters, and so on.

This is the least-specified part of the PEP proposal, since many aspects of negotiation have been pushed out into specific protocol-specs. Nevertheless, there are going to be common mechanisms for well-known negotiable properties. Numeric ranges can be checked and flagged, as can multivalue sets.

There is one other kind of state-maintenance that may emerge as a client-side issue: realm contexts (security domains). It will be essential for an authentication module to retrieve a key and then say ``apply my protocol to any requests in domain X''. In the existing Spyglass proposal, the answer is polling on each request, which may become cumbersome.

Evaluation Process

To ``interpret a message compliant with a given protocol'' will often mean reprocessing a message (decipher, signature-check, etc), and the processing routine will essentially set up a pipe, according to the Content-Encoding: line. First, remove any ids that are out of scope, or are optional and skipped. Then setup a pipeline with the original message being copied into each module until a ','; the module before the comma produces the output that subsequent stages expect to see.

There may be a preprocessing stage as a compatibility layer. If a set of security protocols can define encryption, signature, and compression operations, a parser can be written that accepts PKCS-7 messages from an SHTTP message and produces an HTTP message with an equivalent pipeline.

A few remarks about the execution environment of a module: A protocol spec defines a message and an (invertible) function on that message. It says nothing about the corresponding software architecture, which may be operating on preparsed data structures, may or may not have access to keyrings and network interfaces, and so on. There is, however, a clear bias to inband transmission of information. Since processing yields a new output message and control signals, it is most flexible to pass information between independent modules in the message than through platform- and protocol-specfic control signals.

Applications

We have scenarios for content-labeling negotiation using PICS. We have a prototype library of protocol specs for security applications. There will be an entire, separate document about these samples and negotiation practices.


Glossary

Agent
Any process that communicates according to HTTP. In particular, any process that communicates in HTTP/1.2 or later is expected to adhere to the PEP spec. Agent encompasses servers, proxies, caches, and clients.

Module
Many protocols will imply accompanying processing, which is implemented by a module. A module can be used as a stage of a processing pipeline. A module may implement several protocols.

Protocol
Any agreement defining the external responsibilities in preparing a communication, the import of such communication, and any associated state. Protocols are not defined by operational semantics. (TimBL: ``A convention for communication between two or more parties relating the syntax, sequence and semantics of the communication between them.'')

Protocol Compatibility
Two protocols are compatible if one can be substituted for the other in a particular role. Protocol compatibility can be expressed in a protocol spec, a module, or a Compatible-Protocol: line entry.

Protocol Specification
A human-readable document that describes a well-known protocol defining a message, associated semantics, and possible compatibility with other well-known specifications.

protocol-type
the well-known name given to a particular protocol that two HTTP agents are agreeing to.

protocol-spec
a document defining the protocol-type, compatibility with other protocol-types, message formats, headers, semantics, and any well-known negotiable key-value pairs.

negotiable-block
any name-value pair set specified in accordance with negotiable parameters in a protocol-spec.

scope
In a complete HTTP transaction, which HTTP agents are covered: the next hop (connection), the entire chain (route), or only the endpoints (origin).

strength
This is a parameter used in negotiation phases that indicates that the counterparty will require, refuse, or optionally accept protocol-type in a subsequent communication.


Sources & Acknowledgements

We started with input from several sources:

Key Contributors:


Open Concerns

Addressing secure transactions smaller than an HTTP transaction. HTML support. Boolean combination vs. inheritance-by-aggregation. Highlight rationale for symmetric protocol, not server-only.


Minutæ: the first ``Protocol'' is the named type of a particular extension; the second defines the type of document this is, namely:

pro*to*col \'pro¯t-e-,ko—l, -,ko¯l, -,ka¨l, -kel\ n

2a: a preliminary memorandum often formulated and signed by diplomatic negotiators as a basis for a final convention or treaty


PEP for HTTP 1.2 was converted on Tue Oct 03 21:15:32 EDT 1995 by the eText Engine, version 5, release 0.96