buglwIP - A Lightweight TCP/IP stack - Bugs: bug #26649, TCP fails when TCP_MSS >...

 
 

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

bug #26649: TCP fails when TCP_MSS > TCP_SND_BUF

Submitted by:  Robert Sprowson <sprow>
Submitted on:  Sat 23 May 2009 06:24:35 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.3.0

Sun 23 Aug 2009 01:03:36 PM UTC, comment #3:

Actually, that was a bug introduced in 1.3.0: the parenthesis were included there and were simply set wrong.

I've also added a check in init.c that TCP_SND_BUF is at least 2*TCP_MSS (necessary for nagle).

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 02 Jun 2009 11:02:17 AM UTC, comment #2:

There should really be no relation between TCP_SND_QUEUELEN and TCP_MSS, but they are defined to have that dependency because (i) we assumed that TCP_MSS < TCP_SND_BUF and (ii) it makes sure that the send queue is big enough to get some performance out of the stack.

I'm happy to see these changes - they shouldn't affect the normal case where TCP_MSS is much less TCP_SND_BUF. It might be nice to warn people running with the the small SND_BUF that they're likely to see poor performance though. Without thinking in much detail I'm guessing it wouldn't work very well with the nagle algorithm for example.

Kieran Mansley <kieranm>
Project Administrator
Sat 23 May 2009 08:34:55 PM UTC, comment #1:

I'm not the expert on this options here and maybe we should wait for Kieran to return and give it a thought, but I'd say a sanity check should do: TCP_SND_BUF is a limitation introduced by lwIP and I don't see a point using an MSS larger than we can support, anyway...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 23 May 2009 06:24:35 PM UTC, original submission:

I'm assuming it is valid to have TCP_MSS > TCP_SND_BUF, if not a sanity check in "core/init.c" might be worthwhile.

Anyway, the placement of parenthesis means that

#define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS))

in "opt.h" evaluates to zero when the send buffer is larger than the segment size. Likewise in "core/init.c" the sanity check

if (TCP_SND_QUEUELEN < (2 * (TCP_SND_BUF/TCP_MSS)))

would boil down to

if (0 < 0)

Proposed fixes:

#define TCP_SND_QUEUELEN ((4 * TCP_SND_BUF)/TCP_MSS)

and

if (TCP_SND_QUEUELEN < ((2 * TCP_SND_BUF)/TCP_MSS))

with these in place everything seems to work fine when TCP_SND_BUF=256 and TCP_MSS=512.

Robert Sprowson <sprow>

 

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 kieranm (Posted a comment)
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by sprow (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
    Sun 23 Aug 2009 01:03:36 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Tue 02 Jun 2009 11:04:59 AM UTCkieranmPlanned Release=>1.4.0

    Back to the top


    Powered by Savane 3.1-cleanup1