The online racing simulator
QoS for LFS client
(20 posts, started )
QoS for LFS client
I need to set up QoS on my router for LFS, sometimes I or someone else on my network need to download something, and I want to play LFS meanwhile.
I have enough bandwidth for this with an 8 mbit/1 mbit line, so it's not like it will lag enough to annoy others. At least not with QoS set up properly.

Which ports do I need to assign to QoS for the LFS client?
i think you want to set priority?
My router have DMZ and that set first packets for me and other packets for other ips
I want to set the priority of LFS to higher than for example torrent downloads. And I want to do this through my routers QoS. I just need the port numbers the client uses
that depends on the server usually... you might want to look into application-level-based QoS.
But I thought that the client always used the same port? Even if different servers use different ports, which they might, the client uses the same port on my computer to connect to the variable port on the server?
I just can't find anything in the manual, and I'm too lazy to mess around with ethereal or something.
There is a sticky thread about running LFS server in this section. You should find anything you need there.
Quote from RasmusL :But I thought that the client always used the same port? Even if different servers use different ports, which they might, the client uses the same port on my computer to connect to the variable port on the server?

nope, outgoing connections from computers use random ports over 1024.
Quote from bunder9999 :nope, outgoing connections from computers use random ports over 1024.

Well, that's LFS' choice then. I know as a fact that you can bind any socket on any port you want in winsock. I'll check out the server thread, but the server ports I'm not interested in?
I'll try port 63392 and see how it goes.
I don't think that QoS is working, even with a mere 200 kb/s download alongside LFS puts my ping over 2-300 on all servers Usually it's around 50.
I used to just prioritise any packet with a size of less than 256 bytes (excluding SYN/ACK/RST packets and such, which i also did prioritise though, but with a different rule)
That seemed to work well for LFS, since all LFS multiplayer packets are smaller than 256 bytes.
If you think that's too rough of a rule, you could limit it to only UDP packets, so LFS position updates are prioritised and/or limit it to port numbers above 1024.
Quote from Victor :I used to just prioritise any packet with a size of less than 256 bytes (excluding SYN/ACK/RST packets and such, which i also did prioritise though, but with a different rule)
That seemed to work well for LFS, since all LFS multiplayer packets are smaller than 256 bytes.
If you think that's too rough of a rule, you could limit it to only UDP packets, so LFS position updates are prioritised and/or limit it to port numbers above 1024.

What software did you use for that? I'm running ddwrt on my router and it doesn't seem to have that capability I can run any unix program on my router though, so I guess something could be fixed up
If you live in a studenthouse it's difficult, but in a family house you could arrange other people don't use the full download. It's also what i use to keep my phone (sip) working correctly while downloading.

In the DDWRT firmware you can give priority to a port or macadress. You could try that as well. Only problem is that the router doesn't know the actual bandwith, so you have to test what it is by downloading something big and then configure that speed as max speed in DDWRT. The problem then still exists when your ISP can't give you your whole bandwith (overbooked lines) your QOS won't work, but if you have a good ISP that won't happen to often.
Quote from RasmusL :What software did you use for that? I'm running ddwrt on my router and it doesn't seem to have that capability I can run any unix program on my router though, so I guess something could be fixed up

yeah i used to run OpenWRT on mine (until i just got a full freebsd box as a router) and you could utilise iptables and all it's modules with that. Maybe ddwrt doesn't provide all the options that come with iptables on regular linux.
Hi RasmusL,

Quote from RasmusL :What software did you use for that? I'm running ddwrt on my router [...]

Funny... I run DD-WRT on my router too. And if I go to NAT / QOS --> QOS and enable it I can choose "liveforspeed" in the Serivces Priority drop down list. I run DD-WRT v24, but did not play with the QOS features because I had no need for that.
Do you run an older version or does the premade service "liveforspeed" not work for you?

Edit: It seems like the Servcie definition predefined in the QOS Settings work on the application layer.
See this page for a explanation and then go to Game protocols --> Live for speed. The Wiki says that these pattern is not included in the official distribution, but maybe this is old because in v24 I can see it.

Maybe Victor can tell us if the pattern is correct or should work?


Edit 2: In v24 only the pattern "..\x05\x58\x0a\x1d\x03" is included. So the Wiki seems to be correct, at least that the longer pattern is not included. But is it correct? L7 filtering looks like a very nice feature.


Edit 3: Sorry, can´t stop... some more information and info about the "mysterious" guy who submitted the string :->
Quote from Victor :yeah i used to run OpenWRT on mine (until i just got a full freebsd box as a router) and you could utilise iptables and all it's modules with that. Maybe ddwrt doesn't provide all the options that come with iptables on regular linux.

Ah iptables Yes I think that the ddwrt implementation has full features, But I have never really used iptables much, guess I'll read a bit up on it :P Thanks.

Edit: premade liveforspeed service does not work - the port range is 0~0?
Quote from RasmusL :Edit: premade liveforspeed service does not work - the port range is 0~0?

Read my edits above
They don´t seem to use ports. The predefined filters with 0~0 are Layer 7 filters. You can find the patterns for these filters on your router in the "/etc/l7-protocols/protocols" directory.
But the predefined filter for the LFS protocol does not seem to be correct. I lack two things necessary to create a pattern file for L7 filtering: I don´t know the LFS network protocol (maybe with a bit work and some Wireshark) and I have absolutely no clue how regular expressions work. I never really tried to understand them and they look weird to me
How do you make these layer 7 filters? I don't see that anywhere I have ethereal installed anyway :P
Just look at this page in the Pattern writing HOWTO.
But don´t expect that wireshark / ethereal will do the work for you. If you don´t have any in depth knowledge of what to look for in the Packets and how regexp works, I doubt you will be able to create a Pattern file. But if you will, please share it with us
Reading a bit into L7 filtering, it doesn't even seem to be worth it for LFS
If I could simply find the port, L7 would be ridiculous.
If I understand the rest of the thread correctly then you can´t tell which ports LFS uses for all the traffic while playing online. So Victor uses a filter for Packet size and it seems to work for him.
If you want to be more precise the only option is AFAIK L7 filtering

QoS for LFS client
(20 posts, started )
FGED GREDG RDFGDR GSFDG