[riot-devel] Network Stack Question
haoyang.yu at rutgers.edu
Tue Oct 27 21:16:53 CET 2015
Thank you so much for your patient answer!
I changed hundreds of codes in NETWORK stack for the example of default, which implemented txtsnd and echo a ACK back to the source. However, there is still some puzzles hang over my head:
#ifdef MODULE_GNRC_NETIF vs #ifdef MODULE_NETIF: Are they the same definition of MODULE_GNRC_NETIF and MODULE_NETIF?
I understand one packet is formed by many snipts which use linked list. gnrc_pktbuf_add() is used to form a packet. I add the hardware address on linked layer using gnrc_pkbuf_add with the data payload. For layer 3, layer4, is it okay still use gnrc_pktbuf_add() to link the layer 3, layer 4 header?
I am not fully understand the type of GNRC_NETTYPE_UNDEF, is it just the data payload? And also for the GNRC_NETTYPE_NETIF, is it the layer 2 snipt type?
Because my main focus will be grab the layer 2 packet and the implement a new protocol I defined on for layer 3, layer 4 in ICN. Thank you for your help!
my changes: https://github.com/haoyangyu/RIOT/commits?author=haoyangyu
> On Oct 25, 2015, at 11:57, Martine Lenders <authmillenon at gmail.com> wrote:
> Hi Haoyang,
> 2015-10-24 21:17 GMT+02:00 Haoyang Yu <haoyang.yu at rutgers.edu <mailto:haoyang.yu at rutgers.edu>>:
> where can I find the txtsnd source codes?
> `txtsnd` is a default shell command for the `gnrc_netif` module pulled in by the `shell_commands` module. As such you can find it in `sys/shell/commands/sc_netif.c`.
> (When I'm not sure were something is located in RIOT, I use `git grep` ;-))
> Does packet txtsnd sent is through RF based on GNRC protocol, not the serial right?
> Depends, normally (for physical boards) it sends over RF. On native there is no RF, so we use TAP   to virtualize an Ethernet connection. Since native doesn't have a serial line either (since it is just a process in the host OS, utilizing normal stdin/stdout) we decided to "misuse" the PORT environment variable for native to point to the TAP instead to the serial device (so that might be where your confusion stems from). For physical boards you can however also send packets via serial line, if you wish to (for a border router e.g.), using SLIP . See my last mail for how to activate that in RIOT.
>  https://www.kernel.org/doc/Documentation/networking/tuntap.txt <https://www.kernel.org/doc/Documentation/networking/tuntap.txt>
>  https://en.wikipedia.org/wiki/TUN/TAP <https://en.wikipedia.org/wiki/TUN/TAP>
>  https://tools.ietf.org/html/rfc1055 <https://tools.ietf.org/html/rfc1055>_______________________________________________
> devel mailing list
> devel at riot-os.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel