In the future other algorithms may be added as well.
| NGM_ONE2MANY_SET_CONFIG |
| | 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 valid settings for the xmitAlg field are NG_ONE2MANY_XMIT_ROUNDROBIN (default) or NG_ONE2MANY_XMIT_ALL. The only valid setting for failAlg is NG_ONE2MANY_FAIL_MANUAL; this is also the default setting. |
| NGM_ONE2MANY_GET_CONFIG |
| | Returns the current node configuration in a "struct ng_one2many_link_config". |
| NGM_ONE2MANY_GET_STATS |
| | 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 recd on link */
u_int64_t recvPackets; /* total pkts recd on link */
u_int64_t xmitOctets;/* total octets xmitd on link */
u_int64_t xmitPackets; /* total pkts xmitd on link */
};
To access statistics for the one link, use the link number -1. |
| NGM_ONE2MANY_CLR_STATS |
| | This command takes a 32 bit link number as an argument and clears the statistics for that link. |
| NGM_ONE2MANY_GETCLR_STATS |
| | Same as NGM_ONE2MANY_GET_STATS, but also atomically clears the statistics for the link as well. |
|
EXAMPLES
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 192.168.1.1 netmask 0xfffffffc
With a similar setup on a peer machine (using the address 192.168.1.2), a point-to-point Ethernet connection with four times normal bandwidth is achieved.
SEE ALSO
netgraph(4), ng_bridge(4), ng_ether(4), ng_hub(4), ifconfig(8), ngctl(8)
HISTORY
AUTHORS
BUGS