PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/core/net/ipv6/multicast/README.md

https://gitlab.com/rdeterre/contiki
Markdown | 120 lines | 91 code | 29 blank | 0 comment | 0 complexity | 3bcc87a2c85822a81e4b8e10019f5bb5 MD5 | raw file
  1. README file for Contiki's IPv6 multicast core
  2. Author: George Oikonomou
  3. What does it do
  4. ===============
  5. These files, alongside some core modifications, add support for IPv6 multicast
  6. to contiki's uIPv6 engine.
  7. Currently, three modes are supported:
  8. * 'Enhanced Stateless Multicast RPL Forwarding' (ESMRF)
  9. ESMRF is an enhanced version of the SMRF engine with the aim
  10. of resolving the sending limitation of SMRF to allow any node
  11. within the DODAG to send multicast traffic up and down the RPL tree.
  12. ESMRF is documented here:
  13. http://dl.acm.org/citation.cfm?id=2753479
  14. * 'Stateless Multicast RPL Forwarding' (SMRF)
  15. RPL in MOP 3 handles group management as per the RPL docs,
  16. SMRF is a lightweight engine which handles datagram forwarding.
  17. SMRF is documented here:
  18. http://dx.doi.org/10.1007/s11277-013-1250-5
  19. and here:
  20. http://dx.doi.org/10.1109/PerComW.2012.6197494
  21. * 'Multicast Forwarding with Trickle' according to the algorithm described
  22. in the internet draft:
  23. http://tools.ietf.org/html/draft-ietf-roll-trickle-mcast
  24. The version of this draft that's currently implementated is documented
  25. in `roll-tm.h`
  26. More engines can (and hopefully will) be added in the future. The first
  27. addition is most likely going to be an updated implementation of MPL
  28. The Big Gotcha
  29. ==============
  30. Currently we only support traffic originating and destined inside a single 6LoWPAN
  31. To be able to send multicast traffic from the internet to 6LoWPAN nodes or the other
  32. way round, we need border routers or other gateway devices to be able to achieve
  33. the following:
  34. * Add/Remove Trickle Multicast, RPL or other HBHO headers as necessary for datagrams
  35. entering / exiting the 6LoWPAN
  36. * Advertise multicast group membership to the internet (e.g. with MLD)
  37. These are currently not implemented and are in the ToDo list. Contributions welcome.
  38. Where to Start
  39. ==============
  40. The best place in `examples/ipv6/multicast`
  41. There is a cooja example demonstrating basic functionality
  42. How to Use
  43. ==========
  44. Look in `core/net/ipv6/multicast/uip-mcast6-engines.h` for a list of supported
  45. multicast engines.
  46. To turn on multicast support, add this line in your `project-` or `contiki-conf.h`
  47. #define UIP_MCAST6_CONF_ENGINE xyz
  48. where xyz is a value from `uip-mcast6-engines.h`
  49. To disable:
  50. #define UIP_MCAST6_CONF_ENGINE 0
  51. You also need to make sure the multicast code gets built. Your example's
  52. (or platform's) Makefile should include this:
  53. MODULES += core/net/ipv6/multicast
  54. How to extend
  55. =============
  56. Let's assume you want to write an engine called foo.
  57. The multicast API defines a multicast engine driver in a fashion similar to
  58. the various NETSTACK layer drivers. This API defines functions for basic
  59. multicast operations (init, in, out).
  60. In order to extend multicast with a new engine, perform the following steps:
  61. - Open `uip-mcast6-engines.h` and assign a unique integer code to your engine
  62. #define UIP_MCAST6_ENGINE_FOO xyz
  63. - Include your engine's `foo.h`
  64. - In `foo.c`, implement:
  65. * `init()`
  66. * `in()`
  67. * `out()`
  68. * Define your driver like so:
  69. `const struct uip_mcast6_driver foo_driver = { ... }`
  70. - If you want to maintain stats:
  71. * Standard multicast stats are maintained in `uip_mcast6_stats`. Don't access
  72. this struct directly, use the macros provided in `uip-mcast6-stats.h` instead
  73. * You can add your own stats extensions. To do so, declare your own stats
  74. struct in your engine's module, e.g `struct foo_stats`
  75. * When you initialise the stats module with `UIP_MCAST6_STATS_INIT`, pass
  76. a pointer to your stats variable as the macro's argument.
  77. An example of how to extend multicast stats, look at the ROLL TM engine
  78. - Open `uip-mcast6.h` and add a section in the `#if` spree. This aims to
  79. configure the uIPv6 core. More specifically, you need to:
  80. * Specify if you want to put RPL in MOP3 by defining
  81. `RPL_WITH_MULTICAST`: 1: MOP 3, 0: non-multicast MOP
  82. * Define your engine details
  83. #define UIP_MCAST6 foo_driver
  84. #define UIP_MCAST6_STATS foo_stats
  85. typedef struct foo_stats uip_mcast6_stats_t;
  86. * Optionally, add a configuration check block to stop builds when the
  87. configuration is not sane.
  88. If you need your engine to perform operations not supported by the generic
  89. UIP_MCAST6 API, you will have to hook those in the uip core manually. As an
  90. example, see how the core is modified so that it can deliver ICMPv6 datagrams
  91. to the ROLL TM engine.