MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

Turn off quic?

Open Jonesie opened this issue 1 year ago • 7 comments

Describe your question

I dont know if this is at all possible but we have a single customer blocking QUIC in their firewall and we cant use WebSockets without a lot of rework (auth issues). Is it possible to fallback to using plain old TCP/UDP or whatever came before QUIC? Assuming this would be a client configuration since I cant find any reference to QUIC in the AWS IoT Core docs.

Which project is your question related to?

  • Client or
  • ManagedClient

Jonesie avatar Nov 16 '23 19:11 Jonesie

For the HTTP-stack within .NET you can disable QUIC via the environment variable DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP3SUPPORT by setting it to false.

But I wonder how is this related to MQTTnet as that doesn't support QUIC. See https://github.com/dotnet/MQTTnet/issues/1195 Or is there something going on that originates from .NET itself (as you mentioned Websockets).

Can you share what .NET version you are using?

gfoidl avatar Nov 17 '23 09:11 gfoidl

I'll try that. We are using .net 6 currently.

Thanks!

Jonesie avatar Nov 17 '23 15:11 Jonesie

We are using .net 6 currently.

That's interesting, because until .NET 7 QUIC was only used internally for HTTP/3. So I wonder where the (blocked) traffic comes from.

MQTT here is based on TCP, so no QUIC which is UDP based.

gfoidl avatar Nov 17 '23 15:11 gfoidl

Are you sure that setting is not DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT ? Looking at this page: https://learn.microsoft.com/en-us/dotnet/core/runtime-config/networking

I tried setting HTTP3 and HTTP2 to 0 then running my app but I still see QUIC traffic in wireshark - which may be other apps I guess. Its the first time Ive had to use wireshark. Also, Im not sure how to block quic on my setup (VM running under VirtualBox on PopOs) so I cant emulate whatever the client has done.

Jonesie avatar Nov 17 '23 16:11 Jonesie

So your saying that MQTT doesnt use QUIC at all? Maybe theres some lookup thing happening as part of initialisation of the networking. Im definitely seeing some QUIC packets when I start my app so maybe the MQTT thing is a red herring. I wish I could block QUIC here then it might be more obvious.

Jonesie avatar Nov 17 '23 16:11 Jonesie

Are you sure that setting is not DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT ?

Yes, as HTTP/2 has nothing to do with QUIC.

MQTT doesnt use QUIC at all?

At least the implementation here. https://github.com/dotnet/MQTTnet/issues/1195 discusses using QUIC for MQTT.

seeing some QUIC packets when I start my app

Just as wild guess: .NET SDK and .NET CLI telemetry where you can opt-out. How do you start the app?

gfoidl avatar Nov 17 '23 16:11 gfoidl

Pretty wild yes :) I have a compiled exe. Normally debugging via Visual Studio but Ive started from powershell also. Not using dotnet run.

I'll need to actually block QUIC locally to see whats going on but it's looking more and more like it's not related to MQTT.

Thanks for all the help. I'll post an update if/when I figure it out.

Jonesie avatar Nov 17 '23 17:11 Jonesie