0

I understand that one reason we use SNAT on a load balancer for incoming requests is so that the response packet from server will go through the load balancer, where the source IP of returning packet gets modified to Load Balancer IP, so that the client recognizes it and accepts the response.

My question is, for the mechanism that the client drops the packet from the server it does not “recognize”, is that a network-layer mechanism or a TCP mechanism? Should be a TCP mechanism, right? As TCP maintains a “connection”, where the client expects to see the response from the IP it wants to talk to.

1
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Commented Dec 21, 2020 at 17:43

1 Answer 1

1

Whenever NAT is used, the source and destination addresses must match the destination's expectations.

With a private IP client sending out a request, the NAT router (or load balancer) translates the private source IP address to one of its own public addresses, forwards the request, and on return from the server it substitutes the destination address with the original client's private IP. If this process is not consistent due to asymmetric routing or policies it can't work.

Transport layer protocols form sockets from the source/destination IP/port number tuple. If any one parameter doesn't fit it's not the same socket.

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.