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.

Submitted by:  bandu <bandu>
Submitted on:  Wed 18 Feb 2009 12:24:14 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Kieran Mansley <kieranm>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 26 Mar 2009 02:39:29 PM UTCkieranmStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 25 Mar 2009 04:45:49 PM UTCkieranmAssigned toNone=>kieranm
      Planned Release=>1.3.1

    Back to the top


    Powered by Savane 3.1-cleanup1