Fixing the minimum bandwidth

Hi guys, Im going to buy a routeros device from mikrotik.

I just need an answer for one question. Lets say I have 5 Mbps internet and I have 2 user connected to it. Users may play online game so needs lowest latency possible and for this they need at least 2 Mbps bandwidth available. (I cannot trace the tcp-udp ports used per game because not only there are many games to consider but also some ports are dynamic) So came up with this idea.

To conclude, can I do that. I mean users shouldn’t go down below 2 Mbps.

bad scenario: Im downloading heavily and my brother plays online game and he is getting high pings.
scenario to accomplish: Im downloading heavily and my brother plays online game and when he is active my bandwidth will be cut in order to give him 2 mbps and he will get low pings.

same scenario has to apply opposite directions too, like me playing games and he downloads etc.

note: as we cannot detect he is playing so we consider that if the user is making a traffic then make his speed wont go below 2 mbps.

There’s no question in that entire post…

I assume you’re asking if RouterOS can do that? It can. Using simple queues (the “/queue simple” menu).

You create one master queue where you specify your available speed, and then per user, you add a queue that has that master queue as parent. In the per user queues, you can specify the minimum speed using “limit-at”, while the maximum speeds are specified using “max-limit”.

Strictly speaking though… Using the above setup, RouterOS is smart enough to divide the total speed in two equal parts, with or without “limit-at”. The only time you really must use “limit-at” is when you need to give UNequal speed to certain user(s), e.g. if you wanted to make sure the first user always has at least 3 Mbps, and up to 5 Mbps if the second user is not online.

Yep this is what I want, you gave the answer already :slight_smile:

Can you demonstrate it on routeros?

The commands from a terminal:
/queue simple
add name=total target=192.168.88.0/24 max-limit=5M/5M
add name=user1 target=192.168.88.254/32 max-limit=5M/5M limit-at=2M/2M parent=total
add name=user2 target=192.168.88.253/32 max-limit=5M/5M limit-at=2M/2M parent=total(Assuming the local subnet is 192.168.88.0/24, which is at least the case for some RouterBOARDs; Adjust accordingly if using a different subnet)

can we make the total and max limit unlimited?

edit: aldo important, can I refer to interfaces? Not ip addresses. I mean simple queues on eth2-eth3 and wifi interface?

You mean the total’s max-limit? No. There’s no way for RouterOS to “just know” how much speed your ISP provides to you. The max-limit in the “total” queue tells RouterOS “this is how much speed I have from my ISP; divide it between your children”.

You can have the children’s max-limit be unlimited… Although I recently made tests in recent RouterOS versions (6.13 was the last one I checked), and there seems to be a new bug, in that a child with “unlimited” gets “unlimited” speed, rather than the parent’s max-limit speed… Which in turn means that children will be “fighting” for the speed, rather than divide it.

(I’ll write to support when I have time to try it with 6.15, and that fails too)

Yes. In fact, for my queues, I have the “total” queue match the local interface… But I avoided it in the example above, as I couldn’t remember the default interface name for the local bridge on RouterBOARD, and the board is not with me now.

Yes I will make a bridge for all interfaces I have so for total I will use bridge1. and for user 1 I will use eth2 etc.

It is healthy to do it in winbox right? Because command you gave is kind of incomplete.

If you mean Winbox’s “New Terminal”… Yes. It’s in fact equivalent with doing it any other command line kind of way.


Doing it with Winbox is similar. You go to the “Queue” menu, the “Simple” tab, click “+” (which stands for “Add”), adjust the settings in accordance with the arguments, etc.


(Side note: Opps… I forgot to name “user2” differently; Fixed…)

I found this.. https://www.youtube.com/watch?v=G8Gug78SXlM

Now, I will do just one queue, limit at 2 max limit 5 with no target address and in advanced interface select the all. Will it work?

edit: in the end, all of the devices (bridge1 (all eths+wifi)) have the minimum of 2 mbps so in online games pings will be minimum.. am I right?

I found this.. > https://www.youtube.com/watch?v=G8Gug78SXlM

Now, I will do just one queue, limit at 2 max limit 5 with no target address and in advanced interface select the all. Will it work?

That’s how things worked in RouterOS 5.*, yes. In RouterOS v6, the “interface” drop down (and it’s equivalent argument) is removed. Instead, the “target” argument can take the interface name.

Also, in the total queue, you don’t really need a limit-at, since you’re only really using it to specify the “maximum” to then be divided among individual devices.


On that note, I should probably clarify that if you target an interface, you’re saying that the TRAFFIC of all devices IN TOTAL is the specified limit. Using an interface as a target is NOT a shortcut for “any INDIVIDUAL device from that interface”. In other words, having
add name=bridge1queue target=bridge1 max-limit=5M/5Mdoes NOT mean that 192.168.88.254 will get 5M upload and 5M download, and 192.168.88.253 will get another 5M upload and another 5M download, for a total of 10M speed consumption.

No… it means 192.168.88.254 and 192.168.88.253 share a speed of 5M upload and 5M download (so up to 2.5M each when both are present).

(assumes “bridge1” uses 192.168.88.0/24 as a subnet)

So…

edit: in the end, all of the devices (bridge1 (all eths+wifi)) have the minimum of 2 mbps so in online games pings will be minimum.. am I right?

Not exactly, since limit-at (and max-limit for that matter) is pointless if your ISP can’t deliver the specified speed. And if your ISP is indeed offering a 2 Mbps guaranteed speed, then yes, with that one queue, 2 Mbps will be the speed that all devices share, so 1 Mbps each, if you have two devices, 512 kbps if you have 4, etc.

OK I see now, Im thinking different..

I just need eth2 and eth3 should have at least 2 mbps in all conditions. Whats the ros code for that?

If there’s only one device connected to eth2, and only one device connected to eth3, then it’s the exact same thing as above, but with IPs replaced with interface names, so:
/queue simple
add name=total target=bridge1 max-limit=5M/5M
add name=user1 target=eth2 max-limit=5M/5M limit-at=2M/2M parent=total
add name=user2 target=eth3 max-limit=5M/5M limit-at=2M/2M parent=total(assuming “bridge1” includes eth2, eth3, and perhaps other interfaces)

If there are multiple devices, all connected to, let’s say eth2, they are going to share the 2 Mbps allocated for eth2.


It’s just that you need ALL of those queues… There’s no “quick & dirty” way to specify “everyone should have at least 2 Mbps”. You must explicitly tell the router “This IP/interface has at least 2 Mbps, and this IP/interface has at least 2 Mbps [and this…[and this…]], and the remaining speed - the total of which is 5 Mbps, should be shared equally between this IP/interface, this IP/interface [and this…[and this…]]”.

Alright man thanks a lot! :slight_smile:

I found this…

/queue simple
#name=”Day” target-addresses=192.168.1.5/24 dst-address=0.0.0.0/0
interface=<ether-3> parent=none direction=both priority=1
queue=default-small/default-small limit-at=2M/2M
total-queue=default-small



/queue simple
add name=us1 target=eth1 limit-at=2M/2M

Can I do this for one user? That this user won’t go below 2 Mbps?

Can I ask how did you calculate minimum bandwidth for lowest latency ???

It is a fact that online games need bandwidth for smooth game play. If I start downloading something that will consume all the bandwidth and online game will lag. If I reserve 1-2 Mbps at least for a user, game wont lag even if I start downloading something.

This doesnt need any calculation, just see the requirements of online games they need at least 1 Mbps connection :slight_smile: 2 Mbps should be enough for all games.

edit: BF4 can take up 1.5 Mbps sometimes with the latest patch.

Depending on the game being used some only require any speed above dial up and others require 1+Mbps, but this has nothing to do with latency, I would first test the ISP latency and incoming bandwidth during peak usage hours, from the results calculate.

pings and bandwidth is 7/24 stable now :slight_smile: I have no problem on the ISP side.
I have extra lcd to monitor every thing inside the computer, I have seen 250 Kbps minimum on online games max 1.4 Mbps (for a second in bf4), so reserving 2 Mbps would be more efficient for pings.

Why you said this has nothing to do with pings? Yes it has. :slight_smile:

The term latency refers to any of several kinds of delays typically incurred in processing of network data, for example you could have incoming bandwidth of 10Mbps and downloading a file at 128Kps but latency of several hundreds ms - why?
The router processor was locked up and running at 100% (a reboot will usually solve), so bandwidth only solution will not always give the lowest latency as other factors (MTU matching, router CPU load,..etc.) effect latency?

I see your point.. but these are some extreme cases which I have never seen in my life.. so in my case that ups the latency is 100% of the time bandwidth consuming. that my goal is to limit-at it 2 mbps for my brother and myself and problem will be gone hopefully.

edit: OK, for the moment, put all those things at another side, in your opinion what would be the best way to accomplish my goal?