From owner-freebsd-ipfw@FreeBSD.ORG Sat Aug 2 04:26:26 2014 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30884E27; Sat, 2 Aug 2014 04:26:26 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EEC9A263E; Sat, 2 Aug 2014 04:26:25 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-253-202.lns20.per2.internode.on.net [121.45.253.202]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id s724QKhE032342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 1 Aug 2014 21:26:22 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <53DC6866.2090205@freebsd.org> Date: Sat, 02 Aug 2014 12:26:14 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Alexander V. Chernikov" , freebsd-ipfw , "freebsd-net@freebsd.org" Subject: Re: ipfw named objejcts, table values and syntax change References: <53DC01DE.3000000@FreeBSD.org> In-Reply-To: <53DC01DE.3000000@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Luigi Rizzo X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2014 04:26:26 -0000 On 8/2/14, 5:08 AM, Alexander V. Chernikov wrote: > Hello all. > > I'm currently working on to enhance ipfw in some areas. > The most notable (and user-visible) change is named table support. > The other one is support for different lookup algorithms for different > key types. > > For example, new ipfw permits writing this: > > ipfw table tb1 create type cidr > ipfw add allow ip from table(tl1) to any > ipfw add allow ip from any lookup dst-ip tb1 > > ipfw table if1 create type iface > ipfw add skipto tablearg ip from any to any via table(if1) > > or even this: > ipfw table fl1 create type flow:src-ip,proto,dst-ip,dst-port > ipfw table fl1 add 10.0.0.5,tcp,10.0.0.6,80 4444 > ipfw add allow ip from any to any flow table(fl1) > > all these changes fully preserve backward compatibility. > (actually tables needs now to be created before use and their type needs > to match with opcode used, but new ipfw(8) performs auto-creation > for cidr tables). > > There is another thing I'm going to change and I'm not sure I can keep > the same compatibility level. > > Table values, from one point of view, can be classified to the following > types: > > - skipto argument > - fwd argument (*) > - link to another object (nat, pipe, queue) > - plain u32 (not bound to any object) (divert/tee,netgraph,tag/utag,limit) > > There are the following reasons why I think it is necessary to implement > explicit table values typing (like tables): > - Implementing fwd tablearg for IPv6 hosts requires indirection table > - Converting nat/pipe instance ids to names renders values unusable > - retiring old hack with storing saved pointer of found object/rule > inside rule w/o proper locking > - making faster skipto > > So, as the result, table will have lookup key type (already done), > value type ('skipto', 'nexthop', 'nat', 'pipe', 'number', ..) and some > additional restrictions (like inability to add non-existing nat instance > id). > > This change will break (at least) scenarios where people are > using one table for both nat/pipe instances (and keep nat ids in sync > with pipe ones). For example: > > ipfw table 1 add 10.0.10.0/24 110 > ipfw table 1 add 10.0.20.0/24 120 > > ipfw add 100 nat tablearg from table(1) to any via vlanX in > .. > ipfw add 500 pipe tablearg from table(1) to any via ix0 out > > It looks like it is not so easy to bind values for given table to > different objects (or different tasks) (and lack of compatibility kills > hope for MFC). I think this makes sense I have myself been responsible for adding 'odd' usages to tables e.g. fwd tablearg and have thought myself that "really we need to be able to specify tables more specifically" so don't expect me to argue against this :-) > > Ideas? > > > > > > > _______________________________________________ > freebsd-ipfw@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw > To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe@freebsd.org" >