Questions? +(855) 17 68 08 86

Load sharing with ECMP

Overview

ECMP (Equal Cost Multi Path) is one of the other technique to distribute the workload across two or more network link in order to maximize throughput and minimize response time. ECMP use round robin per SRC/DST address combination to distribute traffice to muliple network link.

With ECMP you will have multiple gateway to the same destination address. Normally all reachable nexthops are copied to FIB(Forwarding Information Base) to forward packets. As a result of FIB table, connection with the same source address, destination address, source interface, routing mark and Tos are sent to the same gateway. That’s why ECMP is a per-connection load balancing.

Used Case

Ex: You have connection with 2 ISP (Internet Service Provider) as a diagram below. We got the same bandwidth to both ISP. In this configuration we will share 50% to ISP A and 50% to ISP B.

 

loadbalancing-ecmp

1. Setup IP address

/ ip address add address=192.168.0.1/24 network=192.168.0.0 interface=LAN
add address=10.0.0.2/30 network=10.0.0.0 interface=wlan1
add address=20.0.0.2/30 network=20.0.0.0 interface=wlan2

2. Configure NAT

Because we have customer LAN, using private IP address. So we need to use NAT to translate private IP of customer LAN to public IP.

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

3. Configure Route

Because both ISP have the same bandwidth, so we configure share traffice 1:1. It’s mean 50% to ISP A and 50% to ISP B

/ ip route add dst-address=0.0.0.0/0 gateway=10.0.0.1,20.0.0.1 check-gateway=ping
Some issue on ECMP

DNS Issue
In the case your client have connection to ISP B while your client use ISP A DNS server, your client will not able to resolve domain name. Because ISP they will allow only their customer able to send DNS query to their DNS server. To resolve this issue you should use third party DNS server like 8.8.8.8 or 8.8.4.4

Routing Table Flashing

When router flush the routing table, it also flush the FIB cache. Then the connection will assign to gateway once again. In this case the traffice may or may not distribute to the same gateway as before. As in the above scenario you do masquerade, change of the gateway will result in change of the packet’s source address and connection will be dropped.

0 Comment(s)

  • by Jill Posted November 22, 2016 1:42 pm

    Staisfacory!!!

  • by Maria Posted November 22, 2016 2:08 pm

    I am happpy to be a part of this campus!!!

    • by administrator Posted November 22, 2016 2:09 pm

      Its good!

Leave a Reply

Your email address will not be published. Required fields are marked *

If you Have Any Questions Call Us On CALL US : (+855) 017 680 886 / 093 680 886