All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Andreas Schultz <aschultz@tpip.net>
Cc: Tom Herbert <tom@herbertland.com>,
	Or Gerlitz <gerlitz.or@gmail.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	laforge <laforge@gnumonks.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net/gtp: Add udp source port generation according to flow hash
Date: Thu, 23 Feb 2017 17:42:29 +0100	[thread overview]
Message-ID: <20170223164229.GA4996@salvia> (raw)
In-Reply-To: <635223204.206529.1487859673545.JavaMail.zimbra@tpip.net>

On Thu, Feb 23, 2017 at 03:21:13PM +0100, Andreas Schultz wrote:
> ----- On Feb 23, 2017, at 2:49 PM, pablo pablo@netfilter.org wrote:
[...]
> > According to specs, section 4.4.2.3 Encapsulated T-PDU, TS 29.281.
> > 
> > "The UDP Source Port is a locally allocated port number at the sending
> > GTP-U entity."
> > 
> > Older specs that refer to GTP-U such as TS 09.60 and TS 29.060 also
> > state the same.
> 
> It is absolutely valid the choose any sending port you want. I only
> think you should know which port you did send on.
> 
> TS 29.281, Sect. 5.2.2.1 defines the UDP port extension to be used
> in error indications. It provides the UDP source port of a G-PDU
> that triggered an error.
> 
> If the send side does not know which port it uses to send, how
> can it use this indication to correlate an error? That's the reason
> I thought it would be better to add the UDP source port to the
> PDP context and allow the control path to assign the source port
> on context creation.
> 
> Of course, this header is optional and the receiving side is not
> required to use it.
> 
> About the RSS spreading in the receive side, I would think that
> a receiver would prefer to process all packets that belong to a
> give TEID with the same receive instance. So keeping the UDP
> source port for a given TEID stable would be beneficial. As far
> as I understand it, the hash used in the patch uses the source
> and destination values from the original flow. This would mean
> that GTP packets that belong to the same TEID would end up with
> different UDP source ports.

The receiver needs to scale up, and that happens if packets are
distributed between CPUs in a way that make sense. I don't think it
makes sense to pass packets that belong to the same tunnel to the same
CPU, this is exactly the scenario that makes DDOS easier to trigger.

> So what about this as a compromise, we dd a UDP source port field
> to the PDP context, it defaults to 0 (zero), the control instance
> can optionally initialize this field, when we hit the xmit code
> and the port is non zero, use that value, if it is zero use the hash?

You want to use this for your VRF concept? I would like that you take
the time to explain us your usecases. How are you going to use this
mapping between tunnels and UDP source ports? An explaination would be
better than searching at some optional (corner case) extension in the
specs whose usage is questionable.

In any case, I think we want a good default behaviour, and I think
Or's patch provides it.

  reply	other threads:[~2017-02-23 16:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 14:59 [PATCH net-next] net/gtp: Add udp source port generation according to flow hash Or Gerlitz
2017-02-16 21:58 ` Andreas Schultz
2017-02-22 21:29   ` Or Gerlitz
2017-02-22 21:47     ` Tom Herbert
2017-02-23  9:35       ` Andreas Schultz
2017-02-23 14:00         ` Pablo Neira Ayuso
2017-02-23 16:35           ` Tom Herbert
2017-02-23 16:50             ` Harald Welte
2017-02-23 17:01               ` David Miller
2017-02-23 13:49       ` Pablo Neira Ayuso
2017-02-23 13:58         ` Or Gerlitz
2017-02-23 14:21         ` Andreas Schultz
2017-02-23 16:42           ` Pablo Neira Ayuso [this message]
2017-02-23 17:19             ` Andreas Schultz
2017-02-23 17:54               ` David Miller
2017-03-15 16:14                 ` Or Gerlitz
2017-03-15 16:25                   ` Pablo Neira Ayuso
2017-02-23 16:42           ` Tom Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170223164229.GA4996@salvia \
    --to=pablo@netfilter.org \
    --cc=aschultz@tpip.net \
    --cc=davem@davemloft.net \
    --cc=gerlitz.or@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=laforge@gnumonks.org \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=tom@herbertland.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.