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

Submitter:  Robert Sprowson <sprow>
Submitted:  Sat 23 May 2009 06:24:35 PM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group Member
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>
Group administrator
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>

 

(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 kieranm (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by sprow (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-08-23 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2009-06-02 kieranm Planned Release 1.4.0

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code