Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 2004 02:20:16 -0700 (PDT)
From:      Gleb Smirnoff <glebius@cell.sick.ru>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/63317: make ng_ether(4) support "lower" and "orphans"simultaneously
Message-ID:  <200404280920.i3S9KGPM059986@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/63317; it has been noted by GNATS.

From: Gleb Smirnoff <glebius@cell.sick.ru>
To: Archie Cobbs <archie@dellroad.org>
Cc: Maxim Konovalov <maxim@macomnet.ru>,
	bzeeb-lists@lists.zabbadoz.net, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/63317: make ng_ether(4) support "lower" and "orphans"simultaneously
Date: Wed, 28 Apr 2004 13:13:41 +0400

 On Mon, Apr 26, 2004 at 04:49:48PM -0500, Archie Cobbs wrote:
 A> To preserve the existing behavior, the node would need to duplicate
 A> the orphanable packets and send them to BOTH connected hooks.
 
 I have spent some time drawing relationship between if_ethersubr.c and
 ng_ether.c. Now, I have pointed out, that new node will preserve
 an old behavior in case of 'lower' or 'orphans' connected one at a
 time.
 
 In case of both 'lower' and 'orphans' hooks connected, the node
 will write ALL packets to 'lower', and no packets to 'orphans'.
 This may seem useless. However, packets received on 'upper' will
 travel to upper protocol stack, and those unrecognized will return
 on 'orphans'.
 
 This is useful when someone needs to sniff IP traffic into netgraph
 and use some "orphan" etherproto on the same interface. For example
 I use it for serving PPPoE, and counting raw IP traffic on the same
 interface. In this case a ng_tee node is put on top of ng_ether,
 connecting its 'lower' and 'upper' together.
 
 And you get IP traffic on tee's hooks, and orphaned packet on 'orphans'.
 
 Here is some ASCII art:
 
      ether stack    .     ng_ether                     .   netgraph
                     .                                  .
                     .                                  .
    ether_input()    . ,-- ng_ether_rcvdata() <------------ 'upper' -<--,
             |\      ./                                 .                \ ng_tee
             | \     /                                  .                /
             |  '---/----> ng_ether_input() --------------> 'lower' -->-`
             |     / .                                  .
             |    /  .                                  .
             |   /   .                                  .
             v  v    .                                  .
       ether_demux()-----> ng_ether_input_orphan() -------> 'orphans'
             |       .                                  .
             v
           upper
           stacks
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE



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