Networking Forums

Networking Forums > Computer Networking > Linux Networking > linux tcp keepalive for http?

Reply
Thread Tools Display Modes

linux tcp keepalive for http?

 
 
MDO
Guest
Posts: n/a

 
      08-13-2004, 05:36 PM
Is there a way to implement tcp keepalive packets for http sessions in
Linux/Apache? Ie. where a tcp packet is sent every 15 seconds or so?
This would be used to keep the session active if it is waiting on a
long database query to return a result.

Thanks
Mike
 
Reply With Quote
 
 
 
 
Rick Jones
Guest
Posts: n/a

 
      08-13-2004, 06:05 PM
MDO <(E-Mail Removed)> wrote:
> Is there a way to implement tcp keepalive packets for http sessions
> in Linux/Apache? Ie. where a tcp packet is sent every 15 seconds or
> so? This would be used to keep the session active if it is waiting
> on a long database query to return a result.


Well, one side or the other could always make the
setsockopt(SO_KEEPALIVE) call and have "keepalives" at the TCP level.
There would be the mater of getting the frequency set. That would
_not_ be visible to the HTTP software itself - that is it would not
see that traffic, just TCP, so if there is some timeout in say the
HTTP client, _that_ is what you really need to address.

In and of itself though, the TCP connection would be perfectly content
with hours and hours of idle time.

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
Reply With Quote
 
Allen Kistler
Guest
Posts: n/a

 
      08-13-2004, 07:08 PM
Rick Jones wrote:
> MDO <(E-Mail Removed)> wrote:
>
>>Is there a way to implement tcp keepalive packets for http sessions
>>in Linux/Apache? Ie. where a tcp packet is sent every 15 seconds or
>>so? This would be used to keep the session active if it is waiting
>>on a long database query to return a result.

>
> Well, one side or the other could always make the
> setsockopt(SO_KEEPALIVE) call and have "keepalives" at the TCP level.
> There would be the mater of getting the frequency set. That would
> _not_ be visible to the HTTP software itself - that is it would not
> see that traffic, just TCP, so if there is some timeout in say the
> HTTP client, _that_ is what you really need to address.
>
> In and of itself though, the TCP connection would be perfectly content
> with hours and hours of idle time.


A sane firewall wouldn't be content to maintain state on a connection
idle that long, though. OTOH, a sane firewall admin wouldn't be content
with the use of keepalives used to fool his firewall.
 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      08-13-2004, 07:17 PM
Allen Kistler <(E-Mail Removed)> wrote:
> A sane firewall wouldn't be content to maintain state on a
> connection idle that long, though. OTOH, a sane firewall admin
> wouldn't be content with the use of keepalives used to fool his
> firewall.


I like that, the juxtaposition of sane and firewall I can see where
a firewall (sane or otherwise could detect TCP keepalives, but I
wonder if it could detect application-level keepalives with decent
certainty.

What is the perceived risk of allowing an idle connection for long
periods of time? DOS against the firewall itself or is there more to
it?

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
Reply With Quote
 
Allen Kistler
Guest
Posts: n/a

 
      08-13-2004, 07:17 PM
Rick Jones wrote:
> Allen Kistler <(E-Mail Removed)> wrote:
>
>>A sane firewall wouldn't be content to maintain state on a
>>connection idle that long, though. OTOH, a sane firewall admin
>>wouldn't be content with the use of keepalives used to fool his
>>firewall.

>
>
> I like that, the juxtaposition of sane and firewall I can see where
> a firewall (sane or otherwise could detect TCP keepalives, but I
> wonder if it could detect application-level keepalives with decent
> certainty.
>
> What is the perceived risk of allowing an idle connection for long
> periods of time? DOS against the firewall itself or is there more to
> it?


TCP hijacking.
 
Reply With Quote
 
PC
Guest
Posts: n/a

 
      08-13-2004, 08:41 PM
I have not researched this lately, someone can correct me on this, but it
seems to me the cgi data passed by the browser shows as keep alive is
implimented by the browser software. The browser itself sets the socket
option for keep alive when it opens the socket connection.

"MDO" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> Is there a way to implement tcp keepalive packets for http sessions in
> Linux/Apache? Ie. where a tcp packet is sent every 15 seconds or so?
> This would be used to keep the session active if it is waiting on a
> long database query to return a result.
>
> Thanks
> Mike



 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      08-13-2004, 11:36 PM
Allen Kistler <(E-Mail Removed)> wrote:
> TCP hijacking.


Because? More chances to guess before the window moves?

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
Reply With Quote
 
Allen Kistler
Guest
Posts: n/a

 
      08-14-2004, 12:51 AM
Rick Jones wrote:
> Allen Kistler <(E-Mail Removed)> wrote:
>
>>TCP hijacking.

>
>
> Because? More chances to guess before the window moves?


Yup.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux socket programming and HTTP Protocol Problem PGHULME Linux Networking 1 08-21-2006 09:35 PM
Keepalive Broadcast Beacon David Gibbons Wireless Networks 1 01-21-2006 03:30 AM
New webportal dedicated all about the The Linux-started Jul,7:http://linuxnet.x15.org Bobo Georgiev Linux Networking 0 07-08-2005 08:34 PM
UDP,TCP, HTTP load balancers for Linux goyald@gmail.com Linux Networking 1 07-05-2005 09:19 PM
Keepalive/Firewall Kerwin Cabrera Windows Networking 0 07-14-2004 06:59 PM



1 2 3 4 5 6 7 8 9 10 11