-
Notifications
You must be signed in to change notification settings - Fork 534
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
npcap 0.9993 pcap_packetsend() won't send above 1500 bytes #186
Comments
Thanks for the report. Within Npcap, we do a very simple check against the MaxFrameSize for the adapter, which should work as you are expecting. Can you answer a few followup questions so we can better diagnose the problem?
|
I did some checking in the source, and it looks like there is a discrepancy in the values we are using. Npcap prior to version 0.9988 uses a fixed MaxFrameSize of 1514 regardless of what the network stack supports. This is obviously incorrect because some interfaces do not support this size due to 802.1q or other constraints on frame size. Npcap 0.9986 and later set the MaxFrameSize based on the maximum MTU reported by NDIS when we attach to the adapter. Unfortunately, this is the value we would get from OID_GEN_MAXIMUM_FRAME_SIZE, which does not include the space taken up by the link header. What we need instead is the value we would get from OID_GEN_MAXIMUM_TOTAL_SIZE, which includes the link header minus any 802.1q or 802.1p tag space that a lower layer would add. Unfortunately, this isn't available in the filter attach parameters or restart attributes, so we would have to issue an OID request for it. I will see if I can get this corrected in the release I'm prepping at the moment. In the meantime, you can get the actual value Npcap is using internally by using OID_GEN_MAXIMUM_FRAME_SIZE or another method to get the MTU for the adapter. I'm sorry for the inconvenience. |
The next release will be bugfix-only, so we will work on this after that. Thanks again for reporting it. |
I was under the impression that OID_GEN_MAXIMUM_FRAME_SIZE was deprecated for LWF Drivers as stated here link. When I tried to use it to make a workaround for this issue it always returned 0. I honestly don't know why this would be deprecated as it is still very useful? Can you point me in the right direction to where you use it in your code? |
Got the same issue here. At the end you'll see my diag report. This issue have been failing at least from 0.9988 for me. Works fine using winpcap (old winpcap). Please, if you need any aditional info i'll be glad to help. DiagReport for Npcap ( http://npcap.org ) Script Architecture: 64-bit OS Info: Caption : Microsoft Windows 10 Home CPU Info: Name : Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz Memory Info: Size: 16208 MB (16995794944 Bytes) Network Adapter(s) Info: Caption : [00000003] Intel(R) Wi-Fi 6 AX201 160MHz Caption : [00000014] VMware Virtual Ethernet Adapter for VMnet1 Caption : [00000015] VMware Virtual Ethernet Adapter for VMnet8 Caption : [00000016] Fortinet Virtual Ethernet Adapter (NDIS 6.30) Caption : [00000017] TAP-Windows Adapter V9 Caption : [00000020] Fortinet SSL VPN Virtual Ethernet Adapter Caption : [00000021] PPPoP WAN Adapter NDIS Light-Weight Filter (LWF) Info: HKLM:\SYSTEM\CurrentControlSet\Control\Network{4d36e974-e325-11ce-bfc1-08002be10318}*: InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {227, 7, 11, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {228, 7, 6, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {228, 7, 1, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {221, 7, 12, 0...} InstallTimeStamp : {221, 7, 12, 0...} File Info:
Mode LastWriteTime Length Name -a---- 9/06/2020 2:14 p. m. 862 CheckStatus.bat
Mode LastWriteTime Length Name -a---- 12/06/2020 5:02 p. m. 102232 NpcapHelper.exe
Mode LastWriteTime Length Name -a---- 12/06/2020 5:02 p. m. 102232 NpcapHelper.exe WinPcap Info: HKLM:\SOFTWARE\WOW6432Node\WinPcap: Registry Info: HKLM:\SOFTWARE\WOW6432Node\Npcap: AdminOnly : 0 HKLM:\SYSTEM\CurrentControlSet\Services\npcap: Type : 1 HKLM:\SYSTEM\CurrentControlSet\Services\npcap\Parameters: NdisImPlatformBindingOptions : 0 HKLM:\SYSTEM\CurrentControlSet\Services\npcap_wifi: Start : 4 HKLM:\SYSTEM\CurrentControlSet\Services\npf: Service Info: Status : Running Get-Service : No se encuentra ningún servicio con el nombre 'npf'.
Install Info: Please refer to: C:\Program Files\Npcap\install.log |
Got the same issue, normal frames with 1514 bytes causes PacketSendPacket failure. Tested on different systems. WinPcap works fine. Can try the test builds if necessary. Thank you guys for your work. |
It works now! |
I am using version 0.9993 of npcap. When I query the pcap interface for the OID_GEN_MAXIMUM_TOTAL_SIZE I get 1514, but when I send a frame containing TCP data with the length of 1514 it errors out. I understand that the TCP MTU is 1500 with 14 extra bytes for the Ethernet Header I get 1514. This should work right? Am I missing something?
Please help thanks.
The text was updated successfully, but these errors were encountered: