0

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. **

1
  • "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?" No. "If it is not possible with an L4 load balancer, would an L7 load balancer be capable of handling this situation?" No.
    – Ron Maupin
    Commented May 26 at 15:34

1 Answer 1

1

That doesn't work generally.

It's not about the load balancer - the intermediate protocols won't allow it unless the servers synchronize their sessions. That's less about load balancing and more about high availability, however.

TCP requires the end point to synchronize their sequence number before allowing communication. While the LB could SYN the client's SEQ to the server, the server chooses a random SEQ that the client doesn't know about - so the LB would need to keep translating TCP connections.

On the application layer, this gets worse. Re-establishing an application layer session L7 would require the LB to understand the L7 protocol. That's not a load balancer any more, but rather a proxy. Note that all that is off topic here.

Accordingly, the clean way for the LB is to RST the connection and signal the client to create a new session (which it might have done already due to timeout).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.