Community discussions

MikroTik App
 
pekr
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

The right queue type for wireless?

Sun Feb 12, 2006 9:58 pm

Hi,

we have one RB532 behind ADSL line, catching clients on wireless. I set up simple queue, as follows:

0 name="256kbit" target-addresses=10.0.0.0/24 dst-address=0.0.0.0/0 interface=wlan1 parent=none
direction=both priority=8 queue=wireless-default/wireless-default limit-at=64000/128000
max-limit=128000/320000 burst-limit=256000/800000 burst-threshold=64000/180000
burst-time=10s/10s total-queue=default

First I don't know if I should set target-address as I did it, simply to whole network, but I hope it is ok.

What is strange though, that Queued bytes newer go to zero, even if there is nearly no traffic? Why? It did not happen, when I mistakenly used "default" queue type (which uses pfifo IIRC). Anyone? Why the queue is not cleared?

Thanks a lot,
-pekr-
 
User avatar
djape
Member
Member
Posts: 469
Joined: Sat Nov 06, 2004 7:54 pm
Location: Serbia

Sun Feb 12, 2006 11:55 pm

Well, with the queue you posted here you are setting speed for whole 10.0.0.0/24 subnet all together. If this is not what you wanted you should put 10.0.0.x/32 and so on or use PCQ.
I prefer to use wireless-default for wireless interface and I made customers queue type pfifo 10 packets...

If you want to limit your customers to 256k I would go with this:

add name="user no.1" target-addresses=10.0.0.2/32 dst-address=0.0.0.0/0 interface=all parent=none priority=8 queue=customers/customers limit-at=128000/128000 max-limit=256000/256000 total-queue=customers

Just my 2 cents ;)

Cheers...
I drink like a pirate and smoke like a hippie...
 
pekr
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

Mon Feb 13, 2006 9:00 am

yes, it was just quick hack on my side, that I did limitation for whole subnet :-)

I don't understand your wireless-default remark and pfifo, as wireless-default uses sfq, not pfifo?

As for your tip for limiting customers in your mentioned way, I have following questions:

1) 256/256 - does it mean 256 in total? So including upload and download? So actually if someone uploads in 128kbit, than download is only 128kbit too, right? Is that typical way of how you sell 256 line?

2) the way you mentioned you created limitation for one particular user, right?

3) I don't understand one thing though. Creating 256/256 for each user, am I not creating guaranteed lines for each of them? What is functional difference in limiting whole subnet or creating separate entry for each user? Will the algorithms behave differently?

What I originally intended to do was following - I wanted to create 256kbit line on the radio, which would be aggregated to 1:8 (actual number of our customers there), but the trouble is, one of them started using bittorent and others start to complain :-(, so I will have to come up with more clever marking/shaping/prioritising ....

Thansk,
-pekr-
 
User avatar
djape
Member
Member
Posts: 469
Joined: Sat Nov 06, 2004 7:54 pm
Location: Serbia

Mon Feb 13, 2006 11:46 am

Well, if understand you well, you want to give 256kbit/s to be shared with 8 users? It's no a good idea at all.
I am usually givin' up/down ratio 1:2 (128k up and 256k down) so queue would go like this:
add name="user x" target-addresses=10.0.0.x/32 dst-address=0.0.0.0/0 interface=all parent=none priority=8 queue=customers/customers limit-at=64000/128000 max-limit=128000/256000 total-queue=customers

So you'll give priority=7 to all users except p2p user, you'll give him priority=8.
so they would have guaranteed 128k but 256k when there is available bandwidth. In my case, they always have 128k up and 256 down cause I always have enough bandwidth.

My remark for pfifo is a queue type for each customer you can set it here:
queue type add name="customers" kind=pfifo pfifo-limit=10
so by creating you own queue type you can choose this type when you make simple queues as it was written above.

Wireless-default I use for ap-bridge interface:
queue interface set Local (or whatever you named your ap-bridge interface) queue=wireless-default

256000/256000 is up and down total, but you can do 64000/256000 which gives you 64k up and 256k down or 128000/256000 128k up and 256k down etc...

Functional difference when you limit whole subnet or creating separate queue for each customer is quite obvious. If you give 256000 for whole subnet 8 users will fight over bandwidth (whole subnet is limited to 256k) and they wouldn't have Quality of Service (QoS).
The way I mentioned, you are creating limitation for one particular user, all you need to do is to add queue for each user, this is why I presented as 10.0.0.x/32 where x would be users address, so you need to add 8 queue (for each user one).

Other way is to use PCQ with queue tree, but I don't find that as a proper solution.

Also you can do following rule in the ip firewall filter:
add chain=forward protocol=tcp tcp-flags=syn,!fin,!rst,!psh,!ack,!urg,!ece,!cwr connection-limit=17,32 action=drop

this would limit each user to 16 concurrent tcp connections. I found 16 tcp connections being appropriate (note that in the rule is set to 17 which means it's going to count to 17 and that 17th connection should be droped)

Also, read Manual for mangle, cause you'll need it.

All of this can be found in Manual, so I suggest you to read it carefully.

Cheers...
I drink like a pirate and smoke like a hippie...
 
pekr
Member Candidate
Member Candidate
Topic Author
Posts: 140
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

Mon Feb 13, 2006 4:16 pm

Djape,

thanks for so long reply, really appreciated here! :-)

The trouble is, that I read the manual, several times :-) It is like when you read book about programming, you "understand" even higher concepts, but then you sit in front of empty source code editor, and you are kind of struggling writing simple "Hello world!" app :-)

Of course I do understand what you wrote here, it is just that I don't understand what is the correct model to seel the bandwidth. Here in CZ, we can buy ADSL (end users), of eg. above mentioned 256/128, with let's say noted aggregation of 1:20, which means, that you are sharing the line with 20 users at Telecom or something like that? The thing is, that your line runs decently fast all the time.

Whereas when we sell our 256/128 and put even 8 users ther to share it, the users are struggling for bandwidth as you noted. Setting queue for each particular user, I would have to higher the price no? I have 1mbit, 8 users, if I set 1 128/256 to each user, actually how my line is divided? The thing is they are buying very cheap aggregated lines from us, not guaranteed ones, for which I would raise the price of course. So maybe the solution will be to limit those downloaders somehow, or provide some throughput to P2P apps, or just limit P2P to last evening hours ...

Also - why, in my case, users would not have QoS? What I am confused about is, that there is several alghoritms (bfifo, pfifo, sfq, red, pcq, htb), some of them being shapers, some of them prioritizing only, and then we have simple queues and queue trees, and I am not able to find out, what to start-up with, and to which design I should stick. Different ppl use different methods, but there must be "the one" :-)

OK, thanks a lot,
I will not reread some docs once again,
-pekr-
 
User avatar
djape
Member
Member
Posts: 469
Joined: Sat Nov 06, 2004 7:54 pm
Location: Serbia

Mon Feb 13, 2006 6:06 pm

Hi pekr,

You have 1 mbit/s and 8 users. This is what would I do:

set limit-at=64000/128000 max-limit=128000/256000 for each user

This way, if all of them download/surf/p2p at the same time they would have guaranteed 64k up and 128k down. If they don't to that at the same time they'll have 128k up and 256k. As far as know about anything :) 8 users will never use internet bandiwidth at the same time, so 99% they'll have 128k up and 256k down.
This is if you want to sell 1 mbit/s to 8 users.
1 mbit/s should work on 20 users without problem like this:
set limit-at=32000/64000 max-limit=128000/256000 for each user

If you want to share 128k up and 256 down between 8 users (equal sharing I would do this:
set limit-at=16000/32000 max-limit=128000/256000 for each user

In your case, there is no QoS. Simple queue for whole subnet is not sharing bandwidth equal.

It's like you have bowl full of candies and all kids fight who will take more, so one moment your mouth is full of candies and next moment you're laying down on the floor pushed by other ugly fat kid called p2p :D

In examples a posted above if you are the only, or 4 of you, you can eat as much as 256 candies at the same time, but if 8 of you want candies you can eat 128 not more, cause you are sharing equaly.

Follow this and see what happens.

Cheers...
I drink like a pirate and smoke like a hippie...

Who is online

Users browsing this forum: Bing [Bot], leemans, matiss, xeonabc and 59 guests