From owner-freebsd-net@FreeBSD.ORG Wed Oct 5 08:53:58 2005 Return-Path: X-Original-To: net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0F0316A41F; Wed, 5 Oct 2005 08:53:57 +0000 (GMT) (envelope-from raglon@packetfront.com) Received: from mail.packetfront.com (mail.packetfront.com [212.247.6.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3034043D45; Wed, 5 Oct 2005 08:53:56 +0000 (GMT) (envelope-from raglon@packetfront.com) Received: from localhost (localhost [127.0.0.1]) by mail.packetfront.com (Postfix) with ESMTP id 40C86A3F73; Wed, 5 Oct 2005 10:53:55 +0200 (CEST) Received: from mail.packetfront.com ([127.0.0.1]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05474-09; Wed, 5 Oct 2005 10:53:54 +0200 (CEST) Received: from [192.168.1.159] (pf-raglon.int.packetfront.com [192.168.1.159]) by mail.packetfront.com (Postfix) with ESMTP id E98ABA3F68; Wed, 5 Oct 2005 10:53:54 +0200 (CEST) Message-ID: <43439446.7090400@packetfront.com> Date: Wed, 05 Oct 2005 10:52:22 +0200 From: Ragnar Lonn User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John-Mark Gurney References: <20051003130731.GF56760@submonkey.net> <20051003134132.GE73935@cell.sick.ru> <20051003135324.GH56760@submonkey.net> <4342B4BE.1040304@packetfront.com> <20051004203645.GO716@funkthat.com> In-Reply-To: <20051004203645.GO716@funkthat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at packetfront.com Cc: Ceri Davies , Gleb Smirnoff , net@FreeBSD.org Subject: Re: ng_tee, right2left, et al X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2005 08:53:58 -0000 John-Mark Gurney wrote: >Ragnar Lonn wrote this message on Tue, Oct 04, 2005 at 18:58 +0200: > > >>Ceri Davies wrote: >> >> >> >>>I only call it "wrong" as it didn't agree with Archie's article or my >>>expectations, hence the quotes - I realise that it's subjective. >>> >>>It just seems to me that packets leaving left2right would go to right, >>>as the name implies. I don't really mind either way, it's simply that >>>I found it confusing. >>> >>> >>> >>> >>It's not, really. A good idea is to draw the tee node and its hooks on a >>piece of paper. >>Here is an ASCII attempt: >> >> >>left --- right >> \ / >> x >> / \ >> r2l l2r >> >>The drawing shows that the left hook is associated with the left2right hook: >>When packets come in on the left hook they are forwarded to the left2right >>hook. Logically, that means they are connected, like in the drawing above, >>and that also means that packets can go in the other direction - i.e. from >>the left2right hook and to the left hook. >> >> > >I personally imagined the picture like: > l2r > >>>>^>>>> > / \ > left right > \ / > << r2l > >where the l2r and r2l are taps into the line that goes a certain way... and >so, it'd mean that sending a package on the r2l hook goes to left instead >of right.. not that I use net graph much, but just thought I'd show how >I thought of it... > >Though if the behavior matches what the man page states, that's all that >matters, and my drawing is invalidated... > > > For me, the behaviour was intuitive. Maybe it depends on whether you're familiar with the Unix "tee" command or not, how you look at it? "tee" is used to duplicate a one-way (output) stream, so I've always thought of the hooks right2left and left2right as one-way output hooks. Think of the tee node as a connector between left and right, with the option to "wiretap" traffic going either from right to left, or from left to right. To do this wiretapping you have two hooks where you can snoop the traffic going in either direction. One hook for snooping traffic left->right and one hook for snooping traffic right->left. The option to input traffic into one of these "tap" hooks is just a bonus feature. And maybe it's more confusing than useful, I'm not sure. It seems that if you want to output traffic on the right hook, all you have to do is input it on the left hook, and vice versa. Of course, you'd have to use a hub or bridge to connect more than one node to the hook then. /Ragnar