-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net_if: include pan id for eui-64/IID generation from short address #2517
net_if: include pan id for eui-64/IID generation from short address #2517
Conversation
@gebart can you have a look if this comes close to what we discussed in #2508 ? |
|
This is (and was always) somewhat confusing to me: static HC1 (introduced in the original 6LoWPAN RFC) states the address must be generated from the PAN ID as this PR introduces: https://tools.ietf.org/html/rfc4944#section-6 In IPHC this notion is dropped however: https://tools.ietf.org/html/rfc6282#section-3.2.2 (with no reference to the previous statement). As we only implement IPHC, I decided to go for the second approach since it simplifies a lot and makes 6LoWPAN much more independent from its lower layers. In the end I think its up to the 6LoWPAN or IPv6 implementation to decide what to do, not the interfaces ;-) (that's why I put such things into the network layer implementations nowadays. See #2437) |
well the problem is actually not really the missing pan_id in the IID, but the confusion about the u/l-Bit. That's why packets cannot be received in the rpl_example right now.. |
return 0; | ||
} | ||
|
||
/* RFC 6282 Section 3.2.2 / RFC 2464 Section 4 */ | ||
eui64->uint16[0] = HTONS((uint16_t)pan_id) & ~(1 << 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think you have this reversed, the EUI-64 (radio link layer extended address) should have the U/L bit set to signify a locally administered address, while the IPv6 IID should have the bit inverted, 0 means locally administered.
See https://supportforums.cisco.com/document/100566/understanding-ipv6-eui-64-bit-address and http://packetlife.net/blog/2008/aug/4/eui-64-ipv6/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its set later to 1. at this line the MAC/IID address is built with the pan_id, 00fffe00 and then the short address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that for eui-64 addresses this line of code is not executed => force_generation is false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the final u/l-bit inversion is done in file ip.c at line 693
There should be no inversion at all for short address generated IIDs iirc. |
Can we close this? |
NACK (: |
Currently, the link-local address generation is odd, due to some complications and confusions regarding the generation of the EUI-64/IID.
This PR fixes the problems (that we are facing with RPL right now) according to the discussion in #2508
IIDs generated from short addresses will be of the form 16_bit_PAN:00ff:fe00:16_bit_short_address, with an U/L-Bit set to 0.