Vadim Smirnov

Forum Replies Created

Viewing 15 posts - 586 through 600 (of 1,476 total)
  • Author
    Posts
  • in reply to: Изменение пакета #9598
    Vadim Smirnov
    Keymaster

      Если пакет был изменен, то надо по меньше мере пересчитать контрольные суммы. Это делается? Если нет, то пакет с неверной контрольной суммой может быть просто отброшен стеком на принимающей стороне.

      in reply to: C# Collect packets in queue before processing them #9596
      Vadim Smirnov
      Keymaster

        You must process the packet before calling

        Ndisapi.SendPacketToAdapter(driverPtr, ref request);

        The call above injects the packet into the network flow and processing does not make any sense after this point.

        If I understand you right then you are working over bandwidth limiter solution for outgoing traffic. So, instead of SendPacketToAdapter you should put packet into the queue (List<INTERMEDIATE_BUFFER> an example). A different thread can pop packets from the queue and call SendPacketToAdapter for them when time passes or queue reaches some predefined limit.

        in reply to: C# Wait? #9588
        Vadim Smirnov
        Keymaster

          Just add Console.ReadKey() before forwarding packet to the network interface. Below is a part of PassThru C# sample with Console.ReadKey() added.

          Please note, that all the networking for the selected network interface will be frozen while console waits for the input…

          while (packetsCount > 0)
          {
          	manualResetEvent.WaitOne();
          
          	while (Ndisapi.ReadPacket(driverPtr, ref request))
                  {
                  	--packetsCount;
          
                          buffer = (INTERMEDIATE_BUFFER)Marshal.PtrToStructure(bufferPtr, typeof(INTERMEDIATE_BUFFER));
          
                          WriteToConsole(buffer, bufferPtr);
          
                          if (buffer.m_dwDeviceFlags == Ndisapi.PACKET_FLAG_ON_SEND)
          		{
          			Console.ReadKey();
          	                Ndisapi.SendPacketToAdapter(driverPtr, ref request);
          		}
                          else
                                  Ndisapi.SendPacketToMstcp(driverPtr, ref request);
                  }
          
                  manualResetEvent.Reset();
          }
          in reply to: WinpkFilter news/updates. #9578
          Vadim Smirnov
          Keymaster

            WinpkFilter 3.2.7.6 update:

            • Fixed Hyper-V switch issue: enabling filter driver for virtual switch and at the same time for the network interface below it, could result incorrect send/receive operation counting and thus prevent the filter from correct detach. Under some circumstances it could result DRIVER_POWER_STATE_FAILURE.

            Driver version in version resource was also updated according the request above.

            If you are eligible for a free update, please send the following details to support@ntkernel.com tо receive an update instruction:

            Your order ID.
            An approximate date of purchasing.

            in reply to: WinpkFilter news/updates. #9570
            Vadim Smirnov
            Keymaster

              Yes, NDIS LWF drivers were rebuilt to switch off the debug output, but besides this driver has not changed (and other drivers were not changed at all). If you have any reason to have the resource changed in the onsite build I could consider doing this. However, the onsite build is mostly used for demo and test purposes so I never thought that it can be important.

              Vadim Smirnov
              Keymaster

                Hmm, I don’t think you can alter Windows native bridge behavior, however you can try an alternative network bridging approach suggested here https://www.ntkernel.com/bridging-networks-with-windows-packet-filter/. It should work for your setup.

                If your task is connecting RNDIS USB device to laptop network then you can also use NAT approach instead bridge. I have had such experience in the past with USB connected NetTalk DUO device.

                And the last, you can try to play around OID_GEN_CURRENT_PACKET_FILTER by setting it directly for underlying USB RNDIS miniport. WinpkFilter driver allows you to bind above and below Windows native Ethernet Bridge, so you can bind to USB RNDIS miniport directly even with enabled bridging. And then try try set different filter for USB RNDIS by using CNdisApi:SetHwPacketFilter. Al least you can find out if setting different packet filter can help here.

                in reply to: VirtNet in Windows 10 #9339
                Vadim Smirnov
                Keymaster

                  It looks that problem is specific to the particular host, not to Windows 10 in general. There are two possibilities: first, something is screwed in this particular Windows installation and you may try system restore or you have some kind of security software installed which prevents third-party drivers from being installed…

                  in reply to: VirtNet in Windows 10 #9337
                  Vadim Smirnov
                  Keymaster

                    I have tested VirtNet on Windows 10 x86 1511 and Windows 10 x64 1607. In both cases driver was installed using Device Manager and installation worked as intended.

                    I suspect you have tryed to install x86 driver build on x64 platform or vide versa. This would explain an error message you have got.

                    in reply to: VirtNet in Windows 10 #9336
                    Vadim Smirnov
                    Keymaster

                      Hmm, probably driver package have to be updated to support Windows 10. We will check and update the package if necessary.

                      in reply to: 'Jumbo Frame' – 9000 bytes length frames #9335
                      Vadim Smirnov
                      Keymaster

                        Question: What happens if, for whatever reason, all 1000 buffers are filled before a receiver calls ReadPacket(hDriver, &Request)?

                        First, I have to note that part of this buffers (10% or 100 packets) is reserved and never placed into the adapter queue. So if packets queue grows up to 900 buffers (an example, if user mode application stops reading packets from the driver) then the driver stops placing followed packets into the queue. Instead it checks packets against loaded static filters and current adapter mode, if the packet should be passed then it is passed, if it should be dropped OR PLACED INTO THE QUEUE then is is DROPPED. Such driver behaviour allows to avoid network lock if user mode application is hangs. An example, in case of remote debugging you can set the static filter to pass TCP port 3389 (RDP) and even if you stop the filtering application in debugger (causing driver queue grow up to maximum size) you still won’t loose the RDP connection. Although, please note that all other network activity (except allowed explicitely by static filters) will be blocked.

                        in reply to: 'Jumbo Frame' – 9000 bytes length frames #9330
                        Vadim Smirnov
                        Keymaster

                          There are actually two different things by the link you posted, socket buffer size and winpcap buffer size. If your question is about WinpkFilter driver internal buffers then for Windows Vista and later driver preallocates 1000 buffers for 1514 bytes sized packets. This value is hardcoded (changing requires driver recompile) and can’t be changed from user mode application.

                          in reply to: 'Jumbo Frame' – 9000 bytes length frames #9328
                          Vadim Smirnov
                          Keymaster

                            It also requires driver recompilation with ‘#define MAX_ETHER_FRAME 9000’.

                            in reply to: 'Jumbo Frame' – 9000 bytes length frames #9326
                            Vadim Smirnov
                            Keymaster

                              Do you mean incoming jumbo frames?

                              in reply to: 'Jumbo Frame' – 9000 bytes length frames #9324
                              Vadim Smirnov
                              Keymaster

                                Yes, this is possible for your custom build.

                                in reply to: 'Jumbo Frame' – 9000 bytes length frames #9320
                                Vadim Smirnov
                                Keymaster

                                  Yes, this is a part of required changes, but it is not enough to change this definition in common.h and rebuild ndisapi.dll. In order to enable jumbo frames you also have to enable jumbo frames in winpkfilter driver and rebuild it.

                                Viewing 15 posts - 586 through 600 (of 1,476 total)