lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #25629] keep-alive not working.


From: bandu
Subject: [lwip-devel] [bug #25629] keep-alive not working.
Date: Wed, 18 Feb 2009 12:24:15 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; .NET CLR 2.0.50727; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

URL:
  <http://savannah.nongnu.org/bugs/?25629>

                 Summary: keep-alive not working.
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: bandu
            Submitted on: Wed 18 Feb 2009 12:24:14 GMT
                Category: TCP
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.3.0

    _______________________________________________________

Details:

Problem description
===================
I'm trying to implement remote side network cable unplugging scenario by
using keep-alive timer.
 
I set keep alive like:
pcb->so_options |= SOF_KEEPALIVE;
pcb->keep_idle = 15000;
pcb->keep_cnt = 1;
pcb->keep_intvl = 15000;
 
>From wireshark, I can see my device is sending TCP keep alive packet. (Note:
wireshark show with black color and marked as broken TCP.)
And remote side didn't ACK my keep-alive packet. (remote side is windows XP
OS with telnet.exe running. my telnet implementation work fine)
so that my connection get keep-alive timed-out and disconnected.


Fix suggested by Kieran 
=======================
Quote from Kieran:

There was a problem reported for a zero-window probes (which are very similar
to the keep alive probes) where because we don't set the ACK flag windows
hosts do not reply.  The trace you provide shows that the keep alive probe
doesn't have the ACK flag set, so I'd guess you've got the same problem. 
Could you try replacing, in src/core/tcp_out.c:tcp_keepalive():

 tcphdr->ackno = htonl(pcb->rcv_nxt);
 TCPH_FLAGS_SET(tcphdr, 0);
 tcphdr->wnd = htons(pcb->rcv_ann_wnd);
 tcphdr->urgp = 0;

with:

 tcphdr->ackno = htonl(pcb->rcv_nxt);
 TCPH_FLAGS_SET(tcphdr, TCP_ACK);
 tcphdr->wnd = htons(pcb->rcv_ann_wnd + 1);
 tcphdr->urgp = 0;

(I've also fixed the window in the packet with that change to not shrink
what we advertise by one octet).

If that works, please open a bug and this code should get checked in. We
should really make the same change to the tcp_zero_window_probe() function
below it which has the same block of code.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?25629>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]