L4STeam / linux

Kernel tree containing patches for TCP Prague and the dualpi2 qdisc
Other
47 stars 16 forks source link

Question about TCP Prague in socket programming #18

Open Jason-lmx opened 1 year ago

Jason-lmx commented 1 year ago

I want to set a flow to ECT(1) as low-latency traffic. So I would like to know if I can selectively use TCP Prague as a congestion control method in socket programming, what parameters can be set, and how to set them. Looking forward to your reply.

minuscat commented 1 year ago

To do this, make sure to use congestion control that supports ECT(1) traffic on the sender (e.g., TCP-Prague) and set the proper tcp_ecn parameter on both sender and receiver. Taking TCP-Prague as an example,

On the sender side, configure Prague congestion control and tcp_ecn:

sysctl -w net.ipv4.tcp_congestion_control=Prague
sysctl -w net.ipv4.tcp_ecn=3

On the client side, configure tcp_ecn:

sysctl -w net.ipv4.tcp_ecn=3

If above configuration is not doable, make sure you already load the module.

Jason-lmx commented 1 year ago

I am very interest in testing L4S in my network. I am trying to understand how it affects the terminals. "sysctl" seems to be a global behavior. Does TCP prague support customizing the parameters of a single flow,except ‘ecn’ ?

Also, I would like to know how QUIC supports BBRv2 and L4S, any suggestions are welcome.

minuscat commented 1 year ago

Indeed, sysctl is a global behaviour. But if you run your L4S in the network namespace it will not affect the root namespace. Not sure about your meaning for "customising the parameters of a single flow", but if your goal is to test L4S without modifying all your current setup, the simplest way is to run the application using namespace or even use dedicated machines with Prague kernel.

Related to QUIC support L4S, AFAIK from the thread (https://developer.apple.com/forums/thread/720486), the QUIC can support L4S under Developer setting. But related QUIC support BBRv2, I am not aware on that.

Jason-lmx commented 1 year ago

I mean could I set some parameters of TCP prague in SOCKET, such as rtt_target. Also,May I ask when a congestion event is detected, how does the sender adjust the congestion window? What is the difference between ‘prague_enter_loss’ and 'prague_enter_cwr'?Why did you use ‘prague_classic_ecn_fallback’ to update alpha?

minuscat commented 1 year ago
  1. You can use the following two commands to see the meaning of TCP Prague module parameters and their current values, but if you want to change then you need to reload the module parameters with the parameters. modinfo tcp_prague systool -vm tcp_prague
  2. If you are asking the ACCECN (I assume) the sender adjust the congestion window based on the ECN Echo feedback in TCP ack to adjust.
  3. The enter_loss and enter_cwr are used respectively for TCP_CA_Recovery (means when packets are re-transmitted) and TCP_CA_CWR (means when congestion window reduced)
  4. Finally, the prague_classic_ecn_fallback is used when the TCP Prague is configured to detect & fallback for classic ECN, but this mode is not used as default right now.