Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > how about implement network bandwidth shaping for win7?

Reply
Thread Tools Display Modes

how about implement network bandwidth shaping for win7?

 
 
Fei Zhang
Guest
Posts: n/a

 
      07-01-2010
I wanna implement a traffic shaper for win7 to limit some application's
downloading speed.If I write a ndis intermediate driver and throttle the
receiving speed from the IM driver, the IM driver should put the
application's rx frames into a queue to limit its receiving speed, that will
use out the miniport NIC driver's rx buffer so that the NIC will send pause
frame to the partner. Then all other application's receiving performance
will decline too. This is not what I expect. It seems that Winsock Kernel
and Windows Filtering Platform can't be used to shape traffic, limit
receiving speed. I know some firewall for xp uses TDI driver to shape
traffic, but there is no TDI on win7 now. What should I do?
Any suggestions or any kind of keywords will be appreciated. Thanks a lot
in advance.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5241 (20100630) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




 
Reply With Quote
 
 
 
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      07-01-2010
> use out the miniport NIC driver's rx buffer so that the NIC will send pause
> frame to the partner.


There is no such thing as "pause frame" sent by the NIC. This is all done at the TCP level.

What you can really do is to really emulate low bandwidth, i.e. delay - or even drop altogether - the packets belonging to some "pipe", so that the total data flow through a pipe will be below the limit.

If done properly, this will properly influence the TCP's slow start/congestion avoidance algorithm and properly decrease the download speed.

Or you can use the OS's PSCHED, which is now - a pity - manageable only from the admin tools, not from the app's code.

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
Pavel A.
Guest
Posts: n/a

 
      07-01-2010
"Maxim S. Shatskih" <> wrote in message
news:...
>> use out the miniport NIC driver's rx buffer so that the NIC will send
>> pause
>> frame to the partner.

>
> There is no such thing as "pause frame" sent by the NIC. This is all done
> at the TCP level.


This is 802.3x flow control
http://en.wikipedia.org/wiki/Ethernet_flow_control

> What you can really do is to really emulate low bandwidth, i.e. delay - or
> even drop altogether - the packets belonging to some "pipe", so that the
> total data flow through a pipe will be below the limit.


.... and this can cause re-sends on TCP level :-( May work with UDP.

> Or you can use the OS's PSCHED, which is now - a pity - manageable only
> from the admin tools, not from the app's code.
>


There's really no some API for pacer (or whatever its name)? Pity, indeed.

Regards,
-- pa


 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      07-01-2010
>> What you can really do is to really emulate low bandwidth, i.e. delay - or
>> even drop altogether - the packets belonging to some "pipe", so that the
>> total data flow through a pipe will be below the limit.

>
> ... and this can cause re-sends on TCP level :-( May work with UDP.


This is how FreeBSD's "dummynet" works actually. Resends will occur, but this is OK - on a slow network, they will occur anyway. Just don't forget to send SQ when the packet is discarded.

> There's really no some API for pacer (or whatever its name)? Pity, indeed.


Once it was controllable by QoS bits in IP header, but now MS abandoned this and it is only controllable now using some admin tools, so the app writers cannot hardcode the packet priority.

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
Pavel A.
Guest
Posts: n/a

 
      07-01-2010
"Maxim S. Shatskih" <> wrote in message
news:...
>>> What you can really do is to really emulate low bandwidth, i.e. delay -
>>> or
>>> even drop altogether - the packets belonging to some "pipe", so that the
>>> total data flow through a pipe will be below the limit.

>>
>> ... and this can cause re-sends on TCP level :-( May work with UDP.

>
> This is how FreeBSD's "dummynet" works actually. Resends will occur, but
> this is OK - on a slow network, they will occur anyway. Just don't forget
> to send SQ when the packet is discarded.
>
>> There's really no some API for pacer (or whatever its name)? Pity,
>> indeed.

>
> Once it was controllable by QoS bits in IP header, but now MS abandoned
> this and it is only controllable now using some admin tools, so the app
> writers cannot hardcode the packet priority.


IIRC, the diffserv DSCP field take over the 3 QOS bits in the 802.1p/Q
ethernet header.
the value in this field is index into table of TC "flows". And IIRC there is
some API to configure the "flows".
Haven't touched this stuff for long time. They now have MDSN forum for QOS:
msdn.en-us.networkqoswave

Regards,
-- pa

> --
> Maxim S. Shatskih
> Windows DDK MVP
>
> http://www.storagecraft.com
>

 
Reply With Quote
 
Fei Zhang
Guest
Posts: n/a

 
      07-02-2010
Hi Pavel, Maxim,
Thank you all, your suggestions are very helpful. I'm studying and revising
the WFP driver to shape traffic now. Thanks for your kind help.
BR,
Fei Zhang



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5244 (20100701) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network recognition won't stick.... Øyvind Granberg Windows Vista Networking 3 05-01-2010 01:30 PM
Can't add XP PC to wireless network setup on Vista fshelledy Windows Vista General Discussion 2 12-26-2009 08:11 PM
Computer in Network Cannot connect powerwalk Windows Vista Networking 2 12-12-2009 06:25 PM
Re: Local Access Only, Unidentified Network Jack-MVP Windows Vista Networking 5 12-08-2009 11:48 AM
Network Disk and "The network BIOS session limit was exceeded" Joachim Windows Vista Administration 0 05-22-2007 05:33 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59