Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Tomas Mudrunka <mudrunka@spoje.net>
To: netfilter@vger.kernel.org
Subject: Traffic shaping with nftables maps and tc
Date: Thu, 02 Nov 2017 21:34:20 +0100	[thread overview]
Message-ID: <62018f4d1c124ef84a7bd2281b1b2dcc@spoje.net> (raw)

Hello,
i am thinking about improving the way we do bandwidth shaping (traffic 
control) in our network.

Currently we have like 80000 rules that do something like this:

iptables -A post_10_11_171_248_29 -d 10.11.171.249/32 -o vlan1100 -j 
CLASSIFY --set-class 0001:3065

And even when there is some level of optimalization using subchains, i 
guess that nftables can optimize this simply by internal hashing in 
named map (or dictionary - i did not get how these two are different).

I need to have $IP : $CLASS map like this:

10.11.171.247/32 : 0001:4095
10.11.171.248/32 : 0001:3065
10.11.171.249/32 : 0001:2023

And then simply classify the packets using single rule like this:

-d $IP -j CLASSIFY --set-class $CLASS

So i can later shape the classified packets using tc. (BTW i've heard 
that nft has something called "ingress hook" that could replace tc, so i 
could have everything configured thru nft, is that true?)

Is there way to do this in nftables?

-- 
S pozdravem
Best regards
      Tomáš Mudruňka - SPOJE.NET s.r.o.

             reply	other threads:[~2017-11-02 20:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 20:34 Tomas Mudrunka [this message]
2017-11-03  0:07 ` Traffic shaping with nftables maps and tc Tomas Mudrunka
2017-11-03 10:48   ` Arturo Borrero Gonzalez
2017-11-03 12:37     ` Tomas Mudrunka
2017-11-03 16:01       ` Arturo Borrero Gonzalez
2017-11-03 16:28         ` Tomas Mudrunka

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=62018f4d1c124ef84a7bd2281b1b2dcc@spoje.net \
    --to=mudrunka@spoje.net \
    --cc=netfilter@vger.kernel.org \
    /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