Packet loss

I have the Mikrotik (RB153) setup on our LAN as a transparent traffic shaper. We have about 50 users on our LAN. Right now I have a PCQ setup for upload and download. We have a 3Mbit bonded T1 line and I have the PCQ setup at 800kbps for both up and down.

I created a simple queue for target addresses 192.168.0.0/16 (our LAN IPs) using the PCQs for upload and download. The simple queue is given a max upload and download of 3Mbps.

I have been testing this, and I am being throttled perfectly at 800kbps. However, when other users crowd the line and it reaches capacity, I’m suffering a lot of packet loss and slow response times. I thought the way I have this configured the bandwidth would be equally distributed and the heaviest users would be throttled back more when this occurs.

Is this something I’m not doing right, or is this how it works? I want to set a maximum speed for each LAN IP, but if the line approaches capacity I want the Mikrotik to throttle them back further… is this possible?

Could it be the board I have is too slow to handle this many users? My CPU usage when the line is maxed out with the queues enabled is about 50%

I believe I’ve narrowed this issue down. It seems like it has to do with the PCQ, because if I start using BitTorrent to setup many, many connections from my single IP, the packet loss from the Mikrotik shoots way up (as does the CPU usage, it goes to about 50%). I’m still not consuming all the bandwidth, but I believe it has to do with Mikrotik keep track of all the individual connections from my IP?

Should the RB153 be able to do this? Is there something I should try to prevent this from happening, or do I just need a faster Mikrotik?

Clients whom can not hear each other will broadcast at the same time.
The AP has no choice but to drop the packets because the 2 signals cancel and distort each other.

Try setting the RTS value of the clients to a low value.

I typically use 900-1000.
You may find that a lower value is more optimal for your setup.

When the RTS is below a certain threshold the clients request from the AP a broadcast interval.

I’m actually not using this as an AP, just a wired LAN. I am only using the Mikrotik board for traffic shaping on our LAN.

Yes, RB100 should handle such load without any problems. 50% CPU is not the problem.
Provide us with configuration from 'ip firewall mangle ’ and queues.

just wanted to post that 50% CPU usage is more than OK, you only have to start to worry if cpu usage hits 100% and stays there for a long periods of time.

do as sergejs suggested post you configs here so we could evaluate that.

I have my settings with a 3Mbit line. I set the max bandwidth at 2.8Mbit to give it some room if the line isn’t going at full capacity (should I set it at 3Mbit? I know most say to use an 85 percentile). I want a LAN user at any given time to be able to burst half the line, so I use 1.4Mbit for the up/down on the PCQs.

Here is what I have:

PCQ:

5 name=“pcq-download” kind=pcq pcq-rate=1400000 pcq-limit=50
pcq-classifier=dst-address pcq-total-limit=2000

6 name=“pcq-upload” kind=pcq pcq-rate=1400000 pcq-limit=50
pcq-classifier=src-address pcq-total-limit=2000

Simple Queue:

1 name=“Global” dst-address=0.0.0.0/0 interface=all parent=none
direction=both priority=1 queue=default-small/default-small
limit-at=0/0 max-limit=2800000/2800000 total-queue=default-small

2 name=“Private” target-addresses=192.168.0.0/16 dst-address=0.0.0.0/0
interface=all parent=Global direction=both priority=1
queue=pcq-upload/pcq-download limit-at=0/0 max-limit=0/0
total-queue=ethernet-default

3 X name=“Public” target-addresses=69.178.183.0/26 dst-address=0.0.0.0/0
interface=all parent=Global direction=both priority=8
queue=pcq-upload/pcq-download limit-at=0/0 max-limit=0/0

I have the global queue set as the main queue with all the bandwidth. The private and public queues both feed off of that queue (we have some users on our LAN, others are using a public IP address).

And here is my firewall rule to limit connections to 50 per user:

0 chain=forward protocol=tcp tcp-flags=syn connection-limit=50,32
action=drop

Basically I just want the bandwidth to be equalized among all users so latency for any given user is low at all times. I could take off the limits on the PCQs, but I don’t want a user to be able to burst the whole line as latency can spike briefly as other users come on.

Again, it seems I am getting high packet loss (~4%) at some times when the CPU is really churning… I don’t know how to narrow down what may be causing it…

Ah queues!!

Do queues not DROP packets when the traffic exceeds a threshold?

Could this be what you are experiencing?

Yes, but I’m setting the main queue to use about 85% of the bandwidth and I’m running the ping tests from the Mikrotik itself. Why would the pings timeout from the Mikrotik if there is still bandwidth available to get out?