Skip to content

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Dec 15, 2015

Fixes #4397 (and maybe #4462). Could not test because for some reason I can't send anything right now (even with txtsnd).

Here is the general idea of this fix: the ipv6 parameter of gnrc_sixlowpan_iphc_decode() is replaced with the out-parameter dec_hdr. While gnrc_sixlowpan_iphc_decode() handles the dereferenced pointer the same as it used to handle ipv6 iphc_nhc_udp_decode() sets it to the UDP header and appends the IPv6 header (the old value of dec_hdr) to the UDP header. This way the correct header order should be preserved.

Depends on #4507 (merged).

@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. labels Dec 15, 2015
@miri64 miri64 added this to the Release 2015.12 milestone Dec 15, 2015
@OlegHahm
Copy link
Member

Most likely you cannot send because of #4482.

@OlegHahm OlegHahm added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Dec 15, 2015
@miri64
Copy link
Member Author

miri64 commented Dec 15, 2015

I wait in anticipation (can't test for now anyway).

@jfischer-no
Copy link
Contributor

looks good, will test it during the day.

@jfischer-no
Copy link
Contributor

https://github.com/RIOT-OS/RIOT/blob/master/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c#L729
will drop the packet:
gdb output:

Breakpoint 1, _receive (pkt=0x1fffe1b8 <_pktbuf+44>) at /home/jfischer/src/RIOT/sys/net/gnrc/network_laye
r/ipv6/gnrc_ipv6.c:729
1: x/i $pc
=> 0x2b2a <_receive+98>:        ldr     r3, [r3, #52]   ; 0x34
(cm4-gdb) print pkt->type
$12 = GNRC_NETTYPE_IPV6
(cm4-gdb) print pkt->next->type
$13 = GNRC_NETTYPE_UDP
(cm4-gdb) print pkt->next->next->type
$14 = GNRC_NETTYPE_IPV6
(cm4-gdb) print pkt->next->next->next->type
$15 = GNRC_NETTYPE_NETIF

(cm4-gdb) print pkt      
$16 = (gnrc_pktsnip_t *) 0x1fffe1b8 <_pktbuf+44>

(cm4-gdb) print pkt->next->next      
$17 = (struct gnrc_pktsnip *) 0x1fffe1e8 <_pktbuf+92>

sorry, do not have time to dig deeper, possibly tonight

@kaspar030
Copy link
Contributor

As today is release day, I propose disabling NHC for this release. It seems a little to hotfixed to me. What do you guys think?

@OlegHahm
Copy link
Member

What do you mean by disabling it? And be aware that without NHC no UDP connection between RIOT and Linux is possible over 6LoWPAN (at least not unless you know how to disable IPHC on Linux).

@kaspar030
Copy link
Contributor

What do you mean by disabling it?

I thought about disabling the pseudomodule by just not making it a dependency of IPHC.

And be aware that without NHC no UDP connection between RIOT and Linux is possible over 6LoWPAN (at least not unless you know how to disable IPHC on Linux).

Hm. With the broken NHC no UDP exchange is possible when RIOT translates between IPv6 and 6lowpan. Isn't that the border router use case?

No hard feelings here, but IMHO not having NHC is not a show stopper, and once we have a fix, we could backport (and then reenable NHC).

What does the RFC say? Isn't NHC optional? Or all of IPHC? (Sending broken packages is definately just wrong.)

The best would be to just fix it. @authmillenon? ;)

@OlegHahm
Copy link
Member

RFC6282 says:

A compliant implementation of [RFC4944] as updated by this document
MUST be able to properly process a packet received that makes use of
the provisions of this document.

I still haven't fully understand which setups are currently broken.

May be a bit weird to introduce a new feature to the bug-fixing branch. However, I guess it's our decision what is allowed to go into this branch and we don't have to limit ourselves to bugfixes.

@kaspar030
Copy link
Contributor

kaspar030 commented Dec 18, 2015 via email

@emmanuelsearch
Copy link
Member

planning to test with the below setup as soon as I get libcoap installed on the (slow) pi.

Linux (Pi + 802.15.4 module) <=> RIOT (samr21-xpro)

@jfischer-no
Copy link
Contributor

linux (Linux 4.4.0) <-> riot (master), udp with nhc working fine in both directions !

@miri64
Copy link
Member Author

miri64 commented Dec 18, 2015

What about #4485 (comment) then?

@jfischer-no
Copy link
Contributor

About: linux (Linux 4.4.0) <-> riot (00b64b2)

@miri64
Copy link
Member Author

miri64 commented Dec 18, 2015

Ah sorry, did not saw the master. But the headers are still reversed RIOT internally?

@OlegHahm
Copy link
Member

linux (Linux 4.4.0) <-> riot (master), udp with nhc working fine in both directions !

Also for the CoAP example?

@cgundogan
Copy link
Member

I just tried the same setup as before: linux (copper) <-> 6lbr (RIOT) <-> 6lr (RIOT). I did a CoAP ping from linux to the 6lr and the fix proposed here merged into master. CoAP ping does not work. If I disable ifconfig <x> -iphc IPHC then CoAP ping works again.

@OlegHahm
Copy link
Member

What about Linux (copper or libcoap) <-> 6lr (RIOT)?

@cgundogan
Copy link
Member

What about Linux (copper or libcoap) <-> 6lr (RIOT)?

I have no setup for this ready. @emmanuelsearch were you able to install the coap-client?

@miri64
Copy link
Member Author

miri64 commented Dec 18, 2015

Found cause of #4485 (comment) will fix, but test first

@emmanuelsearch
Copy link
Member

yes I have finally managed to installe coap-client (libcoap) on our local pi. Stay tuned.

@emmanuelsearch
Copy link
Member

EDIT: the below works for master, but not with this PR

Seems to work for the setup I tried: Linux (Pi + 802.15.4 module) <=> RIOT (samr21-xpro)
I get the below:

pi@raspberrypi ~/libcoap $ coap-client coap://[fe80::5855:5c7c:8647:1e2e%lowpan0]/riot/board
v:1 t:CON c:GET i:22af {} [ ]
samr21-xpro

@jfischer-no
Copy link
Contributor

tested with libcoap:
linux (Linux 4.4.0 + Debian on Phytec Wega SBC + CC2520) <-> riot (master,microcoap_server), coap with nhc works in both directions.

@cgundogan
Copy link
Member

So, then the problem is only existent when ahving an 6lbr in between? At least it didn't work for me and from what I understand it also didn't work for @kaspar030 (wit this fix included in master?)

@miri64
Copy link
Member Author

miri64 commented Dec 18, 2015

Found another issue causing #4462 that is unrelated to this fix.

@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

Rebased to current master.

@jfischer-no
Copy link
Contributor

tested quickly:

  • linux (Linux 4.4.0 + Debian on Phytec Wega SBC + CC2520) <-> riot-node (b398941,microcoap_server), coap 👍
  • linux (Debian) <-> riot 6lo (b398941) <-> riot-node (b398941,microcoap_server), coap 👎 (node sends malformed packet)

I'll try to debug, if I have time today evening...

@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

Might not be related to this PR, but thanks

@miri64 miri64 added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Dec 22, 2015
@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

Updated the doc for the pkt parameter also.

@jfischer-no
Copy link
Contributor

Might not be related to this PR, but thanks

To which PR is it related then?

@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

There is none yet, issue #4462 exists for that.

@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

This PR just fixes the packet order

@cgundogan
Copy link
Member

Could you squash, please?

1 similar comment
@cgundogan
Copy link
Member

Could you squash, please?

@miri64 miri64 removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Dec 22, 2015
@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

Done

@cgundogan
Copy link
Member

I see two commits with the same commit message

@miri64 miri64 force-pushed the gnrc_sixlowpan/fix/nhc-iphc branch from 7232eea to 21beaa7 Compare December 22, 2015 16:17
@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

Look again ;-)

@cgundogan
Copy link
Member

magic.. (: Let's wait for travis now and then merge this

@jfischer-no jfischer-no mentioned this pull request Dec 22, 2015
@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 22, 2015
@miri64
Copy link
Member Author

miri64 commented Dec 22, 2015

You forgot to set the label ;-)

@cgundogan
Copy link
Member

travis agrees - GO

cgundogan added a commit that referenced this pull request Dec 22, 2015
gnrc_sixlowpan: Fix IPHC/NHC packet order problem
@cgundogan cgundogan merged commit 17e21e3 into RIOT-OS:master Dec 22, 2015
@cgundogan cgundogan removed Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 22, 2015
@miri64 miri64 deleted the gnrc_sixlowpan/fix/nhc-iphc branch January 6, 2016 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. 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.

gnrc_sixlowpan: Header order or UDP and IPv6 swapped
6 participants