jamulussoftware / jamulus

Jamulus enables musicians to perform real-time jam sessions over the internet.
https://jamulus.io
Other
997 stars 222 forks source link

set TOS/DSCP IP header bits for routers to prioritize packages #1016

Closed bjacke closed 3 years ago

bjacke commented 3 years ago

To signalize edge routers to prioritize Jamulus UDP traffic, it would be good if Jamulus would set the TOS header bits accordingly. https://doc.qt.io/qt-5/qabstractsocket.html describes TypeOfServiceOption which could probably used for that. A values of 0x10 (IPTOS_LOWDELAY) is an often used value, which is known to be very compatible with different kinds of routers without causing problems. That would help many people get better latency even if they are not able to configure QoS manually on their routers.

gene96817 commented 3 years ago

A very good idea. However many (most?) ISPs (in the USA) ignore these bits.

bjacke commented 3 years ago

It's imporant for routers before the packages arrive the internet. Many home router honor TOF bits and send the packages out earlier, even if othe bulk data is in the send queue

18.02.2021 17:53:14 gene96817 notifications@github.com:

A very good idea. However many (most?) ISPs (in the USA) ignore these bits.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub[https://github.com/jamulussoftware/jamulus/issues/1016#issuecomment-781484904], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAP2C7FEXNCVZVTO3XQ5VHLS7VAXLANCNFSM4X2OOTGA]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAnSURBVHic7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAAPBjRFIAASHKmKkAAAAASUVORK5CYII=###24x24:true###][Verfolgungsbild][https://github.com/notifications/beacon/AAP2C7GRCKYFESLMA7WV7YLS7VAXLA5CNFSM4X2OOTGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2KIG2A.gif]

gene96817 commented 3 years ago

Yes, individuals can configure their personal network to give Jamulus packets priority over competing traffic from other members of their household. I would not give this idea to anyone that needed assistance installing Jamulus.

ghost commented 3 years ago

This functionality should be added to the Linux version of Jamulus... and Apple (BSD ) if possible. IPTOS in Linux sockets programming is obviously Not obsolete. Otherwise, one will have to configure their router or firewall to set these bits in IP packets. Maybe someone (MSFT ?) could write a Windows(tm) driver to add IPTOS funtionality

hoffie commented 3 years ago

I like this idea. I've been running my Jamulus servers (and even clients) while adding TOS flags using iptables. Although I haven't done any objective tests, it seems that ping times are reduced.

Having this directly in Jamulus would simplify setups and make this accessible to more people and platforms.

@bjacke Do you know about possible negative side effects, such as routers blocking such packets entirely?

which is known to be very compatible with different kinds of routers without causing problems

Any pointers regarding that maybe?

bjacke commented 3 years ago

IPTOS_LOWDELAY (0x10) is working very well and I'm not aware of broken routers that block those packets openssh has been using IPTOS_LOWDELAY for a long time, then they changed that to af21 because they liked that more for some reason. That change however resulted in a number of boxes to drop those packages then. This is why Debian for example patched their ssh client back to use IPTOS_LOWDELAY insted of af21. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923880 To make a long story short, the TOS value of 0x10 is quite common and known to be working stable.

gilgongo commented 3 years ago

@pljones @ann0see @bjacke (and others)

Does this idea need some discussion before arriving at an implementable spec? If so, please move to Discussions and once we have some agreement we can create a work ticket.

pljones commented 3 years ago

The first question: can it be done with Qt without writing platform-specific code?

If the answer to that is "No", then alternative solutions need to be considerably harder to implement that making platform-specific changes to Jamulus (which are to be avoided). In addition, the benefit needs to be measurable and deterministic, so that it can be verified that the change is working.

(I'm definitely not saying "Don't do it" - just we don't want code that can't be tested as doing what we say it does. So whoever does this also needs to provide reproducible test cases demonstrating it the improvement.)

gilgongo commented 3 years ago

Does this idea need some discussion before arriving at an implementable spec?

@bjacke @hoffie @gene96817

can it be done with Qt without writing platform-specific code?

I'll take that as a "yes" :-)

(The reason for this is that we're trying to get Issues into a state where we can start tagging and bagging them for a road map, milestones, etc. So unless we have a reasonably clear spec for something, please discuss ideas first, then raise the necessary tickets/ do PRs once we have an agreed plan of action - thanks!)