We have a large pool of devices that establishes socket connections with a server. Connections are TCP socket connections hitting a server IP: port pair from a destination IP port pair. In stand alone mode there is no problem in responding back to the devices.
However as the number of devices have scaled up, we are forced to introduce a load balancer which would then repool traffic to various receivers in the backend. Receivers then processes the information, and store it in the database for future processing.
However, we are unable to send response to any of the devices, as the Load Balancer(HA Proxy) NATs the packets and changes IP Address as it sends the packets to the Server Pool behind firewall.
How do we ensure that connections are not lost, and the responses are made back to the devices?
What is the correct way to load balance TCP/IP Connections, and still ensure that the connections are responded back?
Any help will be appreciated.
We are currently using HA Proxy. We are open to switching to any other open source Load Balancer. We only need a round-robin load balancer.