buglwIP - A Lightweight TCP/IP stack - Bugs: bug #21492, TCP MSS can be larger than MTU

 
 

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

bug #21492: TCP MSS can be larger than MTU

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Thu 01 Nov 2007 04:08:28 PM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

Wed 21 Nov 2007 06:10:47 PM UTC, comment #4: 

As noone objects, I'll check this in, together with an option to disable it to reduce code size.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 14 Nov 2007 07:18:32 AM UTC, comment #3: 


> I'm probably being dumb


Of course you're not :-)

The + 20 is a remainder of the previous version of that function. It can be deleted, so the line should be

sendmss = LWIP_MIN(sendmss, mss_s);

Simon Goldschmidt <goldsimon>
Group administrator
Tue 13 Nov 2007 09:16:42 PM UTC, comment #2: 

I'm probably being dumb, but can you explain the + 20 in this line:

+    sendmss = LWIP_MIN(sendmss + 20, mss_s);

I would have thought that we should use the MSS received from the remote side as-is. Otherwise it seems to be adding 20 to the MSS passed in every time.

Jonathan Larmour <jifl>
Group Member
Tue 13 Nov 2007 08:56:50 PM UTC, comment #1: 

In this patch, I introduced a function tcp_eff_send_mss() that takes a configured mss (the one currently set to pcb->mss in tcp_connect or tcp_listen_input/tcp_process) and calculates the mss_s based on the mtu of the netif used to reach pcb->remote_ip (through ip_route).

So effectively, if mtu doesn't allow mss as big as the currently set pcb->mss, it will now be set smaller. Without the patch, things wouldn't work at all if mtu is smaller than mss(+header), which makes me worry whether we really need this...

It seemed kind of mandatory to me when readinf RFC 1122 :-)

(file #14383)

Simon Goldschmidt <goldsimon>
Group administrator
Thu 01 Nov 2007 04:08:28 PM UTC, original submission:  

This might currently not be a problem for most users, but (according to RFC 1122, chapter 4.2.2.6), the MSS should be the minimum of the received MSS (option) and the 'MTU-minus-headersize'-(calculated)-MSS (effectivly MTU-20 for us).

I think this is very straightforward: since netif already holds the MTU, just call ip_route on connection setup and calculate the "effective send MSS" based on the netif's MTU.

This is also a precondition for effectively using path MTU discovery with TCP.

Simon Goldschmidt <goldsimon>
Group administrator

 

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

Attached Files
file #14383:  effsendmss.patch added by goldsimon (3KiB - 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 jifl (Posted a comment)
  • -email is unavailable- added by goldsimon (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
    2007-11-21 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2007-11-13 goldsimon Attached File- Added effsendmss.patch, #14383

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code