Re: [riot-devel] How to Choose Network Interface to Send Packets Over
[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: fe80::3a2c:4aff:fe6e:19f3 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 control. 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, Mark ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel
Re: [riot-devel] How to Choose Network Interface to Send Packets Over
Hey Mark! > 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? Selecting the proper interface for sending, is task of the network layer and is implemented according to the procedures explained in the according RFCs [1][2] in GNRC. This means that a node will first check if the destination prefix is "on-link" (if applicable) and use the according interface. If not, it will look up the destination in the FIB (Forwarding Information Base) if available (e.g., if a routing protocol is available or someone else filled the FIB manually) for the next hop's IP address. You can check the content of the FIB using the `fibroute` shell command. Finally, the neighbor cache (check with `ncache` shell command) is checked or a neighbor solicitation may be performed. Hence, if your IPv6 prefixes are configured correctly (e.g. as described in the gnrc_border_router example's README), the appropriate interface should be chosen. > 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. The border router is (as the name suggests ;-)) a router, not a bridge. Forwarding packets via the correct interface is done according to the rules stated above. HTH, Oleg [1] https://tools.ietf.org/html/rfc4861#section-5.2 [2] https://tools.ietf.org/html/rfc6775#section-5.6 -- I'd make a joke about UDP, but I don't know if anyone's actually listening... signature.asc Description: PGP signature ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel