Community discussions

MikroTik App
 
Riajul74
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Sun Feb 10, 2013 12:01 am

FTP connection problem from load-balancing

Sat Jul 27, 2013 10:29 pm

hello all,

i am facing my server FTP connection problem. I am using RB450 and using loadbalancing . I am getting perfect load-balancing,problem is when i tried to connect my FTP server , after sometime try it got disconnect and donot retrieve folders from my FTP.

when i disable one connection (i have two isp connection ) from one ISP, i got folder retrive well.

can anybody give me a solve about this. its really important for me. I need to continue with load balancing. i cannot disable continue one ISP.

please suggest me.
 
User avatar
joshaven
Member
Member
Posts: 438
Joined: Fri May 06, 2011 1:50 am
Location: USA
Contact:

Re: FTP connection problem from load-balancing

Sun Jul 28, 2013 5:40 am

You probably need to be using PCC load balancing. I am not sure but I am guessing that the issue is that the FTP connection is ending up split between the two when it shouldn't be. If that is not the issue the. Possibly try both passive and active FTP modes.
 
Riajul74
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Sun Feb 10, 2013 12:01 am

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 4:09 pm

You probably need to be using PCC load balancing. I am not sure but I am guessing that the issue is that the FTP connection is ending up split between the two when it shouldn't be. If that is not the issue the. Possibly try both passive and active FTP modes.

i also assume that connection being split between. does there any way to fix it ?
 
User avatar
joshaven
Member
Member
Posts: 438
Joined: Fri May 06, 2011 1:50 am
Location: USA
Contact:

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 4:28 pm

In order to not send your FTP over multiple connections you can:

1) Use PCC (per connection classifier). The connection tracking keeps track of what belongs to that one connection and the PCC load balances across your internet uplinks on a per connection basis rather then a per packet equal cost or other method.
http://wiki.mikrotik.com/wiki/Manual:PCC
http://mum.mikrotik.com/presentations/US12/steve.pdf

2) Always send your FTP traffic over just one connection by adding a routing mark to FTP traffic and setting a default route for that routing mark.
 
Rudios
Forum Veteran
Forum Veteran
Posts: 977
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 4:47 pm

In order to not send your FTP over multiple connections you can:

1) Use PCC (per connection classifier). The connection tracking keeps track of what belongs to that one connection and the PCC load balances across your internet uplinks on a per connection basis rather then a per packet equal cost or other method.
http://wiki.mikrotik.com/wiki/Manual:PCC
http://mum.mikrotik.com/presentations/US12/steve.pdf

2) Always send your FTP traffic over just one connection by adding a routing mark to FTP traffic and setting a default route for that routing mark.
You put one fine detailed PDF document there.
Nevertheless I think I found an error on the second page from the end.
There you descirbed a isuse with assymetrical connections and created 4 PCC mangle rules
Shouldn't these rules be 4/0, 4/1, 4/2 and 4/3?
You wrote them as 3/0, 3/1, 3/2 and 3/3.
 
Riajul74
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Sun Feb 10, 2013 12:01 am

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 4:53 pm

In order to not send your FTP over multiple connections you can:

1) Use PCC (per connection classifier). The connection tracking keeps track of what belongs to that one connection and the PCC load balances across your internet uplinks on a per connection basis rather then a per packet equal cost or other method.
http://wiki.mikrotik.com/wiki/Manual:PCC
http://mum.mikrotik.com/presentations/US12/steve.pdf

2) Always send your FTP traffic over just one connection by adding a routing mark to FTP traffic and setting a default route for that routing mark.

Thanks for advice. 2nd instruction you said to send over one connection. Does it will work loanbalancing from ftp download or upload. Also can you please give me example of doing routing mark rule ..please
 
User avatar
joshaven
Member
Member
Posts: 438
Joined: Fri May 06, 2011 1:50 am
Location: USA
Contact:

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 5:10 pm

You put one fine detailed PDF document there.
Nevertheless I think I found an error on the second page from the end.
There you descirbed a isuse with assymetrical connections and created 4 PCC mangle rules
Shouldn't these rules be 4/0, 4/1, 4/2 and 4/3?
You wrote them as 3/0, 3/1, 3/2 and 3/3.
I am not the author of that document. I just did a quick google search and found something that I could tell was going to answer the questions better then a quick post on a message board. That PDF is from a MUM presentation.
 
User avatar
joshaven
Member
Member
Posts: 438
Joined: Fri May 06, 2011 1:50 am
Location: USA
Contact:

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 5:19 pm

Thanks for advice. 2nd instruction you said to send over one connection. Does it will work loanbalancing from ftp download or upload. Also can you please give me example of doing routing mark rule ..please
FTP is TCP traffic which means that it has a connection. It isn't then so much about upload or download it is more about TCP states. When the client FTP initiates the connection in what you would consider upload or download then all of the traffic from that connection will belong to that connection regardless of the direction of the traffic. If you have ingress FTP traffic initialization then you'll need to mark that traffic according to the ingress connection mark that belongs to that interface. If your router is making the decision on what uplink to use then it can choose the connection intelligently by adding the connection mark through PCC.

I would suppose that you are not using some type of load balancing on FTP ingress unless your using some auto changing DNS or configuring the remote host to some how randomly choose the destination.

I don't know how important FTP load balancing is to you but I would suspect that it would be easier to simply always send all FTP over a single connection by default. If you use the check gateway option on the route then FTP will fail over to the other route upon failure to reach the gateway of the primary connection.

I expect that PCC will be a better load balancing option for you then ECMP.
 
Riajul74
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Sun Feb 10, 2013 12:01 am

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 7:23 pm

thanks a lot for making me clear.

actually i really need load balancing for ftp download and upload. mainly my business depend on my download and upload. huge download need and upload each day. I am using two ISP and i need to use all bandwidth from those.

if i mark one connection for ftp then it will only use ISP . other ISP will be idle so....
 
User avatar
joshaven
Member
Member
Posts: 438
Joined: Fri May 06, 2011 1:50 am
Location: USA
Contact:

Re: FTP connection problem from load-balancing

Tue Aug 13, 2013 10:48 pm

PCC will help you load balance both the upload and download on any TCP traffic that you initiate.

The only way you can load balance incoming requests is to somehow load balance the IP address that the remote end is going to use to initiate the connection. If the remote end uses your IP from ISP A then you don't have any abilities to move the incoming connection to ISP B from the router. There are load balancing options including but not limited to Round Robin DNS, however I would have to know a lot more about your use before I could recommend a way to load balancing incoming connections.

You can see an example of load balancing based on DNS by doing a query on google.com (`nslookup` for windows or `host` for Mac or Linux). If you look-up the IP address a few times in a row you will see that the order of the addresses change on a regular basis. That causes users to spread across those IP addresses. http://en.wikipedia.org/wiki/Round-robin_DNS
 
Riajul74
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 68
Joined: Sun Feb 10, 2013 12:01 am

Re: FTP connection problem from load-balancing

Wed Aug 14, 2013 9:34 am

Hello Dear,

you are trig to help me thanks for it. really i am not advance user so i am asking question and question. Let me clear to you about my uses

I get work from my client server. i need to download the jobs from ftp. then work again upload via ftp. I have two ISP connection and i need to use both for use maximum bandwidth. I have two computer for download and upload. one i am downloading and from another one i am uploading. more around 80 computers on my network which DHCP giving via router. all computer are being login via local domain. i was using my loadbalancing fine and it working good. but till few days i discovered that my client ftp folders are not being retrieve with load balancing. i tried to disable one ISP connection then its being retrieving good. so yes problem with the balancing where its being split connection and when back not getting started destination.

for make you more clear about my loadbalancing i am giving below mangle rules. please look into it and tell me if i am using good or somewhere bad.

yesterday i tried with PCC configuration. but after PCC configure if i start download, its going via only one connection. not downloading from both connection. my current configuration working download good, when i start a download, its getting speed from both ISP.

if you want to see my router live please tell me, i will give you my router's login details to look after it. i am sorry i am disturbing you too much. below is my current configuration

/ip firewall mangle> print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=input action=mark-connection new-connection-mark=ether5-AFTAB_conn
passthrough=yes hotspot=auth in-interface=ether5-AFTAB

1 chain=input action=mark-connection new-connection-mark=ether4_BDCOM_conn
passthrough=yes hotspot=auth in-interface=ether4_BDCOM

2 chain=output action=mark-routing new-routing-mark=to_ether5-AFTAB
passthrough=yes hotspot=auth connection-mark=ether5-AFTAB_conn

3 chain=output action=mark-routing new-routing-mark=to_ether4_BDCOM
passthrough=yes hotspot=auth connection-mark=ether4_BDCOM_conn

4 chain=prerouting action=accept dst-address=58.147.172.152/29
in-interface=ether1-LAN

5 chain=prerouting action=accept dst-address=114.31.3.128/29
in-interface=ether1-LAN

6 chain=prerouting action=mark-connection
new-connection-mark=ether5-AFTAB_conn passthrough=yes
dst-address-type=!local hotspot=auth in-interface=ether1-LAN
per-connection-classifier=both-addresses-and-ports:2/0

7 chain=prerouting action=mark-connection
new-connection-mark=ether4_BDCOM_conn passthrough=yes
dst-address-type=!local hotspot=auth in-interface=ether1-LAN
per-connection-classifier=both-addresses-and-ports:2/1

8 chain=prerouting action=mark-routing new-routing-mark=to_ether5-AFTAB
passthrough=yes hotspot=auth in-interface=ether1-LAN
connection-mark=ether5-AFTAB_conn

9 chain=prerouting action=mark-routing new-routing-mark=to_ether4_BDCOM
passthrough=yes hotspot=auth in-interface=ether1-LAN
connection-mark=ether4_BDCOM_conn

ip route> print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 0.0.0.0/0 58.147.172.153 1
1 A S 0.0.0.0/0 114.31.3.129 1
2 A S 0.0.0.0/0 114.31.3.129 1
58.147.172.153
3 ADC 58.147.172.152/29 58.147.172.156 ether5-AFTAB 0
4 ADC 114.31.3.128/29 114.31.3.132 ether4_BDCOM 0
5 ADC 192.168.2.0/24 192.168.2.254 ether1-LAN 0



ip address> print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 114.31.3.132/29 114.31.3.128 ether4_BDCOM
1 58.147.172.156/29 58.147.172.152 ether5-AFTAB
2 192.168.2.254/24 192.168.2.0 ether1-L


/ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
0 X ;;; place hotspot rules here
chain=unused-hs-chain action=passthrough to-addresses=0.0.0.0

1 chain=srcnat action=masquerade out-interface=ether4_BDCOM

2 chain=srcnat action=masquerade out-interface=ether5-AFTAB
 
Juni4567
just joined
Posts: 1
Joined: Sun Aug 02, 2015 10:16 pm

Re: FTP connection problem from load-balancing

Sat Aug 08, 2015 6:33 pm

I have found a solution for you. I described it visually. Although by following this method you forward your traffic on a single wan but it helped me.

http://gamier.blogspot.com/2015/08/mikr ... oblem.html

Who is online

Users browsing this forum: grosnico, nichky and 81 guests