diff --git a/api-outline.md b/api-outline.md index 33926f3..bd4445d 100644 --- a/api-outline.md +++ b/api-outline.md @@ -200,13 +200,25 @@ dictionary RtcPacketSentInfo { DOMHighResTimeStamp sendTime; }; -dictionary RtcPacketReceived { +enum RtcEcnMarking { + "classic", + "l4s", + "experienced-congestion", +}; + +[Exposed=Window,Worker] +interface RtcPacketReceived { // TODO: BYOB, change to a CopyToBuffer function. - // TODO: L4S/ECN - ArrayBuffer data; - DOMHighResTimeStamp receiveTime; + readonly attribute ArrayBuffer data; + readonly attribute DOMHighResTimeStamp receiveTime; + + // ECN marking observed when this packet was received. This is receive-only + // metadata and is not part of `data`; forwarding `data` does not copy the + // marking to the newly sent packet. This is null for packets with an ECN + // field of 00. + readonly attribute RtcEcnMarking? ecnMarking; - RtcNetworkRoute networkRoute; + readonly attribute RtcNetworkRoute networkRoute; }; ``` diff --git a/index.bs b/index.bs index 70f45b1..f73a2eb 100644 --- a/index.bs +++ b/index.bs @@ -843,21 +843,50 @@ dictionary RtcPacketSentInfo { : sendTime :: The actual timestamp that the packet was put on the wire. +## RtcEcnMarking ## {#rtc-ecn-marking} +
+enum RtcEcnMarking {
+  "classic",
+  "l4s",
+  "experienced-congestion"
+};
+
+: "classic" +:: The ECN field is `10`, indicating the ECT(0) codepoint used by classic ECN senders. + +: "l4s" +:: The ECN field is `01`, indicating the ECT(1) codepoint used by L4S-aware senders. + +: "experienced-congestion" +:: The ECN field is `11`, indicating that the packet experienced congestion. + ## RtcPacketReceived ## {#rtcpacketreceived}
-dictionary RtcPacketReceived {
-  ArrayBuffer data;
-  DOMHighResTimeStamp receiveTime;
-  RtcNetworkRoute networkRoute;
+[Exposed=(Window,Worker)]
+interface RtcPacketReceived {
+  readonly attribute ArrayBuffer data;
+  readonly attribute DOMHighResTimeStamp receiveTime;
+  readonly attribute RtcEcnMarking? ecnMarking;
+  readonly attribute RtcNetworkRoute networkRoute;
 };
 
-: data +: data :: The byte buffer received. -: receiveTime +: receiveTime :: The timestamp of packet receipt. -: networkRoute +: ecnMarking +:: The Explicit Congestion Notification (ECN) field of the IP packet as + received from the network, or `null` if the ECN field is `00`, indicating + a Not-ECN-Capable Transport packet. + + This is receive-only metadata. It is not part of + {{RtcPacketReceived/data}}, and copying that data into an + {{RtcPacketToSend}} does not cause the received ECN marking to be applied + to the packet sent by {{RtcTransport/sendPackets()}}. + +: networkRoute :: The route the packet arrived on. ## IceServer ## {#iceserver}