From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
To: Jonathan Morton <chromatix99@gmail.com>
Cc: <cake@lists.bufferbloat.net>
Subject: Re: [Cake] flow dissector idea/enhancement - help
Date: Thu, 30 Jun 2016 10:33:26 +0100 [thread overview]
Message-ID: <5774E766.2050302@darbyshire-bryant.me.uk> (raw)
In-Reply-To: <6A7C70EE-906E-4624-A84A-645ED4530A07@gmail.com>
On 02/06/16 13:29, Jonathan Morton wrote:
>> On 2 Jun, 2016, at 14:09, Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> wrote:
>>
>> Cake uses the flow dissector API to do flow hashing...including per host flows for dual/triple isolation. The unfortunate bit is that the qdisc inevitably gets placed after packets have been NATed on egress and before they've been de-NATed on ingress.
>>
>> When mentioned before Johnathan said "flow dissector ideally needs to be tweaked to do this" or words to that effect.
>>
>> I'd like to progress that idea...the thought of me kernel programming should horrify everyone but really I'm asking for help in being pointed in the right direction to ask for help...and go from there :-)
> I believe Linux does NAT using a “connection tracker” subsystem. That would contain the necessary data for resolving NAT equivalents. I don’t know how easy it is to query in a qdisc context, though.
Imagine my joy of discovering http://fatooh.org/esfq-2.6/ - someone has
already bl**dy done it....and I found it lurking in LEDE as part of a patch.
So there relevant bits are something of the order:
+#ifdef CONFIG_NET_SCH_ESFQ_NFCT
+ enum ip_conntrack_info ctinfo;
+ struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
+#endif
+#ifdef CONFIG_NET_SCH_ESFQ_NFCT
+ /* defaults if there is no conntrack info */
+ info.ctorigsrc = info.src;
+ info.ctorigdst = info.dst;
+ info.ctreplsrc = info.dst;
+ info.ctrepldst = info.src;
+ /* collect conntrack info */
+ if (ct && ct != &nf_conntrack_untracked) {
+ if (skb->protocol == __constant_htons(ETH_P_IP)) {
+ info.ctorigsrc =
ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip;
+ info.ctorigdst =
ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip;
+ info.ctreplsrc =
ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip;
+ info.ctrepldst =
ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip;
+ }
+ else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
+ /* Again, hash ipv6 addresses into a single u32. */
+ info.ctorigsrc =
jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6, 4,
q->perturbation);
+ info.ctorigdst =
jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip6, 4,
q->perturbation);
+ info.ctreplsrc =
jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip6, 4, q->perturbation);
+ info.ctrepldst =
jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip6, 4, q->perturbation);
+ }
+
+ }
+#endif
I'd rip out the IPv6 conntrack stuff as I'm much more concerned by
handling IPv4 NAT. And I'm not sure how to get it into cake's host
handling yet but....
I can feel an experiment and hackery coming on later today :-)
Am overjoyed!
next prev parent reply other threads:[~2016-06-30 9:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 11:09 Kevin Darbyshire-Bryant
2016-06-02 12:29 ` Jonathan Morton
2016-06-30 9:33 ` Kevin Darbyshire-Bryant [this message]
2016-06-30 10:27 ` Jonathan Morton
2016-06-30 19:23 ` Kevin Darbyshire-Bryant
2016-07-01 8:11 ` Kevin Darbyshire-Bryant
2016-07-01 15:38 ` Kevin Darbyshire-Bryant
2016-07-02 12:47 ` [Cake] conntrack and ipv6 Dave Täht
2016-07-02 13:00 ` moeller0
2016-07-03 6:16 ` David Lang
2016-07-03 7:44 ` Jonathan Morton
2016-07-03 21:12 ` [Cake] [Cerowrt-devel] " moeller0
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
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5774E766.2050302@darbyshire-bryant.me.uk \
--to=kevin@darbyshire-bryant.me.uk \
--cc=cake@lists.bufferbloat.net \
--cc=chromatix99@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox