Socket queue size

Socket queue size

Post by Jalil Feghh » Wed, 17 May 1995 04:00:00



Hi,

We are having a problem on the number of packets that can be queued on a UDP
socket we open to listen at. We get socket overflows very easily and are
wondering how we can increase the number of the packets that can be queued. We
have tried setsockopt() but we think we need to reconfigure the kernel.

Any ideas on how to do this? we run: HP-UX A.09.01  9000/715

 ==============================================================================
    Jalil Feghhi                                Phone: 415 375-5159
    Network Management Group                    Fax  : 415 375-5018

    700 Airport Blvd., Burlingame, CA 94010
 ==============================================================================

 
 
 

Socket queue size

Post by Rick Jon » Wed, 17 May 1995 04:00:00


: We are having a problem on the number of packets that can be queued
: on a UDP socket we open to listen at. We get socket overflows very
: easily and are wondering how we can increase the number of the
: packets that can be queued. We have tried setsockopt() but we think
: we need to reconfigure the kernel.

How large are your packets, which interface are you using, and how
many can be queued to the socket? (Open socket, block the receiver
send say 100-1000 packets, after sending has stopped, allow the
receiver to receive and count...)

There is no value you can poke in the kernel that will get you a
larger socket buffer than you can have with setsockopt().

On HP-UX 9.X (and 8.X I believe), setsockopt sets a *byte* limit on
the quantity of data which can be queued to a UDP socket, not the number of
messages. This may be part of the issue.

Also, there is the issue of network buffer internal fragmentation. The
BSD-based code is actually tracking two limits for a socket - the
actual number of data bytes, and the number of "overhead" bytes.
Overhead limits are generally the lesser of 64ishKB and 2X data bytes.

So, if you are getting packets off the network, and they are small,
there could be a considerable difference between the two - the network
drivers will typically post say an mbuf (capacity 224 bytes) and then
a cluster (1, 2, or 4KB) for an inbound packet. If your datagrams are
say 225 bytes, there will be a lot of "overhead" for the quantity of
data. For less intelligent network interfaces, the driver has to post
just a cluster large enough for a network packet.

One might then say that the driver should then copy the data into
smaller buffers, but copies are something one *really, really* would
like to avoid - certainly in the mainline datapath. It might be
interesting to consider some additions to the socket buffer overflow
code to handle this condition - thus hopefully being out of the
mainline path. Such a change would best be initiated by an official
enhancement request...

And finally, something that may be the more likely situation?

It is important to remember that there is *no* flow control with UDP,
so regardless of the size of the socket buffer, if your sender is
faster than your receiver, there *will* be overflows with sustained
traffic. So, if you have increased the size of the socket buffer on
the receiver to the limit for HP-UX (58KBish I think), and you still
are loosing packets, you may have to consider adding flow control, or
going with TCP.

hope this helps,

rick jones
http://www.cup.hp.com/netperf/NetperfPage.html

I've directed follow-ups to comp.sys.hp.hpux...

 
 
 

1. socket queue size

Hi all!!
I need to obtain the number of bytes that remain to send

$ netstat -tan
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0    135 xxx.xx.x.x:12345        yyy.yyy.yyy.yy:54321 ESTABLISHED

I want to get 135 value.
It's possible??
How can I do?

Thanks all

2. DPT SCSI CD-ROM and IDE Hard Disk

3. MAX SOCKET QUEUE SIZE

4. lp options under Solaris 5.x not sent to printer or cause error

5. How to get the socket queue size

6. converting Staroffice address book to Kmail

7. wchar_t in JLE 1.2 (Japanese Language Environment)

8. UNIX Domain Datagram Sockets - Receive Queue Size?

9. UNIX Domain Datagram Socket:Receive Queue Size?

10. How do I set a streams queue (pipe queue) size?

11. Any relationship between message size and tcp/udp socket buffer size?

12. AF_UNIX datagram rcv queue size?