Community discussions

MikroTik App
 
isaacu
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Thu Oct 28, 2010 8:18 pm

individually rate limit every IP in a network

Thu Feb 12, 2015 4:06 am

Greetings,
I'm looking for a way to individually que/rate-limit every ip in a /24 network without creating 253 individual ques.
Example: Every customer on 192.168.66.0/24 gets 1.5Mbps x 512Kbps.. PPPoE is not an option as it would require asking everyone to re-configure their routers....
Any help would be greatly appreciated
 
vstman
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Sat Mar 27, 2010 9:05 pm

Re: individually rate limit every IP in a network

Thu Feb 12, 2015 5:34 am

some notes I took when I had to figure out what you are asking for. I could show you the config but that would not make any sense since the overall formula needs to be understood so you can program/apply any data rate efficiently. IMHO, this is a lot of smoke and mirrors that ISP's have come to manage very well in order to spoof what customers into "seeing is believing." Ultimately, the actual proof in any contracted bandwidth is the actual "SUSTAINED" bandwidth. Most ISP's allow specific rates to be stressed based on what they want you to see. The below applies directly to the Que config pages. You are not limited to the below and you should consider this as "basic" que settings.

Max Limit: this is the max. up & download allowed when the burst settings are not managing the bandwidth.

Burst Limit; this setting is the maximum allowed burst limit. Note that the actual available bandwidth from the Access Point can be
lower than this setting but this limit will effect the overall "time" a burst is allowed from the Access Point.

Burst Threshold: this is a point that allows or refuses burst. If the AVERAGE demand for bandwidth is below this number the Burst
will NOT engage. Burst will disengage, as set for time/limits, when this number is reached.

Burst Time: Is NOT the actual time a burst is allowed. The actual time is calculated; Burst Time * Burst Threshold / Burst Limit.

Note that the actual bandwidth available at the time of the "Burst" is used to calculate the time the burst actually stays engaged.

Using the Queue setting 80 * 2 = 160 divided by 8 = 20 seconds of allowed burst. If any of the values are changed the allowed burst time is also changed. Burst Time * Burst Threshold / Burst Limit

Notes;
- Speedtest.net needs a minimum amount of "burst time" for the test to record the "actual" bandwidth results at that time tested. I think our target time to program our queues to is 30 seconds. This allows speedtest.net to display to our customers a recorded value that represents our sales practices.

- Burst Threshold can be programmed to effectively reduce BURST's to our Access Points. Not sure how we can identify the proper Burst Threshold setting since this value directly effects the burst time.

- using a simple queue on a DHCP Server with multiple customers is NOT manageable. This Queue is specifically programmed to Ethernet 4 and the DHCP address range of 192.16.1.0/24 which will provide burst as set to only those IP addresses.

- placing a second queue above the Queue to identify a static IP address with separate burst values works. The order of the queues are managed by the router in a top to bottom order.
 
coylh
Member Candidate
Member Candidate
Posts: 159
Joined: Tue Jul 12, 2011 12:11 am

Re: individually rate limit every IP in a network

Thu Feb 12, 2015 1:08 pm

Something similar?
/queue type
set 5 pcq-burst-rate=768k pcq-burst-threshold=128k pcq-burst-time=3s pcq-limit=256 pcq-rate=256k pcq-total-limit=4096
set 6 pcq-burst-rate=2500k pcq-burst-threshold=1M pcq-burst-time=5s pcq-limit=256 pcq-rate=1500k pcq-total-limit=4096
/queue simple
add max-limit=10M/10M name=Total queue=default/default target=192.168.128.0/17
add name=Default parent=Total priority=7/7 queue=pcq-upload-default/pcq-download-default target=192.168.128.0/17
 
isaacu
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Thu Oct 28, 2010 8:18 pm

Re: individually rate limit every IP in a network

Thu Feb 12, 2015 5:26 pm

Do these suggestions not just collectively rate-limit the entire /24?? I have done this in the past to rate limit a customer who has a /28 assigned to them. Seems it doesn't limit each host, but the whole subnet.
 
yancho
Member Candidate
Member Candidate
Posts: 207
Joined: Tue Jun 01, 2004 3:04 pm
Location: LV

Re: individually rate limit every IP in a network

Thu Feb 12, 2015 5:32 pm

coylh example missing very important detail
pcq-classifier=dst-address or src-address
And yes RTM ;) http://wiki.mikrotik.com/wiki/Manual:Qu ... Q_Examples
 
isaacu
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Thu Oct 28, 2010 8:18 pm

Re: individually rate limit every IP in a network

Thu Feb 12, 2015 7:49 pm

This is exactly what I needed.
http://wiki.mikrotik.com/wiki/Manual:Qu ... Q_Examples

Now, how do I get a 1.5Mbps burst to work??
 
yancho
Member Candidate
Member Candidate
Posts: 207
Joined: Tue Jun 01, 2004 3:04 pm
Location: LV

Re: individually rate limit every IP in a network

Fri Feb 13, 2015 11:53 am

You should adjust pcq parameters:

pcq-rate: maximal available data rate of client or stream based on pcq-classfier
pcq-burst-rate: maximal data rate which can be reached while the burst for is allowed
pcq-burst-threshold: this is value of burst on/off switch
pcq-burst-time: period of time, in seconds, over which the average data rate is calculated. (This is NOT the time of actual burst)

For example
/queue type add name="pcq-download" kind=pcq pcq-rate=1500k  pcq-classifier=dst-address pcq-burst-rate=4M   pcq-burst-threshold=1M pcq-burst-time=10s