Skip to content

6lo nd: prefer NCEs over FIB entries#4714

Merged
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
OlegHahm:6lo_nd_lookup
Feb 3, 2016
Merged

6lo nd: prefer NCEs over FIB entries#4714
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
OlegHahm:6lo_nd_lookup

Conversation

@OlegHahm
Copy link
Copy Markdown
Member

If an address can be found in the neighbor cache, it should be used - whatever the FIB may return.

If an address can be found in the neighbor cache, it should be used - whatever the FIB may return.
New condition -> new line
@OlegHahm OlegHahm added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking NSTF labels Jan 29, 2016
@OlegHahm OlegHahm added this to the Release 2016.03 milestone Jan 29, 2016
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 29, 2016

I'm ambivalent about this. On the first hand the NC has much better information on the node's neighbors on the other we take out user control over forwarding with this...

@OlegHahm
Copy link
Copy Markdown
Member Author

Well, first of all, the current behavior is broken. (A node with more than one interfaces may have a route in its FIB that matches the destination, e.g., the default route which may return another interface than the one stored in the NC, resulting in not sending the packet.)
Second, the user may still pass a interface to the function which doesn't get overwritten.
Finally, we may swap the order of the gnrc_ipv6_nc_get() calls, but I would prefer to first lookup in the neighbor cache and then consult the FIB over the reverse order.

@emmanuelsearch, @cgundogan, @Yonezawa-T2, any opinon?

@Yonezawa-T2
Copy link
Copy Markdown
Contributor

The current implementation already prefers NC over FIB, except interface.

The outline of the current gnrc_sixlowpan_nd_next_hop_l2addr is as follows:

  1. Lookup FIB to next hop and its interface.
  2. Lookup NC with the destination address and the interface of the next hop (if any).
  3. If NC contains the destination address on the interface of the next hop, send the packet to it directly.
  4. Otherwise, forward the packet to the next hop.

This patch changes step 2 and 3 to follows:

2 . Lookup NC with the destination address and the original interface.
3 . If NC contains the destination address on the original interface, send the packet to it directly.

and add the following between 3 and 4:

3.1. Lookup NC with the destination address and the interface of the next hop (if any).
3.2. If NC contains the destination address on the interface of the next hop, send the packet to it directly.

I agree with @OlegHahm, looking up NC with the destination address and the interface of the next hop seems make no sense.

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Feb 1, 2016

@Yonezawa-T2, thanks for the clarification.

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Feb 2, 2016

So, can we finally merge this?

@miri64
Copy link
Copy Markdown
Member

miri64 commented Feb 2, 2016

I'm not sure how to test this, but at least networking through a border router works for both master and this PR. (Untested) ACK.

@OlegHahm OlegHahm added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 3, 2016
@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Feb 3, 2016

Tested, @kaspar030 confirmed. Go.

OlegHahm added a commit that referenced this pull request Feb 3, 2016
6lo nd: prefer NCEs over FIB entries
@OlegHahm OlegHahm merged commit ca8dbba into RIOT-OS:master Feb 3, 2016
@OlegHahm OlegHahm deleted the 6lo_nd_lookup branch February 3, 2016 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants