Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i Control the download speed of an application using QoS API?

What I have tried:

I have QoS Traffic control reference Structure FLOWSPEC which helps me control the traffic but Upload speed/rate is limited I need to limit download speed/rate using QoS API.
Posted
Updated 11-Jan-18 8:29am
v3
Comments
Member 8620759 29-Jul-16 5:51am    
I have used QoS and Traffic Control API's like TcAddFlow and TcAddFilter to control my applications download bandwidth usage.
We need to manipulate TC_GEN_FLOW, send and receive FLOWSPEC paramters.
Now I want to set the limit to exact 5Mbps, What are the value I will need to set for TokenBucketSize and TokenRate to limit the bandwidth to 5Mbps in FLOWSPEC structure?


Code snippet:
newFlow->ReceivingFlowspec.DelayVariation = QOS_NOT_SPECIFIED;
newFlow->ReceivingFlowspec.Latency = QOS_NOT_SPECIFIED;
newFlow->ReceivingFlowspec.MaxSduSize = QOS_NOT_SPECIFIED;
newFlow->ReceivingFlowspec.MinimumPolicedSize = QOS_NOT_SPECIFIED;
newFlow->ReceivingFlowspec.PeakBandwidth = POSITIVE_INFINITY_RATE;
newFlow->ReceivingFlowspec.ServiceType = SERVICETYPE_NETWORK_CONTROL;
newFlow->ReceivingFlowspec.TokenBucketSize = ?;
newFlow->ReceivingFlowspec.TokenRate = ?;
newFlow->SendingFlowspec.DelayVariation = QOS_NOT_SPECIFIED;
newFlow->SendingFlowspec.Latency = QOS_NOT_SPECIFIED;
newFlow->SendingFlowspec.MaxSduSize = QOS_NOT_SPECIFIED;
newFlow->SendingFlowspec.MinimumPolicedSize = QOS_NOT_SPECIFIED;
newFlow->SendingFlowspec.PeakBandwidth = POSITIVE_INFINITY_RATE;
newFlow->SendingFlowspec.ServiceType = SERVICETYPE_NETWORK_CONTROL;
newFlow->SendingFlowspec.TokenBucketSize = ?;
newFlow->SendingFlowspec.TokenRate = ?;
Thanks & Regards
chaau 11-Jan-18 18:46pm    
Why don't you use the PeakBandwidth parameter for this? From MSDN: PeakBandwidth - The upper limit on time-based transmission permission for a given flow, in bytes per second. https://msdn.microsoft.com/en-us/library/windows/desktop/aa373702(v=vs.85).aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900