Internet-Draft | FEC for QUIC | May 2024 |
Moskvitin, et al. | Expires 7 November 2024 | [Page] |
This document proposes a FEC supporting mechanism of QUIC protocol for both short flows and long flows protection in accordance to the sender observed packet loss rate.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 7 November 2024.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The QUIC protocol [QUICv1] is general purpose transport protocol, which supports both reliable and unreliable data transmission. Depending on application-specific use cases, one can choose either to rely on QUIC built-in loss recovery mechanism [QUIC-RECOVERY] or to use application layer retransmission mechanism. In both cases it takes more than one round-trip time to retransmit lost data, which may be crucial in delay-sensitive applications (e.g. RTC) if RTT is high enough. Forward erasure coding allows to avoid or minimize extra delay incurred by the retransmission of lost data, while redundancy adaptation minimizes data overhead generated by FEC..¶
There are several works considering the use of Forward Erasure Correction (FEC) in QUIC protocol: [I-D.roca-nwcrg-rlc-fec-scheme-for-quic], [I-D.swett-nwcrg-coding-for-quic] and [I-D.michel-quic-fec]. These works share the common idea of protecting a sequence of packets each containing protected data. But there is a broad area of applications there it’s only needed to send short messages of data (one or couple QUIC packets) in timely manner with relatively high time gap in-between, for example instant messaging, control channels, notifications, etc. In this case it’s more beneficial to protect every message independently of each over.¶
This document defines extensions to the QUIC protocol which has the ability to cover both use cases, i.e., either a FEC packet protecting a sequence of packets or several FEC packets protecting single packet independently, and adaptively adjust the FEC redundancy according to packet loss rate. It is useful in random loss scenarios for delay sensitive services.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
FEC mechanisms used for streaming scenario which is one FEC pacekts protecting a seqence of packets is well known. In this section, how to protect whole QUIC packet is introduced, motivated by the applications described in introduction. Therefore, each protected packet corresponds to several repair symbols, and each repair symbol correspond to one protected packet. Prior to encryption, serialized QUIC packet is divided into several parts, called shards, each shard acts as source symbol and sequence of shards corresponding to single QUIC packet act as message (see Figure 1).¶
Number of shards depend on encoding algorithm and parameters used for protection. If the size of protected packet is either too small or can’t be evenly divided, then the protected packet may be padded with PADDING frame during serialization to achieve desirable size. It is noted that this method only protect the application data space.¶
After sending protected packet, sender SHOULD encode corresponding shards into repair symbols and send them afterwards. Several repair symbols MAY be sent in one QUIC packet, but it’s RECOMMENDED to send repair symbols in separate packets. In general, distribution of repair symbols between packets depends on properties of concrete erasure code used. Each repair symbol MUST contain information about corresponding protected packet number. It allows to avoid marking protected packets with some FEC-specific id.¶
Receiver MAY ignore repair symbols, particularly in the cases when corresponding protected packet is either already received or recovered. Repair symbols are accumulated on receiver either until recovery or the moment when recovery of corresponding lost packet is not possible anymore.¶
The FEC extension described in this document SHOULD work as an addition to built-in QUIC loss recovery mechanism and intended only for faster recovery of data lost during transmission through network. Modules of QUIC, which rely on precise loss rate measurements (e.g. congestion control) during transmission, should be provided with actual packet loss rate from wire, rather than loss rate measured after recovery. Depending on repair symbol scheduling, packet recovery may be observed as packet reordering in wire, therefore should be properly accounted. Finally, FEC adaptive redundancy mechanism should consider possible losses incurred by congestion control overshooting and avoid positive feedback loop: recursively increase redundancy as a reaction to increased packet loss rate.¶
QUIC protocol extensions are specified in this sectioin.¶
This extension defines a new transport parameter, used to negotiate the use of FEC extensions during the connection handshake, as specified in [QUICv1]. The new transport parameter is defined as follows:¶
enable_FEC: The enable_FEC transport parameter is included if the endpoint supports FEC mechanism and FEC extensions as defined in this draft. This parameter specify the the support FEC algorithm. How the FEC algorithm is encoded will be added in future versions.¶
FEC_Tag Frame are used to indicate the relationship between FEC source symbol and repair symbol, as well as adaptive FEC information. FEC_Tag frames are formattes as follow Figure 3¶
This FEC Tag frame can be used either in source symbol or in repair symbol. It contains the following fields:¶
Tag type: It indicates the usage of this FEC tag. 0 indicates it is using short message FEC mechanism, in which case only repair symbol MUST include this frame; 1 indicates it's for long flow usage in which case both source symbol and repair symbos must include this frame.¶
Sequence: The sequence number in FEC block. When the frame is used in source symbol, it indicates sequence number of this proctected QUIC packet appeared in the current FEC block. When the frame is used in repair symbol, it indicates the sequence number of this repair packet in the current FEC block produced by the FEC mechanism.¶
Tag ID Length: It is encoded as an unsigned two-bit integer that is one less than the length of the Tag ID field in bytes¶
Tag ID: It is the information of current FEC block. In the case of tag type is 0, i.e., one QUIC packet is protected by several FEC repair packets, it is equal to the corresponding source packet number that the FEC frame protects, As defined in the packet number definition in [QUICv1]. In the case of tag type is 1, i.e., multiple QUIC packets are protected by one or multiple FEC repair packets, it is encoded as the FEC block ID.¶
Redundancy Ratio: The ration of FEC repair packets in one FEC block. It is equivalent to taking the interger part after multiplying the redundancy ratio by 256. The redundacy ratio is defined to be the number of FEC repair packets divided by the total number of packets sent in the same FEC block. When this field is 0, it means that adaptive FEC is not used.¶
FEC-REPAIR Frame are used by a sender to contain the FEC symbol which will be used by the receiver to recover a lost packet. FEC_REPAIR frames are formatted as follow Figure 4.¶
It contains the following fields:¶
FEC Version: A variable-length integer which specifies the encoding algorithm used and the structure of the following FEC Meta Data field.¶
FEC Meta Data: A structure, which is intended for additional information about repair symbol, such as identificator of repair symbol in the coding block, encoding parameters, FEC Payload size, etc. Contents of this structure depend on concrete implementation and encoding algorithm used.¶
In this case, the souce symbol quic packets are untouched. The repair symbol quic packets will look like as follow:¶
Repir_Symbol_QUIC_Packet { QUIC header, FEC_Tag, FEC_REPAIR }¶
In this case, both the souce symbol quic packets and the repair symbol quic packets MUST contain FEC_Tag frame.¶
Souce_Symbol_QUIC_Packet { QUIC header, FEC_Tag, Original payload } Repir_Symbol_QUIC_Packet { QUIC header, FEC_Tag, FEC_REPAIR }¶
In the case of lost source symbol packets have been successfully recovered by FEC mechnisim, it should avoid the retransmssion of those packets at the sender. Thus, the receiver MUST treat those recovered packets as the received packets, in stead of lost packets, in the ACK frames.¶
In the case of lost pacekts are FEC repair symbol, retransmission of these packet at the sender is meaningless. Therefore, the sender SHOULD ignore them when detecting such losses from the ACK frames.¶
Loss rate calculation is based on the received ACK frame by the sender. With the introduction of FEC, loss rate calculation will includes repair packets, which is not accurately represent the source symbol packet loss rate. When using adaptive FEC, a more precise calculation of the original packet loss rate would be benefitial to determine the appropriate level of FEC redundancy to be injected. Considering the diagram as follow.¶
To address this issue, a new frame is introduced to inform the sender what packets have been recovered. It is formatted as follow Figure 6.¶
FEC Latest Restored Packet Number: A variable-length integer which contains latest restored packet number.¶
FEC Restored Bytes: A variable-length integer which contains number of bytes restored on receiver side. This field is intended for statistics collection and analysis on sender.¶
FEC Restored Packets: A variable-length integer which contains number of packets restored on receiver side. This field is intended for statistics collection and analysis on sender.¶
FEC Restored Packet List Size: A variable-length integer which contains amount of packet numbers following after in that frame.¶
FEC Restored Packet Number: A list of recovered packet numbers listed in restoring order (newer first).¶
This frame is optional. It can be used to calculate the loss rate more accurately when used for adaptive FEC.¶
In order to achieve maximum efficiency, sender should change encoding algorithm parameters to match network conditions. To be precise, from a set of algorithm parameters, which provide a certain protection level at current network packet loss rate ( we provide example of relation between loss rate in BEC and performance of FEC scheme with fixed parameters as follow), choose one that have maximum coding rate. This way it will tend to reduce redundancy while providing certain level of protection.¶
The FEC mechanism for QUIC only runs under 0-RTT and 1-RTT encryption levels and only operates inside the encrypted payload.¶
An attacker could try to cause a DoS of a receiver by selectively sending repair symbols to trigger intensive erasure correction operations on the receiver. A QUIC receiver is never forced to perform any erasure correction and may ignore any received repair symbol if it has doubts in its capabilities to decode it in a reasonable amount of time.¶
This document defines a new transport parameter for supporting FEC mechanisms, and possibly 2 new frame types.¶