-
Notifications
You must be signed in to change notification settings - Fork 256
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
The pcap session doesn't emit UDP packet event until it receives the next package! #103
Comments
+1 The parallel tcpdump indicates the packet already received, but not yet by pcap based app |
This example generates the expected output for me on both OSX and Linux, so I think this bug got fixed and some point. This is probably both the same problem and solution as #110 |
Still have this bug tested using Debian Jessie, Nodejs 0.10.29 and the pcap package from npm install and github repo. Could you tell me which environment did you test, thanks. Besides there is another error reported
|
Hmm, I don't see this on my OSX or Linux machines. Can you give me more info on your environment? Linux distro + version and node version? |
|
Sorry for overlooking your version info in the previous message. This is very strange. I have similar node and Linux versions, and I do not see this behavior. I wonder if there's something different about how those DNS names resolve for you. I tried to use the same recursive DNS server you used in your example, but it doesn't give me any results. Maybe this is some kind of GFW issue? If you want to dig into this further, you could save a pcap from tcpdump, and then send over somehow. Maybe there's something about the DNS parser that's getting confused on certain kinds of responses that causes this. Since I can't see these responses myself, it's really hard to fix the bug. |
That is not DNS related. I have same behaviour with ICMP and any others. See pcap_header.tv_sec vs Date. The app:
then:
output:
|
I have just created a testing environment in a docker container. And send you an account to your email mjr@ranney.com. Thanks |
@cuckoohello I didn't get any email from you yet, sorry. I'm on gmail, so maybe that's in our way. @egorse I can't reproduce those results, but I want to figure out what's causing this. I know on some OSX systems, there was a similar issue what we worked around by setting BIOCIMMEDIATE on the pcap fd. Maybe there's something similar we need to set on some Linux systems? If you (or anyone reading this) are willing to dig into this some more, it would be very helpful to add some print lines in a few places in the code:
Also, when running a test like this, please make sure to use the same filter and interface for tcpdump that you use for node_pcap. In your example above, it would be |
I would guess that is actually not your issue - this seems to be 2015-01-12 21:38 GMT+02:00 Matt Ranney notifications@github.com:
|
@egorse 👍 Nice catch there! |
This tpacket3 stuff does sound promising. Can you try adding this line to pcap_session.cc, right before the call to pcap_activate():
My systems do not have a new enough pcap that exposes this. If you can confirm that this fixes the issue, I'll figure out how to #define around it. |
Adding
did help this issue to get fixed. Should it be somehow managed by option passed to createSession? |
+1 Adding
did help this issue to get fixed. |
Wonderful, thanks for testing that out. I'm working on a big refactor for a major performance win. As soon as that's done, I'll get the fix in for this. I think it should be set by default with a way to disable if you are doing higher volume traffic. |
Test Source Code
DNS Lookup
Pcap Output
*The pcap session doesn't emit UDP packet event until it receives the next package! *
The text was updated successfully, but these errors were encountered: