Community discussions

MikroTik App
 
User avatar
uebi
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 13, 2005 5:27 pm
Location: Austria
Contact:

Per port rate limiting

Wed May 09, 2007 2:33 am

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 :)

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 ;)
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Wed May 09, 2007 9:50 am

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'.
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Wed May 09, 2007 11:04 am

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

..............
 
User avatar
uebi
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 13, 2005 5:27 pm
Location: Austria
Contact:

Wed May 09, 2007 12:31 pm

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
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Wed May 09, 2007 12:49 pm

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.
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Wed May 09, 2007 12:59 pm

You can search it in WIKI web site

as follow site page

http://wiki.mikrotik.com/wiki/Bandwidth ... and_Queues
 
sten
Forum Veteran
Forum Veteran
Posts: 919
Joined: Tue Jun 01, 2004 12:10 pm

Wed May 09, 2007 1:06 pm

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?
 
User avatar
uebi
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 13, 2005 5:27 pm
Location: Austria
Contact:

Wed May 09, 2007 2:20 pm

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
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Wed May 09, 2007 3:57 pm

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 :roll:

to achieve better results and per port limiting follow sergejs suggestion.
 
User avatar
uebi
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 13, 2005 5:27 pm
Location: Austria
Contact:

Wed May 09, 2007 4:10 pm

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 :oops:

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
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Wed May 09, 2007 4:16 pm

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.
 
User avatar
uebi
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 13, 2005 5:27 pm
Location: Austria
Contact:

Wed May 09, 2007 4:23 pm

I'll keep that in mind :-)

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
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Wed May 09, 2007 4:28 pm

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
 
User avatar
uebi
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 13, 2005 5:27 pm
Location: Austria
Contact:

Wed May 09, 2007 4:38 pm

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

Who is online

Users browsing this forum: Ahrefs [Bot], billjellis, bp0, maldridge and 101 guests