-
Notifications
You must be signed in to change notification settings - Fork 8.2k
net: tcp: Use larger default MSS until its negotiation is fully implemented (1.10 release workaround) #5034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This augments #5015 to not touch some Note that I'll be happy to work on full impl of MSS negotiation, I'm just not sure it would be ready for 1.10. |
subsys/net/ip/tcp.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if MSS is not fully implemented, then an MSS larger than 536 cannot be used, see the mentioned RFC. Here one has to be conservative and keep that MSS of 536 until the MSS negotiation has completed successfully. In IPv6 the MSS cannot be larger than 1220, since there are 40 bytes of IPv6 headers and 20 bytes of TCP headers, so setting it to 1280 is not the correct value. Besides, if this function does not know whether TCP is going to be transported over IPv4 or IPv6, the conservative estimate of 536 needs to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pfl thanks, but:
- What you say is pretty obvious and known to the author of the patch.
- Zephyr IP stack has multiple violations of IP standards.
- There's incremental work to make it compliant, and fixing one issue often leads to exposing issues in other parts of code.
- This patch is part of the work to get more overall p.1 fixes into the 1.10 release, rather than less, which requires quite extensive negotiations and compromises among all the parties involves, see net: net_pkt_append: Take into account MSS/MTU when adding data to a packet #119, BSD Sockets API: Offloading Support #4821, net: 15.4 network interfaces use incorrect MTU setting of 127 #4934, net: pkt: net_pkt_append: Use only TCP MSS to cap packet size #5015, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can agree with points 1.-4. above. But in order to fix things, let's not break the ones that actually implement the standards properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am the author of MSS handling/negotiation support in Zephyr (there was none before I started to implement, I haven't finished yet). And for the sake of impeding 1.10 release, I find it acceptable to effectively disable the MSS handling functionality I added, because there're a lost of code in Zephyr which isn't ready for proper MSS handling (actually, only 2 pieces are guaranteedly ready: BSD Sockets, authors by me, and new HTTP API, for which @jukkar kindly accepted my suggestions).
tbursztyka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a wrong hack to me as well.
Then let me be straight: this is the final "litmus test" to figure out whether there's more interest in a) just reverting the functionality I added, or b) resolving the issues. For b) part, I offered 3-4 solutions, with ones not immediately shot down, backed by patches. I guess the rest are for the maintainers to decide. |
|
I'm all for point b), resolving the issues. For this change, it apparently means fixing MSS handling, if found to be broken. Question is, whether it is totally broken or works somewhat to the extent that the applications can work "mostly". In the latter case it is not in need of immediate fixing, in both cases let's fix the buggy parts and not add a temporary hack - especially since this change is not visibly part of a bigger patch set and by itself introduces yet another thing that is afterwards violating TCP specifications. |
It was found to be non-existent, and I started to implement it (as recursive task to allow POSIX-style model of network sends). I'm sad that I didn't finish it, but "disabling" it definitely feels better than throwing away even more work done during last month. |
|
There are now too many patches floating around fixing various things and we seem to loose the track.
|
|
That's good summary, there're 2 options:
|
I do not think this would cause new HTTP API revertion, if there would be some issues in HTTP API, those could be fixed.
If we do not revert the MTU changes, then we should apply #5015 but should not apply #5034 but fix the callers of net_pkt_append() instead (option 3). Adding new code might regress things more so safest option might be to apply #4972 This needs more testing if it would cause some issues in HTTP API. |
That would be a big change. Literally, all of them (TCP ones, of course) would need to follow the same pattern as new HTTP API - loop over get_pkt_tx() and pkt_append() (because MSS can be 1, send window can be 1).
Well, handling of large amounts of data (more than fits in one packet (actually MSS, soon send window)) in the new HTTP API depends on net_pkt_append() adding only as much as possible, and returning how much was added.
#5015 doesn't add new code, it removes UDP branch. This patch (#5034) doesn't add code, just changes value of a constant (we can set it to 1220 as @pfl suggested, or to 1500/1460/1440 to cover Eth case). The cumulative effect should be that net_pkt_append() will do pkt size limiting, but only for TCP, and using optimistic defaults, similar to how IP stack worked before. IMHO, that's a pretty safe approach, but you're the maintainer to make a decision. |
We don't yet implement MSS negotiation for all directions (client vs server), and yet have tests/samples which assume that it's possible to transfer more than default MSS of 536 in a single packet. So, until negotiation is fully implemented, bump default MSS to be higher. Signed-off-by: Paul Sokolovsky <[email protected]>
d880d17 to
a8e5e49
Compare
|
Added RFC #5038 to address this issue. Please comment and let's continue after the weekend. Applications need also to be updated to take into account how many octets can be and were sent to the other end. |
|
Per the #5038 (comment) , closing this, as long as #4972 is closed. |
We don't yet implement MSS negotiation for all directions (client vs
server), and yet have tests/samples which assume that it's possible
to transfer more than default MSS of 536 in a single packet.
So, until negotiation is fully implemented, bump default MSS to be
higher.
Signed-off-by: Paul Sokolovsky [email protected]