Home Forums Discussions Support Portal SEND PACKET TO DESIRED ADAPTER

This topic contains 2 replies, has 2 voices, and was last updated by  joseespa 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #9685


    I’m trying to implement in a c ++ internet gateway example a bandwidth control. Charge the packets in a buffer and send or discard them according to the determined bandwidth.

    I capture packets from adapter 1 (connected to the internet)

    The problem is when the timer skips to send a packet with delay and the adapter 2 (LAN) event has been activated. I do not know how to select the adapter to send the data packet to the desired adapter.

    Is there any possibility of doing it? Any guidance?

    Thanks in advance


    Vadim Smirnov

    If I’m not mistaken Internet Gateway uses single thread to send/receive packets from both adapters (LAN and WAN) waiting with WaitForMultipleObjects an adapter associated event objects.

    So, in order to implement bandwidth management I’d advise launching two threads instead, one per network interface, each waiting with WaitForSingleObject on associated event. This way you should be able to delay packets for the selected network adapter without affecting the second one. Just note to take care about threads synchronization when accessing shared data. You can use Ethernet Bridge source for the reference for thread per network adapter model.



    Tanks !!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.