Community discussions

MikroTik App
 
ssin
just joined
Topic Author
Posts: 1
Joined: Tue Apr 20, 2021 7:27 pm

Pure per packet load balancing for two connected ISPs with similar public IP

Thu May 13, 2021 9:41 pm

I would like to use Mikrotik hap-ac lite router in order to increase the overall bandwidth of my home LAN network.

My main intention is to watch IPTV using my Android TV and the IPTV requires a very reliable minimum bandwidth of 5Mbps inorder to function properly and show the contents with no frame drops.

For the mentioned purpose I have following ISPs setup, please keep in mind that my home internet providers do not give me more bandwidth than my current one.

My first ISP is an ADSL service provider with very stable download link speed around 3 Mbps and upload link speed of 400 kbps.

My second ISP is from a mobile service provider with a very unreliable and fluctuating download and upload speed during different hours of a day.

I have checked my mobile network speed after the (LTE modem) and its download speeds swings between 2.8 Mbps during the days and 8 Mbps between 22:30 to 6:00AM.

I have realized that the speed both of the connections together never drops below 5.8Mbps and I presume that I could find a strategy or a method to use both of the bandwidths efficiently and simultaneously in order to watch IPTV flawlessly.

Before explaining my tried scenarios I would like to ask whether the IPTV protocol MPG/TS does use multi link data-flow connections similar to torrents or not?

Then I am wondering one should expect a boost with speed and performance of the IPTV when he implements any of the per connection based load balancing techniques such as PCC or not?

I have tried following PCC scenarios with two ISPs connected to my Mikrotik router.

Using the PCC when ether1-WAN1 was connected directly to the ISP1, and ether2-WAN2 was connected directly to the ISP2.

The performance of the above mentioned scenario with different types of classifiers combinations such as dst address, src address, ports,... was evaluated and the result was extremely poor.

Even trying different sharing ratios such as using 3 as denominator instead of 2 for having a fair traffic distribution among the two WANs didn't not improve the overall performance at all and the IPTV couldn't perform properly.

In my second attempt of using the PCC load balancing
I do not feed the ether1-WAN1, ether2-WAN2 interfaces with the direct Internet traffic forwarded from my ISPs, instead, for both of my ISPs I passthrough the direct traffic of the ISPs via two physical independent VPN routers and then feed them to my Mikrotik ether1-WAN1 and ether2-WAN2 interfaces.
Please consult the trimmed enclosed router settings.
Which means that both WAN interfaces on my Mikrotik will see a similar static public IP address.
Since the VPN provider that I use allows me to get two static similar public IP addresses simultaneously without imposing any bandwidth restrictions.

Having that said my second attempt with different PCC combination and bandwidth sharing did not solve my issues with the IPTV yet and I am totally hopeless with per connection based load balancing techniques.

I am presuming since I do have two similar public IP addresses on two of my Mikrotik WAN ports and the IPTV provider does only see one public IP the bandwidth improvement will be an achievement.


Therefore I am wondering whether there exists any solution for taking advantage of both of the ISP BWs by using per packet based solutions such as nth load balancing or IP firewall,.... In order to reach
a stable and reliable overall minimum bandwidth of 5.8 Mbps??!

I have googled a lot in order to find a single example for a pure per packet nth load balancing using Mikrotik RouterOS and I haven't found any.

I would be happy if one could guide me through an example of a per packet nth load balancing in RouterOS and help me to identify if this method is a viable solution or not.

In addition I am not sure if using following methods could be handy too or not, an example on any of the following methods would be really appreciated

-- Using IP firewall
-- Using queues or bandwidth limiting methods on interfaces or bridges.


In order to clarify my usage of failed PCC I have enclosed my PCC router configuration down below.

Thanks in advance

/interface bridge
add admin-mac=AC:3B:6B:42:30:1C auto-mac=no comment=defconf name=bridge
add name=bridge-combined-lan

/interface ethernet
set [ find default-name=ether1 ] comment="after SS VPN ADSL (192.168.150.x) has static public IP 185.85.85.80" name=\
ether1-WAN1
set [ find default-name=ether2 ] comment="after SS VPN LTE modem (192.169.140.y) has static public IP 185.85.85.80" name=\
ether2-WAN2
set [ find default-name=ether3 ] name=ether3-LAN

/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
add name=dhcp_pool1 ranges=10.10.10.10-10.10.10.254

/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
add address-pool=dhcp_pool1 disabled=no interface=bridge-combined-lan name=\
dhcp1

/routing table
add fib name=via-ISP1
add fib name=via-ISP2

/interface bridge port
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge-combined-lan comment=defconf interface=wlan2
add bridge=bridge-combined-lan interface=ether3-LAN

/interface detect-internet
set detect-interface-list=all internet-interface-list=all

/interface list member
add comment=defconf interface=bridge-combined-lan list=LAN
add comment=defconf interface=ether1-WAN1 list=WAN

/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
192.168.88.0
add address=10.10.10.1/24 interface=bridge-combined-lan network=10.10.10.0

/ip dhcp-client
add comment="ADSL VPN Router should bound to 192.168.150.xxx subnet ADSL 3.1mbps dl/400\
kbps ul checked address" disabled=no interface=\
ether1-WAN1 script="\r\
\n"
add comment="LTE VPN Router should bound to 192.168.140.xxx subnet LTE 6mbps dl/12mbps ul che\
cked address" disabled=no interface=ether2-WAN2 script=\
"\r\
\n\r\
\n"

/ip dhcp-server network
add address=10.10.10.0/24 dns-server=192.168.130.1,8.8.8.8,192.168.42.129 \
gateway=10.10.10.1
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1

/ip dns
set allow-remote-requests=yes servers=217.146.82.84

/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan

/ip firewall mangle
add action=accept chain=prerouting dst-address=10.10.10.0/24
add action=accept chain=prerouting dst-address=192.168.140.0/24
add action=accept chain=prerouting dst-address=192.168.150.0/24
add action=mark-connection chain=prerouting in-interface=ether1-WAN1 \
new-connection-mark=ISP1 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether2-WAN2 \
new-connection-mark=ISP2 passthrough=yes
add action=mark-connection chain=prerouting comment=\
"ADSL-ether1-WAN1 Max 3.1mbps dl/400kbps UL 33%" in-interface=\
bridge-combined-lan new-connection-mark=ISP1 passthrough=yes \
per-connection-classifier=both-addresses:3/0
add action=mark-connection chain=prerouting comment=\
"LTE-ether2-WAN2 max 6mbps dl/6mbps ul 66% part1" \
in-interface=bridge-combined-lan new-connection-mark=ISP2 passthrough=yes \
per-connection-classifier=both-addresses:3/1
add action=mark-connection chain=prerouting comment=\
"LTE-ether2-WAN2 max 6mbps dl/6mbps ul 66% part2" \
in-interface=bridge-combined-lan new-connection-mark=ISP2 passthrough=yes \
per-connection-classifier=both-addresses:3/2
add action=mark-routing chain=prerouting connection-mark=ISP1 in-interface=\
bridge-combined-lan passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP2 in-interface=\
bridge-combined-lan passthrough=yes
add action=mark-routing chain=output connection-mark=ISP1 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP2 passthrough=yes

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-WAN1
add action=masquerade chain=srcnat out-interface=ether2-WAN2

/ip route
add check-gateway=ping comment="ADSL GW ether1-WAN1" disabled=no dst-address=\
0.0.0.0/0 gateway=192.168.150.1 routing-table=via-ISP1
add check-gateway=ping comment="LTE GW ether2-WAN2" disabled=no dst-address=\
0.0.0.0/0 gateway=192.168.140.1 routing-table=via-ISP2
add comment="ISP1 ADSL failover " disabled=no distance=2 dst-address=0.0.0.0/0 \
gateway=192.168.140.1 routing-table=via-ISP1
add comment="ISP2 LTE failover " disabled=no distance=2 dst-address=0.0.0.0/0 \
gateway=192.168.150.1 routing-table=via-ISP2
 
DeJoe
newbie
Posts: 33
Joined: Thu May 31, 2018 4:26 pm

Re: Pure per packet load balancing for two connected ISPs with similar public IP

Thu May 20, 2021 7:12 pm

Hi.
Then I am wondering one should expect a boost with speed and performance of the IPTV when he implements any of the per connection based load balancing techniques such as PCC or not?
I have no experience with IPTV but I would guess that IPTV uses a single connection. So a connection based load balancing would not help.

The problem with packet based load balacing is that the other side needs also to take care of that load balancing.

Just a short and incomplete description:
You get two different IP-Adresses from WAN1 and WAN2. So if you want your IPTV-Provider to deliver a TV-Stream to you, your Provider needed to split the stream to different IP-Addresses.

So unless IPTV streams uses two or more connections, you have no chance.

Who is online

Users browsing this forum: ccrsxx, inna and 38 guests