* TCP socket timeout after IP address is removed
@ 2014-07-25 20:04 Zoltan Kiss
2014-07-25 23:31 ` Yuchung Cheng
0 siblings, 1 reply; 3+ messages in thread
From: Zoltan Kiss @ 2014-07-25 20:04 UTC (permalink / raw)
To: netdev; +Cc: Joby Poriyath
Hi,
We have a timout problem on TCP sockets, which probably has some trivial
solution, but I couldn't figure it out after hours of staring at the
code, so hopefully someone can shed some light on it here.
The scenario is the following:
- I start an ssh connection from host A to B, it works fine
- netstat shows the socket is using local address K
- then I remove local address K, and with DHCP I get a new one, L on a
different interface (interfaces are always up during the whole time)
- the socket is still alive, but my SSH connection doesn't transmit
anything, obviously, as netstat says it is still using IP address K
- ftrace showed me the data goes through the TCP layer and finally the
IP layer drops it because the route is no longer valid
On 3.10 kernel it times out after ~15 minutes or so, which isn't too
good for me. On 2.6.32 it times out after a couple of minutes, and I
would like to achieve the same, but I couldn't figure out how. Could
anyone give me some guidance?
Regards,
Zoltan Kiss
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: TCP socket timeout after IP address is removed
2014-07-25 20:04 TCP socket timeout after IP address is removed Zoltan Kiss
@ 2014-07-25 23:31 ` Yuchung Cheng
2014-07-25 23:59 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: Yuchung Cheng @ 2014-07-25 23:31 UTC (permalink / raw)
To: Zoltan Kiss; +Cc: netdev, Joby Poriyath
On Fri, Jul 25, 2014 at 1:04 PM, Zoltan Kiss <zoltan.kiss@citrix.com> wrote:
> Hi,
>
> We have a timout problem on TCP sockets, which probably has some trivial
> solution, but I couldn't figure it out after hours of staring at the code,
> so hopefully someone can shed some light on it here.
> The scenario is the following:
> - I start an ssh connection from host A to B, it works fine
> - netstat shows the socket is using local address K
> - then I remove local address K, and with DHCP I get a new one, L on a
> different interface (interfaces are always up during the whole time)
> - the socket is still alive, but my SSH connection doesn't transmit
> anything, obviously, as netstat says it is still using IP address K
> - ftrace showed me the data goes through the TCP layer and finally the IP
> layer drops it because the route is no longer valid
>
> On 3.10 kernel it times out after ~15 minutes or so, which isn't too good
> for me. On 2.6.32 it times out after a couple of minutes, and I would like
> to achieve the same, but I couldn't figure out how. Could anyone give me
> some guidance?
Depending on your scenario, you can either try tweaking the sysctl
net.ipv4.tcp_retries2 or use setsockopt TCP_USER_TIMEOUT
man tcp or see http://patchwork.ozlabs.org/patch/62889/
>
> Regards,
>
> Zoltan Kiss
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: TCP socket timeout after IP address is removed
2014-07-25 23:31 ` Yuchung Cheng
@ 2014-07-25 23:59 ` Cong Wang
0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2014-07-25 23:59 UTC (permalink / raw)
To: Yuchung Cheng; +Cc: Zoltan Kiss, netdev, Joby Poriyath
On Fri, Jul 25, 2014 at 4:31 PM, Yuchung Cheng <ycheng@google.com> wrote:
> On Fri, Jul 25, 2014 at 1:04 PM, Zoltan Kiss <zoltan.kiss@citrix.com> wrote:
>> Hi,
>>
>> We have a timout problem on TCP sockets, which probably has some trivial
>> solution, but I couldn't figure it out after hours of staring at the code,
>> so hopefully someone can shed some light on it here.
>> The scenario is the following:
>> - I start an ssh connection from host A to B, it works fine
>> - netstat shows the socket is using local address K
>> - then I remove local address K, and with DHCP I get a new one, L on a
>> different interface (interfaces are always up during the whole time)
>> - the socket is still alive, but my SSH connection doesn't transmit
>> anything, obviously, as netstat says it is still using IP address K
>> - ftrace showed me the data goes through the TCP layer and finally the IP
>> layer drops it because the route is no longer valid
>>
>> On 3.10 kernel it times out after ~15 minutes or so, which isn't too good
>> for me. On 2.6.32 it times out after a couple of minutes, and I would like
>> to achieve the same, but I couldn't figure out how. Could anyone give me
>> some guidance?
>
> Depending on your scenario, you can either try tweaking the sysctl
> net.ipv4.tcp_retries2 or use setsockopt TCP_USER_TIMEOUT
>
> man tcp or see http://patchwork.ozlabs.org/patch/62889/
>
Besides that the cached dst by that socket should be obsolete as well,
since the old routing entry might not be valid any more. I mention this
because routing cache was removed between 2.6.32 and 3.10.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-25 23:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 20:04 TCP socket timeout after IP address is removed Zoltan Kiss
2014-07-25 23:31 ` Yuchung Cheng
2014-07-25 23:59 ` Cong Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).