Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Oct 2005 10:52:22 +0200
From:      Ragnar Lonn <raglon@packetfront.com>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        Ceri Davies <ceri@submonkey.net>, Gleb Smirnoff <glebius@FreeBSD.org>, net@FreeBSD.org
Subject:   Re: ng_tee, right2left, et al
Message-ID:  <43439446.7090400@packetfront.com>
In-Reply-To: <20051004203645.GO716@funkthat.com>
References:  <20051003130731.GF56760@submonkey.net>	<20051003134132.GE73935@cell.sick.ru>	<20051003135324.GH56760@submonkey.net>	<4342B4BE.1040304@packetfront.com> <20051004203645.GO716@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
>	    \          /
>	      <<<v<<<<
>		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







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43439446.7090400>