Re: [riot-devel] Network Stack Question

2015-10-27 Thread Haoyang Yu
Hi Martine,

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

Best,
Haoyang
> On Oct 25, 2015, at 11:57, Martine Lenders  wrote:
> 
> Hi Haoyang,
> 
> 2015-10-24 21:17 GMT+02:00 Haoyang Yu  >:
> 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 [1] [2] 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 [3]. See my last mail for how to activate 
> that in RIOT.
> 
> [1] https://www.kernel.org/doc/Documentation/networking/tuntap.txt 
> 
> [2] https://en.wikipedia.org/wiki/TUN/TAP 
> 
> [3] https://tools.ietf.org/html/rfc1055 
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-25 Thread Martine Lenders
Hi Haoyang,

2015-10-24 21:17 GMT+02:00 Haoyang Yu :

>
>1. 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` ;-))

>
>1. 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 [1] [2] 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 [3]. See my last mail for how to
activate that in RIOT.

[1] https://www.kernel.org/doc/Documentation/networking/tuntap.txt
[2] https://en.wikipedia.org/wiki/TUN/TAP
[3] https://tools.ietf.org/html/rfc1055
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-24 Thread Haoyang Yu
Thanks for your answer!

I think I can send data between with each other, but I am puzzled by the 
realization, 

where can I find the txtsnd source codes?
Does packet txtsnd sent is through RF based on GNRC protocol, not the serial 
right? 

Thanks,
Haoyang


> On Oct 23, 2015, at 15:34, Martine Lenders  wrote:
> 
> Hi Haoyang,
> 
> 
> 2015-10-23 20:08 GMT+02:00 Haoyang Yu  >:
> txtsnd: I cannot set the interface, if I use tap0, which will echo: error: 
> invalid interface given. 
> You need to use the interface on the node, not the TAP. The TAP is the 
> endpoint on the host system for the "cable" you draw between host and native 
> node. Use `ifconfig` to see what interface to use (as documented in the 
> default example's README [1]).
> I found the tutorial that said using addr, but I do not have the addr command 
> when I use the R21 board.
> Can you point us to this tutorial? The addr command was dropped for the last 
> release. Everything can be done with `ifconfig` now (there is already an 
> address configured though). 
> And what is the mean for interface for txtsnd to use, if I have 
> /dev/tty.usbmodem* MCU device
> I don't know what you mean by that? If you mean it in the same way as you 
> said you used `tap0` on the native node, see above, if you want to send 
> actual packets over the serial line, have a look at SLIP [2] (or the 
> gnrc_border_router example about how to use it).
>  
> [1] https://github.com/RIOT-OS/RIOT/tree/2015.09/examples/default#networking 
> 
> [2] http://doc.riot-os.org/group__net__gnrc__slip.html 
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-23 Thread Oliver Hahm
Hi Haoyang,

welcome to RIOT!

> I forward this mail to my colleague Oleg, who is actually doing the same
> thing - so I guess he is probably the best one to help you!

Since you already found the mailing list, I took the liberty of replying here
instead.

Yes, I'm working indeed on CCN for RIOT. Until recently, there was a port of
ccn-lite [1] in RIOT. See for example our second last release 2014.12 [2].
However, during refactoring the network stack and due to the increasing
divergence of RIOT's ccn-lite port and the upstream version, we decided to
remove it temporarily and re-integrate it. Hence, I'm currently working
towards this re-integration as a package [3].

> @Oleg: do you have already code for CCN-lite @ netapi?

The code I have for now is probably of very limited use for other people, but
I think the main question for you is how to interact with layer 2. Hence, I
would advice to take a look at the default example [4] which provides a very
simple example for dealing with L2 transmissions. You probably also want to
look at the documentation for the gnrc network stack, most particular the
documentation of the netapi [5] and the registry [6]. There's also some
ongoing effort on some more high-level documentation in [7].

Please, don't hesitate to ask more questions here on the list or on IRC.

Cheers,
Oleg

[1] http://www.ccn-lite.net/
https://github.com/cn-uofbasel/ccn-lite
[2] https://github.com/RIOT-OS/RIOT/releases/tag/2014.12
[3] https://github.com/RIOT-OS/RIOT/wiki/External-Libraries
[4] https://github.com/RIOT-OS/RIOT/tree/master/examples/default
[5] http://doc.riot-os.org/group__net__gnrc__netapi.html
[6] http://doc.riot-os.org/group__net__gnrc__netreg.html
[7] https://github.com/RIOT-OS/RIOT/issues/4072#issuecomment-147752215
https://github.com/RIOT-OS/RIOT/pull/4091
-- 
Institute of Computer Science
Freie Universität Berlin
AG-Tech, Room 148
Takustr. 9, 14195 Berlin
Mail: oliver.h...@inria.fr
Web: http://www.des-testbed.net
 http://www.riot-os.org


signature.asc
Description: PGP signature
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-23 Thread Haoyang Yu
Hi Oleg,

I understand and tried what you said. The problem I faced for a long time is 
that 

txtsnd: I cannot set the interface, if I use tap0, which will echo: error: 
invalid interface given. 
I found the tutorial that said using addr, but I do not have the addr command 
when I use the R21 board. 
And what is the mean for interface for txtsnd to use, if I have 
/dev/tty.usbmodem* MCU device

Thanks,
Haoyang


> On Oct 23, 2015, at 13:50, Oliver Hahm  wrote:
> 
> Hi Haoyang!
> 
>> The problem I face now is that I want to use the embedded default network
>> stack to make two Atmel R21board to send packet with each other through RF,
>> before I implemented the a new protocol on Network stack. Do you have any
>> experience about that? I did not find many resources online.
> 
> I'm not sure, if I understand your question correctly: by "embedded default
> network stack" you mean RIOT's default stack aka gnrc stack? If the answer is
> yes, than just take a look at the default example I mentioned in the previous
> mail (it has a README and the shell has an online help), flash it to two nodes
> and play around by sending messages over the link layer using the `txtsnd`
> command.
> 
> Cheers,
> Oleg
> -- 
> The problem with a SQL security joke is that Sony don't get it.
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-23 Thread Oliver Hahm
Hi Haoyang!

> The problem I face now is that I want to use the embedded default network
> stack to make two Atmel R21board to send packet with each other through RF,
> before I implemented the a new protocol on Network stack. Do you have any
> experience about that? I did not find many resources online.

I'm not sure, if I understand your question correctly: by "embedded default
network stack" you mean RIOT's default stack aka gnrc stack? If the answer is
yes, than just take a look at the default example I mentioned in the previous
mail (it has a README and the shell has an online help), flash it to two nodes
and play around by sending messages over the link layer using the `txtsnd`
command.

Cheers,
Oleg
-- 
The problem with a SQL security joke is that Sony don't get it.


signature.asc
Description: PGP signature
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-23 Thread Haoyang Yu
Hi Oliver,

Thanks for your quick response! These resources will be very useful for me, I 
will ask more question here.

The problem I face now is that I want to use the embedded default network stack 
to make two Atmel R21board to send packet with each other through RF, before I 
implemented the a new protocol on Network stack. Do you have any experience 
about that? I did not find many resources online.

Thanks,
Haoyang
> On Oct 23, 2015, at 06:48, Oliver Hahm  wrote:
> 
> Hi Haoyang,
> 
> welcome to RIOT!
> 
>> I forward this mail to my colleague Oleg, who is actually doing the same
>> thing - so I guess he is probably the best one to help you!
> 
> Since you already found the mailing list, I took the liberty of replying here
> instead.
> 
> Yes, I'm working indeed on CCN for RIOT. Until recently, there was a port of
> ccn-lite [1] in RIOT. See for example our second last release 2014.12 [2].
> However, during refactoring the network stack and due to the increasing
> divergence of RIOT's ccn-lite port and the upstream version, we decided to
> remove it temporarily and re-integrate it. Hence, I'm currently working
> towards this re-integration as a package [3].
> 
>> @Oleg: do you have already code for CCN-lite @ netapi?
> 
> The code I have for now is probably of very limited use for other people, but
> I think the main question for you is how to interact with layer 2. Hence, I
> would advice to take a look at the default example [4] which provides a very
> simple example for dealing with L2 transmissions. You probably also want to
> look at the documentation for the gnrc network stack, most particular the
> documentation of the netapi [5] and the registry [6]. There's also some
> ongoing effort on some more high-level documentation in [7].
> 
> Please, don't hesitate to ask more questions here on the list or on IRC.
> 
> Cheers,
> Oleg
> 
> [1] http://www.ccn-lite.net/
>https://github.com/cn-uofbasel/ccn-lite
> [2] https://github.com/RIOT-OS/RIOT/releases/tag/2014.12
> [3] https://github.com/RIOT-OS/RIOT/wiki/External-Libraries
> [4] https://github.com/RIOT-OS/RIOT/tree/master/examples/default
> [5] http://doc.riot-os.org/group__net__gnrc__netapi.html
> [6] http://doc.riot-os.org/group__net__gnrc__netreg.html
> [7] https://github.com/RIOT-OS/RIOT/issues/4072#issuecomment-147752215
>https://github.com/RIOT-OS/RIOT/pull/4091
> -- 
> Institute of Computer Science
> Freie Universität Berlin
> AG-Tech, Room 148
> Takustr. 9, 14195 Berlin
> Mail: oliver.h...@inria.fr
> Web: http://www.des-testbed.net
> http://www.riot-os.org

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Network Stack Question

2015-10-23 Thread Martine Lenders
Hi Haoyang,


2015-10-23 20:08 GMT+02:00 Haoyang Yu :

>
>- txtsnd: I cannot set the interface, if I use tap0, which will echo:
>error: invalid interface given.
>
> You need to use the interface on the node, not the TAP. The TAP is the
endpoint on the host system for the "cable" you draw between host and
native node. Use `ifconfig` to see what interface to use (as documented in
the default example's README [1]).

>
>- I found the tutorial that said using addr, but I do not have the
>addr command when I use the R21 board.
>
> Can you point us to this tutorial? The addr command was dropped for the
last release. Everything can be done with `ifconfig` now (there is already
an address configured though).

>
>- And what is the mean for interface for txtsnd to use, if I
>have /dev/tty.usbmodem* MCU device
>
> I don't know what you mean by that? If you mean it in the same way as you
said you used `tap0` on the native node, see above, if you want to send
actual packets over the serial line, have a look at SLIP [2] (or the
gnrc_border_router example about how to use it).

[1] https://github.com/RIOT-OS/RIOT/tree/2015.09/examples/default#networking
[2] http://doc.riot-os.org/group__net__gnrc__slip.html
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel