2001-12-10 06:17:24

by Ben Greear

[permalink] [raw]
Subject: question on select: How big can the empty buffer space be before select returns ready-to-write?

For instance, it appears that select will return that a socket is
writable when there is, say 8k of buffer space in it. However, if
I'm sending 32k UDP packets, this still causes me to drop packets
due to a lack of resources...

Is there any IOCTL that can tell select how much space to require
before it thinks a socket is writable?

Many thanks,
Ben

--
Ben Greear <[email protected]> <Ben_Greear AT excite.com>
President of Candela Technologies Inc http://www.candelatech.com
ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear



2001-12-10 07:42:53

by Chris Wright

[permalink] [raw]
Subject: Re: question on select: How big can the empty buffer space be before select returns ready-to-write?

* Ben Greear ([email protected]) wrote:
> For instance, it appears that select will return that a socket is
> writable when there is, say 8k of buffer space in it. However, if
> I'm sending 32k UDP packets, this still causes me to drop packets
> due to a lack of resources...

udp has a fixed 8k max payload. did you try breaking up your packets?

cheers,
-chris

2001-12-10 08:30:06

by Alan

[permalink] [raw]
Subject: Re: question on select: How big can the empty buffer space be before select returns ready-to-write?

>
> * Ben Greear ([email protected]) wrote:
> > For instance, it appears that select will return that a socket is
> > writable when there is, say 8k of buffer space in it. However, if
> > I'm sending 32k UDP packets, this still causes me to drop packets
> > due to a lack of resources...
>
> udp has a fixed 8k max payload. did you try breaking up your packets?

UDP has a 64K - headers max payload.

2001-12-10 16:42:15

by Ben Greear

[permalink] [raw]
Subject: Re: question on select: How big can the empty buffer space be before select returns ready-to-write?



Alan Cox wrote:

>>* Ben Greear ([email protected]) wrote:
>>
>>>For instance, it appears that select will return that a socket is
>>>writable when there is, say 8k of buffer space in it. However, if
>>>I'm sending 32k UDP packets, this still causes me to drop packets
>>>due to a lack of resources...
>>>
>>udp has a fixed 8k max payload. did you try breaking up your packets?
>>
>
> UDP has a 64K - headers max payload.


Yes, and I am writing code to specifically try out large UDP
packet sizes, so limiting myself to a certain size is not at
all useful in this case....

Thanks,
Ben

--
Ben Greear <[email protected]> <Ben_Greear AT excite.com>
President of Candela Technologies Inc http://www.candelatech.com
ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear


2001-12-10 19:05:22

by Chris Friesen

[permalink] [raw]
Subject: Re: question on select: How big can the empty buffer space be before select returns ready-to-write?

Chris Wright wrote:
>
> * Ben Greear ([email protected]) wrote:
> > For instance, it appears that select will return that a socket is
> > writable when there is, say 8k of buffer space in it. However, if
> > I'm sending 32k UDP packets, this still causes me to drop packets
> > due to a lack of resources...
>
> udp has a fixed 8k max payload. did you try breaking up your packets?

Are you sure about that? UDP has a 16-bit field for the length. Thus the
standard technically allows for packet sizes (including header) of up to 2^16
(roughly 65K) bytes.

Chris

--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: [email protected]

2001-12-10 22:04:02

by Chris Wright

[permalink] [raw]
Subject: Re: question on select: How big can the empty buffer space be before select returns ready-to-write?

* Christopher Friesen ([email protected]) wrote:
> Chris Wright wrote:
> >
> > * Ben Greear ([email protected]) wrote:
> > > For instance, it appears that select will return that a socket is
> > > writable when there is, say 8k of buffer space in it. However, if
> > > I'm sending 32k UDP packets, this still causes me to drop packets
> > > due to a lack of resources...
> >
> > udp has a fixed 8k max payload. did you try breaking up your packets?
>
> Are you sure about that? UDP has a 16-bit field for the length. Thus the
> standard technically allows for packet sizes (including header) of up to 2^16
> (roughly 65K) bytes.

no, you are absolutely right, it's 16 bits. sorry for spewing
misinformation.

cheers,
-chris