How to force a write to send a packet over the wire?

Jason Heirtzler jdh at bu-pub.bu.edu
Sat Mar 23 01:45:00 AEST 1991


In BSD 4.3-ish TCP (SunOS/Irix/whatever), is there an easy way to force a
write(2) to immediately push a packet out to the network?  It looks like
the kernel wants to buffer things and some analysis with our network
analyzer confirms that large packets are always being sent (~1500 bytes,
which you would expect for ethernet) regardless of the length given to the
write(2) system call.  

Attempts to convince it otherwise, with fsync(2), or send(2) have no
effect.  If I use setsockopt(2) and change SO_SNDBUF it will force small
packets to be sent over the wire, but it seems to also have the
undesirable side effect of reducing the size of what's buffered inside the
kernel as well, since then performance is terrible (more than I guess it
should be.)

The reason is that I need to control the size of packets going over the
wire (at this point I'm not real concerned about the size of the various
headers) is to do various performance tests on throughput.

Jason Heirtzler           (617) 353-2780       jdh at bu-pub.bu.edu
Information Technology    Boston University    ..!bu.edu!bu-pub!jdh  



More information about the Comp.sys.sun mailing list