{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/36234833","id":36234833,"diff_hunk":"@@ -0,0 +1,598 @@\n+/*\n+ * Copyright (C) 2013 - 2014  INRIA.\n+ * Copyright (C) 2015 Cenk Gündoğan <cnkgndgn@gmail.com>\n+ *\n+ * This file is subject to the terms and conditions of the GNU Lesser General\n+ * Public License v2.1. See the file LICENSE in the top level directory for more\n+ * details.\n+ */\n+\n+/**\n+ * @{\n+ *\n+ * @file\n+ *\n+ * @author  Cenk Gündoğan <cnkgndgn@gmail.com>\n+ */\n+\n+#include \"net/ng_rpl.h\"\n+#include \"inet_ntop.h\"\n+\n+#define ENABLE_DEBUG    (0)\n+#include \"debug.h\"\n+\n+#if ENABLE_DEBUG\n+static char addr_str[NG_IPV6_ADDR_MAX_STR_LEN];\n+#endif\n+\n+#define NG_RPL_GROUNDED_SHIFT           (7)\n+#define NG_RPL_MOP_SHIFT                (3)\n+#define NG_RPL_OPT_DODAG_CONF_LEN       (14)\n+#define NG_RPL_SHIFTED_MOP_MASK         (0x7)\n+#define NG_RPL_PRF_MASK                 (0x7)\n+\n+void _ng_rpl_send(ng_pktsnip_t *pkt, ng_ipv6_addr_t *src, ng_ipv6_addr_t *dst,\n+        ng_ipv6_addr_t *dodag_id)\n+{\n+    ng_pktsnip_t *hdr;\n+    ng_ipv6_addr_t all_RPL_nodes = NG_IPV6_ADDR_ALL_RPL_NODES, ll_addr, *tmp = NULL;\n+    kernel_pid_t iface = ng_ipv6_netif_find_by_addr(NULL, &all_RPL_nodes);\n+    if (iface == KERNEL_PID_UNDEF) {\n+        DEBUG(\"RPL: no suitable interface found for this destination address\\n\");\n+        ng_pktbuf_release(pkt);\n+        return;\n+    }\n+\n+    if (src == NULL) {\n+        if (dodag_id != NULL) {\n+            tmp = ng_ipv6_netif_match_prefix(iface, dodag_id);\n+        }\n+        else if (dodag_id == NULL) {\n+            tmp = ng_ipv6_netif_find_best_src_addr(iface, &all_RPL_nodes);\n+        }\n+\n+        if (tmp == NULL) {\n+            DEBUG(\"RPL: no suitable src address found\\n\");\n+            ng_pktbuf_release(pkt);\n+            return;\n+        }\n+\n+        memcpy(&ll_addr, tmp, sizeof(ll_addr));\n+        ng_ipv6_addr_set_link_local_prefix(&ll_addr);\n+        src = &ll_addr;\n+    }\n+\n+    if (dst == NULL) {\n+        dst = &all_RPL_nodes;\n+    }\n+\n+    hdr = ng_ipv6_hdr_build(pkt, (uint8_t *)src, sizeof(ng_ipv6_addr_t), (uint8_t *)dst,\n+                            sizeof(ng_ipv6_addr_t));\n+\n+    if (hdr == NULL) {\n+        DEBUG(\"RPL: Send - no space left in packet buffer\\n\");\n+        ng_pktbuf_release(pkt);\n+        return;\n+    }\n+\n+    if (!ng_netapi_dispatch_send(NG_NETTYPE_IPV6, NG_NETREG_DEMUX_CTX_ALL,hdr)) {\n+        DEBUG(\"RPL: cannot send packet: no subscribers found.\\n\");\n+        ng_pktbuf_release(hdr);\n+    }\n+\n+}\n+\n+void ng_rpl_send_DIO(ng_rpl_dodag_t *dodag, ng_ipv6_addr_t *destination)\n+{\n+    if (dodag == NULL) {\n+        DEBUG(\"RPL: Error - trying to send DIO without being part of a dodag.\\n\");\n+        return;\n+    }\n+\n+    ng_pktsnip_t *pkt;\n+    ng_icmpv6_hdr_t *icmp;\n+    ng_rpl_dio_t *dio;\n+    ng_rpl_opt_dodag_conf_t *dodag_conf;\n+    uint8_t *pos;\n+    int size = sizeof(ng_icmpv6_hdr_t) + sizeof(ng_rpl_dio_t);\n+\n+    if ((dodag->dodag_conf_counter % 3) == 0) {\n+        size += sizeof(ng_rpl_opt_dodag_conf_t);\n+    }\n+\n+    if ((pkt = ng_icmpv6_build(NULL, NG_ICMPV6_RPL_CTRL, NG_RPL_ICMPV6_CODE_DIO, size)) == NULL) {\n+        DEBUG(\"RPL: Send DIO - no space left in packet buffer\\n\");\n+        return;\n+    }\n+\n+    icmp = (ng_icmpv6_hdr_t *)pkt->data;\n+    dio = (ng_rpl_dio_t *)(icmp + 1);\n+    pos = (uint8_t *) dio;\n+    dio->instance_id = dodag->instance->id;\n+    dio->version_number = dodag->version;\n+    dio->rank = byteorder_htons(dodag->my_rank);\n+    dio->g_mop_prf = (dodag->grounded << NG_RPL_GROUNDED_SHIFT) |\n+        (dodag->instance->mop << NG_RPL_MOP_SHIFT) | dodag->prf;\n+    dio->dtsn = dodag->dtsn;\n+    dio->flags = 0;\n+    dio->reserved = 0;\n+    dio->dodag_id = dodag->dodag_id;\n+\n+    pos += sizeof(*dio);\n+\n+    if ((dodag->dodag_conf_counter % 3) == 0) {\n+        dodag_conf = (ng_rpl_opt_dodag_conf_t *) pos;\n+        dodag_conf->type = NG_RPL_OPT_DODAG_CONF;\n+        dodag_conf->length = NG_RPL_OPT_DODAG_CONF_LEN;\n+        dodag_conf->flags_a_pcs = 0;\n+        dodag_conf->dio_int_doubl = dodag->dio_interval_doubl;\n+        dodag_conf->dio_int_min = dodag->dio_min;\n+        dodag_conf->dio_redun = dodag->dio_redun;\n+        dodag_conf->max_rank_inc = byteorder_htons(dodag->instance->max_rank_inc);\n+        dodag_conf->min_hop_rank_inc = byteorder_htons(dodag->instance->min_hop_rank_inc);\n+        dodag_conf->ocp = byteorder_htons(dodag->instance->of->ocp);\n+        dodag_conf->reserved = 0;\n+        dodag_conf->default_lifetime = dodag->default_lifetime;\n+        dodag_conf->lifetime_unit = byteorder_htons(dodag->lifetime_unit);\n+        pos += sizeof(*dodag_conf);\n+    }\n+\n+    dodag->dodag_conf_counter++;\n+    _ng_rpl_send(pkt, NULL, destination, &dodag->dodag_id);\n+}\n+\n+void ng_rpl_send_DIS(ng_rpl_dodag_t *dodag, ng_ipv6_addr_t *destination)\n+{\n+    (void) dodag;\n+    ng_pktsnip_t *pkt;\n+    ng_icmpv6_hdr_t *icmp;\n+    ng_rpl_dis_t *dis;\n+    /* TODO: Currently the DIS is too small so that wireshark complains about an incorrect\n+     * ethernet frame check sequence. In order to prevent this, 4 PAD1 options are added.\n+     * This will be addressed in follow-up PRs */\n+    int size = sizeof(ng_icmpv6_hdr_t) + sizeof(ng_rpl_dis_t) + 4;\n+\n+    if ((pkt = ng_icmpv6_build(NULL, NG_ICMPV6_RPL_CTRL, NG_RPL_ICMPV6_CODE_DIS, size)) == NULL) {\n+        DEBUG(\"RPL: Send DIS - no space left in packet buffer\\n\");\n+        return;\n+    }\n+\n+    icmp = (ng_icmpv6_hdr_t *)pkt->data;\n+    dis = (ng_rpl_dis_t *)(icmp + 1);\n+    dis->flags = 0;\n+    dis->reserved = 0;\n+    /* TODO: see above TODO */\n+    memset((dis + 1), 0, 4);\n+\n+    _ng_rpl_send(pkt, NULL, destination, (dodag ? &dodag->dodag_id : NULL));\n+}\n+\n+void ng_rpl_recv_DIS(ng_rpl_dis_t *dis, ng_ipv6_addr_t *src, ng_ipv6_addr_t *dst, uint16_t len)\n+{\n+    /* TODO handle Solicited Information Option */\n+    (void) dis;\n+    (void) len;\n+\n+    if (ng_ipv6_addr_is_multicast(dst)) {\n+        for (uint8_t i = 0; i < NG_RPL_DODAGS_NUMOF; ++i) {\n+            if (ng_rpl_dodags[i].state != 0) {\n+                trickle_reset_timer(&ng_rpl_dodags[i].trickle);\n+            }\n+        }\n+    }\n+    else {\n+        for (uint8_t i = 0; i < NG_RPL_DODAGS_NUMOF; ++i) {\n+            if (ng_rpl_dodags[i].state != 0) {\n+                ng_rpl_dodags[i].dodag_conf_counter = 0;\n+                ng_rpl_send_DIO(&ng_rpl_dodags[i], src);\n+            }\n+        }\n+    }\n+}\n+\n+bool _parse_options(ng_rpl_dodag_t *dodag, ng_rpl_opt_t *opt, uint16_t len, ng_ipv6_addr_t *src)\n+{\n+    uint16_t l = 0;\n+    ng_rpl_opt_target_t *first_target = NULL;\n+    while(l < len) {\n+        if ((opt->type != NG_RPL_OPT_PAD1) && (len < opt->length + sizeof(ng_rpl_opt_t) + l)) {\n+            /* return false to delete the dodag,\n+             * because former options may also contain errors */\n+            return false;\n+        }\n+\n+        switch(opt->type) {\n+            case (NG_RPL_OPT_PAD1): {\n+                DEBUG(\"RPL: PAD1 option parsed\\n\");\n+                l += 1;\n+                opt = (ng_rpl_opt_t *) (((uint8_t *) opt) + 1);\n+                continue;\n+            }\n+            case (NG_RPL_OPT_PADN): {\n+                DEBUG(\"RPL: PADN option parsed\\n\");\n+                break;\n+            }\n+            case (NG_RPL_OPT_DODAG_CONF): {\n+                DEBUG(\"RPL: DODAG CONF DIO option parsed\\n\");\n+                ng_rpl_opt_dodag_conf_t *dc = (ng_rpl_opt_dodag_conf_t *) opt;\n+                ng_rpl_of_t *of = ng_rpl_get_of_for_ocp(byteorder_ntohs(dc->ocp));\n+                if (of != NULL) {\n+                    dodag->instance->of = of;\n+                }\n+                else {\n+                    DEBUG(\"RPL: Unsupported OCP 0x%02x\\n\", dc->ocp);\n+                    dodag->instance->of = ng_rpl_get_of_for_ocp(NG_RPL_DEFAULT_OCP);\n+                }\n+                dodag->dio_interval_doubl = dc->dio_int_doubl;\n+                dodag->dio_min = dc->dio_int_min;\n+                dodag->dio_redun = dc->dio_redun;\n+                dodag->instance->max_rank_inc = byteorder_ntohs(dc->max_rank_inc);\n+                dodag->instance->min_hop_rank_inc = byteorder_ntohs(dc->min_hop_rank_inc);\n+                dodag->default_lifetime = dc->default_lifetime;\n+                dodag->lifetime_unit = byteorder_ntohs(dc->lifetime_unit);\n+                dodag->trickle.Imin = (1 << dodag->dio_min);\n+                dodag->trickle.Imax = dodag->dio_interval_doubl;\n+                dodag->trickle.k = dodag->dio_redun;\n+                break;\n+            }\n+            case (NG_RPL_OPT_TARGET): {\n+                DEBUG(\"RPL: RPL TARGET DAO option parsed\\n\");\n+                kernel_pid_t if_id = ng_ipv6_netif_find_by_prefix(NULL, &dodag->dodag_id);\n+                if (if_id == KERNEL_PID_UNDEF) {\n+                    DEBUG(\"RPL: no interface found for the configured DODAG id\\n\");\n+                    return false;\n+                }\n+\n+                ng_rpl_opt_target_t *target = (ng_rpl_opt_target_t *) opt;\n+                if (first_target == NULL) {\n+                    first_target = target;\n+                }\n+\n+                fib_add_entry(if_id, target->target.u8, sizeof(ng_ipv6_addr_t), AF_INET6, src->u8,\n+                        sizeof(ng_ipv6_addr_t), AF_INET6,\n+                        (dodag->default_lifetime * dodag->lifetime_unit) * SEC_IN_MS);\n+                break;\n+            }\n+            case (NG_RPL_OPT_TRANSIT): {\n+                DEBUG(\"RPL: RPL TRANSIT INFO DAO option parsed\\n\");\n+                ng_rpl_opt_transit_t *transit = (ng_rpl_opt_transit_t *) opt;\n+                if (first_target == NULL) {\n+                    DEBUG(\"RPL: Encountered a RPL TRANSIT DAO option without \\\n+a preceding RPL TARGET DAO option\\n\");\n+                    break;\n+                }\n+\n+                do {\n+                    fib_update_entry(first_target->target.u8, sizeof(ng_ipv6_addr_t),\n+                            src->u8, sizeof(ng_ipv6_addr_t), AF_INET6,\n+                            (transit->path_lifetime * dodag->lifetime_unit * SEC_IN_MS));\n+                    first_target = (ng_rpl_opt_target_t *) (((uint8_t *) (first_target)) +\n+                        sizeof(ng_rpl_opt_t) + first_target->length);\n+                }\n+                while (first_target->type == NG_RPL_OPT_TARGET);\n+\n+                first_target = NULL;\n+                break;\n+            }\n+        }\n+        l += opt->length + sizeof(ng_rpl_opt_t);\n+        opt = (ng_rpl_opt_t *) (((uint8_t *) (opt + 1)) + opt->length);\n+    }\n+    return true;\n+}\n+\n+void ng_rpl_recv_DIO(ng_rpl_dio_t *dio, ng_ipv6_addr_t *src, uint16_t len)\n+{\n+    ng_rpl_instance_t *inst = NULL;\n+    ng_rpl_dodag_t *dodag = NULL;\n+\n+    len -= (sizeof(ng_rpl_dio_t) + sizeof(ng_icmpv6_hdr_t));\n+\n+    if (ng_rpl_instance_add(dio->instance_id, &inst)) {\n+        inst->mop = (dio->g_mop_prf >> NG_RPL_MOP_SHIFT) & NG_RPL_SHIFTED_MOP_MASK;\n+        inst->of = ng_rpl_get_of_for_ocp(NG_RPL_DEFAULT_OCP);\n+    }\n+    else if (inst == NULL) {\n+        DEBUG(\"RPL: Could not allocate a new instance.\\n\");\n+        return;\n+    }\n+\n+    if ((byteorder_ntohs(dio->rank) == NG_RPL_INFINITE_RANK) &&\n+            (ng_rpl_dodag_get(inst, &dio->dodag_id) == NULL)) {\n+        DEBUG(\"RPL: ignore INFINITE_RANK DIO when we are not part of this DODAG\\n\");\n+        ng_rpl_instance_remove(inst);\n+        return;\n+    }\n+\n+    if (ng_rpl_dodag_add(inst, &dio->dodag_id, &dodag)) {\n+        DEBUG(\"RPL: Joined DODAG (%s).\\n\",\n+                ng_ipv6_addr_to_str(addr_str, &dio->dodag_id, sizeof(addr_str)));\n+\n+        if(!_parse_options(dodag, (ng_rpl_opt_t *)(dio + 1), len, NULL)) {\n+            ng_rpl_dodag_remove(dodag);\n+            return;\n+        }\n+\n+        ng_rpl_parent_t *parent = NULL;\n+\n+        if (!ng_rpl_parent_add_by_addr(dodag, src, &parent) && (parent == NULL)) {\n+            DEBUG(\"RPL: Could not allocate new parent.\\n\");\n+            ng_rpl_dodag_remove(dodag);\n+            return;\n+        }\n+\n+        trickle_start(ng_rpl_pid, &dodag->trickle, NG_RPL_MSG_TYPE_TRICKLE_INTERVAL,\n+                      NG_RPL_MSG_TYPE_TRICKLE_CALLBACK, (1 << dodag->dio_min),\n+                      dodag->dio_interval_doubl, dodag->dio_redun);\n+        dodag->version = dio->version_number;\n+        ng_rpl_delay_dao(dodag);\n+        parent->rank = byteorder_ntohs(dio->rank);\n+        ng_rpl_parent_update(dodag, parent);\n+        return;\n+    }\n+    else if (dodag == NULL) {\n+        DEBUG(\"RPL: Could not allocate a new DODAG.\\n\");\n+        if (inst->dodags == NULL) {\n+            ng_rpl_instance_remove(inst);\n+        }\n+        return;\n+    }\n+\n+    if (dodag->instance->mop !=\n+            ((dio->g_mop_prf >> NG_RPL_MOP_SHIFT) & NG_RPL_SHIFTED_MOP_MASK)) {\n+        DEBUG(\"RPL: invalid MOP for this instance.\\n\");\n+        return;\n+    }\n+\n+    if (NG_RPL_COUNTER_GREATER_THAN(dio->version_number, dodag->version)) {\n+        if (dodag->node_status == NG_RPL_ROOT_NODE) {\n+            dodag->version = NG_RPL_COUNTER_INCREMENT(dio->version_number);\n+            trickle_reset_timer(&dodag->trickle);\n+        }\n+        else {\n+            dodag->version = dio->version_number;\n+            ng_rpl_local_repair(dodag);\n+        }\n+    }\n+    else if (NG_RPL_COUNTER_GREATER_THAN(dodag->version, dio->version_number)) {\n+        trickle_reset_timer(&dodag->trickle);\n+        return;\n+    }\n+\n+    if (dodag->node_status == NG_RPL_ROOT_NODE) {\n+        if (byteorder_ntohs(dio->rank) != NG_RPL_INFINITE_RANK) {\n+            trickle_increment_counter(&dodag->trickle);\n+        }\n+        return;\n+    }\n+\n+    dodag->grounded = dio->g_mop_prf >> NG_RPL_GROUNDED_SHIFT;\n+    dodag->prf = dio->g_mop_prf & NG_RPL_PRF_MASK;\n+\n+    ng_rpl_parent_t *parent = NULL;\n+\n+    if (!ng_rpl_parent_add_by_addr(dodag, src, &parent) && (parent == NULL)) {\n+        DEBUG(\"RPL: Could not allocate new parent.\\n\");\n+        if (dodag->parents == NULL) {\n+            ng_rpl_dodag_remove(dodag);\n+        }\n+        return;\n+    }\n+    else if (parent) {\n+        trickle_increment_counter(&dodag->trickle);\n+    }\n+\n+    parent->rank = byteorder_ntohs(dio->rank);\n+\n+    ng_rpl_parent_update(dodag, parent);\n+\n+    if (parent->state != 0) {\n+        if (dodag->parents && (parent == dodag->parents) && (parent->dtsn != dio->dtsn)) {\n+            ng_rpl_delay_dao(dodag);\n+        }\n+        parent->dtsn = dio->dtsn;\n+\n+        if(!_parse_options(dodag, (ng_rpl_opt_t *)(dio + 1), len, NULL)) {\n+            ng_rpl_dodag_remove(dodag);\n+            return;\n+        }\n+    }\n+}\n+\n+void _dao_fill_target(ng_rpl_opt_target_t *target, ng_ipv6_addr_t *addr)\n+{\n+    target->type = NG_RPL_OPT_TARGET;\n+    target->length = sizeof(target->flags) + sizeof(target->prefix_length) + sizeof(target->target);\n+    target->flags = 0;\n+    target->prefix_length = 128;\n+    target->target = *addr;\n+}\n+\n+void ng_rpl_send_DAO(ng_rpl_dodag_t *dodag, ng_ipv6_addr_t *destination, uint8_t lifetime)\n+{\n+    size_t dst_size = NG_RPL_PARENTS_NUMOF;\n+    fib_destination_set_entry_t fib_dest_set[NG_RPL_PARENTS_NUMOF];\n+\n+    if (dodag == NULL) {\n+        DEBUG(\"RPL: Error - trying to send DIO without being part of a dodag.\\n\");","path":"sys/net/routing/ng_rpl/ng_rpl_control_messages.c","position":417,"original_position":417,"commit_id":"03dc8bf5b6481095071be2253bfe1d61b5ed0234","original_commit_id":"03dc8bf5b6481095071be2253bfe1d61b5ed0234","user":{"login":"gebart","id":317506,"avatar_url":"https://avatars.githubusercontent.com/u/317506?v=3","gravatar_id":"","url":"https://api.github.com/users/gebart","html_url":"https://github.com/gebart","followers_url":"https://api.github.com/users/gebart/followers","following_url":"https://api.github.com/users/gebart/following{/other_user}","gists_url":"https://api.github.com/users/gebart/gists{/gist_id}","starred_url":"https://api.github.com/users/gebart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gebart/subscriptions","organizations_url":"https://api.github.com/users/gebart/orgs","repos_url":"https://api.github.com/users/gebart/repos","events_url":"https://api.github.com/users/gebart/events{/privacy}","received_events_url":"https://api.github.com/users/gebart/received_events","type":"User","site_admin":false},"body":"s/DIO/DAO/","created_at":"2015-08-04T20:07:24Z","updated_at":"2015-08-04T20:07:24Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/3050#discussion_r36234833","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/36234833"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/3050#discussion_r36234833"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050","id":36066891,"html_url":"https://github.com/RIOT-OS/RIOT/pull/3050","diff_url":"https://github.com/RIOT-OS/RIOT/pull/3050.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/3050.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3050","number":3050,"state":"open","locked":false,"title":"ng_rpl: port to the new network stack","user":{"login":"cgundogan","id":739129,"avatar_url":"https://avatars.githubusercontent.com/u/739129?v=3","gravatar_id":"","url":"https://api.github.com/users/cgundogan","html_url":"https://github.com/cgundogan","followers_url":"https://api.github.com/users/cgundogan/followers","following_url":"https://api.github.com/users/cgundogan/following{/other_user}","gists_url":"https://api.github.com/users/cgundogan/gists{/gist_id}","starred_url":"https://api.github.com/users/cgundogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgundogan/subscriptions","organizations_url":"https://api.github.com/users/cgundogan/orgs","repos_url":"https://api.github.com/users/cgundogan/repos","events_url":"https://api.github.com/users/cgundogan/events{/privacy}","received_events_url":"https://api.github.com/users/cgundogan/received_events","type":"User","site_admin":false},"body":"~~Depends on: #2783 and #2818~~\r\n\r\nThis PR introduces RPL for the new network stack. I used the old RPL implementation as a blueprint and copied code blocks, which could be reused.\r\n\r\nFor a better internal dodag management I made use of `utlist.h` (linked list).\r\nThus, it was quite easy to adopt the code to support multiple dodags and/or instances.\r\n\r\nFurthermore, I changed the parsing of control packets. The old implementation did use a mediary data structure to parse all the information and then assign them to the internal dodag structure. I completely removed this mediary step and operate directly on the internal data structures.\r\n\r\nWhile adopting the code, I found small discrepancies betwen the implementation and the RFC. I tried to correct them to the best of my knowledge.\r\n\r\nThis port is far from being complete, as I only included the `Storing` mode of operation\r\nMissing things:\r\n\r\n- [ ] Non-Storing Mode of Operation\r\n    - [ ] Source Routing Header missing [RFC6554](https://tools.ietf.org/html/rfc6554) (see also #2898)\r\n- [ ] ETX/MrHof is not included, because ETX needs to be ported to the new network stack separately\r\n- [ ] some message options are missing, like the Prefix Information Object (in DIOs) #3489 \r\n- [ ] RPL Information Option missing [RFC6553](https://tools.ietf.org/html/rfc6553)\r\n\r\nI did all my testing with the `ng_nativenet` implementation by rebasing this to the branch of @kaspar030 #2776 and then use the test application in `./tests/driver_netdev_eth/`.\r\nThere I modifid the `Makefile` to include `ng_ipv6_default` and `ng_rpl`.\r\n\r\nWhen starting two to four nodes (tap0..tap3), I first have to add an IPv6 address to the nodes and can then initialize RPL on the given interface.\r\n```\r\nifconfig 5 add 2001:db8::x/64\r\nrpl init 5\r\n```\r\nPlease make sure, that you use the same prefix part for all nodes.\r\n\r\nOn one node I create a DODAG by issuing: `rpl root 1 2001:db8::x`, where `1` is the instance id by choice and `2001:db8::x` the dodag id. Note that you should not use the prefix notation (`*/xx`) like I did for `ifconfig` here.\r\n\r\n`rpl` shows some basic information about the dodags and `rpl help` will display some more commands, like deleting/adding dodags, starting/stoping trickle timers, sending DIS etc.\r\n\r\nI would like to test this on some iotlab m3s, but I don't know how. Could somebody point me to a test/example application, which I can use as a baseline?\r\n\r\n@OlegHahm @BytesGalore @authmillenon @gebart @Lotterleben @haukepetersen @emmanuelsearch and basically everyone else: please help me by reviewing this code of a Kraken...\r\n\r\n@authmillenon you should especially look into the communication with the network layer part, because I do not know if I implemented it the right way - it works though.","created_at":"2015-05-22T20:38:29Z","updated_at":"2015-08-04T20:07:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"257755cb6e73e4e3c34ea1bfe6d3d9138bf63602","assignee":{"login":"Lotterleben","id":581552,"avatar_url":"https://avatars.githubusercontent.com/u/581552?v=3","gravatar_id":"","url":"https://api.github.com/users/Lotterleben","html_url":"https://github.com/Lotterleben","followers_url":"https://api.github.com/users/Lotterleben/followers","following_url":"https://api.github.com/users/Lotterleben/following{/other_user}","gists_url":"https://api.github.com/users/Lotterleben/gists{/gist_id}","starred_url":"https://api.github.com/users/Lotterleben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lotterleben/subscriptions","organizations_url":"https://api.github.com/users/Lotterleben/orgs","repos_url":"https://api.github.com/users/Lotterleben/repos","events_url":"https://api.github.com/users/Lotterleben/events{/privacy}","received_events_url":"https://api.github.com/users/Lotterleben/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/12","html_url":"https://github.com/RIOT-OS/RIOT/milestones/Release%202015.06","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/12/labels","id":1088995,"number":12,"title":"Release 2015.06","description":"This release aims mainly to include the brand new network stack.","creator":{"login":"OlegHahm","id":1590423,"avatar_url":"https://avatars.githubusercontent.com/u/1590423?v=3","gravatar_id":"","url":"https://api.github.com/users/OlegHahm","html_url":"https://github.com/OlegHahm","followers_url":"https://api.github.com/users/OlegHahm/followers","following_url":"https://api.github.com/users/OlegHahm/following{/other_user}","gists_url":"https://api.github.com/users/OlegHahm/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegHahm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegHahm/subscriptions","organizations_url":"https://api.github.com/users/OlegHahm/orgs","repos_url":"https://api.github.com/users/OlegHahm/repos","events_url":"https://api.github.com/users/OlegHahm/events{/privacy}","received_events_url":"https://api.github.com/users/OlegHahm/received_events","type":"User","site_admin":false},"open_issues":63,"closed_issues":252,"state":"open","created_at":"2015-04-29T10:11:27Z","updated_at":"2015-08-03T20:27:08Z","due_on":"2015-06-29T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050/comments","review_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3050/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/03dc8bf5b6481095071be2253bfe1d61b5ed0234","head":{"label":"cgundogan:ng_rpl_fib","ref":"ng_rpl_fib","sha":"03dc8bf5b6481095071be2253bfe1d61b5ed0234","user":{"login":"cgundogan","id":739129,"avatar_url":"https://avatars.githubusercontent.com/u/739129?v=3","gravatar_id":"","url":"https://api.github.com/users/cgundogan","html_url":"https://github.com/cgundogan","followers_url":"https://api.github.com/users/cgundogan/followers","following_url":"https://api.github.com/users/cgundogan/following{/other_user}","gists_url":"https://api.github.com/users/cgundogan/gists{/gist_id}","starred_url":"https://api.github.com/users/cgundogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgundogan/subscriptions","organizations_url":"https://api.github.com/users/cgundogan/orgs","repos_url":"https://api.github.com/users/cgundogan/repos","events_url":"https://api.github.com/users/cgundogan/events{/privacy}","received_events_url":"https://api.github.com/users/cgundogan/received_events","type":"User","site_admin":false},"repo":{"id":19483231,"name":"RIOT","full_name":"cgundogan/RIOT","owner":{"login":"cgundogan","id":739129,"avatar_url":"https://avatars.githubusercontent.com/u/739129?v=3","gravatar_id":"","url":"https://api.github.com/users/cgundogan","html_url":"https://github.com/cgundogan","followers_url":"https://api.github.com/users/cgundogan/followers","following_url":"https://api.github.com/users/cgundogan/following{/other_user}","gists_url":"https://api.github.com/users/cgundogan/gists{/gist_id}","starred_url":"https://api.github.com/users/cgundogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgundogan/subscriptions","organizations_url":"https://api.github.com/users/cgundogan/orgs","repos_url":"https://api.github.com/users/cgundogan/repos","events_url":"https://api.github.com/users/cgundogan/events{/privacy}","received_events_url":"https://api.github.com/users/cgundogan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cgundogan/RIOT","description":"RIOT -  The friendly OS for IoT","fork":true,"url":"https://api.github.com/repos/cgundogan/RIOT","forks_url":"https://api.github.com/repos/cgundogan/RIOT/forks","keys_url":"https://api.github.com/repos/cgundogan/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cgundogan/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cgundogan/RIOT/teams","hooks_url":"https://api.github.com/repos/cgundogan/RIOT/hooks","issue_events_url":"https://api.github.com/repos/cgundogan/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/cgundogan/RIOT/events","assignees_url":"https://api.github.com/repos/cgundogan/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/cgundogan/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/cgundogan/RIOT/tags","blobs_url":"https://api.github.com/repos/cgundogan/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cgundogan/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cgundogan/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/cgundogan/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cgundogan/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/cgundogan/RIOT/languages","stargazers_url":"https://api.github.com/repos/cgundogan/RIOT/stargazers","contributors_url":"https://api.github.com/repos/cgundogan/RIOT/contributors","subscribers_url":"https://api.github.com/repos/cgundogan/RIOT/subscribers","subscription_url":"https://api.github.com/repos/cgundogan/RIOT/subscription","commits_url":"https://api.github.com/repos/cgundogan/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/cgundogan/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/cgundogan/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/cgundogan/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/cgundogan/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/cgundogan/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cgundogan/RIOT/merges","archive_url":"https://api.github.com/repos/cgundogan/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cgundogan/RIOT/downloads","issues_url":"https://api.github.com/repos/cgundogan/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/cgundogan/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/cgundogan/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/cgundogan/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cgundogan/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/cgundogan/RIOT/releases{/id}","created_at":"2014-05-06T06:16:02Z","updated_at":"2015-05-08T17:29:07Z","pushed_at":"2015-08-04T18:12:48Z","git_url":"git://github.com/cgundogan/RIOT.git","ssh_url":"git@github.com:cgundogan/RIOT.git","clone_url":"https://github.com/cgundogan/RIOT.git","svn_url":"https://github.com/cgundogan/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":20778,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RIOT-OS:master","ref":"master","sha":"ecf0f96ce4a4f009a24d5d80cecfcd799c204808","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"repo":{"id":7370241,"name":"RIOT","full_name":"RIOT-OS/RIOT","owner":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIOT-OS/RIOT","description":"RIOT -  The friendly OS for IoT","fork":false,"url":"https://api.github.com/repos/RIOT-OS/RIOT","forks_url":"https://api.github.com/repos/RIOT-OS/RIOT/forks","keys_url":"https://api.github.com/repos/RIOT-OS/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIOT-OS/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIOT-OS/RIOT/teams","hooks_url":"https://api.github.com/repos/RIOT-OS/RIOT/hooks","issue_events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/events","assignees_url":"https://api.github.com/repos/RIOT-OS/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/RIOT-OS/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/tags","blobs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/RIOT-OS/RIOT/languages","stargazers_url":"https://api.github.com/repos/RIOT-OS/RIOT/stargazers","contributors_url":"https://api.github.com/repos/RIOT-OS/RIOT/contributors","subscribers_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscribers","subscription_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscription","commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIOT-OS/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/RIOT-OS/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIOT-OS/RIOT/merges","archive_url":"https://api.github.com/repos/RIOT-OS/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIOT-OS/RIOT/downloads","issues_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/RIOT-OS/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/RIOT-OS/RIOT/releases{/id}","created_at":"2012-12-29T20:38:40Z","updated_at":"2015-08-04T11:08:54Z","pushed_at":"2015-08-04T19:15:39Z","git_url":"git://github.com/RIOT-OS/RIOT.git","ssh_url":"git@github.com:RIOT-OS/RIOT.git","clone_url":"https://github.com/RIOT-OS/RIOT.git","svn_url":"https://github.com/RIOT-OS/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":123226,"stargazers_count":463,"watchers_count":463,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":351,"mirror_url":null,"open_issues_count":392,"forks":351,"open_issues":392,"watchers":463,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/3050"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3050"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3050/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050/comments"},"review_comment":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3050/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/03dc8bf5b6481095071be2253bfe1d61b5ed0234"}}}}