Re: [riot-devel] Connectivity between new NG stack and loopback

2015-07-27 Thread Martine Lenders
Hi,
> If you want to, I can update the article and add a Pull Request, or you
can just copy&paste it (would be much faster), if the others agree..?

Please do. I would also have to make a PR, just like you do so it would not
be faster if you just do it as you think is best ;-). The review will
decide if others agree.

Cheers,
Martine

2015-07-27 17:14 GMT+02:00 Lennart Dührsen :

> Hi,
>
> that would be a good example for great communication :D
>
> Personally, I would add
>
> - the link to the Wikipedia page about link-local address
>
> - some short explanations what the netcat options are for (for people
>   like me, who are too lazy to open the man page and search for it)
>
> - the note at the end of my article about writing your own software
>
> - and, most important, the note at the beginning of my article
>   concerning the damn firewall and the modprobe ipv6 stuff on a
>   Raspberry Pi.
>
> If you want to, I can update the article and add a Pull Request, or you
> can just copy&paste it (would be much faster), if the others agree..?
>
> Cheers,
> Lennart
> ___
> 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] Connectivity between new NG stack and loopback

2015-07-27 Thread Lennart Dührsen
Hi,

that would be a good example for great communication :D

Personally, I would add

- the link to the Wikipedia page about link-local address

- some short explanations what the netcat options are for (for people
  like me, who are too lazy to open the man page and search for it)

- the note at the end of my article about writing your own software

- and, most important, the note at the beginning of my article
  concerning the damn firewall and the modprobe ipv6 stuff on a
  Raspberry Pi.

If you want to, I can update the article and add a Pull Request, or you
can just copy&paste it (would be much faster), if the others agree..?

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


Re: [riot-devel] Connectivity between new NG stack and loopback

2015-07-27 Thread Martine Lenders
Forgot the link:
https://github.com/RIOT-OS/RIOT/blob/master/examples/ng_networking/README.md

2015-07-27 16:53 GMT+02:00 Martine Lenders :

> Hey Lennart,
> at the IETF hackathon we started documenting this in the README of
> `ng_networking`, since it seemed to be a better place for this (things tend
> to get lost in the Wiki and most peoble trying to network with the GNRC
> stack will probably stumble upon this app). Maybe you can just update there?
>
> Cheers,
> Martine
>
> 2015-07-27 15:35 GMT+02:00 Lennart Dührsen 
> :
>
>> Hi everyone,
>>
>> I'm sorry for answering so late (I had some other things to take care
>> of), and I would like to thank you for your help.
>>
>> The reason why this wasn't working on my system was just my firewall
>> that interfered. After turning it off, everything worked just as you
>> described.
>>
>> To make it easier for other newcomers, who might have to deal with this,
>> I created a wiki article that describes how to talk to your RIOT process
>> and mentions some of the pitfalls. It's not published yet, for now it's
>> just a gist, but feel free to check it out:
>>
>> https://gist.github.com/backenklee/2dbdaae90af5b5878200
>>
>> If you feel like something is missing or think something could be
>> improved, please let me know.
>>
>> Cheers,
>> Lennart
>>
>> ___
>> 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] Connectivity between new NG stack and loopback

2015-07-27 Thread Martine Lenders
Hey Lennart,
at the IETF hackathon we started documenting this in the README of
`ng_networking`, since it seemed to be a better place for this (things tend
to get lost in the Wiki and most peoble trying to network with the GNRC
stack will probably stumble upon this app). Maybe you can just update there?

Cheers,
Martine

2015-07-27 15:35 GMT+02:00 Lennart Dührsen :

> Hi everyone,
>
> I'm sorry for answering so late (I had some other things to take care
> of), and I would like to thank you for your help.
>
> The reason why this wasn't working on my system was just my firewall
> that interfered. After turning it off, everything worked just as you
> described.
>
> To make it easier for other newcomers, who might have to deal with this,
> I created a wiki article that describes how to talk to your RIOT process
> and mentions some of the pitfalls. It's not published yet, for now it's
> just a gist, but feel free to check it out:
>
> https://gist.github.com/backenklee/2dbdaae90af5b5878200
>
> If you feel like something is missing or think something could be
> improved, please let me know.
>
> Cheers,
> Lennart
>
> ___
> 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] Connectivity between new NG stack and loopback

2015-07-27 Thread Lennart Dührsen
Hi everyone,

I'm sorry for answering so late (I had some other things to take care
of), and I would like to thank you for your help.

The reason why this wasn't working on my system was just my firewall
that interfered. After turning it off, everything worked just as you
described.

To make it easier for other newcomers, who might have to deal with this,
I created a wiki article that describes how to talk to your RIOT process
and mentions some of the pitfalls. It's not published yet, for now it's
just a gist, but feel free to check it out:

https://gist.github.com/backenklee/2dbdaae90af5b5878200

If you feel like something is missing or think something could be
improved, please let me know.

Cheers,
Lennart

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


Re: [riot-devel] Connectivity between new NG stack and loopback

2015-06-25 Thread Alexandru Razvan Caciulescu
Hello Lennart,

Did you by any chance forgot to edit the makefile to include the module for
ng_nativenet and recompile?

Cheers,
Alex

2015-06-25 18:49 GMT+03:00 Cenk Gündogan :

> Hello Lennart,
>
> On 25.06.2015 16:14, Lennart Dührsen wrote:
>
>> the method you suggested now works halfway for me, but I still can't
>>
> that's half the battle (:
>
>> linux~ nc -u fe80::b400:b1ff:fe63:f33d%tap0 54545
>>
> Using nc without the -l flag will start a udp client and connect to the
> riot server. You will however not be able to receive messages on Linux
> without starting a udp server (-l flag). You need to also specify the
> tap0's ipv6 address here > f33c < with the %tap0 suffix, instead of riot's
> ipv6 address, in order to listen on the tap0 device.
>
>> Additionally, what I don't really understand is how one device (tap0)
>> can have two IPv6 addresses. In the default example for RIOT, where two
>>
> In general, it is completely valid for a device to have multiple ipv6
> addresses. However, this is not the case in this situation. In Linux you
> should only see >one< ipv6 address when you use ip/ifconfig on tap0 with
> this method.
>
> I am not really experienced enough to tell how ng_nativenet utilizes the
> tun/tap interface in detail.. Maybe it's possible to use tap0 and tap1 and
> the additional bridge to establish a connection between riot and linux..
> But one tap interface seems to be sufficient for this purpose.
>
>> Btw, using nc as you initially described did not produce any output on
>> either side (nc -ul fe80:...:f33c%tap0 54545).
>>
> Could you try this again and re-check the ipv6 addresses you used? I don't
> know why this shouldn't work..
>
> Best,
> Cenk
>
> ___
> 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] Connectivity between new NG stack and loopback

2015-06-25 Thread Cenk Gündogan

Hello Lennart,

On 25.06.2015 16:14, Lennart Dührsen wrote:

the method you suggested now works halfway for me, but I still can't

that's half the battle (:

linux~ nc -u fe80::b400:b1ff:fe63:f33d%tap0 54545
Using nc without the -l flag will start a udp client and connect to the 
riot server. You will however not be able to receive messages on Linux 
without starting a udp server (-l flag). You need to also specify the 
tap0's ipv6 address here > f33c < with the %tap0 suffix, instead of 
riot's ipv6 address, in order to listen on the tap0 device.

Additionally, what I don't really understand is how one device (tap0)
can have two IPv6 addresses. In the default example for RIOT, where two
In general, it is completely valid for a device to have multiple ipv6 
addresses. However, this is not the case in this situation. In Linux you 
should only see >one< ipv6 address when you use ip/ifconfig on tap0 with 
this method.


I am not really experienced enough to tell how ng_nativenet utilizes the 
tun/tap interface in detail.. Maybe it's possible to use tap0 and tap1 
and the additional bridge to establish a connection between riot and 
linux.. But one tap interface seems to be sufficient for this purpose.

Btw, using nc as you initially described did not produce any output on
either side (nc -ul fe80:...:f33c%tap0 54545).
Could you try this again and re-check the ipv6 addresses you used? I 
don't know why this shouldn't work..


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


Re: [riot-devel] Connectivity between new NG stack and loopback

2015-06-25 Thread Lennart Dührsen
Hi Cen,

the method you suggested now works halfway for me, but I still can't
send packets from RIOT to netcat. Would you (or anyone else) mind having
a look at what I did, maybe you know what's wrong...?

Below are the exact commands I typed and the corresponding output:

===

linux~ sudo openvpn --mktun --dev tap0

Thu Jun 25 15:42:47 2015 TUN/TAP device tap0 opened
Thu Jun 25 15:42:47 2015 Persist state set to: ON

linux~ sudo ip link set dev tap0 up

linux~ cd /home/lennart/git/RIOT/examples/ng_networking && make

linux~ ./bin/native/ng_networking.elf tap0

riot> ifconfig

Iface  7   HWaddr: b6:00:b1:63:f3:3d
   inet6 addr: ff02::1/128  scope: local [multicast]
   inet6 addr: fe80::b400:b1ff:fe63:f33d/64  scope: local
   inet6 addr: ff02::1:ff63:f33d/128  scope: local [multicast]

linux~ ip addr show dev tap0

4: tap0:  mtu 1500 qdisc pfifo_fast
state UP group default qlen 100
link/ether b6:00:b1:63:f3:3c brd ff:ff:ff:ff:ff:ff
inet6 fe80::b400:b1ff:fe63:f33c/64 scope link
   valid_lft forever preferred_lft forever

riot> udp server start 54545

Success: started UDP server on port 54545

linux~ nc -u fe80::b400:b1ff:fe63:f33d%tap0 54545

hello-from-nc

riot>

PKTDUMP: data received:
~~ SNIP  0 - size:  14 byte, type: NETTYPE_UNDEF (0)
00 68 65 6c 6c 6f 2d 66 72 6f 6d 2d 6e 63 0a
~~ SNIP  1 - size:   8 byte, type: NETTYPE_UDP (3)
   src-port: 55187  dst-port: 54545
   length: 22  cksum: 0x4fc7f
~~ SNIP  2 - size:  40 byte, type: NETTYPE_IPV6 (1)
traffic class: 0x00 (ECN: 0x0, DSCP: 0x00)
flow label: 0x0
length: 22  next header: 17  hop limit: 64
source address: fe80::b400:b1ff:fe63:f33c
destination address: fe80::b400:b1ff:fe63:f33d
~~ SNIP  3 - size:  19 byte, type: NETTYPE_NETIF (-1)
if_pid: 7  rssi: 0  lqi: 0
src_l2addr: b6:00:b1:63:f3:3c
dst_l2addr: b6:00:b1:63:f3:3d
~~ PKT-  4 snips, total size:  81 byte

riot> udp send fe80::b400:b1ff:fe63:f33c 55187 hello-from-riot

Success: send 15 byte to fe80::b400:b1ff:fe63:f33c:55187

===

So as you can see, the RIOT node has the IP  address fe80:...:f33d,
whereas the other end of the channel has the address fe80:...:f33c.

The RIOT node listens on port 54545, so when I start netcat, »connect«
to the nodes address on port 54545 and send data, the node receives it
(as expected).

However, this doesn't work the other way around: When I try send data
from the RIOT node to netcat, using the source address and source port
from the packet RIOT just received before, nothing arrives at netcat.
Both packets appear in wireshark with the right address/port fields,
just as one would expect.

Additionally, what I don't really understand is how one device (tap0)
can have two IPv6 addresses. In the default example for RIOT, where two
nodes communicate with each other, you have to set up two tap devices
and a bridge which connects them, which makes sense to me.
When and how is the second address assigned (the nc source address)?

Btw, using nc as you initially described did not produce any output on
either side (nc -ul fe80:...:f33c%tap0 54545).

Any help / explanation would be greatly appreciated.

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


Re: [riot-devel] Connectivity between new NG stack and loopback

2015-06-25 Thread Alexandru Razvan Caciulescu
Hello Cenk,

I tried your method and it works !
Thanks for the help !

Cheers,
Alex

2015-06-24 20:34 GMT+03:00 Cenk Gündogan :

> Hello Lennart,
>
> I might be wrong and Sebastian might be able to shed some light on this,
> BUT
> isn't marz restricted to the old network stack? As far as I know it
> strips/adds the old nativenet header from outgress/ingress packets.
>
> BTW, are you also using the old network stack? My described method works
> only for the new network stack and with ng_nativenet (:
>
> cheers,
> CG
>
>
> On 24.06.2015 19:27, Lennart Dührsen wrote:
>
>> Hi Alex,
>>
>> have a look at the microcoap example [1], which uses marz [2] to connect
>> the RIOT node with your »normal« localhost. The RIOT application in this
>> example is a just a server (and only reacts on requests), but it
>> shouldn't be too hard to extend/customize.
>>
>> The marz code is a bit spaghetti like, and maybe I will build a better
>> solution in the near future, as I need the same functionality you do for
>> testing a gateway.
>>
>> As for the microcoap example: beware of pip, you may want to install
>> Twisted and bidict manually by downloading it from the respective
>> websites, because (on my system) pip installed only parts of the
>> libraries. Also, check the $PYTHONPATH variable and which version of
>> python the respective file/program uses when things don't work, this
>> caused some trouble for me.
>>
>> As soon as I know more, I'll let you know.
>>
>> The method described by Cenk did not work for me, but I'll try and make
>> that (or something similar) work as well.
>>
>> Best,
>> Lennart
>>
>>
>> [1] https://github.com/RIOT-OS/applications/tree/master/microcoap
>>
>> [2] https://github.com/sgso/marz
>> ___
>> 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
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Connectivity between new NG stack and loopback

2015-06-24 Thread Cenk Gündogan

Hello Lennart,

I might be wrong and Sebastian might be able to shed some light on this, BUT
isn't marz restricted to the old network stack? As far as I know it 
strips/adds the old nativenet header from outgress/ingress packets.


BTW, are you also using the old network stack? My described method works 
only for the new network stack and with ng_nativenet (:


cheers,
CG

On 24.06.2015 19:27, Lennart Dührsen wrote:

Hi Alex,

have a look at the microcoap example [1], which uses marz [2] to connect
the RIOT node with your »normal« localhost. The RIOT application in this
example is a just a server (and only reacts on requests), but it
shouldn't be too hard to extend/customize.

The marz code is a bit spaghetti like, and maybe I will build a better
solution in the near future, as I need the same functionality you do for
testing a gateway.

As for the microcoap example: beware of pip, you may want to install
Twisted and bidict manually by downloading it from the respective
websites, because (on my system) pip installed only parts of the
libraries. Also, check the $PYTHONPATH variable and which version of
python the respective file/program uses when things don't work, this
caused some trouble for me.

As soon as I know more, I'll let you know.

The method described by Cenk did not work for me, but I'll try and make
that (or something similar) work as well.

Best,
Lennart


[1] https://github.com/RIOT-OS/applications/tree/master/microcoap

[2] https://github.com/sgso/marz
___
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] Connectivity between new NG stack and loopback

2015-06-24 Thread Lennart Dührsen
Hi Alex,

have a look at the microcoap example [1], which uses marz [2] to connect
the RIOT node with your »normal« localhost. The RIOT application in this
example is a just a server (and only reacts on requests), but it
shouldn't be too hard to extend/customize.

The marz code is a bit spaghetti like, and maybe I will build a better
solution in the near future, as I need the same functionality you do for
testing a gateway.

As for the microcoap example: beware of pip, you may want to install
Twisted and bidict manually by downloading it from the respective
websites, because (on my system) pip installed only parts of the
libraries. Also, check the $PYTHONPATH variable and which version of
python the respective file/program uses when things don't work, this
caused some trouble for me.

As soon as I know more, I'll let you know.

The method described by Cenk did not work for me, but I'll try and make
that (or something similar) work as well.

Best,
Lennart


[1] https://github.com/RIOT-OS/applications/tree/master/microcoap

[2] https://github.com/sgso/marz
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Connectivity between new NG stack and loopback

2015-06-24 Thread Cenk Gündogan

Hello Alexandru,

I am not certain that this method is bullet-proof, but you can try the 
following:


* Create a tun/tap interface:
> sudo openvpn --mktun --dev tap0
[FYI: I did not test this method with the tapsetup script]

* Enable the interface:
> sudo ip link set dev tap0 up

* start ng-nativenet
> make term PORT=tap0
[FYI: Starting RIOT with tap0 will assign an ip address to tap0]

* In Linux: lookup the ipv6 address of tap0
> ifconfig tap0

* Start a udp server on Linux
> nc -ul %tap0 13377
[ It is necessary to use the suffix %tap0 in order to give a hint to 
Linux that this is a tun/tap device]


* In RIOT: start a udp server and happily communicate with linux
> udp server start 13377
> udp send  13377 HELLO-RIOT

* In Linux: netcat will receive this message and you can reply by just 
typing something in your shell


I hope this helps

cheers,
Cenk

On 24.06.2015 10:40, Alexandru Razvan Caciulescu wrote:

Hello everyone,

I'm new to RIOT and currently trying to test the connectivity between 
a RIOT instance on native and the loopback. I'm currently using the 
ng_networking.elf from the examples and while I can pass messages 
between 2 RIOT instances using this example I would also like to be 
able to have a connection with the loopback on my machine for future 
tests but I can't seem to make it work.
If someone could give me a quick walkthrough or help me figure out 
where my mistake is I would really appreciate it. I'm sure this must 
seem trivial .


Thank you,
Alex


___
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