Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Nov 2001 10:31:46 -0800 (PST)
From:      Archie Cobbs <archie@dellroad.org>
To:        Trond Davidsen <trond.davidsen@ii.uib.no>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: Mpd with a large number, 200+ , of bundles
Message-ID:  <200111031831.fA3IVl424031@arch20m.dellroad.org>
In-Reply-To: <3BE40BC8.9060504@ii.uib.no> "from Trond Davidsen at Nov 3, 2001 04:22:48 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Trond Davidsen writes:
> When I try to make 240 bundles, from the log, it seems mpd is makeing 
> all the nodes ok, but when I try to establish a connection nothing 
> happens, no respons, nothing in the log, and mpd is frozen and needs to 
> be killed with kill -9.  And then it leaves 720 nodes behind which needs 
> to be removed manually.

Hmmm.. sounds like a kernel problem (the fact that kill -9 is required).

> > This is probably due to a fixed size buffer in the base netgraph
> > code somewhere... it doesn't look like libnetgraph can generate
> > an ENOBUFS on its own. Try running ngctl with one or more '-d' flags..
> 
> vpn-gw3# ngctl -d -d -d
> Available commands:
>    config     get or set configuration of node at <path>
>    connect    Connects hook <peerhook> of the node at <relpath> to <hook>
>    debug      Get/set debugging verbosity level
>    help       Show command summary or get more help on a specific command
>    list       Show information about all nodes
>    mkpeer     Create and connect a new node to the node at "path"
>    msg        Send a netgraph control message to the node at "path"
>    name       Assign name <name> to the node at <path>
>    read       Read and execute commands from a file
>    rmhook     Disconnect hook "hook" of the node at "path"
>    show       Show information about the node at <path>
>    shutdown   Shutdown the node at <path>
>    status     Get human readable status information from the node at <path>
>    types      Show information about all installed node types
>    quit       Exit program
> + list
> ngctl: SENDING MESSAGE:
> ngctl: SOCKADDR: { fam=32 len=4 addr="." }
> ngctl: NG_MESG :
> ngctl:   vers   2
> ngctl:   arglen 0
> ngctl:   flags  0
> ngctl:   token  1
> ngctl:   cookie GENERIC (851672668)
> ngctl:   cmd    9
> ngctl:   args (0 bytes)
> ngctl: sendto(.): No buffer space available
> ngctl: send msg: No buffer space available

I think this error must be coming from the socket code. I wonder
if increasing the receive buffer size on the netgraph socket would
help.. try this patch for example:

Index: main.c
===================================================================
RCS file: /home/cvs/freebsd/src/usr.sbin/ngctl/main.c,v
retrieving revision 1.4.2.3
diff -u -r1.4.2.3 main.c
--- main.c	2001/01/09 06:52:25	1.4.2.3
+++ main.c	2001/11/03 18:29:33
@@ -145,6 +145,13 @@
 	if (NgMkSockNode(name, &csock, &dsock) < 0)
 		err(EX_OSERR, "can't create node");
 
+    {
+	int size = 128 * 1024;
+
+	if (setsockopt(csock, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) == -1)
+		err(1, "setsockopt");
+    }
+
 	/* Do commands as requested */
 	if (ac == 0) {
 		if (fp != NULL) {

> When I create 240 bundles, mpd creates 720 netgraph nodes.
> Is there a limit on how many nodes the netgraph system can handle?

No hard limit internally, but there are limits on how large a
control message you can jam through a socket.

> Where is the netgraph system defined?  i can find the modules under 
> /usr/src/sys/modules/netgraph, but I can't find the 'netgraph base system'.

It's in /sys/netgraph/ng_base.c.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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