Skip to content

Conversation

daniel-k
Copy link
Member

@daniel-k daniel-k commented Aug 27, 2015

I have developed a (not so) simple (anymore) duty cycling MAC protocol focused for IEEE 802.15.4 transceiver. It has the working title "LwMAC" which stands for "lightweight MAC", I really didn't have a better idea. This is still work-in-progress but has reached a point where maybe someone else might want to try it or comment on it's future development.

In the current state it behaves like the LPEA LPEAS protocol described in this paper (sorry, there doesn't seem to be a free source). This is quite similiar to ContikiMAC, but doesn't provide compatibility (yet). Later it's planned to add implicit synchronization with neighbor nodes, i.e. extent to LPEAS. Done

I created a quick overview of the overall structure. Maybe this helps to better understand all the moving parts. Yet there is no overview over the RX or TX state machines.

It still has bugs and TODOs, so I want to use this PR as my TODO list.

Currently this depends on #3138 #3619 #3729 #4078 #3867 #4081 #2309
Incorporates, but not critical: #3993 #3868 #3887 #4015 #4058 #3954

TODOs

  • use gnrc pktqueue
  • implement broadcast
  • verify duty cycling
  • implement implicit sync
  • use xtimer instead of RTT peripheral when low power timer source is implemented (xtimer: Add support for arbitrary frequency hardware timers (32768 Hz support) #3990 et al.)
  • update documentation, make clear what's supposed to be changed by the user
  • rework error logging
  • integrate properly and implement selection of mac layer
  • review and address inline TODOs
  • major cleanup

How to test

Currently you should use the samr21-xpro board to test this, because certain features (see depending PRs) are only available on that platform. And it's the only I can test :-)

Flash to board with the at86rf2xx driver test:

$ cd tests/driver_at86rf2xx
$ BOARD=samr21-xpro make flash term

Then manually send packet from one board to the other via interactive shell(note: baudrate is 921600)

txtsnd 4 xx:xx Helloxx

or even as broadcast:

txtsnd 4 bcast aReallyBroadCast

You can use a packet sniffer to verify the communication or just check if packets arrive at the destination by flashing the same test.

@daniel-k daniel-k added Area: network Area: Networking State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable Type: new feature The issue requests / The PR implemements a new feature for RIOT State: waiting for other PR State: The PR requires another PR to be merged first labels Aug 27, 2015
@OlegHahm
Copy link
Member

Wooohooo, I'm excited and eager to test!

@@ -1,4 +1,4 @@
ifneq (,$(filter gnrc_netif_default,$(USEMODULE)))
USEMODULE += at86rf233
USEMODULE += gnrc_nomac
USEMODULE += gnrc_lwmac
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should discuss on the mailing list or in the next meeting what we want to configure as the default MAC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not meant to be merged as-is. There is intentionally a separate commit that replaces nomac and eases testing. Since there has only been one MAC layer, I didn't know how to integrate it properly, so I just replaced it.

@OlegHahm
Copy link
Member

Can we make this independent from gnrc?


netif_hdr = _gnrc_pktbuf_find(pkt, GNRC_NETTYPE_NETIF);
if(netif_hdr == NULL) {
LOG_WARNING("Reject packet: no NETIF header\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should sort out debugging messages from logging messages here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in the rest of the PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off course. I don't like that I made my own logging/debugging macros either. All debug messages will need a review when this is ready to be merged. For the time being these will stay as-is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, makes sense.

@daniel-k
Copy link
Member Author

Can we make this independent from gnrc?

I do think so. It only relies on netdev, netapi, netconf and timer interfaces and uses gnrc_pktnsnip_t which doesn't really need to be tied to gnrc imo.

@OlegHahm OlegHahm modified the milestone: Release NEXT MAJOR Sep 2, 2015
@daniel-k daniel-k force-pushed the mac_gnrc branch 7 times, most recently from e25303f to 430761b Compare September 24, 2015 14:47
@daniel-k daniel-k force-pushed the mac_gnrc branch 5 times, most recently from 9e03c4c to 7a7862c Compare October 1, 2015 09:51
@miri64
Copy link
Member

miri64 commented Oct 31, 2016

Feature freeze and still WIP -> postponed (but I hope to have it in soonish).

@miri64 miri64 modified the milestones: Release 2017.01, Release 2016.10 Oct 31, 2016
@zhuoshuguo
Copy link
Contributor

Hi, @daniel-k, could you please rebase Lw-MAC on the new master branch? I have recently built and merged a gnrc_mac module which contains some key MAC functionalities and parameters. Actually, gnrc_mac modularized the key components (like neighbor-list, tx-queue and rx-queue) that were extracted from Lw-MAC.

After rebasing on master, I will help to apply those new features to Lw-MAC, by pushing adaptation PRs to Lw-MAC. :-)

@daniel-k
Copy link
Member Author

daniel-k commented Jan 9, 2017

Hi @zhuoshuguo, will do but it may still take some days, depending on how extensive the rebasing will be. Thanks for already merging some parts :)

@zhuoshuguo
Copy link
Contributor

@daniel-k Thanks!
By the way, there is another request from my side: could you also split some parts of this PR that are not direct components of Lw-MAC, like your revisions (or new contributions) of lpm, wireshark into other PRs?
My another personal consideration is that, as the assignee of this PR, I am not familiar with them ;-/, sorry about that. By splitting them into other individual small PRs, other peoples who are more familiar with them can better review and ACK them. What do you think of this proposal? @emmanuelsearch @OlegHahm @miri64 :-)

@miri64
Copy link
Member

miri64 commented Jan 9, 2017

Splitting PRs by functionality is always a good idea, so 👍

@daniel-k
Copy link
Member Author

daniel-k commented Jan 9, 2017

Those things were never meant to be merged together with LwMAC, that's for example why there's an explicit merge commit.

Let's go through them one by one:

  • lpm: not my code and marked as a dependency in the description. Has been merged into master some time ago, so will go away after rebasing anyway
  • gdb: part of lpm merge commit, only there for convenience during work, has it's own PR, will not be merged
  • wireshark: I consider the Wireshark dissector part of this protocol and as such belongs into this PR. Merging it without LwMAC makes no sense
  • samr21-xpro code (11aa1cd): This commit is also temporary to test LwMAC with such boards, shouldn't be merged either

So in the end, there's nothing that should be splitted out of the PR. Any comments?

@miri64
Copy link
Member

miri64 commented Jan 9, 2017

wireshark: I consider the Wireshark dissector part of this protocol and as such belongs into this PR. Merging it without LwMAC makes no sense

but it could be merged as a follow-up.

@zhuoshuguo
Copy link
Contributor

@daniel-k Thanks, much more clear to me now. :-)

@OlegHahm
Copy link
Member

So, what exactly is missing?

@daniel-k
Copy link
Member Author

I just tried rebasing this onto the current master branch, but it looks like power management has sufficiently changed over time and seems incompatible to my current approach now ☹️

Any hints what has happened to lpm_prevent_sleep and if there's a replacement?

@OlegHahm
Copy link
Member

@haukepetersen, @kaspar030, can you take a look?

@zhuoshuguo
Copy link
Contributor

Ping~

@miri64
Copy link
Member

miri64 commented Jan 24, 2017

@haukepetersen @kaspar030 ping? But also due to feature freeze we need to postpone :(.

@miri64 miri64 modified the milestones: Release 2017.04, Release 2017.01 Jan 24, 2017
@haukepetersen
Copy link
Contributor

I can't really say much about the MAC layer stuff, but this PR seems to contain some unrelated items:

  • openocd fixes should be factored out
  • lpm does not exist anymore

@daniel-k
Copy link
Member Author

@haukepetersen

I can't really say much about the MAC layer stuff, but this PR seems to contain some unrelated items:

  • openocd fixes should be factored out
  • lpm does not exist anymore

No doubt and already discussed. The ping was more into the direction of:

Any hints what has happened to lpm_prevent_sleep and if there's a replacement?

@haukepetersen, @kaspar030, can you take a look?

If the power management has changed as much as it looked like on the first sight, I won't have the time to adapt the PR in the near future. Sorry, much to busy times at the moment :(

@zhuoshuguo
Copy link
Contributor

Hi, @daniel-k, to push Lw-MAC forward immediately, do you mind that I totally take over it?
I mean, if you don't mind, by utilizing and adapting your codes here, I will create a new PR (or several) that realizes the functionalities of Lw-MAC, and this PR here will be replaced and closed?

@daniel-k
Copy link
Member Author

Hi @zhuoshuguo, that would be totally fine! Sorry that I cannot spend time on this currently. Feel free to take it over, I thought that I would have proposed this already.

@miri64
Copy link
Member

miri64 commented Feb 17, 2017

Closed in favor for #6554.

@miri64 miri64 closed this Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable State: waiting for other PR State: The PR requires another PR to be merged first State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.