dtaht / sch_cake

Out of tree build for the new cake qdisc
100 stars 35 forks source link

question about fair queuing. #133

Closed odkrys closed 4 years ago

odkrys commented 4 years ago

I am testing the behavior of the cake. The problem I am having is when idm (internet download manager) is used, idm eats up most of the bandwidth.

IDM helps to receive files at high speed through simultaneous connection. For example, if I start to receive Google Drive files on 100/100Mbps Internet through 4 simultaneous connections, YouTube is guaranteed only 20Mbps bandwidth. That's why 4K@60fps video (which requires at least 25Mbps speed) takes stuttering.

If I download with 2 connections, Youtube is guaranteed 33.3Mbps speed, so there is no problem viewing the same 4k@60fps video.

If I have 8 connections, YouTube is guaranteed a 11.1 Mbps speed, which makes 1440p@60fps video difficult to watch.

The connections are probably something like this.

192.168.50.100:10000-> youtube.com:443 192.168.50.100:20000-> googledrive.com:443 192.168.50.100:30000-> googledrive.com:443 192.168.50.100:40000-> googledrive.com:443 192.168.50.100:50000-> googledrive.com:443

This seems to be expected behavior. What I'm curious about is whether youtube: 443 and 4 x googledrive.com:443 connections can guarantee 1:1 bandwidth.

moeller0 commented 4 years ago

So the default behaviour for cake is equitable sharing between all active flows, so your observed behaviour is expected. The simplest work-arounds for that issue are:

a) use cake's dual isolation modes and use idm on a different internal host than youtube, that way up to 4 concurrently active hosts/applocations youtube will get the 25Mbps it requires*. (You might be able to use network nmae spaces to get a different IP address for the IDM in that case you might be able to still run both applications on the same real host computer, but that gets fiddly to configure).

b) if a) is not desirable use an idm that allows to control the maximum download rate.

I note that this issue should not be exclusive to cake, even without an AQM bottleneck bandwidth sharing is roughly equitable, so your google drive flows can also affect a concurrent youtube stream (fair queueing AQMs like cake will make the issue more likely to bite and be noticed, but this is IMHO a quantitative, not a qualitative change).

Best Regards Sebastian

*) Obviously there will be a few other applications on each host eating up bandwidth, so the calculation above is only approximate, but you get the gist, I hope...

On May 28, 2020, at 09:57, odkrys notifications@github.com wrote:

I am testing the behavior of the cake. The problem I am having is when idm (internet download manager) is used, idm eats up most of the bandwidth.

IDM helps to receive files at high speed through simultaneous connection. For example, if I start to receive Google Drive files on 100/100Mbps Internet through 4 simultaneous connections, YouTube is guaranteed only 20Mbps bandwidth. That's why 4K@60fps video (which requires at least 25Mbps speed) takes stuttering.

If I have 8 connections, YouTube is guaranteed a 12.5 Mbps speed, which makes 1440p@60fps video difficult to watch.

The connection is probably something like this.

192.168.50.100:10000-> youtube.com:443 192.168.50.100:20000-> googledrive.com:443 192.168.50.100:30000-> googledrive.com:443 192.168.50.100:40000-> googledrive.com:443 192.168.50.100:50000-> googledrive.com:443

This seems to be expected behavior. What I'm curious about is whether youtube: 443 and 4 x googledrive.com:443 connections can guarantee 1:1 bandwidth.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

odkrys commented 4 years ago

dual-srchost & dual-dsthost / triple-isolate allows me to watch 4k@60fps video on my smartphone when using IDM with 8 connections on a PC. nat seems essential. IDM speed goes down to 60~70Mbps and when I turn off youtube, it goes up to 100Mbps again.

Fortunately, IDM has a speed limit feature. I was curious. Because if I turn on IDM's speed limit feature always, I will lose some bandwidth when there is no other activity.

I think I need to find out what the network namespaces feature is. Thanks.

chromi commented 4 years ago

On 28 May, 2020, at 11:05 am, moeller0 notifications@github.com wrote:

So the default behaviour for cake is equitable sharing between all active flows, so your observed behaviour is expected. The simplest work-arounds for that issue are:

a) use cake's dual isolation modes and use idm on a different internal host than youtube, that way up to 4 concurrently active hosts/applocations youtube will get the 25Mbps it requires*. (You might be able to use network nmae spaces to get a different IP address for the IDM in that case you might be able to still run both applications on the same real host computer, but that gets fiddly to configure).

b) if a) is not desirable use an idm that allows to control the maximum download rate.

Option c) is to try using the triple-isolate mode of Cake. As long as the external end of the IDM's connections are all to the same IP address, this will treat the IDM as a single flow for fairness purposes.

However, googledrive.com is a sharded server with multiple IP addresses. It is entirely possible for each connection from the IDM to go to a different one. You'll have to try it and see.

odkrys commented 4 years ago

Hello Jonathan. Thanks for answer. triple-isolate was the first what I tested. Because it is a default option. It allows me to watch 4k@60fps youtube video on my smartphone, but it doesn't help on a PC running IDM.

chromi commented 4 years ago

On 28 May, 2020, at 11:44 am, odkrys notifications@github.com wrote:

It allows me to watch 4k@60fps youtube video on my smartphone, but it doesn't help on a PC running IDM.

That does imply that the IDM is making connections to multiple external IP addresses. It's basically impossible to distinguish the IDM's traffic as belonging to a single application, distinct from YouTube, under those circumstances.