-
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
sys/udp: Checksum calculation broken #2508
Comments
Maybe @authmillenon is also interested in this issue? |
@fnack can you provide a packet capture? The source address is wrong on the receiving end, which gives the wrong checksum (2), we need to check whether the error is in the reception or transmission |
Interesting.. when I test rpl_udp on native I do not see any checksum errors from udp. However, as a side effect form the bug I mentioned in #2493 it is not possible to send messages from root -> node, because DAOs are not received properly by root. |
A packet capture in libpcap format from wireshark can be found here. Ifconfig on sender:
Ifconfig on receiver:
The corresponding output is:
Receiver:
I'm confused where the 200 in the printed source address on the receiver side comes from. EDIT: All data from rpl_udp example tested with native on current master. |
@fnack the 200 comes from the flipping of the universal/local bit when generating the link local address from the EUI-64. see here https://tools.ietf.org/html/rfc4291#page-20 |
I think we need to revise the EUI-64 generation. I can't find a authoritative source on how to generate 64 bit addresses from 16 bit short 802.15.4 address. I have the following PPT which suggests using PAN ID and Short address to create a 64 bit address. |
I was also searching for the past hour.. and did also not find any specific source. What I found so far:
|
it confuses me that RFC4944 suggests using the |
While RFC4944 states that the u/l bit SHALL be set to zero, RFC6282 just tells
But I cannot find any MUST or SHALL in this context.. |
I vote for going with RFC4944 and generating a 48 bit "ethernet MAC" from the PAN and short addr, and handling it like a 48 bit address and inserting 0xfffe in the middle. Thoughts on this? |
what about the u/l bit? how should this be handled when deriving the IID from the short address? |
semantically, I would prefer to leave the u/l bit as zero to point out that this interface id is not universally unique, but generated from an arbitrary short address |
@cgundogan I agree. Set the U/L to 1 in the "MAC" address to signify a local address, then it will be inverted in the EUI-64 to IID conversion as recommended by the RFC when used in 6lowpan. |
👍 sound.
[1] 16_bit_PAN:16_zero_bits:16_bit_short_address |
@cgundogan That's a good description of what I was thinking. |
@cgundogan Do you have the time to implement the proposed algorithm soon-ish? |
I will have a look at it asap |
That is the complete opposite to what we decided in the NSTF on. We decided on the RFC6282 solution since it is the update. All in all: the EUI-64 from 16-bit address generation is not standardized globally and a totally 6LoWPAN-related thing. This is why I think (after 2 years of working with this) it's a bad idea to put this stuff in the link-layer anyways. ;-) |
I think I will be able to participate remotely in the hack N ack tomorrow, maybe we'll be able to solve this during that time? |
@gebart good idea, I also will most likely attend |
@authmillenon I trust in your experience in this field. Does the ng-net implementation of the network layer know about link-layer properties such as PAN IDs and such? I suggest that in using short addresses, the U/L bit should be set to 1, example: This follows the guideline to invert the bit when taking the EUI address as an IPv6 link local address, which means that it does not need any branching in the IPHC/lowpan handler for different kinds of hardware addresses. |
Is there any benefit to including the PAN ID in the link-local address? The overlap between the RFC 4944 PAN ID bits and the U/L bit makes the choice of inverting/non-inverting seem arbitrary and probably won't play well with other implementations.. |
For what it's worth, Wireshark agrees that the IEEE802.15.4 packet sent from short address 0x2615 with IPHC mode source address elided (0 bits), has a decompressed IPv6 source address of fe80::ff:fe00:2615 https://www.cloudshark.org/captures/3751f069fe12 I forged that packet by hand btw, I don't have a PR yet. |
Closed via #2523 |
UDP packet handling no longer works because the checksum calculation in udp.c fails. Reverting in the master history, the problem was introduced with the merge of #2497.
The problem can for example be reproduced using the rpl_udp example:
Sending:
But on the receiver side it fails:
The text was updated successfully, but these errors were encountered: