-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Initial import of csma_mac protocol #2467
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
Can't see a thing at the site you linked to. |
/** | ||
* @brief The physical timer that is used for the MAC-layer, (periph/timer - IF). | ||
*/ | ||
#define MAC_TIMER TIMER_0 |
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.
This should probably be better defined by the board. TIMER_0
is often used for hwtimer
.
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.
oh, ok.
The long term solution would be to use the timer modules of the radio-transceiver. Nearly all transceivers support their own hw-timer. I think, especially it comes to beacon-enabled network it makes more sense to use these timer as they can also trigger automatic actions.
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.
While this sounds good to me, AFAIK none of our by now supported transceivers provides this functionality or at least don't provide an external API.
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 thought most radios would support this, but I was wrong. I did not found this functionality e.g. in the AT86RF233. The KW2x internal radio supports this and also the event trigger in combination with the timer.
But as it seems to be the only one, the CPU internal timer will fit better.
Why did you decided to call it |
* will attempt before declaring a channel access failure. | ||
* The IEEE 802.15.4 Standard allows values from 0-5. | ||
*/ | ||
#define MAX_CSMA_BACKOFFS 4 |
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.
This and all macros below should be prefixed NG_SIMPLEMAC_
.
I decided to call it simplemac because it is just an CSMA algorithm and not an officially (IEEE 802.15.4) defined MAC layer procedure (only a part of it). In the IEEE 802.15.4 standard describes at least an Beacon synchronized MAC protocol. So this mac protocol should only be a first step to a IEEE 802.15.4 compatible MAC layer. But csma_mac is also fine, if it is not that important to fully comply with the IEEE standard in this approach. |
I asked because there can be other simple MAC protocols possible, not utilizing e.g. CSMA but other medium access methods IMHO. Additionally if it is just for IEEE 802.15.4 this should be clear by the name too I think to avoid confusion, since we support more than just IEEE 802.15.4. |
Ok, you are right. Then I would call it csma_mac and reserve the name IEEE802.15.4_mac or so for a mac layer that fully complies with the standard. |
👍 |
ffa0695
to
3aad504
Compare
9f184dd
to
45554bf
Compare
@jremmert-phytec-iot, any news? |
@OlegHahm No news, sorry. Will hopefully have time to work on this and finish it in the second week of september. If you or anybody else want to take this over, please do. |
Won't come to it in the near future -> If there is nobody that wants to take this over, shall we close this for now? Needs adaption to #3730. |
Yes, let's close as a memo then. |
This PR adds an approach to a simple CSMA MAC layer (simplemac).
It is partly pseudo-code and not a testable implementation yet.
There is also a state-chart diagram that describes the course architecture. You can find it here:
https://github.com/jremmert-phytec-iot/Pictures_Phytec_IOT/blob/master/CSMA_MAC.pdf
I made some assumptions that should be discussed.
-> That enables a statemachine driven approach without context switching.