nat: deal with flows instead of sessions 83/29983/29
authorKlement Sekera <ksekera@cisco.com>
Tue, 15 Dec 2020 17:47:05 +0000 (18:47 +0100)
committerOle Tr�an <otroan@employees.org>
Mon, 18 Jan 2021 08:36:26 +0000 (08:36 +0000)
commit4881cb4c6f0d9c6276eb7a45ed355f9fc3d729b3
tree07959eb6fc99b88b30e6f81f4620d8d6c70110e2
parent4a58e49cfe03150034a65e147a2ffe8d24391b86
nat: deal with flows instead of sessions

This change introduces flow concept to endpoint-dependent NAT. Instead
of having a session and a plethora of special cases in code for e.g.
hairpinning, twice-nat and others, figure all this out and store it in
flow logic. Every flow has a match and a rewrite part. This unifies all
the NAT packet processing cases into one - match a flow and rewrite the
packet based on that flow. It also provides a cure for hairpinning
dilemma where one part of the flow is on one worker and another on
a different one. These cases are also sped up by not requiring
destination adress lookup every single time to be able to rewrite source
nat as this is now part of flow rewrite logic.

Type: improvement
Change-Id: Ib60c992e16792ea4d4129bc10202ebb99a73b5be
Signed-off-by: Klement Sekera <ksekera@cisco.com>
15 files changed:
src/plugins/nat/in2out_ed.c
src/plugins/nat/nat.c
src/plugins/nat/nat.h
src/plugins/nat/nat44-ei/nat44_ei_ha.h
src/plugins/nat/nat44-ei/nat44_ei_in2out.c
src/plugins/nat/nat44/ed_inlines.h
src/plugins/nat/nat44_classify.c
src/plugins/nat/nat44_cli.c
src/plugins/nat/nat44_hairpinning.c
src/plugins/nat/nat44_handoff.c
src/plugins/nat/nat_format.c
src/plugins/nat/nat_inlines.h
src/plugins/nat/out2in_ed.c
src/plugins/nat/test/test_nat44_ed.py
src/vnet/buffer.h