buglwIP - A Lightweight TCP/IP stack - Bugs: bug #25629, keep-alive not working.

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #25629: keep-alive not working.

Submitter:  bandu <bandu>
Submitted:  Wed 18 Feb 2009 12:24:14 PM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  kieranm
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.3.0

Fri 27 Mar 2009 11:04:31 AM UTC, comment #5: 

I've corrected it, thanks.

Kieran Mansley <kieranm>
Group Member
Fri 27 Mar 2009 10:58:29 AM UTC, comment #4: 

Hmm, I'm not sure now: I think I was confused.


Kieran Mansley <kieranm>
Group Member
Fri 27 Mar 2009 10:44:34 AM UTC, comment #3: 

Sorry, Kieran

can you explain why in this code fragment
we increase announced receive window?

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

You write:
"I've also fixed the window in the packet with that change to not shrink what we advertise by one octet. "

We send one byte in case zero window probe or keep alive probe.
Why receive window would be shrink without this "+1"?

Oleg Tyshev <olegreen>
Thu 26 Mar 2009 02:39:29 PM UTC, comment #2: 

Checked in, resolving fixed. Thanks Chen.

Kieran Mansley <kieranm>
Group Member
Wed 11 Mar 2009 06:10:49 PM UTC, comment #1: 

Yeah, that fixed the problem

Chen <xchen>
Wed 18 Feb 2009 12:24:14 PM UTC, original submission:  

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.

bandu <bandu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by olegreen (Posted a comment)
  • -email is unavailable- added by kieranm (Updated the item)
  • -email is unavailable- added by xchen (Posted a comment)
  • -email is unavailable- added by bandu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-03-26 kieranm StatusNone Fixed
        Open/ClosedOpen Closed
    2009-03-25 kieranm Assigned toNone kieranm
        Planned Release 1.3.1

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code