new network stack mini howto

Hey guys,

is there any kind of example on how to set up the new network stack as far as currently possible?

So many PR's, components, etc. and all I want is ping my node...

Kaspar

Hey Kaspar, Just take the current ng_icmpv6/feat/initial branch in my repo (PR’ed in #2555) + your favorite device driver. Start your device in a nomac thread (look into tests/driver_xbee for how to do it) and add ng_icmpv6_echo, ng_netbase and ng_nomac to your application’s modules. Currently you have to set up your local IP addresses by hand using ifconfig in the shell and you also have to populate the neighbor cache with the ncache command.

Then you can use the ping6 command to send echo requests. Echo relies are answered automatically in the background. If you want to dump them to the terminal register ng_pktdump for NG_NETTYPE_ICMPV6 (merge branch pktdump/feat/dump-ipv6 (#2741) for nicer output).

If you need 6LoWPAN, merge the branch ng_sixlowpan_frag/feat/initial (#2781) and add the module ng_sixlowpan_frag, but be aware that I need to test if the reassembly on receive is working, yet ;). 6LoWPAN needs to be initialized for the interface too. For now using ifconfig 6lo (or simply set the NG_IPV6_NETIF_FLAGS_SIXLOWPAN flag for the ng_ipv6_netif_t of your interface in your code). Hope this was helpful.

Cheers, Martine

Hey Martine,

thanks a lot, that was what I was looking for!

Just take the current ng_icmpv6/feat/initial branch in my repo (PR'ed in #2555) + your favorite device driver. Start your device in a nomac thread (look into tests/driver_xbee for how to do it) and add ng_icmpv6_echo, ng_netbase and ng_nomac to your application's modules. Currently you have to set up your local IP addresses by hand using ifconfig in the shell and you also have to populate the neighbor cache with the ncache command.

That's exactly what I needed. I can now ping6 a native instance of riot using the dev_eth+tap driver.

What I stumpled upon on the way:

- also have to populate the neighbour cache of the Linux box I used to ping from (doh)

- our native tap drivers take the mac address from the tap interface. if using the same tap interface on the host, the mac addresses collide. I solved this by just incrementing the last byte of tap's mac address. As tap mac addresses are random, that *should* be ok with 1:2^48 probability, right?

- (bug in icmpv6? [1])

It seems very reliable and quite fast: --snip-- [kaspar@localhost sys]$ sudo ping6 2001:db8::2 -f -c 100000 PING 2001:db8::2(2001:db8::2) 56 data bytes .. --- 2001:db8::2 ping statistics --- 100000 packets transmitted, 99998 received, 0% packet loss, time 5905ms rtt min/avg/max/mdev = 0.028/0.040/1.384/0.017 ms, ipg/ewma 0.059/0.045 ms [kaspar@localhost sys]$ --snip--

Kaspar

[1] https://github.com/RIOT-OS/RIOT/pull/2555/files#r28201992 )

Hi,