Giter Club home page Giter Club logo

Comments (3)

maximevince avatar maximevince commented on May 27, 2024

Option 1 seems most suitable to me.
Will solve this @ the Leuven site!

from picotcp.

andreixc avatar andreixc commented on May 27, 2024

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.

andreixc avatar andreixc commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.