msquic icon indicating copy to clipboard operation
msquic copied to clipboard

Incomplete data packets received when encryption is disable.

Open fofewyoung opened this issue 2 years ago • 6 comments

Describe the bug

In my stress testing program, when I turn off encryption by setting QUIC_PARAM_CONN_DISABLE_1RTT_ENCRYPTION to TRUE, I found that there is a small chance of receiving incomplete data packets (some header bytes is missing).

Affected OS

  • [X] Windows
  • [ ] Linux
  • [ ] macOS
  • [ ] Other (specify below)

Additional OS information

windows 10

MsQuic version

release/2.1

Steps taken to reproduce bug

  1. set QUIC_PARAM_CONN_DISABLE_1RTT_ENCRYPTION to TRUE
  2. send many packets to clients from one server
  3. use clumsy to make some lag and drop
  4. Verifying data integrity

Expected behavior

Receiving complete data packets

Actual outcome

some header bytes is missing

Additional details

No response

fofewyoung avatar Feb 06 '23 11:02 fofewyoung

small chance of receiving incomplete data packets

Can you please provide more details on this? What do you mean by incomplete? Just not all in a single receive call? It never comes? Do you have any logs you can share?

nibanks avatar Feb 06 '23 12:02 nibanks

int my test: server: stream send bytes0: 240 240 0 0 0 0 0 1 2 3 4 5 (12 bytes) stream send bytes1: 240 240 0 0 0 0 0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9……(40KB ~ 60KB) ...

client: stream receive bytes0: 240 240 0 0 0 0 0 1 2 3 4 5 (12 bytes) -- ok stream receive bytes1: 5 6 7 8 9 1 2 3 4 5 6 7 8 9…… the header bytes(240 240 0 0 0 0 0 1 2 3 4 ) is missing ...

fofewyoung avatar Feb 06 '23 14:02 fofewyoung

Can you share logs for a repro?

nibanks avatar Feb 07 '23 00:02 nibanks

@nibanks
https://drive.google.com/file/d/16WR2NWT3oO12Y6vtjsCIJYK2ziM-ZMpO/view?usp=share_link

fofewyoung avatar Feb 07 '23 03:02 fofewyoung

I tested the whole day today with the same code, only the encryption was turned on, and the issue never happened

fofewyoung avatar Feb 07 '23 08:02 fofewyoung

The only thing I can think is that the UDP checksum was bad and the packet was still accepted. I think the only way forward here is to add minimal checksum support.

nibanks avatar May 08 '23 22:05 nibanks