Load balance session to same server

I have a scenario where I need a load balancer
When a new tcp connection is initiated from the client, the load balancer much assign a server, and always route all traffic from that that to the server it initially picked

When I netstat, I see and ipaddress and port for the client. (connection) so it makes sense to use this as the identifier for that client

Is there any software in exisitance to do this? Or do. I need to write my own?
websssCEOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nociSoftware EngineerCommented:
Session affinity/persistence/stickyness  can be done in various ways depending on data to be transported.
haproxy should be able to do this for you.
See below article. (Load balancing + getting the the same backend is not limited to HTTP though, you can do more (even encrypted SSL traffic)  as there almost always is some kind of key-id/ session-id inside packets.

https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Coolie SheppardSystems EngineerCommented:
If you're using Windows server, just install the feature Network Load Balancer.

It's free and you can add as many additional servers in there (you'll need to install NLB on each server you want to be part of the load balance)

You can allow specific ports (80,443) to load balance.  You can set it up to go to a specific server or load balance to the best server available and so on.

Here's a walkthrough on how to get it installed and configured:

https://wiki.unify.com/wiki/How_to_configure_NLB_for_Windows_Server
nociSoftware EngineerCommented:
@coolie: Topics are: "Linux networking"...    
haproxy is free & opensource.  and gratis as well.  without any requirement for Clustering or transforming your LAN into a broadcast network wrt. to NLB systems.  Or even a windows server license...
(effectively there are quite a few "hardware" loadbalancer's which actually run haproxy.)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
network load balance

From novice to tech pro — start learning today.