Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: jdh@bu-pub.bu.edu (Jason Heirtzler) Newsgroups: comp.sys.sun Subject: How to force a write to send a packet over the wire? Keywords: Networks Message-ID: <2052@brchh104.bnr.ca> Date: 22 Mar 91 15:45:00 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 20 Approved: Sun-Spots@rice.edu X-Original-Date: 17 Mar 91 02:00:42 GMT X-Sun-Spots-Digest: Volume 10, Issue 52, message 8 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu 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@bu-pub.bu.edu Information Technology Boston University ..!bu.edu!bu-pub!jdh