loxilb-io / loxilb

eBPF based cloud-native load-balancer. Powering Kubernetes|Edge|5G|IoT|XaaS Apps.
https://www.loxilb.io
Apache License 2.0
1.33k stars 98 forks source link

Fullnat support pool of local IP addresses assigned to local network interface as source IP #684

Open vincentmli opened 3 months ago

vincentmli commented 3 months ago

Is your feature request related to a problem? Please describe.

In traditional load balancer, SNAT could choose local IP addresses created/assigned to local network interface, it has two main benefits as far as I know:

  1. local backend server/endpoint gateway pointed to the load balancer local network ip, when deploy load balancer, no need to change backend server/endpoint gateway IP

  2. select pool of local IP addresses can increase concurrent connection to backend server > 64k since 4 tuples concurrent connection is limited to 64k

now loxilb only support one arm deployment with assigned IP address on interface as SNAT source ip.

Describe the solution you'd like

Maybe create a bpf map with pool of IP addresses which are also assigned to local network interface, when doing SNAT, loxilb could round robin select the IP in the pool of IP addresses as source ip for each connection

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context

ipfire user https://community.ipfire.org/t/can-the-ipfire-support-bi-directional-nat/11645 expressed similar request, bpfire with loxilb could meet this requirement with eBPF technology instead of traditional netfilter SNAT/DNAT.

vincentmli commented 3 months ago

in loxilb HA environment, this pool of IP addresses can be "floating" IP addresses in HA, meaning this pool of IP addresses follows the active loxilb unit and get assigned to the active loxilb.