public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* question on select:  How big can the empty buffer space be before select returns ready-to-write?
@ 2001-12-10  6:16 Ben Greear
  2001-12-10  7:33 ` Chris Wright
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Greear @ 2001-12-10  6:16 UTC (permalink / raw)
  To: linux-kernel

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 <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question on select:  How big can the empty buffer space be before select returns ready-to-write?
  2001-12-10  6:16 question on select: How big can the empty buffer space be before select returns ready-to-write? Ben Greear
@ 2001-12-10  7:33 ` Chris Wright
  2001-12-10  8:38   ` Alan Cox
  2001-12-10 19:05   ` Christopher Friesen
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Wright @ 2001-12-10  7:33 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-kernel

* Ben Greear (greearb@candelatech.com) 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question on select:  How big can the empty buffer space be before select returns ready-to-write?
  2001-12-10  7:33 ` Chris Wright
@ 2001-12-10  8:38   ` Alan Cox
  2001-12-10 16:41     ` Ben Greear
  2001-12-10 19:05   ` Christopher Friesen
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Cox @ 2001-12-10  8:38 UTC (permalink / raw)
  To: Chris Wright; +Cc: Ben Greear, linux-kernel

> 
> * Ben Greear (greearb@candelatech.com) 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. 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question on select:  How big can the empty buffer space be before select returns ready-to-write?
  2001-12-10  8:38   ` Alan Cox
@ 2001-12-10 16:41     ` Ben Greear
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Greear @ 2001-12-10 16:41 UTC (permalink / raw)
  Cc: Chris Wright, linux-kernel



Alan Cox wrote:

>>* Ben Greear (greearb@candelatech.com) 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 <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question on select: How big can the empty buffer space be before  select returns ready-to-write?
  2001-12-10  7:33 ` Chris Wright
  2001-12-10  8:38   ` Alan Cox
@ 2001-12-10 19:05   ` Christopher Friesen
  2001-12-10 21:46     ` Chris Wright
  1 sibling, 1 reply; 6+ messages in thread
From: Christopher Friesen @ 2001-12-10 19:05 UTC (permalink / raw)
  To: Chris Wright; +Cc: Ben Greear, linux-kernel

Chris Wright wrote:
> 
> * Ben Greear (greearb@candelatech.com) 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: cfriesen@nortelnetworks.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question on select: How big can the empty buffer space be before select returns ready-to-write?
  2001-12-10 19:05   ` Christopher Friesen
@ 2001-12-10 21:46     ` Chris Wright
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wright @ 2001-12-10 21:46 UTC (permalink / raw)
  To: Christopher Friesen; +Cc: Ben Greear, linux-kernel

* Christopher Friesen (cfriesen@nortelnetworks.com) wrote:
> Chris Wright wrote:
> > 
> > * Ben Greear (greearb@candelatech.com) 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-12-10 22:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-10  6:16 question on select: How big can the empty buffer space be before select returns ready-to-write? Ben Greear
2001-12-10  7:33 ` Chris Wright
2001-12-10  8:38   ` Alan Cox
2001-12-10 16:41     ` Ben Greear
2001-12-10 19:05   ` Christopher Friesen
2001-12-10 21:46     ` Chris Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox