I'm currently working on a network setup that uses an L4 load balancer to manage traffic for our services. The L4 load balancer effectively distributes new client connections to various backend servers based on a specified algorithm (e.g., round-robin, least connections). However, I've encountered a challenge regarding the handling of existing connections.
For new connections from clients, I can successfully reroute the connection to another backend server if the original server goes down. The load balancer handles this scenario well, ensuring continuity for new client requests. However, I'm facing difficulties with existing connections, particularly with TCP and SCTP protocols.
Here are my specific questions:
TCP Connections:
Is it possible for an L4 load balancer to shift an existing TCP connection (including the TCP packet stream) from one backend server to another if the original server goes down? From my understanding, this does not seem feasible because the TCP connection state (sequence numbers, acknowledgments, etc.) is maintained between the client and the original server. SCTP Connections:
Similarly, can an L4 load balancer transfer an ongoing SCTP connection (including SCTP chunks) to a new backend server if the original server fails? Given the multi-homing and multi-streaming features of SCTP, is there any mechanism that an L4 load balancer can utilize to accomplish this without breaking the connection? L7 Load Balancers:
If it is not possible with an L4 load balancer, would an L7 load balancer be capable of handling this situation? Since an L7 load balancer operates at the application layer and forms a new connection with the backend server, could it potentially re-establish the connection with a new backend server without disrupting the client's existing connection? How would this work in practice, and are there any specific configurations or considerations required to achieve this? Additional Context: Our application is designed to maintain high availability and fault tolerance. The ability to seamlessly transfer active connections from one backend server to another without interruption is crucial for our service reliability.
**NOTE: I don't have any control on the client, I can only make changes in the load balancer to handle this scenario. The client doesn't have a mechanism to establish a new SCTP connection if the backend server goes down. **