[riot-devel] How to Choose Network Interface to Send Packets Over

2015-11-03 Thread Mark Solters
I am relatively new to RIOT and I hope someone can provide some expertise
here; I am exploring the gnrc networking stack in the pursuit of a
functioning border router.

This question is centered around "examples/posix_sockets."  I am using
ATMEL SAMR21 chips.

The posix_example works as expected, without modification, provided I am
communicating between two SAMR21 nodes using the 802.15.4 radio (SAMR21
depends on at86rf2xx).

BUT, I am also working towards a functioning border router by adding an
ethernet interface to the SAM.

I have explored the edge case (no pun intended) of the posix_sockets
example where I use ONLY an ethernet adapter (i.e., replacing the
dependency on at86rf2xx with ksz8851snl, the ethernet driver).  It works as
expected: I am able to send UDP data from the SAM over the ethernet to my
computer's UDP server (and back).  In this edge case, the ethernet is the
only interface the SAM reports, also expected.

But, when I combine these two cases -- so that I have both at86rf2xx and
ksz8851snl interfaces enabled -- it seems that UDP data is only transmitted
via the radio!  Other SAMs can receive the UDP packets, but the computer
server stops receiving them.  No IP addresses were changed; only the number
of interfaces available to the SAM (i.e. GNRC_NETIF_NUMOF := 2).

This leads me to a slightly deeper question -- how does RIOT decide what
physical interface to attempt to communicate over when I use network send
calls such as conn_udp_sendto?

As an associated question -- is it the intention of the gnrc_border_router
example to automatically bridge interfaces (such as ethernet & 802.15.4)?
As far as I can tell it really only initializes interfaces but does not
provide any actual routing between them.

Thank you,

Mark Solters
devel mailing list

Re: [riot-devel] How to Choose Network Interface to Send Packets Over

2015-11-05 Thread Mark Solters
[Sorry if this message ends up in the wrong place or as a separate thread
-- I was stuck in digest mode and it was not clear to me how to reply to a
single message.]

Oleg, thank you very much for the description of and reference to the
packet routing protocol -- I did not realize that RIOT followed the
contents of the RFC document so precisely.

I now know that the process of deciding what network interface to route a
packet to comes down to (at first) finding an on-link match between the
destination IP address and the available interfaces (if one exists).  This
is done by examining the prefixes for a match.

In my case, I have two interfaces, ethernet and 802.15.4, with
auto-assigned local IPV6 addresses:

[Iface 6, 802.15.4] = fe80::5846:346f:c2da:ad12/64
[Iface 7, ethernet] = fe80::204:25ff:fe19:1a3e/64

So I think my problem is as follows.  I am transmitting packets to a
destination IP that reads:


And therefore the fe80:: could match the 64-bit prefix of *either* of those
interfaces.  I think that the request is then being routed to the first
match, which is 802.15.4, which is incorrect, because that IP address is
actually an ethernet neighbor, not a radio one.  When I disable Iface 6,
the packets DO reach their destination on Iface 7.

Maybe I'm wrong; but it would seem that my problem is, I need to change the
prefix of my 802.15.4 interfaces to something other than fe80:: so they do
not conflict with the ethernet interface's prefix, which is beyond my

Am I on the right track here?  I do not as of yet fully comprehend the
addition of the global affe::2 address in the gnrc_border_router example;
and additionally, I am uncertain if my reasoning here is still flawed due
to a deeper failure to internalize the core concept behind RIOT's
implementation of the packet routing algorithm.

Many thanks,

devel mailing list