You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Protocol.md
+45-43Lines changed: 45 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ __NOTE__: Byte ordering is big endian.
166
166
#### Handling Ignore Flag
167
167
168
168
The (__I__)gnore flag is used for extension of the protocol. A value of 0 in a frame for this flag indicates the protocol can't
169
-
ignore this frame. An implementation MAY send an ERROR frame (with CONNECTION_ERROR error code) and close the underlying transport
169
+
ignore this frame. An implementation MAY send an ERROR[CONNECTION_ERROR] frame and close the underlying transport
170
170
connection on reception of a frame that it does not understand with this bit not set.
171
171
172
172
#### Frame Validation
@@ -302,13 +302,12 @@ rules MAY be used for handling layout. For example, `application/x.netflix+cbor`
302
302
*__Setup Data__: includes payload describing connection capabilities of the endpoint sending the
303
303
Setup header.
304
304
305
-
__NOTE__: A server that receives a SETUP frame that has (__R__)esume Enabled set, but does not support resuming operation, MUST reject the SETUP with an ERROR.
305
+
__NOTE__: A server that receives a SETUP frame that has (__R__)esume Enabled set, but does not support resuming operation, MUST reject the SETUP with an ERROR[REJECTED_SETUP].
306
306
307
307
<aname="frame-error"></a>
308
308
### ERROR Frame (0x0B)
309
309
310
-
Error frames are used for errors on individual requests/streams as well as connection errors and in response
311
-
to SETUP frames. The latter is referred to as a SETUP_ERROR.
310
+
Error frames are used for errors on individual requests/streams as well as connection errors and in response to SETUP frames.
312
311
313
312
Frame Contents
314
313
@@ -332,8 +331,7 @@ Frame Contents
332
331
* See list of valid Error Codes below.
333
332
*__Error Data__: includes Payload describing error information. Error Data SHOULD be a UTF-8 encoded string. The string MUST NOT be null terminated.
334
333
335
-
A Stream ID of 0 means the error pertains to the connection. Including connection establishment. A Stream ID > 0
336
-
means the error pertains to a given stream.
334
+
A Stream ID of 0 means the error pertains to the connection., including connection establishment. A Stream ID > 0 means the error pertains to a given stream.
337
335
338
336
The Error Data is typically an Exception message, but could include stringified stacktrace information if appropriate.
339
337
@@ -356,6 +354,14 @@ The Error Data is typically an Exception message, but could include stringified
356
354
357
355
__NOTE__: Unsed values in the range of 0x0001 to 0x00300 are reserved for future protocol use. Values in the range of 0x00301 to 0xFFFFFFFE are reserved for application layer errors.
358
356
357
+
When this document refers to a specific Error Code as a frame, it uses this pattern: ERROR[error_code] or ERROR[error_code|error_code]
358
+
359
+
For example:
360
+
361
+
- ERROR[INVALID_SETUP] means the ERROR frame with the INVALID_SETUP code
362
+
- ERROR[REJECTED] means the ERROR frame with the REJECTED code
363
+
- ERROR[CONNECTION_ERROR|REJECTED_RESUME] means the ERROR frame either either the CONNECTION_ERROR or REJECTED_RESUME code
364
+
359
365
<aname="frame-lease"></a>
360
366
### LEASE Frame (0x02)
361
367
@@ -696,28 +702,26 @@ All ERROR frames sent MUST be CONNECTION_ERROR or REJECTED_RESUME error code.
696
702
Client side resumption operation starts when the client desires to try to resume and starts a new transport connection. The operation then proceeds as the following:
697
703
698
704
* Client sends RESUME frame. The client MUST NOT send any other frame types until resumption succeeds. The RESUME Identification Token MUST be the token used in the original SETUP frame. The RESUME Last Received Position field MUST be the last successfully received implied position from the server.
699
-
* Client waits for either a RESUME_OK or ERROR frame from the server.
700
-
* On receiving an ERROR frame, the client MUST NOT attempt resumption again if the error code was REJECTED_RESUME.
705
+
* Client waits for either a RESUME_OK or ERROR[CONNECTION_ERROR|REJECTED_RESUME] frame from the server.
706
+
* On receiving an ERROR[REJECTED_RESUME] frame, the client MUST NOT attempt resumption again.
701
707
* On receiving a RESUME_OK, the client:
702
708
* MUST assume that the next REQUEST, CANCEL, ERROR, and PAYLOAD frames have an implied position commencing from the last implied positions
703
709
* MAY retransmit *all* REQUEST, CANCEL, ERROR, and PAYLOAD frames starting at the RESUME_OK Last Received Position field value from the server.
704
-
* MAY send an ERROR frame indicating the end of the connection and MUST NOT attempt resumption again
710
+
* MAY send an ERROR[CONNECTION_ERROR|CONNECTION_CLOSE] frame indicating the end of the connection and MUST NOT attempt resumption again
705
711
706
712
Server side resumption operation starts when the client sends a RESUME frame. The operation then proceeds as the following:
707
713
708
714
* On receiving a RESUME frame, the server:
709
-
* MUST send an ERROR frame if the server does not support resuming operation. This is accomplished by handling the Ignore bit in the RESUME frame.
710
-
* use the RESUME Identification Token field to determine which client the resume pertains to. If the client is identified successfully, resumption MAY be continued. If not identified, then the server MUST send an ERROR frame.
715
+
* MUST send an ERROR[REJECTED_RESUME] frame if the server does not support resuming operation. This is accomplished by handling the Ignore bit in the RESUME frame.
716
+
* use the RESUME Identification Token field to determine which client the resume pertains to. If the client is identified successfully, resumption MAY be continued. If not identified, then the server MUST send an ERROR[REJECTED_RESUME] frame.
711
717
* if successfully identified, then the server MAY send a RESUME_OK and then:
712
718
* MUST assume that the next REQUEST, CANCEL, ERROR, and PAYLOAD frames have an implied position commencing from the last implied positions
713
719
* MAY retransmit *all* REQUEST, CANCEL, ERROR, and PAYLOAD frames starting at the RESUME Last Received Position field value from the client.
714
-
* if successfully identified, then the server MAY send an ERROR frame if the server can not resume operation given the value of RESUME Last Received Position if the position is not one it deems valid to resume operation from or other extenuating circumstances.
715
-
716
-
A Server that receives a RESUME frame after a SETUP frame, SHOULD send an ERROR.
720
+
* if successfully identified, then the server MAY send an ERROR[REJECTED_RESUME] frame if the server can not resume operation given the value of RESUME Last Received Position if the position is not one it deems valid to resume operation from or other extenuating circumstances.
717
721
718
-
A Server that receives a RESUME frame after a previous RESUME frame, SHOULD send an ERROR.
722
+
A Server that receives a RESUME frame after a SETUP frame, SHOULD send an ERROR[CONNECTION_ERROR].
719
723
720
-
A Server implementation MAY use CONNECTION_ERROR or REJECTED_RESUME as it sees fit for each error condition.
724
+
A Server that receives a RESUME frame after a previous RESUME frame, SHOULD send an ERROR[CONNECTION_ERROR].
721
725
722
726
Leasing semantics are NOT assumed to carry over from previous connections when resuming. LEASE semantics MUST be restarted upon a new connection by sending a LEASE frame from the server.
723
727
@@ -804,12 +808,11 @@ The requirements for the Resume Identification Token are implementation dependen
804
808
805
809
__NOTE__: The semantics are similar to [TLS False Start](https://tools.ietf.org/html/draft-bmoeller-tls-falsestart-00).
806
810
807
-
The term SETUP_ERROR is used below to indicate an ERROR frame that has a Stream ID of 0 and an Error Code
808
-
that indicates a SETUP error.
811
+
Immediately upon successful connection, the client MUST send either a SETUP or RESUME frame with
812
+
Stream ID of 0. Any other frame received that is NOT a SETUP|RESUME frame or a SETUP|RESUME frame with
813
+
a Stream ID > 0, MUST cause the server to send an ERROR[INVALID_SETUP] and close the connection.
809
814
810
-
Immediately upon successful connection, the client MUST send a SETUP frame with
811
-
Stream ID of 0. Any other frame received that is NOT a SETUP frame or a SETUP frame with
812
-
a Stream ID > 0, MUST cause the server to send a SETUP_ERROR (with INVALID_SETUP) and close the connection.
815
+
See [Resume Operation](#resume-operation) for more information about resuming. The rest of this section assumes use of SETUP for establishing a connection.
813
816
814
817
The client-side Requester can inform the server-side Responder as to whether it will
815
818
honor LEASEs or not based on the presence of the __L__ flag in the SETUP frame.
@@ -825,7 +828,7 @@ the SETUP frame set the __L__ flag. The server-side Requester may send requests
825
828
immediately upon receiving a SETUP frame that it accepts if the __L__ flag is not set in the SETUP frame.
826
829
827
830
If the server does NOT accept the contents of the SETUP frame, the server MUST send
828
-
back a SETUP_ERROR and then close the connection.
831
+
back an ERROR[INVALID_SETUP|UNSUPPORTED_SETUP] and then close the connection.
829
832
830
833
The __S__ flag of the SETUP indicates the client requires the server to adhere to strict interpretation
831
834
of the Data and Metadata of the SETUP. Anything in the Data and/or Metadata that is not understood or can
@@ -839,7 +842,7 @@ send a LEASE frame after a SETUP frame with the __L__ flag set.
839
842
A client assumes a SETUP is accepted if it receives a response to a request, a LEASE
840
843
frame, or if it sees a REQUEST type.
841
844
842
-
A client assumes a SETUP is rejected if it receives a SETUP_ERROR.
845
+
A client assumes a SETUP is rejected if it receives an ERROR.
843
846
844
847
Until connection establishment is complete, a Requester MUST NOT send any Request frames.
845
848
@@ -848,7 +851,7 @@ Until connection establishment is complete, a Responder MUST NOT emit any PAYLOA
848
851
### Negotiation
849
852
850
853
The assumption is that the client will be dictating to the server what it desires to do. The server will decide to support
851
-
that SETUP (accept it) or not (reject it). The SETUP_ERROR error code indicates the reason for the rejection.
854
+
that SETUP (accept it) or not (reject it). The ERROR[INVALID_SETUP|UNSUPPORTED_SETUP|REJECTED_SETUP] error code indicates the reason for the rejection.
852
855
853
856
### Sequences without LEASE
854
857
@@ -859,13 +862,13 @@ The possible sequences without LEASE are below.
859
862
* Server accepts SETUP, handles REQUEST, sends back normal sequence based on REQUEST type
@@ -1079,9 +1082,9 @@ Upon receiving a CANCEL, the stream is terminated on the Responder.
1079
1082
1080
1083
Upon sending a CANCEL, the stream is terminated on the Requester.
1081
1084
1082
-
Upon receiving an ERROR, the stream is terminated on both Requester and Responder.
1085
+
Upon receiving an ERROR[APPLICATION_ERROR|REJECTED|INVALID], the stream is terminated on both Requester and Responder.
1083
1086
1084
-
Upon sending an ERROR, the stream is terminated on both the Requester and Responder.
1087
+
Upon sending an ERROR[APPLICATION_ERROR|REJECTED|INVALID], the stream is terminated on both the Requester and Responder.
1085
1088
1086
1089
In absence of ERROR or CANCEL, the stream is terminated after both Requester and Responder have sent and received COMPLETE.
1087
1090
@@ -1125,8 +1128,7 @@ is responsible for the logic of generation and informing the Responder it should
1125
1128
Requester MUST respect the LEASE contract. The Requester MUST NOT send more than __Number of Requests__ specified
1126
1129
in the LEASE frame within the __Time-To-Live__ value in the LEASE.
1127
1130
1128
-
A Responder that receives a REQUEST that it can not honor due to LEASE restrictions MUST respond with an ERROR frame with error code
1129
-
of LEASE_ERROR. This includes an initial LEASE sent as part of [Connection Establishment](#connection-establishment).
1131
+
A Responder that receives a REQUEST that it can not honor due to LEASE restrictions MUST respond with an ERROR[LEASE_ERROR]. This includes an initial LEASE sent as part of [Connection Establishment](#connection-establishment).
1130
1132
1131
1133
<aname="flow-control-qos"></a>
1132
1134
#### QoS and Prioritization
@@ -1157,6 +1159,6 @@ assume it is set and act accordingly.
1157
1159
1. Receiving a PAYLOAD on an unknown Stream ID (including 0) MUST be ignored.
1158
1160
1. Receiving a METADATA_PUSH with a non-0 Stream ID MUST be ignored.
1159
1161
1. A server MUST ignore a SETUP frame after it has accepted a previous SETUP.
1160
-
1. A server MUST ignore a SETUP_ERROR frame.
1161
-
1. A client MUST ignore a SETUP_ERROR after it has completed connection establishment.
1162
+
1. A server MUST ignore an ERROR[INVALID_SETUP|UNSUPPORTED_SETUP|REJECTED_SETUP|REJECTED_RESUME] frame.
1163
+
1. A client MUST ignore an ERROR[INVALID_SETUP|UNSUPPORTED_SETUP|REJECTED_SETUP|REJECTED_RESUME] frame after it has completed connection establishment.
0 commit comments