Skip to content
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

High throughput fixes for csma and sixlowpan #648

Merged
merged 3 commits into from
Oct 21, 2014

Conversation

laurentderu
Copy link
Member

When traffic is send to a node with a higher rate than the radio can output this consumes all the available packet buffers in CSMA, nay other traffic is blocked or seriously slowed; this can break the DAG as DIO/DAO are no longer send timely. This fix add a new configuration parameter, CSMA_CONF_MAX_PACKET_PER_NEIGHBOR, limiting the number of packet buffer used by a given neighour. Its default value is set to MAX_QUEUED_PACKETS so that the default behaviour of CSMA is not modified.

Also, if this high rate traffic is fragmented, it will also consumes all the available queuebuf leading to a strange behaviour : only the first fragment is sent as at a time only one queuebuf can be released by the radio, all the remaining fragments are dropped and the message is never received by the target node. Also, as all the queuebuf are used almost no other traffic can go trough.

High throughput traffic also requires modifications in native-rdc, they will be part of another PR

@adamdunkels
Copy link
Member

This is really good. We've seen similar problems on platforms with limited numbers of queuebufs, and this looks like a very nice way to solve it!

A few quick comments:

  • the global variables in csma.c probably shouldn't be there
  • how about just counting the queuebufs instead of introducing a new function in the memb module - or maybe that is useful somewhere else too?
  • what do you think about the name queuebuf_numfree() instead of queuebuf_freeslots()? (Given that the concept of "slots" really isn't used otherwise.)

@laurentderu
Copy link
Member Author

the global variables in csma.c probably shouldn't be there

I thought they were used in the debug trace, I will remove them and maybe include them in a CSMA_STAT like RPL_STAT in a later PR, what do you think ?

how about just counting the queuebufs instead of introducing a new function in the memb module - or maybe that is useful somewhere else too?

It's easy to miss one add or free in queuebuf.c especially with WITH_SWAP) so counting the used memb entries is safer. If you think it's better to use a counter per queuebuf type I will update it accordingly.

what do you think about the name queuebuf_numfree() instead of queuebuf_freeslots()? (Given that the concept of "slots" really isn't used otherwise.)

Agreed :)

@laurentderu
Copy link
Member Author

Travis is failing because we are again overflowing the rom on the Sky platform :

region `rom' overflowed by 92 bytes

@adamdunkels
Copy link
Member

In principle, this pull request looks good (and solves a problem that we've also seen from time to time).

But the global variables (and their naming) in this commit shouldn't go in: cetic@9562c9c

Removing that commit would make this 👍 from me!

@adamdunkels
Copy link
Member

Also, rebasing to current master might fix the sky compile problem.

@laurentderu
Copy link
Member Author

rebased, functions renamed as suggested, csma statistics commit removed and travis is ok :)

@nvt
Copy link
Member

nvt commented Oct 21, 2014

👍

nvt pushed a commit that referenced this pull request Oct 21, 2014
High throughput fixes for csma and sixlowpan
@nvt nvt merged commit 6fb7dd2 into contiki-os:master Oct 21, 2014
@laurentderu laurentderu deleted the pr-csma-fixes branch November 7, 2014 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants