2

With a Mikrotik router (form of embedded Linux) I have created simple queues per machine matched by source IP address.

Each of the 4 machine queues has an unlimited burst 3Mbps/3Mbps for Tx/Rx.

During speedtest.net on all 4 machines at the same time, each machine shows 3Mbps (and is limited correctly there), however the total bandwidth on the uplink goes to 12Mbps (i need to set this to 10Mbps max for the upstream).

I want to restrict the actual traffic passing across the uplink port to 10Mbps regardless of what the other queues are doing (I need this catch all queue to have the final say on the uplink speed).

For example I need:

Scenario A

  • Machine A transferring @ 3Mbps
  • Machine B transferring @ 3Mbps
  • Machine C transferring @ 3Mbps
  • Machine D transferring @ 0Mbps Up-link speed = 9Mbps

Scenario B

  • Machine A trying to transfer @ 3Mbps
  • Machine B trying to transfer @ 3Mbps
  • Machine C trying to transfer @ 3Mbps
  • Machine D trying to transfer @ 3Mbps
  • Up-link speed = 10Mbps
  • Actual transfer speed of machine A,B,C,D = 2.5Mbps

This is to allow slight over subscription of bandwidth queues as not all will be transmitting at 3Mbps all the time.

Is this possible and if so how would one go about doing this?

morleyc
  • 1,120
  • 13
  • 45
  • 86

1 Answers1

1

Instead of using simple queues you probably want to use a queue tree. See: http://wiki.mikrotik.com/wiki/Manual:Queue#Queue_Tree

Briefly, you'll want a top level queue for upload and a separate one for download so duplicate this for each direction changing src-address to dest-address as appropriate.

  1. Create a queue with 10Mbps max for:

    /queue tree add name=all_up limit-at=10M parent=machine_ingress_interface

  2. Use packet marks to tag each packet by source or destination IP. E.g. traffic from Machine A is marked as machine_a_up:

    /ip firewall mangle add action=mark chain=prerouting new-packet-mark=machine_a_up src-address=192.168.1.2

  3. Create a queue to shape the traffic marked with the parent queue specified:

    /queue tree add name=machine_a_up packet-mark=machine_a_up parent=all_up

Alternatively, look at a PCQ. It might do what you want with less work.

jda
  • 271
  • 2
  • 8