Subject: Cost of parsing ACK frames in QUIC

From: "Deval, Manasi" <[email-masked]>
Date: Thu, 10 May 2018 14:25:38 +0000

Hi All,

The QUIC header definitions tend to use as few bits as possible by implementing the policy to use variable size fields. The result of this policy would be that each receiver needs to do a two part lookup to identify the field and this needs to be implemented serially in order to parse the whole frame time.

For example, in a case where no packets were dropped, a sender may receive an ACK for a single block. If a code path were trying to determine the size of an ACK, they would have to read 8 fields to determine the size of ACK.

A client only sees a few ACKs. Majority of the ACKs are seen on the server side. It would be good to simplify this scheme so ACK processing can be accelerated with SIMD instructions would be good.

Thanks,
Manasi

---

From: Mikkel Fahnøe Jørgensen <[email-masked]>
Date: Thu, 10 May 2018 07:44:21 -0700

While this may be true, please note that QUIC also requires that the entire
packet is valid before it does anything that modifies the state of the
receiver.

This means that you generally have to do two passes of the packet to ensure
that the packet is valid. In the first pass you can then store data for the
optimistic case of a single ACK frame.

That said, arguments about fast(er) processing still apply, but it is no
longer limited to only ACK frames.

On 10 May 2018 at 16.25.50, Deval, Manasi ([email-masked]) wrote:

Hi All,

The QUIC header definitions tend to use as few bits as possible by
implementing the policy to use variable size fields. The result of this
policy would be that each receiver needs to do a two part lookup to
identify the field and this needs to be implemented serially in order to
parse the whole frame time.

For example, in a case where no packets were dropped, a sender may receive
an ACK for a single block. If a code path were trying to determine the size
of an ACK, they would have to read 8 fields to determine the size of ACK.

A client only sees a few ACKs. Majority of the ACKs are seen on the server
side. It would be good to simplify this scheme so ACK processing can be
accelerated with SIMD instructions would be good.

Thanks,

Manasi

---

From: "Lubashev, Igor" <[email-masked]>
Date: Thu, 10 May 2018 14:48:24 +0000

My understanding is that QUIC requires that the packet decrypts successfully before it can modify the state of the receiver.  However, once it decrypts (hopefully in H/W), you do not need two passes.  You can modify the state as you parse the packet.  If there is anything syntactically or semantically wrong with the packet, that’s a cause for an immediate connection abort, so your entire state is out of the window at that point anyway.

  *   Igor

From: Mikkel Fahnøe Jørgensen [mailto:[email-masked]]
Sent: Thursday, May 10, 2018 10:44 AM
To: Deval, Manasi <[email-masked]>; IETF QUIC WG <[email-masked]>
Subject: Re: Cost of parsing ACK frames in QUIC

While this may be true, please note that QUIC also requires that the entire packet is valid before it does anything that modifies the state of the receiver.

This means that you generally have to do two passes of the packet to ensure that the packet is valid. In the first pass you can then store data for the optimistic case of a single ACK frame.

That said, arguments about fast(er) processing still apply, but it is no longer limited to only ACK frames.

On 10 May 2018 at 16.25.50, Deval, Manasi ([email-masked]<mailto:[email-masked]>) wrote:
Hi All,

Thanks,
Manasi

---

From: Nick Banks <[email-masked]>
Date: Thu, 10 May 2018 14:49:58 +0000

I’m don’t agree that you need to make two passes on a packet when processing ACK frames. If you have successfully decrypted the packet and you got to the point of processing ACK frames, then any other error that would later encounter while processing the packet would likely be considered a protocol violation, would it not? If so, then you would terminate the entire connection.

That being said, on the topic of being a bit more expensive to process ACK frames in general, QUIC has made a decision to generally prefer smaller wire encoding over CPU costs, where appropriate. If you have a suggestion to change the encoding that doesn’t increase the wire format cost, we could take a look at it.

- Nick

From: QUIC <[email-masked]> On Behalf Of Mikkel Fahnøe Jørgensen
Sent: Thursday, May 10, 2018 7:44 AM
To: Deval, Manasi <[email-masked]>; IETF QUIC WG <[email-masked]>
Subject: Re: Cost of parsing ACK frames in QUIC

Thanks,
Manasi

---

From: Mikkel Fahnøe Jørgensen <[email-masked]>
Date: Thu, 10 May 2018 07:52:10 -0700

Yes, that would often be the case.

On 10 May 2018 at 16.49.59, Nick Banks ([email-masked]) wrote:

I’m don’t agree that you need to make two passes on a packet when
processing ACK frames. If you have successfully decrypted the packet and
you got to the point of processing ACK frames, then any other error that
would later encounter while processing the packet would likely be
considered a protocol violation, would it not? If so, then you would
terminate the entire connection.

That being said, on the topic of being a bit more expensive to process ACK
frames in general, QUIC has made a decision to generally prefer smaller
wire encoding over CPU costs, where appropriate. If you have a suggestion
to change the encoding that doesn’t increase the wire format cost, we could
take a look at it.

- Nick

*From:* QUIC <[email-masked]> *On Behalf Of * Mikkel Fahnøe Jørgensen
*Sent:* Thursday, May 10, 2018 7:44 AM
*To:* Deval, Manasi <[email-masked]>; IETF QUIC WG <[email-masked]>
*Subject:* Re: Cost of parsing ACK frames in QUIC

Hi All,

Thanks,

Manasi

---

From: Mikkel Fahnøe Jørgensen <[email-masked]>
Date: Thu, 10 May 2018 08:12:30 -0700

At least for ACK outside handshake,
but you cannot feed unreliable data into your application, so generally you
need a full packet validation.

On 10 May 2018 at 16.52.10, Mikkel Fahnøe Jørgensen ([email-masked])
wrote:

- Nick

Hi All,

Thanks,

Manasi