All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Thomas Jacob <jacob@internet24.de>, netfilter-devel@vger.kernel.org
Subject: Re: Plans for future iptables versions / jumpset feature
Date: Thu, 22 May 2008 22:15:55 +0200	[thread overview]
Message-ID: <4835D47B.8010304@trash.net> (raw)
In-Reply-To: <alpine.LNX.1.10.0805222140160.9332@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> On Thursday 2008-05-22 21:18, Patrick McHardy wrote:
>
>   
>
>> Additionally it natively supports sets, bitmaps and hashes, so your
>> 500 source IP rules can be represented as a single rule with,
>> depending on how the IPs are distributed, either O(1) or O(n) lookup
>> time.
>>     
>
> That sounds just like what ipsets does today.

Yes, but not for arbitary data. Even verdicts (including jumps) and
argument selection for other modules like MARK, ...

>  Also, netlink, at least
> when using the TLV infrastructure it provides, does not come without
> a cost—namely encoding and decoding to/from nlmsg structures. I
> suggest to test-run the current binary protocol (a concatenation of
> struct ipt_entries etc.) over netlink first before changing it to
> something dynamic. Also, from what I have read from the iproute2
> source so far, each attribute has an index, and that's rather bad for
> add-on modules which want to define arbitrary attributes.
>   

Netlink message size is limited, but you can of course use
lists of attributes or structures.

>   
>>> Are the plans for that online somewhere? Is there
>>> a envisioned time line?
>>>       
>> The plans come mostly from multiple discussions on this list
>> and in private, as well as my dislikes of certains aspects
>> of iptables (like the insane amount of modules).
>>     
>
> If it's just the number of source files, then that is an easy
> target; these can be collapsed into one file. That would
> reduce both compile time and the runtime overhead.
>
> Concrete thoughts: combine
> - xt_{CLASSIFY,CONNMARK,CONNSECMARK,MARK,SECMARK,connmark,mark}
> - xt_{ah,esp,policy}
> - xt_{conntrack,state}, though I'd say let's obsolete xt_state
> - xt_{RATEEST,rateest}
> - xt_{connbytes,connlimit,length,limit,hashlimit,quota,statistic}
> - xt_{ECN,DSCP,HL,TTL,ecn,hl,dscp,ttl}
> - xt_{comment,string,time,u32}
> - xt_{addrtype,pkttype}
> - xt_{hbh,dst,frag,eui64,ipv6header}

Roughly, there will be:

- data module: any packet data: headers, payload
- meta module: meta-data associated with packet, maybe also conntrack things
  and others
- maybe conntrack module if not contained in meta module
- existing stateful modules like limit, hashlimit, ...

And whatever is still missing. The logic how to use them will
be completely in userspace. Meaning the data module doesn't
care at all what kind of data it looks at, the set lookup
doesn't care whether its a port number, an IP address or
an ifindex, ...

>   
>>> I'm asking because I'm thinking about whether or not
>>> it's feasible and/or sensibly to write some kind
>>> of target module that I'm choosing to call "jumpset" for now, that
>>> would act as a fast (>O(log(n)) "jump diststribution point".
>>>       
>> Thats one of the things I also want to add (halfway finished yet).
>> Jumps are regular verdicts in my new design and verdicts can be
>> gathered though lookups in sets, hashes etc. So you could do:
>>
>> unnamed ... -j { 192.168.0.1:chain_1, 192.168.0.2:chain_2, ...}
>>     
>
> This comes at the expense of ease-of-use. But you can persuade me to
> agree on something à la
> 	iptables -N 'chainx[0]'
> 	iptables -N 'chainx[1]'
> 	iptables -s 192.168.17.0/24 -j 'chainx[]'
>   

Thats not any simpler. Besides such optimization also may be
performed by the userspace tool, the user doesn't necessarily
has to do them himself. Though this is not planned for an
initial version.

>   
>> I also want to have the same working for mark etc:
>>
>> unnamed ... -j MARK --set-mark { 192.168.0.1:1, 192.168.0.2: 2, .. }
>>     
>
> See IPMARK.
>
>   
>> or alternatively:
>>
>> unnamed ... -j MARK --set-mark ip-dst & 0xFF
>>     
>
> See IPMARK!
>
> (Hint: http://dev.medozas.de/gitweb.cgi?p=xtables-addons )
> Hint2:
> 	... -j IPMARK --addr dst
> 	... -j MARK --and-mask 0xFF
>   

1. So?

2. You don't get it. Thats another special-casing module, exactly
the think I *don't* like. How many more of these (with slightly
differing semantic and features) should we add?


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-05-22 20:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22 19:00 Plans for future iptables versions / jumpset feature Thomas Jacob
2008-05-22 19:18 ` Patrick McHardy
2008-05-22 19:57   ` Jan Engelhardt
2008-05-22 20:15     ` Patrick McHardy [this message]
2008-05-22 20:27     ` Thomas Jacob
2008-05-22 20:14   ` Thomas Jacob
2008-05-22 20:18     ` Patrick McHardy
2008-05-22 20:47       ` Thomas Jacob
2008-05-22 20:51         ` Patrick McHardy
2008-05-22 21:43           ` Thomas Jacob
2008-05-23 11:55   ` Nishit Shah
2008-05-23 12:15     ` Patrick McHardy
2008-05-23 12:47       ` Thomas Jacob
2008-05-23 13:28         ` Patrick McHardy

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=4835D47B.8010304@trash.net \
    --to=kaber@trash.net \
    --cc=jacob@internet24.de \
    --cc=jengelh@medozas.de \
    --cc=netfilter-devel@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 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.