Trying to make a Host into a gigabit hub for testing

Gleb Smirnoff glebius at FreeBSD.org
Sun Oct 30 23:36:52 PST 2005


On Sun, Oct 30, 2005 at 03:49:26AM -0800, Shawn Saunders wrote:
S> Can you clarify then, the difference between the on2many and hub modules?
S> 
S> Based upon the names, I would consider the one2many to do exactly that, 
S> take anything from 'one' and redirect it out to anything identified by 
S> 'many?'

>From ng_hub manual page:

     Packets received on any of the hooks are forwarded out the other hooks.

>From ng_one2many manual page:

     Packets received on any of the many hooks are forwarded out
     the one hook.  Packets received on the one hook are forwarded out one or
     more of the many hooks; which hook(s) is determined by the node's config-
     ured transmit algorithm.

S> I would also think that hub would behave exactly as a hub, introducing 
S> collisions, etc, within the shared namespace of the environment for hub.

No, there is no collisions in ng_hub. Several threads can work in the node
simultaneously, forwarding packets in different directions.

S> At what level is the redirection happening, specifically, is this happening 
S> in the driver on the NIC?  Or are the packets being brought from the NIC 
S> into the kernel on the host, and then retransmitted out the NIC on the 
S> other port?  Just currious.

netgraph(4) works in the kernel, independently from device drivers. This means
that packet is forwarded by driver to upper network layer in the kernel, there
it is consumed by netgraph and later passed out the other NIC.

S> I am hoping to be running an interesting environment for about 20 days, and 
S> at the end of that, I hope to have some interesting real-life metrics, that 
S> I will be happy to share with the rest of you.

It will be interesting.


P.S. Please do not top quote.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE


More information about the freebsd-net mailing list