On 10/29/26 10:30, Antonio Quartulli wrote:
> On 29/10/2026 10:23, Simon Schippers wrote:
>> On 10/29/26 09:07, Antonio Quartulli wrote:
>>> On 29/10/2026 07:19, Simon Schippers wrote:
>>>>> Inside the linux kernel this works reasonably well.
>>>>> We are just playing with several of this knobs in DCO at the moment.
>>>>>
>>>>
>>>> I see. The ovpn driver never calls netif_tx_stop_queue(), so DCO has no
>>>> qdisc backpressure either, right?
>>>
>>> I think Ralf gave a pretty clear explanation of the status here :-)
>>> Adding queue comes with various problems.
>>>
>>> Bufferbloat to start with.
>>
>> I understand it now, thanks Ralf!
>>
>>>
>>>>
>>>>>>
>>>>>> Our paper [2] evaluated this with OpenVPN: over a 120 ms RTT link
>>>>>> between Germany and the USA, TCP throughput without the patch was up to
>>>>>> 36% worse, and with it no retransmissions occurred. With higher
>>>>>> latencies, throughput without the patch can be even worse.
>>>>>>
>>>>>> Unfortunately, stopping and waking the queue can reduce throughput with
>>>>>> many parallel senders: in a synthetic test with eight iperf3 senders,
>>>>>> throughput dropped from 13.5 to 9.13 Gbit/s [3]. The flag is therefore
>>>>>> disabled by default and can be enabled with the new --tun-backpressure
>>>>>> option.
>>>>>
>>>>> Given what you just said above, don't you think users will normally want
>>>>> this off all the time?
>>>>>
>>>>> A VPN tunnel spends most of its time forwarding multiple streams from the
>>>>> host (in case of a roadwarrior setup) or from its LAN clients (in case of
>>>>> a VPN client installed on a router).
>>>>>
>>>>> Do you foresee any reasonable scenario when a user would enable this flag
>>>>> and keep it on all the time?
>>>>
>>>> I think most users should. The TUN/TAP device is usually not the
>>>> bottleneck, the encryption or the network is. Dropping packets in the
>>>> TUN/TAP driver for no good reason hurts real-world TCP throughput, as
>>>> shown in our paper [1] (it has an old implementation). That is why users
>>>> often raise the queue length (--txqueuelen in OpenVPN). This mostly fixes
>>>> the throughput, but causes bufferbloat. Also, the qdisc's ECN marking and
>>>> flow fairness only work with IFF_BACKPRESSURE.
>>>
>>> The internet is going towards "avoid bufferbloat, even if it costs a little
>>> throughput" and to be honest I strongly agree here.
>>>
>>> On top of that, if people wants performance on Linux, they should just
>>> switch to DCO - that's where our effort is going nowadays.
>>>
>>> Adding more complexity for tun, only for linux and only for a very small
>>> niche is not really acceptable. Especially if complexity comes with yet
>>> another option knob.
>>
>> I am not sure if I understand correctly. Wouldn't simply enabling it
>> without a new OpenVPN option be fine then?
>>
>> #ifdef IFF_BACKPRESSURE
>> ifr.ifr_flags |= IFF_BACKPRESSURE;
>> #endif
>>
>> From my POV, this would reduce complexity. Users like me would no longer
>> have to raise --txqueuelen (and get bufferbloat) to get full throughput.
>
> This would be better, yes.
>
> But earlier you said that with many flows/senders (which is often the case in
> a VPN scenario, isn't it?) throughput is reduced.
In that measurement, eight senders on different CPUs pushed around
10 Gbit/s to a QEMU VM, where the packets are just passed on. There, the
TUN path itself uses most of the CPU, so the extra work of
netif_tx_stop_queue() and netif_tx_wake_queue() shows up, also because
each stop/wake has to reach the other CPUs.
>
> So aren't we going to reduce throughput for most people by doing this?
I don't think so. With a VPN, the encryption or the network is the
bottleneck, far below that rate, and the stop/wake cost is small
compared to encrypting a packet.
I could run benchmarks if you want..
>
>
> On top of this, why not using DCO to get better performance overall?
> (throughput, CPU usage, etc..)
Yes, DCO is the better choice when it is available.
>
>
> Regards,
>
>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel