Rfc 4272 pdf
Do you need support on an existing product? We're happy to help! Visit our community Contact support. Do you want to learn more about Ciena's products? Here's some useful information. Connect with Ciena Learn more about us. Subscribe now for the latest Network Insights. The Adaptive Network. Analytics and Intelligence Analytics and Intelligence. Control and Automation Control and Automation.
Programmable Infrastructure Programmable Infrastructure. Services Services. Solutions Solutions. Technology principles Technology principles. View all products View all products. Successful 2xx Redirection 3xx Client Error 4xx Server Error 5xx Response Header Fields Control Data Origination Date Validator Header Fields Authentication Challenges Response Context IANA Considerations Method Registry Considerations for New Methods Status Code Registry Considerations for New Status Codes Header Field Registry Considerations for New Header Fields Content Coding Registry Security Considerations Attacks Based on File and Path Names Disclosure of Personal Information Disclosure of Fragment after Redirects Disclosure of Product Information Browser Fingerprinting Normative References Informative References Conversion to Canonical Form Conversion of Date Formats Conversion of Content-Encoding Conversion of Content-Transfer-Encoding Changes from RFC Imported ABNF Collected ABNF A server listens on a connection for a request, parses each message received, interprets the message semantics in relation to the identified request target, and responds to that request with one or more response messages.
A client constructs request messages to communicate specific intentions, examines received responses to see if the intentions were carried out, and determines how to interpret the results.
HTTP provides a uniform interface for interacting with a resource Section 2 , regardless of its type, nature, or implementation, via the manipulation and transfer of representations Section 3. HTTP semantics include the intentions defined by each request method Section 4 , extensions to those semantics that might be described in request header fields Section 5 , the meaning of status codes to indicate a machine-readable response Section 6 , and the meaning of other control data and resource metadata that might be given in response header fields Section 7.
This document also defines representation metadata that describe how a payload is intended to be interpreted by a recipient, the request header fields that might influence content selection, and the various selection algorithms that are collectively referred to as "content negotiation" Section 3.
Conformance criteria and considerations regarding error handling are defined in Section 2. Appendix C describes rules imported from other documents. HTTP does not limit the nature of a resource; it merely defines an interface that might be used to interact with resources.
When a request is received, the server reconstructs an effective request URI for the target resource Section 5. One design goal of HTTP is to separate resource identification from request semantics, which is made possible by vesting the request semantics in the request method Section 4 and a few request-modifying header fields Section 5.
If there is a conflict between the method semantics and any semantic implied by the URI itself, as described in Section 4. Representations Considering that a resource could be anything, and that the uniform interface provided by HTTP is similar to a window through which one can observe and act upon such a thing only through the communication of messages to some independent actor on the other side, an abstraction is needed to represent "take the place of" the current or desired state of that thing in our communications.
That abstraction is called a representation [ REST ]. For the purposes of HTTP, a "representation" is information that is intended to reflect a past, current, or desired state of a given resource, in a format that can be readily communicated via the protocol, and that consists of a set of representation metadata and a potentially unbounded stream of representation data.
An origin server might be provided with, or be capable of generating, multiple representations that are each intended to reflect the current state of a target resource. In such cases, some algorithm is used by the origin server to select one of those representations as most applicable to a given request, usually based on content negotiation.
Representation Metadata Representation header fields provide metadata about the representation. When a message includes a payload body, the representation header fields describe how to interpret the representation data enclosed in the payload body. In a response to a HEAD request, the representation header fields describe the representation data that would have been enclosed in the payload body if the same request had been a GET.
Processing Representation Data 3. Media types define both a data format and various processing models: how to process that data in accordance with each context in which it is received.
Parameter values might or might not be case-sensitive, depending on the semantics of the parameter name.
The presence or absence of a parameter might be significant to the processing of a media-type, depending on its definition within the media type registry. A parameter value that matches the token production can be transmitted either as a token or within a quoted-string. The quoted and unquoted values are equivalent. A charset is identified by a case-insensitive token. Canonicalization and Text Defaults Internet media types are registered with a canonical form in order to be interoperable among systems with varying native encoding formats.
However, the performance characteristics of email deployments i. HTTP allows the transfer of text media with plain CR or LF alone representing a line break, when such line breaks are consistent for an entire representation. This flexibility regarding line breaks applies only to text within a representation that has been assigned a "text" media type; it does not apply to "multipart" types or HTTP elements outside the payload body e.
If a representation is encoded with a content-coding, the underlying data ought to be in a form defined above prior to being encoded. Multipart Types MIME provides for a number of "multipart" types -- encapsulations of one or more representations within a single message body. All multipart types share a common syntax, as defined in Section 5. HTTP message framing does not use the multipart boundary as an indicator of message body length, though it might be used by implementations that generate or process the payload.
Content-Type The "Content-Type" header field indicates the media type of the associated representation: either the representation enclosed in the message payload or the selected representation, as determined by the message semantics. The indicated media type defines both the data format and how that data is intended to be processed by a recipient, within the scope of the received message semantics, after any content codings indicated by Content-Encoding are decoded. In practice, resource owners do not always properly configure their origin server to provide the correct Content-Type for a given representation, with the result that some clients will examine a payload's content and override the specified type.
Clients that do so risk drawing incorrect conclusions, which might expose additional security risks e. Furthermore, it is impossible to determine the sender's intent by examining the data format: many data formats match multiple media types that differ only in processing semantics. Implementers are encouraged to provide a means of disabling such "content sniffing" when it is used.
Encoding for Compression or Integrity 3. Content Codings Content coding values indicate an encoding transformation that has been or can be applied to a representation. Content codings are primarily used to allow a representation to be compressed or otherwise usefully transformed without losing the identity of its underlying media type and without loss of information.
Frequently, the representation is stored in coded form, transmitted directly, and only decoded by the final recipient. They are used in the Accept-Encoding Section 5. Content-Encoding The "Content-Encoding" header field indicates what content codings have been applied to the representation, beyond those inherent in the media type, and thus what decoding mechanisms have to be applied in order to obtain data in the media type referenced by the Content-Type header field.
Content-Encoding is primarily used to allow a representation's data to be compressed without losing the identity of its underlying media type. Additional information about the encoding parameters can be provided by other header fields not defined by this specification.
Unlike Transfer-Encoding Section 3. Typically, the representation is only decoded just prior to rendering or analogous usage. If the media type includes an inherent encoding, such as a data format that is always compressed, then that encoding would not be restated in Content-Encoding even if it happens to be the same algorithm as one of the content codings. Such a content coding would only be listed if, for some bizarre reason, it is applied a second time to form the representation.
An origin server MAY respond with a status code of Unsupported Media Type if a representation in the request message has a content coding that is not acceptable. Audience Language 3. Language Tags A language tag, as defined in [ RFC ], identifies a natural language spoken, written, or otherwise conveyed by human beings for communication of information to other human beings.
Computer languages are explicitly excluded. Accept-Language uses the broader language-range production defined in Section 5. In most cases, a language tag consists of a primary language subtag that identifies a broad family of related languages e. Whitespace is not allowed within a language tag. Content-Language The "Content-Language" header field describes the natural language s of the intended audience for the representation.
Note that this might not be equivalent to all the languages used within the representation. The primary purpose of Content-Language is to allow a user to identify and differentiate representations according to the users' own preferred language. Thus, if the content is intended only for a Danish-literate audience, the appropriate field is Content-Language: da If no Content-Language is specified, the default is that the content is intended for all language audiences.
This might mean that the sender does not consider it to be specific to any natural language, or that the sender does not know for which language it is intended. Multiple languages MAY be listed for content that is intended for multiple audiences. For example, a rendition of the "Treaty of Waitangi", presented simultaneously in the original Maori and English versions, would call for Content-Language: mi, en However, just because multiple languages are present within a representation does not mean that it is intended for multiple linguistic audiences.
An example would be a beginner's language primer, such as "A First Lesson in Latin", which is clearly intended to be used by an English-literate audience. In this case, the Content-Language would properly only include "en". Content-Language MAY be applied to any media type -- it is not limited to textual documents.
Identification 3. Identifying a Representation When a complete or partial representation is transferred in a message payload, it is often desirable for the sender to supply, or the recipient to determine, an identifier for a resource corresponding to that representation.
For a request message: o If the request has a Content-Location header field, then the sender asserts that the payload is a representation of the resource identified by the Content-Location field-value. However, such an assertion cannot be trusted unless it can be verified by other means not defined by this specification.
The information might still be useful for revision history links. For a response message, the following rules are applied in order until a match is found: 1. If the request method is GET or HEAD and the response status code is Non-Authoritative Information , the payload is a potentially modified or enhanced representation of the target resource as provided by an intermediary.
If the response has a Content-Location header field and its field-value is a reference to the same URI as the effective request URI, the payload is a representation of the resource identified by the effective request URI.
If the response has a Content-Location header field and its field-value is a reference to a URI different from the effective request URI, then the sender asserts that the payload is a representation of the resource identified by the Content-Location field-value. Otherwise, the payload is unidentified. Content-Location The "Content-Location" header field references a URI that can be used as an identifier for a specific resource corresponding to the representation in this message's payload.
In other words, if one were to perform a GET request on this URI at the time of this message's generation, then a OK response would contain the same representation that is enclosed as payload in this message. It is representation metadata.
For a GET Section 4. For a state-changing request like PUT Section 4. This allows authoring applications to update their local copies without the need for a subsequent GET request. If Content-Location is included in a 2xx Successful response message and its field-value refers to a URI that differs from the effective request URI, then the origin server claims that the URI is an identifier for a different resource corresponding to the enclosed representation.
Such a claim can only be trusted if both identifiers share the same resource owner, which cannot be programmatically determined via HTTP. For example, a purchase transaction made via a POST request might include a receipt document as the payload of the OK response; the Content-Location field-value provides an identifier for retrieving a copy of that same receipt in the future. A user agent that sends Content-Location in a request message is stating that its value refers to where the user agent originally obtained the content of the enclosed representation prior to any modifications made by that user agent.
In other words, the user agent is providing a back link to the source of the original representation. An origin server MAY use that context to guide in processing the request or to save it for other uses, such as within source links or versioning metadata. For example, if a client makes a PUT request on a negotiated resource and the origin server accepts that PUT without redirection , then the new state of that resource is expected to be consistent with the one representation supplied in that PUT; the Content-Location cannot be used as a form of reverse content selection identifier to update only one of the negotiated representations.
Representation Data The representation data associated with an HTTP message is either provided as the payload body of the message or referred to by the message semantics and the effective request URI.
The representation data is in a format and encoding defined by the representation metadata header fields. The data type of the representation data is determined via the header fields Content-Type and Content-Encoding. In some cases, a payload might contain only the associated representation's header fields e. The purpose of a payload in a request is defined by the method semantics.
For example, a representation in the payload of a PUT request Section 4. Response messages with an error status code usually contain a payload that represents the error condition, such that it describes the error state and what next steps are suggested for resolving it. Header fields that specifically describe the payload, rather than the associated representation, are referred to as "payload header fields". Payload header fields are defined in other parts of this specification, due to their impact on message parsing.
Content Negotiation When responses convey payload information, whether indicating a success or an error, the origin server often has different ways of representing that information; for example, in different formats, languages, or encodings.
Likewise, different users or user agents might have differing capabilities, characteristics, or preferences that could influence which representation, among those available, would be best to deliver. For this reason, HTTP provides mechanisms for content negotiation. This specification defines two patterns of content negotiation that can be made visible within the protocol: "proactive", where the server selects the representation based upon the user agent's stated preferences, and "reactive" negotiation, where the server provides a list of representations for the user agent to choose from.
These patterns are not mutually exclusive, and each has trade-offs in applicability and practicality. Note that, in all cases, HTTP is not aware of the resource semantics. The consistency with which an origin server responds to requests, over time and over the varying dimensions of content negotiation, and thus the "sameness" of a resource's observed representations over time, is determined entirely by whatever entity or algorithm selects or generates those responses.
HTTP pays no attention to the man behind the curtain. Proactive Negotiation When content negotiation preferences are sent by the user agent in a request to encourage an algorithm located at the server to select the preferred representation, it is called proactive negotiation a. Selection is based on the available representations for a response the dimensions over which it might vary, such as language, content-coding, etc.
Proactive negotiation is advantageous when the algorithm for selecting from among the available representations is difficult to describe to a user agent, or when the server desires to send its "best guess" to the user agent along with the first response hoping to avoid the round trip delay of a subsequent request if the "best guess" is good enough for the user. In order to improve the server's guess, a user agent MAY send request header fields that describe its preferences.
Proactive negotiation has serious disadvantages: o It is impossible for the server to accurately determine what might be "best" for any given user, since that would require complete knowledge of both the capabilities of the user agent and the intended use for the response e. A user agent cannot rely on proactive negotiation preferences being consistently honored, since the origin server might not implement proactive negotiation for the requested resource or might decide that sending a response that doesn't conform to the user agent's preferences is better than sending a Not Acceptable response.
A Vary header field Section 7. Reactive Negotiation With reactive negotiation a. If the user agent is not satisfied by the initial response representation, it can perform a GET request on one or more of the alternative resources, selected based on metadata included in the list, to obtain a different form of representation for that response. Selection of alternatives might be performed automatically by the user agent or manually by the user selecting from a generated possibly hypertext menu.
Note that the above refers to representations of the response, in general, not representations of the resource. The alternative representations are only considered representations of the target resource if the response in which those alternatives are provided has the semantics of being a representation of the target resource e.
A server might choose not to send an initial representation, other than the list of alternatives, and thereby indicate that reactive negotiation by the user agent is preferred.
For example, the alternatives listed in responses with the Multiple Choices and Not Acceptable status codes include information about the available representations so that the user or user agent can react by making a selection.
Reactive negotiation is advantageous when the response would vary over commonly used dimensions such as type, language, or encoding , when the origin server is unable to determine a user agent's capabilities from examining the request, and generally when public caches are used to distribute server load and reduce network usage. Furthermore, this specification does not define a mechanism for supporting automatic selection, though it does not prevent such a mechanism from being developed as an extension.
Request Methods 4. Overview The request method token is the primary source of request semantics; it indicates the purpose for which the client has made this request and what is expected by the client as a successful result. The request method's semantics might be further specialized by the semantics of some header fields when present in a request Section 5 if those additional semantics do not conflict with the method.
This document enlarges the total space available for Private Use ASNs by documenting the reservation of a second, larger range and updates RFC by replacing Section 10 of that document.
It represents the consensus of the IETF community. All rights reserved. It is important to note, however, that the server connection preface SETTINGS frame might include parameters that necessarily alter how a client is expected to communicate with the server. In some configurations, it is possible for the server to transmit SETTINGS before the client sends additional frames, providing an opportunity to avoid this issue. Frame Format All frames begin with a fixed 9-octet header followed by a variable- length payload.
The 9 octets of the frame header are not included in this value. The frame type determines the format and semantics of the frame. Implementations MUST ignore and discard any frame that has a type that is unknown. Flags: An 8-bit field reserved for boolean flags specific to the frame type. Flags are assigned semantics specific to the indicated frame type.
R: A reserved 1-bit field. Stream Identifier: A stream identifier see Section 5. The value 0x0 is reserved for frames that are associated with the connection as a whole as opposed to an individual stream. The structure and content of the frame payload is dependent entirely on the frame type. The size of the frame header is not included when describing frame sizes. A frame size error in a frame that could alter the state of the entire connection MUST be treated as a connection error Section 5.
Responsiveness can be improved by using frames that are smaller than the permitted maximum size. Header fields are used within HTTP request and response messages as well as in server push operations see Section 8. Header lists are collections of zero or more header fields. The serialized header block is then divided into one or more octet sequences, called header block fragments, and transmitted within the payload of HEADERS Section 6. A receiving endpoint reassembles the header block by concatenating its fragments and then decompresses the block to reconstruct the header list.
Header compression is stateful. One compression context and one decompression context are used for the entire connection. Each header block is processed as a discrete unit. Header blocks MUST be transmitted as a contiguous sequence of frames, with no interleaved frames of any other type or from any other stream. This allows a header block to be logically equivalent to a single frame. Recipients process frames in the order they are received. Stream identifiers are assigned to streams by the endpoint initiating the stream.
Stream States The lifecycle of a stream is shown in Figure 2. Both endpoints have a subjective view of the state of a stream that could be different when frames are in transit. Endpoints do not coordinate the creation of streams; they are created unilaterally by either endpoint. Streams have the following states: idle: All streams start in the "idle" state.
The stream identifier is selected as described in Section 5. The stream state for the reserved stream transitions to "reserved local ". The stream state for the reserved stream transitions to "reserved remote ". This causes the stream to open in a "half-closed remote " state. This releases the stream reservation. In this state, sending peers observe advertised stream-level flow-control limits Section 5. An endpoint sending an Belshe, et al. An endpoint can receive any type of frame in this state.
In this state, an endpoint is no longer obligated to maintain a receiver flow-control window. A stream that is "half-closed remote " can be used by the endpoint to send frames of any type. In this state, the endpoint continues to observe advertised stream-level flow-control limits Section 5.
An endpoint MAY choose to limit the period over which it ignores frames and treat frames that arrive after this time as being in error. Flow-controlled frames i. Frames of unknown types are ignored. An example of the state transitions for server push can be found in Sections 8. Stream Identifiers Streams are identified with an unsigned bit integer. A stream identifier of zero 0x0 is used for connection control messages; the stream identifier of zero cannot be used to establish a new stream.
After the upgrade completes, stream 0x1 is "half-closed local " to the client. The identifier of a newly established stream MUST be numerically greater than all streams that the initiating endpoint has opened or reserved.
An endpoint that receives an unexpected stream identifier MUST respond with a connection error Section 5. The first use of a new stream identifier implicitly closes all streams in the "idle" state that might have been initiated by that peer with a lower-valued stream identifier.
For example, if a client sends a HEADERS frame on stream 7 without ever sending a frame on stream 5, then stream 5 transitions to the "closed" state when the first frame for stream 7 is sent or received. Stream identifiers cannot be reused.
Long-lived connections can result in an endpoint exhausting the available range of stream identifiers. A client that is unable to establish a new stream identifier can establish a new connection for new streams.
A server that is unable to establish a new stream identifier can send a GOAWAY frame so that the client is forced to open a new connection for new streams. The maximum concurrent streams setting is specific to each endpoint and applies only to the peer that receives the setting. That is, clients specify the maximum number of concurrent streams the server can initiate, and servers specify the maximum number of concurrent streams the client can initiate.
Streams that are in the "open" state or in either of the "half- closed" states count toward the maximum number of streams that an endpoint is permitted to open. Streams in either of the "reserved" states do not count toward the stream limit. The choice of error code determines whether the endpoint wishes to enable automatic retry see Section 8. Flow Control Using streams for multiplexing introduces contention over use of the TCP connection, resulting in blocked streams.
A flow-control scheme ensures that streams on the same connection do not destructively interfere with each other. Flow control is used for both individual streams and for the connection as a whole. Flow control is specific to a connection.
Both types of flow control are between the endpoints of a single hop and not over the entire end-to-end path. Receivers advertise how many octets they are prepared to receive on a stream and for the entire connection. This is a credit-based scheme. Flow control is directional with overall control provided by the receiver. A receiver MAY choose to set any window size that it desires for each stream and for the entire connection. A sender MUST respect flow-control limits imposed by a receiver.
Clients, servers, and intermediaries all independently advertise their flow-control window as a receiver and abide by the flow-control limits set by their peer when sending. The initial value for the flow-control window is 65, octets for both new streams and the overall connection. The frame type determines whether flow control applies to a frame. Of the frames specified in this document, only DATA frames are subject to flow control; all other frame types do not consume space in the advertised flow-control window.
This ensures that important control frames are not blocked by flow control. Flow control cannot be disabled. This document does not stipulate how a receiver decides when to send this frame or the value that it sends, nor does it specify how a sender chooses to send packets. Implementations are able to select any algorithm that suits their needs. Implementations are also responsible for managing how requests and responses are sent based on priority, choosing how to avoid head-of- line blocking for requests, and managing the creation of new streams.
Algorithm choices for these could interact with any flow-control algorithm. Appropriate Use of Flow Control Flow control is defined to protect endpoints that are operating under resource constraints. For example, a proxy needs to share memory between many connections and also might have a slow upstream connection and a fast downstream one.
Flow-control addresses cases where the receiver is unable to process data on one stream yet wants to continue to process other streams in the same connection. This effectively disables flow control for that receiver. Conversely, a sender is always subject to the flow-control window advertised by the receiver. Deployments with constrained resources for example, memory can employ flow control to limit the amount of memory a peer can consume.
Note, however, that this can lead to suboptimal use of available network resources if flow control is enabled without knowledge of the bandwidth-delay product see [ RFC ]. Even with full awareness of the current bandwidth-delay product, implementation of flow control can be difficult.
The purpose of prioritization is to allow an endpoint to express how it would prefer its peer to allocate resources when managing concurrent streams. Most importantly, priority can be used to select streams for transmitting frames when there is limited capacity for sending. Streams can be prioritized by marking them as dependent on the completion of other streams Section 5. Each dependency is assigned a relative weight, a number that is used to determine the relative proportion of available resources that are assigned to streams dependent on the same stream.
It does not guarantee any particular processing or transmission order for the stream relative to any other stream. An endpoint cannot force a peer to process concurrent streams in a particular order using priority. Expressing priority is therefore only a suggestion. Prioritization information can be omitted from messages.
Defaults are used prior to any explicit values being provided Section 5. Stream Dependencies Each stream can be given an explicit dependency on another stream. Including a dependency expresses a preference to allocate resources to the identified stream rather than to the dependent stream. A stream that is not dependent on any other stream is given a stream dependency of 0x0. In other words, the non-existent stream 0 forms the root of the tree. A stream that depends on another stream is a dependent stream.
The stream upon which a stream is dependent is a parent stream. A dependency on a stream that is not currently in the tree -- such as a stream in the "idle" state -- results in that stream being given a default priority Section 5. When assigning a dependency on another stream, the stream is added as a new dependency of the parent stream.
Dependent streams that share the same parent are not ordered with respect to each other. For example, if streams B and C are dependent on stream A, and if stream D is created with a dependency on stream A, this results in a dependency order of A followed by B, C, and D in any order. The exclusive flag causes the stream to become the sole dependency of its parent stream, causing other dependencies to become dependent on the exclusive stream. In the previous example, if stream D is created with an exclusive dependency on stream A, this results in D becoming the dependency parent of B and C.
A stream cannot depend on itself. Dependency Weighting All dependent streams are allocated an integer weight between 1 and inclusive. Thus, if stream B depends on stream A with weight 4, stream C depends on stream A with weight 12, and no progress can be made on stream A, stream B ideally receives one-third of the resources allocated to stream C. Setting a dependency causes a stream to become dependent on the identified parent stream.
Dependent streams move with their parent stream if the parent is reprioritized. Setting a dependency with the exclusive flag for a reprioritized stream causes all the dependencies of the new parent stream to become dependent on the reprioritized stream.
If a stream is made dependent on one of its own dependencies, the formerly dependent stream is first moved to be dependent on the reprioritized stream's previous parent. The moved dependency retains its weight. If A is made dependent on D, then D takes the place of A. All other dependency relationships stay the same, except for F, which becomes dependent on A if the reprioritization is exclusive.
Prioritization State Management When a stream is removed from the dependency tree, its dependencies can be moved to become dependent on the parent of the closed stream. The weights of new dependencies are recalculated by distributing the weight of the dependency of the closed stream proportionally based on the weights of its dependencies.
Streams that are removed from the dependency tree cause some prioritization information to be lost. Resources are shared between streams with the same parent stream, which means that if a stream in that set closes or becomes blocked, any spare capacity allocated to a stream is distributed to the immediate neighbors of the stream.
However, if the common dependency is removed from the tree, those streams share resources with streams at the next highest level. Prior to the removal of stream A, if streams A and D are unable to proceed, then stream C receives all the resources dedicated to stream A. If stream A is removed from the tree, the weight of stream A is divided between streams C and D.
If stream D is still unable to proceed, this results in stream C receiving a reduced proportion of resources. For equal starting weights, C receives one third, rather than one half, of available resources.
It is possible for a stream to become closed while prioritization information that creates a dependency on that stream is in transit.
0コメント