*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> ng_one2many (4)              



NAME    [Toc]    [Back]

     ng_one2many -- packet multiplexing netgraph node type

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <netgraph/ng_one2many.h>

DESCRIPTION    [Toc]    [Back]

     The one2many provides a simple mechanism for routing packets over several
     links in a one-to-many (and in the reverse direction, many-to-one) fashion.
  There is a single hook named one, and multiple hooks named many0,
     many1, etc.  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 configured
 transmit algorithm.  Packets are not altered in any way.

     Each of the connected many links may be considered to be up or down.
     Packets are never delivered out a many hook that is down.	How a link is
     determined to be up or down depends on the node's configured link failure
     detection algorithm.


	  Packets are delivered out the many hooks in sequential order.  Each
	  packet goes out on a different many hook.

	  Packets are delivered out all the many hooks. Each packet goes out
	  each many hook.

     In the future other algorithms may be added as well.


     At this time, the only algorithm for determining when a link has failed,
     other than the hook being disconnected, is the ``manual'' algorithm: the
     node is explicitly told which of the links are up via the
     NGM_ONE2MANY_SET_CONFIG control message (see below).  Newly connected
     links are down until configured otherwise.

     In the future other algorithms may be added as well.

HOOKS    [Toc]    [Back]

     This node type supports up to NG_ONE2MANY_MAX_LINKS hooks named many0,
     many1, etc., plus a single hook named one.

CONTROL MESSAGES    [Toc]    [Back]

     This node type supports the generic control messages, plus the following:

	  Sets the node configuration using a struct ng_one2many_link_config
	  as the control message argument:

	  /* Node configuration structure */
	  struct ng_one2many_config {
	    u_int32_t	xmitAlg;	/* how to distribute packets */
	    u_int32_t	failAlg;	/* how to detect link failure */
	    u_char	enabledLinks[NG_ONE2MANY_MAX_LINKS];

	  Currently, the only valid setting for the xmitAlg field is
	  NG_ONE2MANY_XMIT_ROUNDROBIN; this is also the default setting.  The
	  only valid setting for failAlg is NG_ONE2MANY_FAIL_MANUAL; this is
	  also the default setting.

	  Returns the current node configuration in a struct

	  This command takes a 32 bit link number as an argument and returns a
	  struct ng_one2many_link_stats containing statistics for the corresponding
 many link, which may or may not be currently connected:

	  /* Statistics structure (one for each link) */
	  struct ng_one2many_link_stats {
	    u_int64_t	recvOctets;	/* total octets rec'd on link */
	    u_int64_t	recvPackets;	/* total pkts rec'd on link */
	    u_int64_t	xmitOctets;	/* total octets xmit'd on link */
	    u_int64_t	xmitPackets;	/* total pkts xmit'd on link */

	  To access statistics for the one link, use the link number -1.

	  This command takes a 32 bit link number as an argument and clears
	  the statistics for that link.

	  Same as NGM_ONE2MANY_GET_STATS, but also atomically clears the statistics
 for the link as well.

SHUTDOWN    [Toc]    [Back]

     This node shuts down upon receipt of a NGM_SHUTDOWN control message, or
     when all hooks have been disconnected.

EXAMPLES    [Toc]    [Back]

     The following commands will set up Ethernet interfaces fxp0 to deliver
     packets alternating over the physical interfaces corresponding to networking
 interfaces fxp0 through fxp3:

       # Plumb nodes together
       ngctl mkpeer fxp0: one2many upper one
       ngctl connect fxp0: fxp0:upper lower many0
       ngctl connect fxp1: fxp0:upper lower many1
       ngctl connect fxp2: fxp0:upper lower many2
       ngctl connect fxp3: fxp0:upper lower many3
       # Allow fxp1 through fxp3 to xmit/recv fxp0 frames
       ngctl msg fxp1: setpromisc 1
       ngctl msg fxp2: setpromisc 1
       ngctl msg fxp3: setpromisc 1
       ngctl msg fxp1: setautosrc 0
       ngctl msg fxp2: setautosrc 0
       ngctl msg fxp3: setautosrc 0
       # Configure all four links as up
       ngctl msg fxp0:upper \
	 setconfig "{ xmitAlg=1 failAlg=1 enabledLinks=[ 1 1 1 1 ] }"
       # Bring up interface
       ifconfig fxp0 netmask 0xfffffffc

     With a similar setup on a peer machine (using the address, a
     point-to-point Ethernet connection with four times normal bandwidth is

BUGS    [Toc]    [Back]

     More transmit and link failure algorithms should be supported.  A good
     candidate is Cisco's Etherchannel.

SEE ALSO    [Toc]    [Back]

     netgraph(4), ng_bridge(4), ng_ether(4), ngctl(8)

HISTORY    [Toc]    [Back]

     The ng_one2many node type was implemented in FreeBSD 4.2.

AUTHORS    [Toc]    [Back]

     The one2many netgraph node (with round-robin algorithm) was written by
     Archie Cobbs <archie@FreeBSD.org>.  The all algorithm was added by Rogier
     R. Mulhuijzen <drwilco@drwilco.net>.

FreeBSD 5.2.1		       January 26, 2001 		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ng_bpf FreeBSD Berkeley packet filter netgraph node type
ng_UI FreeBSD UI netgraph node type
ng_atm FreeBSD netgraph ATM node type
ng_uni FreeBSD netgraph UNI node type
ng_tee FreeBSD netgraph ``tee'' node type
ng_ether FreeBSD Ethernet netgraph node type
ng_hole FreeBSD netgraph discard node type
ng_iface FreeBSD interface netgraph node type
ng_ip_input FreeBSD netgraph IP input node type
ng_echo FreeBSD netgraph echo node type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service