Discussion:
performance of libnet-based tools
Steven Alexander Jr.
2005-02-26 07:07:12 UTC
Permalink
I've been experimenting with a few different
libnet-based tools such as Packit and ISIC. If I try
to generate a high-volume of traffic using these
tools, with various options and protocols, the error
rate is extremely high. ISIC says:

Failed to send packet: No buffer space available

The synflood tool that comes as a libnet sample works
for several seconds and begins reporting:

libnet_write: libnet_write_raw_ipv4(): -1 bytes
written (Host is down)

I'm not sure where the problem lies and I would love
to hear any suggestions. I'm using a 3.0Ghz P4 with
1.5G RAM and a $20 Linksys FA311 card on FreeBSD 5.3
and a 1.3GHZ AMD laptop with 512MB RAM and a built-in
Realtek RTL8139C+ card on FreeBSD 4.9.

Do I need to tune the OS? Do I need a better network
card?

I'd like to be able to perform various stress testing
exercises on my test network.

Thanks.

-Steven
Matt Bing
2005-03-01 19:40:27 UTC
Permalink
Post by Steven Alexander Jr.
I've been experimenting with a few different
libnet-based tools such as Packit and ISIC. If I try
to generate a high-volume of traffic using these
tools, with various options and protocols, the error
Failed to send packet: No buffer space available
It can happen when you try to send packets in a tight loop. You can
tune the code to avoid this, more info here:

http://www.securityfocus.com/archive/89/316789/2003-03-27/2003-04-02/2
Frédéric Raynal
2005-03-01 19:23:18 UTC
Permalink
Post by Steven Alexander Jr.
I've been experimenting with a few different
libnet-based tools such as Packit and ISIC. If I try
to generate a high-volume of traffic using these
tools, with various options and protocols, the error
Failed to send packet: No buffer space available
The synflood tool that comes as a libnet sample works
libnet_write: libnet_write_raw_ipv4(): -1 bytes
written (Host is down)
I'm not sure where the problem lies and I would love
to hear any suggestions. I'm using a 3.0Ghz P4 with
1.5G RAM and a $20 Linksys FA311 card on FreeBSD 5.3
and a 1.3GHZ AMD laptop with 512MB RAM and a built-in
Realtek RTL8139C+ card on FreeBSD 4.9.
Do I need to tune the OS? Do I need a better network
card?
I'd like to be able to perform various stress testing
exercises on my test network.
I'm also very interested in those tests. Can you tell us more please?

Now, I'll try to answer some of your questions.

"Failed to send packet: No buffer space available" : this may be
caused because the driver's buffer is full.

" libnet_write: libnet_write_raw_ipv4(): -1 bytes written (Host is
down)" :
here, that may be because the remote host is really down ? I mean some
OS do not feel very well under synflood.

That is just guesses ... I may be mistaken ...

A+
Fred Raynal
Mark Atkinson
2005-03-01 20:55:22 UTC
Permalink
Post by Steven Alexander Jr.
Failed to send packet: No buffer space available
BPF_MAXBUFSIZE controls this value and lives in
sys/net/bpf.h (usually installed under /usr/src).

you can see the current buffer size with the following command.

sysctl -a |grep bpf

You'll have to rebuild, reinstall your kernel after any change to this
amount.

You might need to increase your maxusers tunable to avoid a panic when the
kernel trys to allocate another buffer but not enough kernel memory is
available. See tuning(7) for more information.

You might try the freebsd -net or -performance mailing lists if you have
any more questions.
Post by Steven Alexander Jr.
The synflood tool that comes as a libnet sample works
libnet_write: libnet_write_raw_ipv4(): -1 bytes
written (Host is down)
I'll let somebody else answer this one.

All the best,

--
Mark Atkinson
(!wired)?(coffee++):(wired);
Aaron Turner
2005-03-01 21:29:53 UTC
Permalink
Hey Steven,

I'm not 100% familar with that error under ISIC, but sounds like libnet
is filling up the socket buffer faster then the network card can empty
it.

Those network cards you have prolly aren't the fastest in the world
which is probably one problem. Intel/Pro 100 or 1000 cards generally
seem to do pretty well. Other high-end or "server" cards should do
well.

You can also increase the buffer size, but that's not going to make your
computer send packets any faster, it may remove the error though. On
*BSD increase the side of NMBCLUSTERS. Check out options(4) for
details.

- -Aaron
Post by Steven Alexander Jr.
I've been experimenting with a few different
libnet-based tools such as Packit and ISIC. If I try
to generate a high-volume of traffic using these
tools, with various options and protocols, the error
Failed to send packet: No buffer space available
The synflood tool that comes as a libnet sample works
libnet_write: libnet_write_raw_ipv4(): -1 bytes
written (Host is down)
I'm not sure where the problem lies and I would love
to hear any suggestions. I'm using a 3.0Ghz P4 with
1.5G RAM and a $20 Linksys FA311 card on FreeBSD 5.3
and a 1.3GHZ AMD laptop with 512MB RAM and a built-in
Realtek RTL8139C+ card on FreeBSD 4.9.
Do I need to tune the OS? Do I need a better network
card?
I'd like to be able to perform various stress testing
exercises on my test network.
Thanks.
-Steven
- --
Aaron Turner <aturner at pobox.com|synfin.net> http://synfin.net/
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -- Benjamin Franklin
All emails are PGP signed; a lack of a signature indicates a forgery.
Loading...