Traffic Shaping and Bandwidth Management

Hi all,

I have few doubts

1)We have a 2 IBW links each having capacity of 100 Mbps and 50 Mbps. Now the problem is that 100 Mbps is reaching upto 98 Mbps during peak hours whereas 50 Mbps link is not reaching 30 Mbps itself.

So how to do traffic shapping, so that the traffic sharing should be in equal ratio?

2)The above two mentioned links are terminated on the same RB1000 router on two different interfaces.The Tx and Rx for 100 Mbps interface during peak usage will be Tx=28-30 Mbps and Rx=95-98 Mbps. But in 50 Mbps interface Tx and Rx is almost equal(i.e, Tx=25-30 and Rx=25-30 Mbps)

So,how do we reduce upload request on 50 Mbps interface.

Awaitng for Reply!!

Thanks in advance.


Pradeep.

Use PCC with three line items, two of which point to the 100 meg circuit. That splits traffic evenly by a ratio of 2:1.

Really, though, you should buy more bandwidth.

Thank you very much. It is working but still I’m facing some problems with some IP pools.

Actually I have two LAN Ip pools working under this 100 Mbps link,out these two IP pools only one Ip pool is working after changing the configuration.
Below is the configuration please correct if any thing is wrong.

/ ip firewall mangle
add chain=input in-interface=wlan1 action=mark-connection new-connection-mark=wlan1_conn
add chain=input in-interface=wlan2 action=mark-connection new-connection-mark=wlan2_conn

add chain=output connection-mark=wlan1_conn action=mark-routing new-routing-mark=to_wlan1
add chain=output connection-mark=wlan2_conn action=mark-routing new-routing-mark=to_wlan2

add chain=prerouting dst-address=x.x.x.x action=accept in-interface=Local
add chain=prerouting dst-address=y.y.y.y action=accept in-interface=Local

add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses:2/0
action=mark-connection new-connection-mark=wlan1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses:2/1
action=mark-connection new-connection-mark=wlan2_conn passthrough=yes

add chain=prerouting connection-mark=wlan1_conn in-interface=Local action=mark-routing new-routing-mark=to_wlan1
add chain=prerouting connection-mark=wlan2_conn in-interface=Local action=mark-routing new-routing-mark=to_wlan2

/ ip route
add dst-address=0.0.0.0/0 gateway=x.x.x.x routing-mark=to_wlan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=y.y.y.y routing-mark=to_wlan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=x.x.x.x distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=y.y.y.y distance=2 check-gateway=ping

/ ip firewall nat
add chain=srcnat out-interface=wlan1 action=masquerade
add chain=srcnat out-interface=wlan2 action=masquerade


Any Corrections please update me

That isn’t doing 2:1 but we will get to that later.

Since you’re having problems with IP pools it would be helpful if you gave some details. Such as what those IP pools are.

Hi,

Here i’m attaching my detailed network diagram with Ip address(for security reasons i didn’t mentioned actual IPs).In this scenario what would be the configuration in core router as well as distribution router.

currently we are terminating the two links on two seperate interfaces of a RB 1000 and we configured 3 lan ip pools under another interfaces as shown in the figure. And in each distribution router we assigned two Ip addresses to the same interface and in routes we added a static route with 2 gateways, in core router also we added a static route with 2 gateways.

After changing the configuration for traffic shapping (PCC) two distribution routers which is having only 100 Mbps Lan ip are not working at all.

So kindly suggest me to configure PCC with out effecting any distribution router.

Awaiting for your reply.

Thanks,
Pradeep.
nw layout.jpg

Hi

I have configured PCC in my core router as the configuration given earlier,after doing this i’m facing some small issues. My internet customers are complaining that their VPNs(people who is trying to connect their office VPN) are not working,before configuring PCC every thing is working fine but traffic shapping is not happening but now traffic shaping is happening but this VPN issue is there and also while tracerouting to websites at my core router it is showing * * * * request timed out.

Kindly suggest to resolve this issue

Thanks
pradeep.

Look at the PCC example on the wiki. The input/output rules are to make connections ‘sticky’ - they make sure that connections established to a particular interface always have return traffic go out that interface. However, input/output is only for traffic TO or FROM the router, not traffic THROUGH the router. You need to make rules in the forward chain that match new connections established from the WAN to customers behind your router, and mark them according to the in-interface so that you can skip PCC on those connections early in the rule set. You will also have to then adjust the PCC rules to apply PCC only to connections that have a connection mark of “no-mark” so you don’t overwrite sticky labels you applied before.

Hi

find the below for the required configuration details of my core router.

Kindly go through it and help me how to configure traffic shapping as per the scenario.

thanks
nas conf.txt (5.68 KB)

Remove all the firewall mangle and NAT rules you have and use this instead. It accounts for sticky inbound connections, and changes the ratio of load balancing to 2:1 to account for the link capacities. NAT is changed to proper static source NAT rather than masquerade (which should be used for dynamically addressed links, you have static IPs), and now only NATs private IPs, of which there aren’t any in the config you posted. You were NATing publics to publics, which is pointless and breaks things. I don’t know what the ICMP packet mark is for so I left it in.

/ip firewall address-list
add address=192.168.0.0/16 list=rfc1918
add address=172.16.0.0/12 list=rfc1918
add address=10.0.0.0/8 list=rfc1918
/ip firewall mangle
add action=mark-packet chain=prerouting comment=ICMP new-packet-mark=ICMP passthrough=yes protocol=icmp
add action=mark-connection chain=input in-interface=ether1-Uplink new-connection-mark=Wan_100Mb passthrough=yes
add action=mark-connection chain=input in-interface="ether4- 50 Mb LINK" new-connection-mark=Wan_50Mb passthrough=yes
add action=mark-routing chain=output connection-mark=Wan_50Mb new-routing-mark=to_wan50Mb passthrough=yes
add action=mark-routing chain=output connection-mark=Wan_100Mb new-routing-mark=to_wan100Mb passthrough=yes
add action=accept chain=prerouting dst-address=122.252.231.204/30 in-interface=ether2-NAS-10-11-12-14
add action=accept chain=prerouting dst-address=112.133.206.0/30 in-interface=ether2-NAS-10-11-12-14
add action=mark-connection chain=prerouting connection-state=new in-interface="ether1-Uplink" new-connection-mark=Wan_100Mb passthrough=no
add action=mark-connection chain=prerouting connection-state=new in-interface="ether4- 50 Mb LINK" new-connection-mark=Wan_50Mb passthrough=no
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=ether2-NAS-10-11-12-14 connection-mark=no-mark new-connection-mark=Wan_100Mb passthrough=yes per-connection-classifier=both-addresses:3/0
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=ether2-NAS-10-11-12-14 connection-mark=no-mark new-connection-mark=Wan_100Mb passthrough=yes per-connection-classifier=both-addresses:3/1
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=ether2-NAS-10-11-12-14 connection-mark=no-mark new-connection-mark=Wan_50Mb passthrough=yes per-connection-classifier=both-addresses:3/2
add action=mark-routing chain=prerouting connection-mark=Wan_100Mb in-interface=ether2-NAS-10-11-12-14 new-routing-mark=to_wan100Mb passthrough=yes
add action=mark-routing chain=prerouting connection-mark=Wan_50Mb in-interface=ether2-NAS-10-11-12-14 new-routing-mark=to_wan50Mb passthrough=yes
/ip firewall nat
add action=src-nat chain=srcnat src-address-list=rfc1918 out-interface=ether1-Uplink to-address=122.252.231.206
add action=src-nat chain=srcnat src-address-list=rfc1918 out-interface="ether4- 50 Mb LINK" to-address=112.133.206.2

Hi,

I have small doubt in the configuration you had given,

/ip firewall address-list
add address=192.168.0.0/16 list=rfc1918
add address=172.16.0.0/12 list=rfc1918
add address=10.0.0.0/8 list=rfc1918

This is for what,we are not using this IP pools at all, kindly explain me I’m not a expirenced guy in configuring the routers and all.

Thanks

That is so that you only NAT private IP addresses. If you’re not using ANY IPs in that range you don’t need NAT at all. In fact, using NAT if you’re not using any addresses in that range would break things badly.

Hi,

Thanks for your prompt reply.Here I’m attaching the configuration of one of the distribution router, total we have 6 distribution routers working under one core router as mentioned in the diagram.

In core router we dropping the total bandwidth in two different interfaces and from there we assigned two LAN Ip address to the same interfaces and that interface is connected to a gigabit switch and from that switch all the six distribution routers are connected and in each distribution router we created the different VLANs as per the area name and for each VLAN we have assaigned some private IP pools and we are masqurading those Ips. we are running hotspot and pppoe servers on each and every vlan.

Kindly suggest me the configuration changes in distribution router as well as core router.

Thanks
Pradeep.
dist nas conf.txt (27.1 KB)

No, this is getting unreasonable for forum support. Maybe go hire a consultant.

Hi,

Thanks for your suggestion,

Can u be a remote consultant for my organization?

hi,

Is there any training centres for mikrotik in India?

There doesn’t appear to be training in India: http://www.mikrotik.com/training/

I do not consult - too much chance of violating my non-compete. There are Indian consultants: http://www.mikrotik.com/consultants.html#upside

Hi, sharing my thoughts based on similar setups I’ve worked with.

  1. Traffic shaping won’t automatically make both links share traffic equally unless you’re actively controlling it. Since the links are different capacities (100 Mbps and 50 Mbps), you’ll need proper queueing and load balancing, not just shaping. On MikroTik (RB1000), you can use PCQ queues or Queue Trees with defined max-limits per interface, and combine that with PCC (Per Connection Classifier) so new connections are distributed proportionally instead of randomly.

  2. For the upload issue on the 50 Mbps link, it usually happens because ACK traffic or asymmetric routing pushes more upload onto that interface. You should:

  • Limit upload using queue trees on the 50 Mbps interface

  • Ensure return traffic follows the same link (proper routing marks)

  • Check if any backup or heavy upload services are pinned to that interface

In short: use PCC for balancing, queue trees for shaping, and routing marks to keep traffic symmetric.