yanet-platform / yanet

A high performance framework for forwarding traffic based on DPDK
Other
165 stars 17 forks source link

Stable session mapping for balancer reals #33

Open GeorgyKirichenko opened 9 months ago

GeorgyKirichenko commented 9 months ago

A small change in reals states (enabled/disabled/weight) could mix session mapping to real completely. This means that there are less guarantees to preserve TCP sessions while the sessions migration between balancers.

The target is to implement some kind of stable mapping between user sessions and reals.

Current mapping implementation places real identifiers into an array accordingly with its weights and then uses session hash to determine a real handling the session. The main idea is to build array of real identifiers resistant to real state changes as family of consistent hashing algorithms does.

GeorgyKirichenko commented 9 months ago

Consistent hashing algorithms typically use relatively large amount of bytes to store mappings and consume lots of CPU cycles to build. This means that some preparation should be done before consistent hashing implementation.

Current implementation maintains two real mappings for each globalBase and rebuilds each on every real state update so we have to eliminate balancer service interference first.

Further, real states update should be reimplemented - controlplane updates it with the whole real state snapshot and dataplane has no glue what exactly was changed. So communicating with delta looks good here.