How to shape local traffic?

Network is separated in three subnets. I have MT with lan adapter for each net. Each net is in its own ip range and routing is set to allow comunication among nets. Internet link is not in question here.

Local trafic is not shaped at all, menaing, each user may take up all physicaly available bandwidth.

I have noticed that it often happens that one user from one subnet can run download (or upload) from other two subnets using all or almost all available bandwidth. Others then have problem with using network because all bandwidth is used by single user.

What I want to achieve is to set shapping in that manner that one user may take all resources if he is using them alone, but if there are several active users bandwidth should be shared equaly.

I already looked at MT Manual and Wiki and coul not get to the right soulution for this.

As I expected, questions about queues always stay unanswered…

This was discussed many times in this forum. You must add PCQ queues for download and upload. Search the forum and you will find answer.

There is no answer for this. all quueue related stuff is targeted to shaping to outgoing internet link.

I have diferent need here.

Outgoing incoming or whatever link, it doesn’t matter, idea is always the same.
I really don’t understand where is the problem:

  • mark trafiic
  • add pcq for download and upload
  • add queue

It’s so simple.

I’ve done that and got nothing. I mean, still one client may take all resources even if there are others using the same link.

That’s why I ask for help.

Hi,

You cannot shape traffic between two devices on same subnet using mikrotik because traffic is not routed using it. Two devices on same subnet uses direct connection instead of going through a firewall. But you may try to shape the traffic using QoS and rate limiting enabled switch etc.

I hope my answer helps!

please copy-paste your rule. mangle, queue…

Of course. I am not trying that.

/queue type set wireless-default name=“wireless-default” kind=pcq pcq-rate=0 pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000

/ip firewall mangle add chain=forward out-interface=wlan-apcd-servcon action=mark-packet new-packet-mark=wlan-apcd-e passthrough=yes comment=“” disabled=no

/ queue tree add name=“wlan-apdc-e” parent=global-out packet-mark=wlan-apcd-e limit-at=0 queue=wireless-default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no

Queue made this way shows the same traffic as wireless interface, so i guess it matches connections properly. but, when i check with torch, I can see that one IP can use all traffic and others are struggling to get any.

One more question. If I make siple queue that matches all trafic on one interface, and set its’ queue-type to one of pcq type, should all connections matching this queue also get equal bandwidth?

For mangle, do not specify out-interface. Just left it blank.

I’ve set out interface to narrow influenced connections, just to make it easier to check if it works.

Today I set some time to experiment. Here is what I found out.

If everything is set as I stated few posts up, there is no equal bandwidth share. Who gets to the bandwidth first, he takes it all.

But, if I set pcq-rate in queue type to some low value, (for example 2M) then, no one could get more than set rate and bandwidth is shared among different users. But, my link is 5.5Mbit, and I want each user to be able to use all bandwidth if he is alone on link, and to share if there are more. So, if I set pcq-rate to 5M, then limit for each user in queue is 5Mbit, and first one who gets it, gets it all, there is no equal bandwidth share among users.

This does not confir5m what MT manual says. I may be setting something wrong, but this is all to simple and straightforward that I cannot see what could I do wrong.

No help?

The issue is that you are wishing to allow your end users to eat all the BW if needed.. Typically FIFO works well, as it will balance the connections to the best of its ability. PCQ will still allow for all of the bw to be used. However, if user 1 starts a download, and is running at 500k or so, the next user start, they will see something in the area of 220k to 260k. The first user will see the 500k for a while, until the download averages down to the 250k mark.

Thats the idea. Another simple option is to put the PCQ to burst to 5 meg (I belive you can burst on it) and then drop the mdown to something like 1 meg after 1-2 mintues. This would keep your resourcses free as needed.

Just some thoghts.

Dennis Burgess
mikrotikconsulting.com
http://www.mikrotikconsulting.com
dmburgess@mikrotikconsulting.com

Well, what you say is what manual says, but even after waiting for quite a while, the first user who gets bandwidth is keeping using it. it is not shared to others. That’s why O am confused.

I thought about bursting, but it would not actually do what I want: to let single user take whole bandwidth and if some other user shows up bandwidth to be equally shared among them.

Hi,

You need to mark the connection first then the packet