Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* TCP listen pending connection does not work as expected
@ 2001-01-22 18:58 francois reygagne
  2001-01-23  2:06 ` Fernando Gont
  2001-01-23 10:43 ` Casper H.S. Dik - Network Security Engineer
  0 siblings, 2 replies; 3+ messages in thread
From: francois reygagne @ 2001-01-22 18:58 UTC (permalink / raw)


I set the backlog parameter of listen to 2 to prevents from server
congestion.
I want the incoming client requests connect to be rejected i.e. refused
by tcp when the listen
queue is full.

The max number of tcp pending connections feature does not exist anymore
for the
kernel 2.2 and 2.4; Anyway it's possible via a root system command to
enable it
on Linux;  I use for that the root command as follow:
echo 1 >  /proc/sys/net/ipv4/tcp_abort_on-overflow on linux 2.2.14-12.

but tcp stack accepts all connection and resets them after !!!
My client receives connection reset by peer when receiving data !!

Normally the tcp stack should work as bellow ?
Once the backlog queuebecomes full, no further connection requests will
be accepted for that service until an entry becomes available in the
queue. Under normal conditions, if a connection request is made and the
queue is full, TCP relies on the client to retransmit the connection
request at some later stage. Generally speaking, TCP is quite expedient
in processing connection requests and so, unless the service is
particularly busy, a retransmitted request should be processed.



Could anyone help me. I want to make tcp rejected my incoming request
when the tcp listen queue is full
on Linux, Solaris 2.8, Tru64, HP-UX and AIX.


I have a workaround exposed here after but this solution seems to me
quick and dirty.

Define a threshold of max pending connections the server handles
* server accepts all connection and pushes the created client socket
into a fifo queue of pending connection
   until the fifo becomes full
* when max of pending connection is reached, the server stops pushing
client socket
1) reads client request then
2) sends a response  to refuse the request (server too busy)
3)closes the connection



--
Fran�ois REYGAGNE
opt[e]way S.A., 2881 route des Cr�tes, BP308
06906 Sophia Antipolis Cedex, FRANCE

t�l: +33 (0)4 92 95 27 01
fax: +33 (0)4 92 95 26 01





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

* Re: TCP listen pending connection does not work as expected
  2001-01-22 18:58 TCP listen pending connection does not work as expected francois reygagne
@ 2001-01-23  2:06 ` Fernando Gont
  2001-01-23 10:43 ` Casper H.S. Dik - Network Security Engineer
  1 sibling, 0 replies; 3+ messages in thread
From: Fernando Gont @ 2001-01-23  2:06 UTC (permalink / raw)


On Mon, 22 Jan 2001 19:58:36 +0100, francois reygagne
<freygagne@opteway.com> wrote:

>Could anyone help me. I want to make tcp rejected my incoming request
>when the tcp listen queue is full
>on Linux, Solaris 2.8, Tru64, HP-UX and AIX.

Keep in mind that the backlog argument for the listen() function is
not literally the number of queued connections on some systems. Please
read thecurrent  "TCP backlog" thread in comp.protocols.tcp-ip.



>* when max of pending connection is reached, the server stops pushing
>client socket
>1) reads client request then
>2) sends a response  to refuse the request (server too busy)
>3)closes the connection

In that case, you're processing the requests, anyway. Will it really
help your server to do that?


--
Fernando Ariel Gont
e-mail: fgont@ANTISPAM.softhome.net

[To send a personal reply, please remove the ANTISPAM tag]


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

* Re: TCP listen pending connection does not work as expected
  2001-01-22 18:58 TCP listen pending connection does not work as expected francois reygagne
  2001-01-23  2:06 ` Fernando Gont
@ 2001-01-23 10:43 ` Casper H.S. Dik - Network Security Engineer
  1 sibling, 0 replies; 3+ messages in thread
From: Casper H.S. Dik - Network Security Engineer @ 2001-01-23 10:43 UTC (permalink / raw)


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

francois reygagne <freygagne@opteway.com> writes:

>Could anyone help me. I want to make tcp rejected my incoming request
>when the tcp listen queue is full on Linux, Solaris 2.8, Tru64, HP-UX and AIX.



You cannot do so on Solaris; you cannot do so using the socket interface.

"Connection refused"  is not for cases when queues are full.  Instead,
common practice is to drop the SYN on the floor.

To the client "Connection Refused" means: oh, no listener.  Let's not retry.
(Unless you use Windows which is broken in this regard)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


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

end of thread, other threads:[~2001-01-23 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-22 18:58 TCP listen pending connection does not work as expected francois reygagne
2001-01-23  2:06 ` Fernando Gont
2001-01-23 10:43 ` Casper H.S. Dik - Network Security Engineer

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