Skip to content

lwIP: Enable TCP out-of-order processing #6882

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

Merged
merged 1 commit into from
May 14, 2018

Conversation

kjbracey
Copy link
Contributor

Description

Our config file for lwIP had TCP_QUEUE_OOSEQ disabled - this can
cause significant performance problems, as observed during testing.

One lost packet can lock an input stream into a mode where the
transmitter keeps thinking packets are being lost, so keeps slowing
down. This caused test failures - a transfer that would normally
take 10s hit a 60s timeout.

Turning this on increases code size, but doesn't significantly increase
static memory use. The memory used for out-of-order packets comes from
the same pbuf pool as for outgoing TCP segments, so there is contention
when running bidirectionally.

Out-of-order processing is on by default for lwIP - this seems to be
another example of us excessively paring it back.

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[X] Feature
[ ] Breaking change

Our config file for lwIP had TCP_QUEUE_OOSEQ disabled - this can
cause significant performance problems, as observed during testing.

One lost packet can lock an input stream into a mode where the
transmitter keeps thinking packets are being lost, so keeps slowing
down. This caused test failures - a transfer that would normally
take 10s hit a 60s timeout.

Turning this on increases code size, but doesn't significantly increase
static memory use. The memory used for out-of-order packets comes from
the same pbuf pool as for outgoing TCP segments, so there is contention
when running bidirectionally.

Out-of-order processing is on by default for lwIP - this seems to be
another example of us excessively paring it back.
@kjbracey kjbracey requested a review from SeppoTakalo May 11, 2018 14:18
@kjbracey
Copy link
Contributor Author

This is intended to solve a problem observed here: #6665

@kjbracey
Copy link
Contributor Author

@mikaleppanen, @VeijoPesonen

@kjbracey
Copy link
Contributor Author

kjbracey commented May 11, 2018

Static memory change with this, for development build.

Current build:

Total Static RAM memory (data + bss): 59196 bytes
Total Flash memory (text + data): 141450 bytes

Enabling TCP_QUEUE_OOSEQ

Total Static RAM memory (data + bss): 59212 bytes (+16)
Total Flash memory (text + data): 142538 bytes (+1,088)

This increase is only for images using lwIP with TCP enabled.

@cmonr
Copy link
Contributor

cmonr commented May 14, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

Build : SUCCESS

Build number : 1990
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6882/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

@VeijoPesonen
Copy link
Contributor

VeijoPesonen commented May 14, 2018

100 KB download, artificial 2% packet loss.

Disabled

TCP_QUEUE_OOSEQ disabled. Gave up after 2mins and 70KB.
tcp_queue_ooseq_disabled

Enabled

TCP_QUEUE_OOSEQ enabled. Took about 4secs.
tcp_queue_ooseq_enabled

@mbed-ci
Copy link

mbed-ci commented May 14, 2018

@cmonr cmonr merged commit 506f9a8 into ARMmbed:master May 14, 2018
@kjbracey kjbracey deleted the lwip-tcp-ooseq branch June 6, 2018 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants