Hi, There is no guarantee that user always get same external address if you have multiple external addresses. What you are referring to mean standard/vanilla NAT use endpoint-independent mapping (RFC4787 section 4.1.) and filtering (RFC4787 section 5.), something different. What you want is address paired pooling behaviour but NAT plugin has arbitrary pooling behaviour (RFC4787 section 4.1.)
Matus From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of JB Sent: Wednesday, February 6, 2019 9:51 AM To: vpp-dev@lists.fd.io Subject: Re: [vpp-dev] [NAT] Assign same external IP Hi Matus, Thanks for the response! Ah, I see, that makes more sense as to why we check against the FIB. However, if we just pick a random port (per protocol) from the "first address with some available ports" (dictated by the "busy ports" I presume), how does this ensure that a user ever gets the same external IP? I can see it happening if we only have one external IP, or by sheer luck. Looking at the algorithm, it's just as you say, we take it from the first available one, but there's no logic in place to assign a user a previously-assigned external IP, or am I missing some logic in the code here? I'm referring to an older discussion you and I had where you mentioned Session/mapping key is 4-tuple (client address, port, fib index and protocol), internal address and port is mapped always to same external address and port no matter what is the endpoint https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=src/plugins/nat/nat.h;h=3ce83ea26022fac43045fc88bfb37466c78c98dd;hb=HEAD#l58 The link refers to the definition of the snat session key (4-tuple). Trying to find the above logic in the code. Is that due to the nature of the 4-tuple and has nothing to do with the assignment algorithm? Thanks, John
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#12187): https://lists.fd.io/g/vpp-dev/message/12187 Mute This Topic: https://lists.fd.io/mt/29639823/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-