Comments (3)
Option 1 seems most suitable to me.
Will solve this @ the Leuven site!
from picotcp.
Tried on linux, with Nagle disabled and a python script sending 1 byte of payload per frame.
For each packet we keep memory used with the following:
- struct pico_frame (sizeof = 160 bytes)
- pico_frame.buffer (buffer_len)
- usage counter(4 bytes)
- node from rb tree (sizeof = 40 bytes)
So for 1 byte of payload we 204 extra bytes.
Wouldn't be a good idea to implement some kind of join for these small segments?
from picotcp.
I refactored the following things:
- the receiving of TCP, when receiving a new segment instead of keeping the full frame
we are selecting only what we need (payload and seq) and drop the rest of the frame. - the tcp queues have now a field called overhead which, can be configured and it's taken into account
when calculating the size of the queue. - when calculating the size of the queues, if it's an input queue we take into account the payload_len and the size of the input segment structure, if it's an output or hold queue we take into account the buffer_len and the size of a the frame structure.
I performed the following tests (on mbed):
- for input I flood the stack with TCP packets of 1 byte payload
when the queue is filled, we get a zero window back, the board survives. - for output, I create a socket, I disable Nagle and I send from mbed towards linux
a flood of packets of 1 byte payload.
There is a pressure on memory but I could send continuously without any crash.
The only memory killer I see at this point is the nagle algorithm, because if you repeat the output test with
nagle, for each packet will create a new frame and then join them and afterwards enqueue into tcpq_out, which
is a lot of alloc's and free's for nothing.
I will think of a design to optimize this like the other queues.
from picotcp.
Related Issues (20)
- pico_socket_read() with timeout HOT 1
- pico_ipv4_route_add() is not correctly adding the gateway HOT 1
- Memory leak in SNTP sync HOT 3
- RAW_SOCKET pendant? HOT 2
- TFTP retries not working
- README.md: GPL LICENSE problem HOT 2
- ARP frames are never set unreachable HOT 5
- tcpecho refuses connection ... HOT 1
- tcpopt_len_check will stop the stack when option length is 0 HOT 1
- Question: How many times pico_stack_tick() should be called HOT 3
- No 'extern "C"' support in headers HOT 2
- Best way to report security issues HOT 1
- Use picotcp without sockets? HOT 2
- security contact
- connect tcpserver and tcpclient via taps interface
- send from tcpclient and receive in tcpserver
- picoapp icmp6 ping failed
- Reassigned a value before the old one has been used.
- Checking if unsigned variable is less than zero.
- Weak references not working correctly under Windows with MinGW HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picotcp.