MikroTik Traffic Shaping for VoIP

New to MikroTik and enjoying it. Just deployed an RB100 in a 4-tenant office building to make good use of their 300M fiber circuit.

I’m under the gun to improve the VoIP experience there and hoping to get some ideas and advice. Right now all I’m doing is a simple rule on the public-facing interface. 217.123.46.27 is the PBX.

/queue tree
add name=IN parent=global priority=1
add name=OUT parent=global priority=1
add name=SIP_IN packet-mark=SIP_IN parent=IN priority=2
add name=SIP_OUT packet-mark=SIP_OUT parent=OUT priority=2
add name=ALL_ELSE_IN packet-mark=ELSE_IN parent=IN

/ip firewall mangle
add action=mark-packet chain=prerouting comment="SIP Only" in-interface=public \
    new-packet-mark=SIP_IN passthrough=no src-address=217.123.46.27
add action=mark-packet chain=postrouting dst-address=217.123.46.27 \
    new-packet-mark=SIP_OUT out-interface=public passthrough=no
add action=mark-packet chain=prerouting comment="All Else" in-interface=public \
    new-packet-mark=ELSE_IN passthrough=no src-address=!217.123.46.27
add action=mark-packet chain=postrouting dst-address=!217.123.46.27 \
    new-packet-mark=ELSE_OUT out-interface=public passthrough=no

/ip firewall nat
add action=masquerade chain=srcnat src-address=172.16.2.0/23
add action=masquerade chain=srcnat src-address=172.16.4.0/23
add action=masquerade chain=srcnat src-address=172.16.6.0/23
add action=masquerade chain=srcnat src-address=172.16.8.0/23

At the moment, outbound quality is good but they frequently complain of the outside party being “clipped” and dropping audio for a few seconds at a time, often to the point of making the call unusable. And this when the network is only lightly loaded with other traffic, mostly HTTP/S and some DropBox upload/download going.

I’ve never tried shaping inbound traffic before, but the way I read the firewall rules above it’s proiriting the traffic in both directions already. Should I be thinking about applying the same thing to the internal interfaces (one per VLAN) or look at something else altogether? Hopefully this hasn’t been done to death and I’m just not finding it via search due to noob-ness.

Hi,

From my understanding, traffic shaping is only relevant for ougoing trafic.
For inbound stream, trafic shaping must be done at the other end, the sending one.

Additionally, it must be done also in transit router when the next pipe is smaller or when many pipe converge into one.
That’s especially true at the PE, the ISP router at the other end of your internet link.

my 2 cents…