-
Notifications
You must be signed in to change notification settings - Fork 444
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
Remove ieee802154 from IphcRepr #1033
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1033 +/- ##
==========================================
- Coverage 80.88% 80.26% -0.62%
==========================================
Files 81 81
Lines 28452 28734 +282
==========================================
+ Hits 23013 23064 +51
- Misses 5439 5670 +231 ☔ View full report in Codecov by Sentry. |
Was hoping to get some feedback on the structure of things before investing time into improving coverage. |
Could you explain why is this needed to support 6lowpan over BLE? IIUC address compression works the same way in both 6lo over BLE and 6lo over ieee802.15.4. The info you use to compress/decompress is an EUI64 that can be derived from either the ieee802.15.4 link address or the BLE link address. So I think it should be possible to pass in the EUI64, and have higher layers calculate it differently depending on whether the link is ieee802.15.4 or BLE? Then the code can stay in the same place, the refactor is not needed. I'm not a 6lowpan expert though. Hopefully @thvdveld can weigh in. (The reason I'm a bit concerned with the refactor is that "look at packet fields, write Rust enum, copy it around, match it to do thing" typically increases code size vs "look at packet fields, do thing") |
Yes, this is largely the case for non-contextual compression.
Due to the things I've mentioned above, some kind of refactor will still be needed to remove ieee802.15.4 from There's more info in the linked issue. |
My question is: why can't we keep the current code structure, just replace This way |
I unfortunately don't know enough about ieee802154 to give you a good answer. @thvdveld thinks an EUI64 isn't enough for ieee802154. |
I had a look at RFC6282 for the address compression, and I think working just with EUI64 will work (sorry for not checking that before). We still have to implement the part where an EUI-64 address can be formed from a short address (we only have the implementation for IEEE 802.15.4 extended addresses), which is defined in section 3.2.2. This means that the full implementation of the compression needs to be rewritten to actually do it with the EUI-64 address. I'm not sure if the case where nothing can be elided from the IPv6 address and the full address is going to be in-lined in the packet is going to occur in BLE. For multicast IPv6, as I understand it, the multicast compression format for IEEE 802.15.4 is not used in BLE, since there is no multicast/broadcast in BLE. IPv6 multicast packets need to be replicated to each link. However, multicast uses broadcast in IEEE 802.15.4. |
Ah I see. In that case this PR isn't what smoltcp is looking for. |
First part of #1031 .
The
IphcRepr
type was written in terms of ieee802154 addresses.I've replaced the ieee802154 address for structures that closer match the RFC and can be used on other mediums like BLE.
After this, I need to do the same for
sixlowpan/mod.rs
and move the ieee802154 bits into thewire/ieee802154.rs
file.