cancel
Showing results for 
Search instead for 
Did you mean: 

TG582N - Amazing upload QOS! (CLI configuration)

gary42
Grafter
Posts: 94
Registered: 09-07-2012

TG582N - Amazing upload QOS! (CLI configuration)

Although the Plusnet downstream traffic prioritisation works incredibly well I was still having problems with upload QOS with the TG582N.
In particular where I was saturating the upstream with my online backup service running over port 443, gaming latency went from around 33ms to 500+ (Using kids and League of Legends as a test bed!)
Although things looked OK on the BQM and the ping command it seems that this was because the ICMP protocol was being specifically prioritised in the router proving that something could be done  Smiley
After doing some searches I found the CLI guide and some info about prioritising based on source IP.
http://help.demon.net/files/2013/03/TG582n-CLI-Guide.pdf
http://npr.me.uk/ipqos.html
Taking the npr notes as a guide (Loads of other useful info on that site), rather than basing QOS on IP I decided to try and de prioritise HTTP/HTTPS traffic and prioritise the default queue. The default queue should catch any traffic not defined with a specific rule so all the many and various game ports. (Warning - But also potentially bulk traffic e.g. Bittorrent upstream!)
Commands made from a telnet session to the TG582N (Using Putty):
label add name=Lopq
label modify name=Lopq classification=overwrite defclass=2 ackclass=2 bidirectional=disabled inheritance=disabled
label rule modify chain=qos_default_labels index=5 label=Lopq
label rule modify chain=qos_default_labels index=7 label=Lopq
label rule modify chain=qos_default_labels index=23 label=Video
saveall

Lopq is the new low priority queue.
Video is an existing higher priority queue.
After making these changes the in game latency now only goes up to 40 when saturating the upstream!
I know this router gets some stick over its wireless capability and GUI but I can’t believe how well it works for QOS, the downside being all this configuration only being available through the CLI.
Really pleased with how well this is now working in combination with Plusnet’s traffic management.
Ideally traffic could be assigned to a queue based on port number to blacklist bulk traffic from the default to a lower priority queue.
May be able to do something with the EXPR commands to define a new signature but couldn’t see an add command in the list.
Will keep playing  Cool
17 REPLIES
Community Veteran
Posts: 1,841
Thanks: 103
Fixes: 6
Registered: 21-01-2013

Re: TG582N - Amazing upload QOS! (CLI configuration)

If you want more info on this, download "IP-QoS-Config-Guide_EN_r7.4.pdf.7z"
from here http://download.modem-help.co.uk/mfcs-A/Alcatel/Modems/TG582n/v1/Manuals/Application-Notes/
Don't worry that it's for a older firmware, the commands don't change much and the principle remains the same.
Happy playing.  Cheesy
Community Veteran
Posts: 5,109
Thanks: 465
Fixes: 17
Registered: 10-06-2010

Re: TG582N - Amazing upload QOS! (CLI configuration)

It's still possible to download the pdf file directly from the technicolor website, they're just not as easy to find as they used to be.
gary42
Grafter
Posts: 94
Registered: 09-07-2012

Re: TG582N - Amazing upload QOS! (CLI configuration)

Perfect, thanks.
Shame they took all the config out of the GUI.
gary42
Grafter
Posts: 94
Registered: 09-07-2012

Re: TG582N - Amazing upload QOS! (CLI configuration)

Quote from: npr
Happy playing.  Cheesy

Doh. Just twigged it was your site. I blame the cryptic link between your forum name and your domain  Wink
Thanks for getting me started.
I've been surprised that I am getting better results with the Technicolor  than I have been with PFsense traffic shaping.

gary42
Grafter
Posts: 94
Registered: 09-07-2012

Re: TG582N - Amazing upload QOS! (CLI configuration)

Well I had some success.
Add a new expression:
expr add name=NNTP type serv proto tcp dstport 563
(There is an existing expression 'nntp' for port 119)
Add new rule:
label rule add chain=qos_user_labels index=1 name=NNTP serv=NNTP label=Lopq

This assigned the NNTP traffic correctly.
I'm assuming this would still help as the NNTP ack uploads will be de-prioritised?
Tried it with a bittorrent port though and the traffic still went to the default queue. Sad
Not such a problem as I don't use torrents much, but it's just nagging at me now as there would be more benefit in controlling torrent uploads.
Community Veteran
Posts: 5,109
Thanks: 465
Fixes: 17
Registered: 10-06-2010

Re: TG582N - Amazing upload QOS! (CLI configuration)

Bittorrent could upload over any connection it establishes (regardless of if it originated with an outgoing or incoming connection), and can use udp or tcp. But to match traffic coming from the port your bittorrent client is listening on, I would expect you'd need to match on the source port number.
gary42
Grafter
Posts: 94
Registered: 09-07-2012

Re: TG582N - Amazing upload QOS! (CLI configuration)

Thanks ejs.
Added a line to the expressions for TCP and UDP defining source port and started catching the torrent traffic.
However although all the UDP connections had local port 20000 (The port defined in utorrent)  there were some TCP connections with different port numbers
Don't think there is a way around this apart from defining a port range which worked when I tried it. They all seemed to be on port 54xxx although this might not always apply.
Community Veteran
Posts: 5,109
Thanks: 465
Fixes: 17
Registered: 10-06-2010

Re: TG582N - Amazing upload QOS! (CLI configuration)

Modern operating systems will use a random high port number as the source port for any outgoing connection, e.g. web browsing might be 192.168.0.101:34294 to 212.159.9.110:80.
Community Veteran
Posts: 1,841
Thanks: 103
Fixes: 6
Registered: 21-01-2013

Re: TG582N - Amazing upload QOS! (CLI configuration)

If it's software on your own machine, I believe most p2p software contains bandwidth setting. why not just use those?
If your trying to limit the bandwidth of p2p on someone else's machine then I don't think you've got a chance. p2p is far to aggressive with the ports it can use. Disabling UPnP in the router may help a tad but IMO targeting the IP address will give better results. Now where have I seen the cli commands for that Wink
I would be very interested to hear of your results on how QOS affects the download speed of p2p. I doubt it will make a difference but some claim it does allow other traffic more bandwidth.
gary42
Grafter
Posts: 94
Registered: 09-07-2012

Re: TG582N - Amazing upload QOS! (CLI configuration)

I guess I've already achieved what I wanted with the HTTP/S rules I modified as it was my online backup upload I had issues with and Plusnet pretty much take care of the download QOS.
This works really well now.
I very rarely use Bittorrent and when I do I use my Synology NAS for which I have used your IP based rules.
Also used IP rules to put my Gigaset VOIP phone into a high priority queue.
It was more about it being a challenge to see if I could make it work and learn a bit more about QOS.  Smiley
Also my focus was on latency rather than bandwidth limiting as in my experience you have to really clamp down on the upstream to around a 1/3 of the upstream rate to avoid latency problems with gaming. At least on ADSL2.
Maybe that will change with Fibre?
With the OQS rules in place I have found you can run the upstream much 'hotter' and still game OK.
Community Veteran
Posts: 1,841
Thanks: 103
Fixes: 6
Registered: 21-01-2013

Re: TG582N - Amazing upload QOS! (CLI configuration)

I'm not a gamer so had not thought about the latency issue, it's a good point.
"Maybe that will change with Fibre?"
Not with my fibre connection, I'm only getting 0.6mbps upstream -- due to aluminium cables Sad
Community Veteran
Posts: 26,686
Thanks: 910
Fixes: 10
Registered: 10-04-2007

Re: TG582N - Amazing upload QOS! (CLI configuration)

Particularly since I had to drop back from Max Premium (832kbps upload) to standard Max (448kbps) I've had people I speak to via VoIP complaining about the call quality. Especially when I'm trying to do other things at the same time as speaking to them. I'm wondering if it is possible to give VoIP higher upload priority than anything else (even from the same PC) - could someone give me pointers please?
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£13/month)
Mobile: iD mobile (£4/month)
gary42
Grafter
Posts: 94
Registered: 09-07-2012

Re: TG582N - Amazing upload QOS! (CLI configuration)

Depending on what type of VOIP you are using you may be able to identify the port(s) in use and add an expression to allocate to a higher priority queue as I did to lower NNTP traffic earlier in the thread.
However it may be easier and just as effective to de-prioritise or black list traffic and raise the priority of the default queue as I did in the first post.
If you enter the commands in that post it will move HTTP/S traffic into a low queue and raise all unidentified traffic into a higher queue.
This should work if it is HTTP/S traffic causing your latency issues when you are making calls.
If it is a traffic over a different port causing problems then you would have to de-prioritise that traffic, again by using my NNTP commands as an example.
Gary

Community Veteran
Posts: 1,841
Thanks: 103
Fixes: 6
Registered: 21-01-2013

Re: TG582N - Amazing upload QOS! (CLI configuration)

Quote from: jelv
I'm wondering if it is possible to give VoIP higher upload priority than anything else (even from the same PC) - could someone give me pointers please?

I don't have a plusnet supplied router in ADSL config to check this out, but the O2 router I do have already has qos configured to give VoIP a high priority (queue 4 -- 2nd highest). I assume the plusnet supplied routers will have a similar config.
Looking at the O2 routers user.ini file these are the relevant parts if you wish to have a play:
[ ipqos.ini ]
queue config dest=pvc_Internet queue=4 hold=2000 loprio=12 hiprio=13
queue config dest=pvc_Internet queue=5 maxpackets=30 maxbytes=12 hold=2000 loprio=14 hiprio=15
[ label.ini ]
modify name=VoIP-Signal classification=overwrite defclass=12 ackclass=12 bidirectional=enabled tosmarking=enabled
(could experiment by changing defclass and ackclass to 14 This will move the VoIP traffic from queue 4 to 5)
[ expr.ini ]
add name=sip type=serv proto=udp dstport=sip
add name=sip type=serv proto=tcp dstport=sip
add name=h323 type=serv proto=tcp dstport=h323
add name=h323 type=serv proto=udp dstport=h323
add name=h323 type=serv proto=tcp dstport=1718
add name=h323 type=serv proto=udp dstport=1718
add name=h323 type=serv proto=tcp dstport=1719
add name=h323 type=serv proto=udp dstport=1719
(could add extra port numbers to "sip" or "h323" to cover any missing ports -- don't duplicate ports)
[ labelrule.ini ]
rule add chain=qos_default_labels index=1 serv=h323 log=disabled state=enabled label=VoIP-Signal
rule add chain=qos_default_labels index=2 serv=sip log=disabled state=enabled label=VoIP-Signal

Note:
Use the command "ipqos queue stats" to see which queue's are being used.
HTH