LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increase UDP received packets per second

Solved!
Go to solution

The version posted ‎06-24-2016 which has 'timeouts' doesn't work correctly.  Turns out that the pcap timeout functions don't really work on windows machines.

Message 21 of 37
(2,760 Views)

I have a new version of this that:

- does correctly have timeouts

- uses eclipse/mingw to compile the dll

- and also has much much better performance (i was forgetting to set the winpcap buffer size... oops)

 

I will try and get around to posting it at some point, I've got to clean it up to remove some proprietary bits at whatnot.

0 Kudos
Message 22 of 37
(2,606 Views)

Hello.

 

Please, can you share with me with the new version of code, which includes timeouts.

 

Thank you.

0 Kudos
Message 23 of 37
(2,500 Views)

Hi there.

 

Because I needed this DLL for LabView 64 bit, I made some small modifications (the pointers "pcap" have to changed to uInt64 or better to uintptr_t in the VIs)  and used the actual NPCAP SDK for the build.

It is build with VS 2019 and the latest SDK and WDK.

I also added the pcap_set_buffer_size function as an extra function in the DLL.

You need to install the latest NPCAP for this, with winpcap API compabilty...

 

Example for buffer size:

marcuskr_0-1585309782579.png

 

 

BR

Marcus

 

0 Kudos
Message 24 of 37
(2,259 Views)

Hi Marcus,

This is great, thank you.

I installed the last version of wireshark (which includes the last version of npcap), enable the winpcap API compatibility mode, change the VIs to call your dll, and change all the pcap handles.

It doesn't work for me.
As an example with your dll I get 1 interfaces + 2 dummy interfaces, whereas with the previous one I got 6 (which is the good value).

Are the pointers "pcap" the only thing you changed in the wrappers VIs ?

What is your version of npcap ?

Would it be possible for you to share your updated VIs ?

Did you include the last jjjcjj modifications (not included in his last posted DLL) ? :
""-does correctly have timeouts
- and also has much much better performance (i was forgetting to set the winpcap buffer size... oops)""

 

Thanks,

0 Kudos
Message 25 of 37
(2,198 Views)

Sorry, I never got around to posting it and I since left the job that I had all the source code at.

 

The buffer size is just some winpcap library function call you have to make.  I don't remeber it off hand but its something you should be able to look up.  I /think/ it might just be this: https://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga124bde25ccd9e39017ff2abec2dda623

 

I don't remember what I did to make the timeouts work.  I don't recall whether I found a workaround or implemented it myself with busy waits.

0 Kudos
Message 26 of 37
(2,188 Views)

Sorry I'm late to the game.  Could you catch me up on why you are trying to use WinPcap?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 27 of 37
(2,180 Views)

 - Promiscuous packet capture

 - Considerably higher packet rate and total throughput than the built in function

 - The relatively easy ability to offload some low level manipulation to C (i.e. proprietary de-interleaving of data)

 - The ability to combine packets in C, lowering the loop rate that labview has to run at.

0 Kudos
Message 28 of 37
(2,164 Views)

I must be half asleep.  The original post didn't make much sense.  (Deleted.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 29 of 37
(2,149 Views)

Hi Sébastien.

 

In the attachment you find the complete directory modificated in that way, that the Packet Sniffer ecample works in 64bit.

All the other SubVis, that are not needed for this example, I did not touch but could be modified in the same way I guess.

My version of npcap is 0.9989 but as the API does not change (WinAPI compatible) there is no need for a special version.

I only changed the pointer-size, yes.

You can change the buffer-size, but it is not nesccary, because the default value works pretty well here. The timeouts I did not change.

You can try the example (I ripped all the filter and displaying off for speed, but could also work with).

Anyway, I decide to use the built-in UDP VI from LabView and rebuild the ethernet header for myself and write this to a pcap file (with the pcap-vis here), because I don't need the exact time-stamps and I don't need to filter the stream afterwards.

 

BR

 

Marcus

0 Kudos
Message 30 of 37
(2,136 Views)