Per port rate limiting

Hi guys!

First of all: Don’t hate because of another stupid rate limiting question, I did search, but I didn’t find an answer :slight_smile:

The point is that I don’t wanna limit a single IP, application or something, I’d like to limit the 100mbps port which is connected to my switch. Normally I would do that on the switch, but at this location I only have a simple L2 switch with no rate limiting features.

Since I don’t want my MT Router to consume 100mbps I was looking in the forum for a solution to do a “per port” rate limiting (something like CAR) and found the “/interface set 0 rx-rate= tx-rate=” command. Is this a good way to solve my problem and limit the port to 6mbps? How does this command fullfill its job exactly?


Thanks and good night,
uebi :wink:

This command will not limit data as you wish.
You have to add mangle rules that will mark traffic for ‘in/out’ interface, add queues for the particular ‘packet-marks’.

I think MT work as well as a router

But it still has a good ability limited lots types flux in your network.

Use simple queue limite by IP address

Use Queue Tree limite by marked packet.

Use PCQ limite by fifo or pipo

Well, this command actually DOES some reate limiting, not very accurate although. I’m just wondering how it is done, if there are any bursts possible, if it drops or queues, …


mfg uebi

Command provided in the first post does not provide ‘rate limiting’.
Burst are implemented to the queues, burst techique is described in the ‘Bandwidth control’ documentation.

You can search it in WIKI web site

as follow site page

http://wiki.mikrotik.com/wiki/Bandwidth_Managment_and_Queues

sergejs: are you saying that if i set my lan (ether1) interface to tx-rate=1000 rx-rate=1000, it won’t be slower than my usual 100Mbit/s?

I apllied “/interface set 0 tx-rate=400000 rx-rate=400000” and a “/interface monitor-traffic ether1 once” shows something like this

received-packets-per-second: 227
received-bits-per-second: 454.4kbps
sent-packets-per-second: 291
sent-bits-per-second: 446.3kbps

The ping becomes very high, because there “would” be about 1mbit traffic.

So there is some impact…


mfg uebi

sergejs said that this command will not limit what was asked - so it will not limit per port traffic.

but that will limit actual tx/rx values of interface and you have to enter these values in bits so 100 Mbps = 100000000 bps :unamused:

to achieve better results and per port limiting follow sergejs suggestion.

Hmmmm, to be honest, when I read my own posting I see that maybe I explained it a bit wrong… With PORT I actually don’t mean a port like 21, 22, 80, 53, 443, … I DO MEAN a physical port, like ether1. An interface so to say…

Please excuse my wrong expression :blush:

My aim is to just attach the RB to a 100mbit switch port and no matter what ports, services, … they use BEHIND it should be just limited to a maximum bandwidth for about 6mbit. I guess in this case the command above would be ok for my RB WAN Interface?


Thanks,
mfg uebi

yes, in that case if you want to allow only 6Mbps for users behind, than this is correct solution for you.

just do not forget that you added it there, in case you want to increase it someday.


edit:

jsut checked that out, that in 2.9.42 there is no such option available for interface. so use simple queues and mangle as sergejs suggested in the first post.

I’ll keep that in mind :slight_smile:

And sorry again for the wrong explanation.


BTW: Do you have some more info for me how this limiting works? Is it dead sharp, are bursts allowed and how does it handle traffic that is above the limit?


mfg uebi

if you go simple queue path, then there are busts allowed if you configure them.

here is the link to the manual:
http://www.mikrotik.com/testdocs/ros/2.9/root/queue.php

also you will need mangle:
http://www.mikrotik.com/testdocs/ros/2.9/ip/mangle.php

For simple queues, but are there any options available to the /interface set command? Or does it just drop everything above the limit?

Thanks,
mfg uebi