Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

When using Network Load Balancer what function is Client source IP among Session affinity fun

When using Network Load Balancer (TCP/SSL) with GCP If you look at Session affinity, there is a Client Source IP. At first, I thought the function was to remove the XFF header and see the original USER IP

 

SeongGi_0-1689749705243.png

 

Looking at the explanation, I don't think it's right. I want to understand that, but it doesn't exist in Google Docs. I want to know about that part.

https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/X-Forwarded-For I thought it was that part I don't know because there's no clear explanation..

 

1 2 818
2 REPLIES 2

Hi @SeongGi ,


@SeongGi wrote:

When using Network Load Balancer (TCP/SSL) with GCP If you look at Session affinity, there is a Client Source IP.


When you configure session affinity with the "Client Source IP" as the affinity type, requests originating from the same client IP address will consistently be directed to the same backend instance. This means that all requests from a specific client are routed to a specific backend server throughout the duration of the session.

To answer your question regarding removing the X-Forwarded-For (XFF) header and seeing the original user IP, the "Client Source IP" session affinity setting and the X-Forwarded-For (XFF) header are not relatedSession affinity is designed to preserve sticky sessions by directing traffic from a specific client to the same backend instance consistently. On the other hand, the XFF header is used for tracking the original client IP address when intermediate proxies or load balancers are involved, but it does not affect the session affinity mechanism.

Hi @Marvin_Lucero 

Thank you so much for writing to my question.
The reason why I asked you this question..
Session affinity option "Client Source IP"  or "Client IP" Because I want to know the difference.

At first, I thought the difference between the two was the XFF header, but you said no..
What is the difference between Client Source IP or Client IP options?


@Marvin_Lucero wrote:

Client Source IP