draft-ietf-httpbis-rand-access-live-00.txt   draft-ietf-httpbis-rand-access-live-01.txt 
HTTP Working Group C. Pratt HTTP Working Group C. Pratt
Internet-Draft CableLabs Internet-Draft CableLabs
Intended status: Experimental B. Stark Intended status: Experimental B. Stark
Expires: September 8, 2017 AT&T Expires: March 8, 2018 AT&T
D. Thakore D. Thakore
CableLabs CableLabs
March 7, 2017 September 4, 2017
HTTP Random Access and Live Content HTTP Random Access and Live Content
draft-ietf-httpbis-rand-access-live-00 draft-ietf-httpbis-rand-access-live-01
Abstract Abstract
To accommodate byte range requests for content that has data appended To accommodate byte range requests for content that has data appended
over time, this document defines semantics that allow a HTTP client over time, this document defines semantics that allow a HTTP client
and server to perform byte-range GET and HEAD requests that start at and server to perform byte-range GET and HEAD requests that start at
an arbitrary byte offset within the representation and ends at an an arbitrary byte offset within the representation and ends at an
indeterminate offset. indeterminate offset.
Editorial Note (To be removed by RFC Editor before publication) Editorial Note (To be removed by RFC Editor before publication)
skipping to change at page 1, line 47 skipping to change at page 1, line 47
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 8, 2017. This Internet-Draft will expire on March 8, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 10 skipping to change at page 3, line 10
the appended/live content using a Range request with the bytes range the appended/live content using a Range request with the bytes range
unit using the currently defined byte-range semantics without unit using the currently defined byte-range semantics without
accepting performance or behavior sacrifices which are not acceptable accepting performance or behavior sacrifices which are not acceptable
for many applications. for many applications.
For instance, HTTP Clients have the ability to access appended For instance, HTTP Clients have the ability to access appended
content by simply transferring the entire accessible portion of the content by simply transferring the entire accessible portion of the
representation from the beginning and continuing to read the appended representation from the beginning and continuing to read the appended
content as it's made available. Obviously, this is highly content as it's made available. Obviously, this is highly
inefficient for cases where the representation is large and only a inefficient for cases where the representation is large and only a
portion of the randomly accessible content is needed by the Client. portion of the randomly-accessible content is needed by the Client.
And when bandwidth is limited, the client may never "catch up" with And when bandwidth is limited, the Client may never be able to
transfer all of the currently accessible potion and "catch up" with
the appending content. the appending content.
Clients can also attempt to access appended content by sending Alternatively, Clients can also access appended content by sending
periodic bytes Range requests using the last-known end byte position periodic open-ended bytes Range requests using the last-known end
(polling). Performing low-frequency periodic bytes Range requests in byte position as the range start. Performing low-frequency periodic
this fashion (polling) introduces latency since the Client will bytes Range requests in this fashion (polling) introduces latency
necessarily be somewhat behind the aggregated content - mimicking the since the Client will necessarily be somewhat behind the aggregated
behavior (and latency) of segmented content representations such as content - mimicking the behavior (and latency) of segmented content
HLS or MPEG-DASH. And performing these Range requests at higher representations such as HLS or MPEG-DASH. And performing these Range
frequency incurs more processing overhead and HTTP traffic as the requests at higher frequency incurs more processing overhead and HTTP
periodic requests will often return no content - since content is exchanges as the requests will often return no content - since
usually aggregated in groups of bytes (e.g. a video frame, audio content is usually aggregated in groups of bytes (e.g. a video frame,
sample, block, or log entry). audio sample, block, or log entry).
To accommodate byte-range requests on large representations which To accommodate byte-range requests on large representations which
have data appended over time efficiently and with low latency, this have data appended over time efficiently and with low latency, this
recommendation defines semantics whereby the HTTP Client performs recommendation defines semantics whereby the HTTP Client performs
byte-range requests using a combination of open-ended byte-range HEAD byte-range requests using a combination of open-ended byte-range HEAD
requests and GET requests using "Large Value" last-byte-pos values. requests and GET requests using "Large Value" last-byte-pos values.
1.1. Requirements Language 1.1. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
2. Performing Range requests on Random-Access Aggregating ("live") 2. Performing Range requests on Random-Access Aggregating ("live")
Content Content
There are two critical operations for accessing randomly accessing There are two critical operations for accessing randomly accessing
live/aggregating representations: live/aggregating representations:
Establishing the randomly accessible range of the representation, o Establishing the randomly-accessible range of the representation,
and and
Performing range requests that continue beyond the randomly o Performing range requests that continue beyond the randomly-
accessible range. accessible range.
2.1. Establishing the Randomly Accessible Byte Range 2.1. Establishing the Randomly Accessible Byte Range
Establishing if a representation is continuously aggregating ("live") Establishing if a representation is continuously aggregating ("live")
and determining the randomly accessible byte range can both be and determining the randomly-accessible byte range can both be
determined using the existing definition for an open-ended byte-range determined using the existing definition for an open-ended byte-range
request. Specifically, [RFC7233] defines a byte-range request of the request. Specifically, [RFC7233] defines a byte-range request of the
form: form:
byte-range-spec = first-byte-pos "-" [ last-byte-pos ] byte-range-spec = first-byte-pos "-" [ last-byte-pos ]
which allows a Client to send a request with a first-byte-pos and which allows a Client to send a HEAD request with a first-byte-pos
leave last-byte-pos absent. A Server that receives a satisfiable and leave last-byte-pos absent. A Server that receives a satisfiable
byte-range request (with first-byte-pos smaller than the current byte-range request (with first-byte-pos smaller than the current
representation length) must respond with a 206 status code (Partial representation length) must respond with a 206 status code (Partial
Content) with a Content-Range header indicating the currently Content) with a Content-Range header indicating the currently
satisfiable byte range. For example, a Client-issued HEAD request satisfiable byte range. For example, a Client-issued HEAD request
performed against a continuously aggregating representation hosted on performed against a continuously aggregating representation hosted on
a Server could contain a byte-range header of the form: a Server could contain a byte-range header of the form:
Range: bytes=0- Range: bytes=0-
could return could return the header
Content-Range: bytes 0-1234567/* Content-Range: bytes 0-1234567/*
from the Server indicating that (1) the complete representation from the Server indicating that (1) the complete representation
length is unknown (via the "*" in place of the complete-length field) length is unknown (via the "*" in place of the complete-length field)
and (2) that only bytes 0-1234567 were accessable at the time the and (2) that only bytes 0-1234567 were accessable at the time the
request was processed. The Client can infer from this response that request was processed by the Server. The Client can infer from this
bytes 0-1234567 of the representation can be requested and returned response that bytes 0-1234567 of the representation can be requested
in a timely fashion (the bytes are immediately available). and returned in a timely fashion (the bytes are immediately
available).
2.2. Byte-Range Requests Beyond the Randomly Accessible Byte Range 2.2. Byte-Range Requests Beyond the Randomly Accessible Byte Range
Once a Client has determined that a representation has an Once a Client has determined that a representation has an
indeterminate length and established the byte range that can be indeterminate length and established the byte range that can be
accessed, it may want to perform a request that starts within the accessed, it may want to perform a request with a start position
randomly accessible content range and ends at an indefinite "live" within the randomly-accessible content range and an end position at
point - a point where the byte-range GET request is fulfilled on- an indefinite "live" point - a point where the byte-range GET request
demand as the content is aggregated. is fulfilled on-demand as the content is aggregated.
For example, for a large video asset, a client may wish to start a For example, for a large video asset, a client may wish to start a
content transfer from the video "key" frame immediately before the content transfer from the video "key" frame immediately before the
point of aggregation and continue the content transfer indefinitely point of aggregation and continue the content transfer indefinitely
as content is aggregated - in order to support low-latency startup of as content is aggregated - in order to support low-latency startup of
a live video stream. a live video stream.
Unlike a byte-range Range request, a byte-range Content-Range Unlike a byte-range Range request, a byte-range Content-Range
response header cannot be "open ended", per [RFC7233]: response header cannot be "open ended", per [RFC7233]:
byte-content-range = bytes-unit SP ( byte-range-resp / byte-content-range = bytes-unit SP
unsatisfied-range ) ( byte-range-resp / unsatisfied-range )
byte-range-resp = byte-range "/" ( complete-length / "*" )
byte-range = first-byte-pos "-" last-byte-pos
unsatisfied-range = "*/" complete-length byte-range-resp = byte-range "/" ( complete-length / "*" )
byte-range = first-byte-pos "-" last-byte-pos
unsatisfied-range = "*/" complete-length
complete-length = 1*DIGIT complete-length = 1*DIGIT
last-byte-pos is required in byte-range. So in order to preserve Specifically, last-byte-pos is required in byte-range. So in order
interoperability with existing HTTP clients, servers, proxies, and to preserve interoperability with existing HTTP clients, servers,
caches, this document proposes a mechanism for a Client to indicate proxies, and caches, this document proposes a mechanism for a Client
support for handling an indeterminate-length byte-range response, and to indicate support for handling an indeterminate-length byte-range
a mechanism for a Server to indicate if/when it's providing a response, and a mechanism for a Server to indicate if/when it's
indeterminate-length response. providing a indeterminate-length response.
A Client can indicate support for indeterminate-length byte-ranges by A Client can indicate support for handling indeterminate-length byte-
providing a Very Large Value for the last-byte-pos in the byte-range range responses by providing a Very Large Value for the last-byte-pos
request. For example, a Client can perform a byte-range GET request in the byte-range request. For example, a Client can perform a byte-
of the form: range GET request of the form:
Range: bytes=1230000-999999999999 Range: bytes=1230000-999999999999
where the last-byte-pos in the Request is much larger than the last- where the last-byte-pos in the Request is much larger than the last-
byte-pos returned in response to an open-ended byte-range request. byte-pos returned in response to an open-ended byte-range HEAD
request, as described above.
2.3. Byte-Range Responses Beyond the Randomly Accessible Byte Range 2.3. Byte-Range Responses Beyond the Randomly Accessible Byte Range
A Server may indicate that it is supplying an continuously A Server may indicate that it is supplying a continuously aggregating
aggregating ("live") response by supplying the Client request's last- ("live") response by supplying the Client request's last-byte-pos in
byte-pos in the Content-Range response header. the Content-Range response header.
For example: For example:
Range: bytes=1230000-999999999999 Range: bytes=1230000-999999999999
could return could return
Content-Range: bytes 1230000-999999999999/* Content-Range: bytes 1230000-999999999999/*
from the Server to indicate that the response will start at byte from the Server to indicate that the response will start at byte
skipping to change at page 6, line 19 skipping to change at page 6, line 19
For example: For example:
Range: bytes=1230000-999999999999 Range: bytes=1230000-999999999999
could return could return
Content-Range: bytes 1230000-1234567/* Content-Range: bytes 1230000-1234567/*
from the Server to indicate that the response will start at byte from the Server to indicate that the response will start at byte
1230000 and end at byte 1234567 and will not include any aggregated 1230000 and end at byte 1234567 and will not include any aggregated
content. This is the response expected from a typically-configured content. This is the response expected from a typical HTTP Server -
HTTP Server - one that doesn't support byte-range requests on one that doesn't support byte-range requests on aggregating content.
aggregated content.
A Client that doesn't receive a response indicating it is A Client that doesn't receive a response indicating it is
continuously aggregating must use other means to access aggregated continuously aggregating must use other means to access aggregated
content (e.g. periodic byte-range polling). content (e.g. periodic byte-range polling).
A Server that returns a continuously aggregating ("live") response A Server that does return a continuously aggregating ("live")
should return data using chunked transfer coding and not provide a response should return data using chunked transfer coding and not
Content-Length header. A 0-length chunk indicates that aggregation provide a Content-Length header. A 0-length chunk indicates that
of the transferring resource is permanently discontinued. aggregation of the transferring resource is permanently discontinued,
per section 4.1 of [RFC7233].
3. Other Applications of Random-Access Aggregating Content 3. Other Applications of Random-Access Aggregating Content
3.1. Requests Starting at the Aggregation ("Live") Point 3.1. Requests Starting at the Aggregation ("Live") Point
If a Client would like to start the content transfer at the If a Client would like to start the content transfer at the
Aggregation ("live") point without including any randomly accessible Aggregation ("live") point without including any randomly-accessible
portion of the representation, then it should supply the last-byte- portion of the representation, then it should supply the last-byte-
pos from the most-recently received byte-range-spec and a Very Large pos from the most-recently received byte-range-spec and a Very Large
Value for the last-byte-pos in the byte-range request. Value for the last-byte-pos in the byte-range request.
For example a HEAD request containing: For example a HEAD request containing:
Range: bytes=0- Range: bytes=0-
could return could return
skipping to change at page 7, line 16 skipping to change at page 7, line 16
Content-Range: bytes 1234567-999999999999/* Content-Range: bytes 1234567-999999999999/*
with the response body starting with continuously aggregating with the response body starting with continuously aggregating
("live") data and continuing indefinitely. ("live") data and continuing indefinitely.
3.2. Shift Buffer Representations 3.2. Shift Buffer Representations
Some representations lend themselves to front-end content deletion in Some representations lend themselves to front-end content deletion in
addition to aggregation. While still supporting random access, addition to aggregation. While still supporting random access,
representations of this type have a portion at the beginning ("0" representations of this type have a portion at the beginning (the "0"
end) of the randomly accessible region become inaccessible over time. end) of the randomly-accessible region that become inaccessible over
Examples of this kind of representation would be a audio-video time- time. Examples of this kind of representation would be an audio-
shift buffer or a rolling log file. video time-shift buffer or a rolling log file.
For example a HEAD request containing: For example a HEAD Range request containing:
Range: bytes=0- Range: bytes=0-
could return could return
Content-Range: bytes 1000000-1234567/* Content-Range: bytes 1000000-1234567/*
indicating that the first 1000000 bytes were not accessible at the indicating that the first 1000000 bytes were not accessible at the
time the HEAD request was processed. Subsequent HEAD requests could time the HEAD request was processed. Subsequent HEAD requests could
return: return:
Content-Range: bytes 1000000-1234567/* Content-Range: bytes 1000000-1234567/*
Content-Range: bytes 1010000-1244567/* Content-Range: bytes 1010000-1244567/*
Content-Range: bytes 1020000-1254567/* Content-Range: bytes 1020000-1254567/*
Note though that the difference between the first-byte-pos and last- Note though that the difference between the first-byte-pos and last-
byte-pos need not be constant. byte-pos need not be constant.
The Client could then follow-up with a GET request containing The Client could then follow-up with a GET Range request containing
Range: bytes=1020000-999999999999 Range: bytes=1020000-999999999999
with the Server returning with the Server returning
Content-Range: bytes 1020000-999999999999/* Content-Range: bytes 1020000-999999999999/*
with the response body returning bytes 1020000-1254567 immediately with the response body returning bytes 1020000-1254567 immediately
and aggregated ("live") data being returned as the content is and aggregated ("live") data being returned as the content is
aggregated. aggregated.
skipping to change at page 8, line 21 skipping to change at page 8, line 21
that the representation will ever exceed 2^^63, a value smaller than that the representation will ever exceed 2^^63, a value smaller than
this value should be used as the Very Large last-byte-pos in a byte- this value should be used as the Very Large last-byte-pos in a byte-
seek request or content-range response. seek request or content-range response.
5. References 5. References
5.1. Normative References 5.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-
<http://www.rfc-editor.org/info/rfc2119>. editor.org/info/rfc2119>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
<http://www.rfc-editor.org/info/rfc7230>. <https://www.rfc-editor.org/info/rfc7230>.
[RFC7233] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., [RFC7233] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed.,
"Hypertext Transfer Protocol (HTTP/1.1): Range Requests", "Hypertext Transfer Protocol (HTTP/1.1): Range Requests",
RFC 7233, DOI 10.17487/RFC7233, June 2014, RFC 7233, DOI 10.17487/RFC7233, June 2014,
<http://www.rfc-editor.org/info/rfc7233>. <https://www.rfc-editor.org/info/rfc7233>.
5.2. Informative References 5.2. Informative References
[RANGE-UNIT-REGISTRY] [RANGE-UNIT-REGISTRY]
IANA, "Hypertext Transfer Protocol (HTTP) Parameters", IANA, "Hypertext Transfer Protocol (HTTP) Parameters",
2016, <http://www.iana.org/assignments/http-parameters/ 2016, <http://www.iana.org/assignments/http-parameters/
http-parameters.xhtml#range-units>. http-parameters.xhtml#range-units>.
[RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 4234, DOI 10.17487/RFC4234, Specifications: ABNF", RFC 4234, DOI 10.17487/RFC4234,
October 2005, <http://www.rfc-editor.org/info/rfc4234>. October 2005, <https://www.rfc-editor.org/info/rfc4234>.
Appendix A. Acknowledgements Appendix A. Acknowledgements
Mark Nottingham, Patrick McManus, Julian Reschke, Remy Lebeau, Rodger Mark Nottingham, Patrick McManus, Julian Reschke, Remy Lebeau, Rodger
Combs, Thorsten Lohmar, Martin Thompson, Adrien de Croy, K. Morgan, Combs, Thorsten Lohmar, Martin Thompson, Adrien de Croy, K. Morgan,
Roy T. Fielding, Jeremy Poulter. Roy T. Fielding, Jeremy Poulter.
Authors' Addresses Authors' Addresses
Craig Pratt Craig Pratt
 End of changes. 30 change blocks. 
71 lines changed or deleted 72 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/