Skip to content
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

gnrc_sixlowpan_iphc_nhc: fix NHC UDP decoding for fragmented packets #4935

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Mar 1, 2016

While running my experiments for my masterthesis I realized that our NHC implementation isn't really able to handle fragmented packets. With this fix it does though it's really ugly.

@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking labels Mar 1, 2016
@miri64 miri64 added this to the Release 2016.04 milestone Mar 1, 2016
@jnohlgard
Copy link
Member

Nice!

@OlegHahm OlegHahm added the ugly label Mar 1, 2016
@jnohlgard
Copy link
Member

Tested working with a Contiki RPL border router connected to Linux, RIOT gnrc_networking example on mulle and using netcat on linux to send long strings to the RIOT node. Without this patch only strings less than 50-something chars could get through.

About the supposed uglyness, I'll leave that to someone more involved with the gnrc stack to decide.

@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 Mar 2, 2016
@OlegHahm
Copy link
Member

OlegHahm commented Mar 2, 2016

If this is working, I think we can live with it. I've seen uglier code.

@jnohlgard
Copy link
Member

Somewhat related Q: Is there any risk of leaking memory when fragments get lost or are the partial packets freed somewhere?

@cgundogan
Copy link
Member

@gebart obsolete fragments should be gc'ed here

@miri64 miri64 mentioned this pull request Mar 2, 2016
@miri64
Copy link
Member Author

miri64 commented Mar 2, 2016

Somewhat related Q: Is there any risk of leaking memory when fragments get lost or are the partial packets freed somewhere?

@Yonezawa-T2 already has a PR open for that: #4771.

@miri64
Copy link
Member Author

miri64 commented Mar 2, 2016

Added a fix for compiling without NHC.

@cgundogan
Copy link
Member

okay, will test with the fix a little bit later. And where is the [ci skip] in your fixup commit message? (;

@cgundogan
Copy link
Member

still need to do some tests with a linux-based boarder router. I have no hardware around today, so I can do it tomorrow

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

And where is the [ci skip] in your fixup commit message? (;

I forward your complaints to the git developers since they still don't allow me to configure the prefix generated by git commit --fixup=<commit> and picked up by git rebase -i --autosquash ;-)

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

(Done)

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

@cgundogan
Copy link
Member

((http://permalink.gmane.org/gmane.comp.version-control.git/288173))

👍 couldn't this be fixed with some pre-commit hooks?

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

Not if I want the commit still be picked up by --autosquash ;-)

@cgundogan
Copy link
Member

I understand --autosquash as a mechanism that inspects the prefix and sets the action while rebasing. In a pre-commit hook you could juts append [ci skip] at the end of the commit message?

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

I can try, but as far as I undestand the prefixing is the other way around.

@cgundogan
Copy link
Member

I can try, but as far as I undestand the prefixing is the other way around.

keep me informed, I would like to copy your fixup process (:

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

Nope. Appending or prepending [ci skip] to the commit message (either the original or the generated) will cause --autosquash not to pickup the commit. :(

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

</OT>

@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

Last commit is a test of something someone proposed on the [edit: git] mailinglist.

@miri64 miri64 force-pushed the gnrc_sixlowpan_iphc_nhc/fix/frag branch from 913c3f6 to b4452ab Compare March 3, 2016 16:40
@miri64
Copy link
Member Author

miri64 commented Mar 3, 2016

(and removed: seemed to work).

@jnohlgard
Copy link
Member

@cgundogan did you have a chance to test this today?

@miri64 miri64 force-pushed the gnrc_sixlowpan_iphc_nhc/fix/frag branch from b4452ab to ae52bf9 Compare March 4, 2016 15:40
@miri64
Copy link
Member Author

miri64 commented Mar 4, 2016

Done.

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 4, 2016
@cgundogan
Copy link
Member

@gebart thanks for the reminder.
I just ran a test with a phytec wega board as a linux border router and a samr21-xpro running the microcoap example. I modified the coap handler to return a long lorem ipsum string.
I explicitely enabled gnrc_sixlowpan_iphc_nhc in the Makefile of that example.

https://www.cloudshark.org/captures/062253ad8832

@authmillenon looks correct?

@miri64
Copy link
Member Author

miri64 commented Mar 4, 2016

Mh… I don't know your setup, but did you make sure that a RIOT node received the long coap packet? When it successfully received the packet it is correct. :-)

@cgundogan
Copy link
Member

nope, the coap message from the linux side was very small (coap get). Only the response from riot -> linux was big (:

@miri64
Copy link
Member Author

miri64 commented Mar 4, 2016

That explains why your previous tries were working ;-). This fix is for reception of fragmented NHC encoded packets. So if you are just send those with RIOT you do not test anything touched by this PR ;-)

@miri64
Copy link
Member Author

miri64 commented Mar 4, 2016

An alternative test would be to use my patch in RIOT-OS/Release-Specs#10 (comment) to send 1 KiB sized packets between two RIOT nodes. @cgundogan just needed to go, so if someone else wants to test until monday: knock yourselves out ;-)

@miri64
Copy link
Member Author

miri64 commented Mar 6, 2016

A friendly reminder for @cgundogan to test this tomorrow ;-)

@miri64
Copy link
Member Author

miri64 commented Mar 7, 2016

@cgundogan ping?

@jnohlgard
Copy link
Member

I am having a problem with the BR dropping the entire payload part of a forwarded UDP packet, possibly related to this PR. Currently investigating..

@miri64
Copy link
Member Author

miri64 commented Mar 9, 2016

Related as in this PR fixes it or this PR causes it?

@miri64
Copy link
Member Author

miri64 commented Mar 9, 2016

The fix for the border router NHC is at #4544 btw.

@jnohlgard
Copy link
Member

@authmillenon Thanks for the hint, I'll try that PR

@cgundogan
Copy link
Member

will test tomorrow - I promise (;

@miri64
Copy link
Member Author

miri64 commented Mar 11, 2016

I'm waiting in anticipation :)

@cgundogan
Copy link
Member

I don't say anything else, before I spread out more empty promises (:
Will be around noon at the university. If you are also there, maybe we can test/confirm it together.

@cgundogan
Copy link
Member

tested together with @authmillenon between two RIOT nodes and also with a RIOT node with a linux node.
NHC breaks on master and works with this branch. ACK!

@cgundogan cgundogan added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 11, 2016
@cgundogan
Copy link
Member

travis is happy, let's see what Murdock has to say.

@jnohlgard
Copy link
Member

I'm still seeing one issue with NHC and multihop routed fragmented packets, but I don't think this PR is the cause

@cgundogan
Copy link
Member

@gebart is there an issue somewhere describing this? Maybe I can also invest some time debugging that.

Nevertheless, travis && murdock are happy! GO

cgundogan added a commit that referenced this pull request Mar 11, 2016
…x/frag

gnrc_sixlowpan_iphc_nhc: fix NHC UDP decoding for fragmented packets
@cgundogan cgundogan merged commit ba7d623 into RIOT-OS:master Mar 11, 2016
@miri64 miri64 deleted the gnrc_sixlowpan_iphc_nhc/fix/frag branch March 11, 2016 15:41
@jnohlgard
Copy link
Member

@cgundogan I think the problem is that #4544 does not fix everything with regards to UDP NHC and fragmented packets

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.

4 participants