Advertisement

limiting trafic speed

Started by July 31, 2003 06:03 AM
4 comments, last by sleepytim 21 years, 6 months ago
Hi all, I have been playing with LSPs to intercept TCP/UDP/IP trafic. I have got the basic intercept working fine and now i want to do something useful with it. Does anyone have any techiques/ideas for how i could limit the upload/download speed... the way the LSP works is that when the application calls recv or send my DLL intercepts the call b4 it gets to winsock. 1 idea I had for limiting download would be.. IF dowloading too fast then Reduce the max bytes to recieve b4 passing the Recv call to winsock Assuming that worked well... would it be safe to do the following: IF uploading too fast then Only upload x of the requested bytes and of course return the actual number of bytes uploaded to the client app Any ideas and comments welcome thanks
quote:
Original post by sleepytim
Does anyone have any techiques/ideas for how i could limit the upload/download speed...


Having another socket exclusively for Flash and ShockWave advertisement banners is a sure way to decrease network bandwidth.

With a replacement DLL, you can filter out one out of every 3 ACK packets and let TCP figure out what happened and perform a slow restart.

You can remove the plastic tab hook on your RJ connector so that it disconnects from your network adapter randomly.

Have you tried Kaazaa or playing CounterStrike online while downloading a file ? Or better, FTP the latest Linux version.
Advertisement
you seem a bit confused au, that would be how to waist bandwidth
> ... now i want to do something useful with it.

Limiting bandwidth is certainly not useful, at least not the way you intend it. Having a little desktop icon like ''Task Manager'' with vertical bars indicating incoming and outgoing traffic on a protocol and port basis would be better.

> Reduce the max bytes to recieve b4 passing the Recv call to winsock
> Only upload x of the requested bytes and of course return
> the actual number of bytes uploaded to the client app

TCP: That would make the application spin its wheel faster, thus wasting CPU time that would be better used somewhere else.

UDP: That''s dangerous since you are cutting out parts of potentially large incoming and outgoing messages.

-cb
>>Limiting bandwidth is certainly not useful

Yes it is ! of course it is.. say you want an ftp client to be capped @ 10KBps leving the rest of the bw for other apps

i guess no one actually has any useful ideas on this advanced topic :/
> say you want an ftp client to be capped @ 10KBps

That could be done through the FTP protocol (there is a throttle mechanism you can control). I''ve seen one implementation of FTP (WinFTP?) that did have user-selectable options to limit the use of bandwidth.

> leaving the rest of the bw for other apps

Then again, how can your LSP can identify which socket belongs to which application and alter it in a coherent manner? Your LSP starts to behave like an OS scheduler, then.

> {...} useful ideas on this advanced topic

QA people will love you if you can simulate network screwups and lag in a controlled manner (through a scriptable object?), a la DP8SIM.DLL/DirectPlay, and even gather statistics exportable to an Excel spreadsheet (hint hint hint). DirectPlay is so ... Microsoft ... and not every game team elect to use DirectPlay even on the Windows platform; I feel there is a market for you right there.

-cb

This topic is closed to new replies.

Advertisement