patchlwIP - A Lightweight TCP/IP stack - Patches: patch #7858, Patch for window scaling support...

 
 

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

patch #7858: Patch for window scaling support for lwip-1.4.0

Submitter:  christian <xtian>
Submitted:  Fri 05 Oct 2012 10:35:40 AM UTC
   
 
Category:  TCP Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Fri 07 Feb 2014 10:11:45 AM UTC, comment #3: 

Hi all:

After submitting the patch we discovered some problems when large windows are supported with high bandwidth.  In tcp_receive, the pcb->acked was updated and truncated to 16 bits, limiting the effective window (and bandwidth). The original code was:

/* Update the send buffer space. Diff between the two can never exceed 64K? */
pcb->acked = (u16_t)(ackno - pcb->lastack);

To achieve high bandwidths we needed to use 32 bits because this diff can indeed be more than 64KB, and ended up with:

/* Update the send buffer space. Diff between the two can never exceed 64K? */
/* Yes, this might happen with high BW and Jumbo frames. We change the size of the acked to 32bit. Otherwise, ACKs maybe lost*/
     
pcb->acked = (u32_t)(ackno - pcb->lastack);

with acked field of 32 bits.

Cheers.

christian <xtian>
Fri 07 Feb 2014 09:43:07 AM UTC, comment #2: 

BTW: I dropped the changes in memp.h/.c: what did you need them for? Are there any elements bigger than 64KByte? Or did any of the pools have more that 65535 elements?

Simon Goldschmidt <goldsimon>
Group administrator
Fri 07 Feb 2014 08:53:35 AM UTC, comment #1: 

I've just pushed this patch, although I had to tweak a few things it applied quite cleanly. Thanks.

As stated at the bottom of the initial comment, OOS code still needs changes to cleanly work with big windows.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 05 Oct 2012 10:35:40 AM UTC, original submission:  

This patch provides window scaling option on lwip-1.4.0.

It is based on the patch #6537, with some modifications.

We opted for using a macro that can be enabled at compile time to support window scaling. The macro is LWIP_WND_SCALE. If this macro is set to 1, some variables in struct tcp_pcb are set to u32_t instead of u16_t, which makes the support for window scaling easier. In addition, the assert in tcp_recved function:

LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n", len <= 0xffff - pcb->rcv_wnd );

was modified to

LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n", len <= 0xffffffffU - pcb->rcv_wnd );

when LWIP_WND_SCALE is set to 1.

In the patch in #6537 Wim Dumon provided an additional patch to solve a problem detected in OOSEQ code when out of order packets are recieved. Notice that the later is not included in this patch, yout might need to include both patches.



christian <xtian>

 

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

Attached Files
file #28026:  window_scaling_1_4_1.patch added by alex_ab (28KiB - text/x-patch - updated to lwip git branch commit fe63f36656bd66b4051bdfab93e351a584337d7c (lwip 1.4.1 ++))
file #26702:  window_scaling.patch added by xtian (37KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by alex_ab (Updated the item)
  • -email is unavailable- added by goldsimon (Updated the item)
  • -email is unavailable- added by xtian (Submitted the item)
  • -email is unavailable- added by xtian
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-07 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2013-05-06 alex_ab Attached File- Added window_scaling_1_4_1.patch, #28026
    2013-01-15 goldsimon CategoryNone TCP
    2012-10-05 xtian Attached File- Added window_scaling.patch, #26702
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code