Click here to Skip to main content
15,306,245 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello guys! I need a source code in C, C++ to test network speed like a

And I need a theory and methods of this tool. For example how to measure the speed.. What I should know to make this tool etc.. Please help me!!
pasztorpisti 7-Apr-13 4:57am
You can not measure the "speed of the internet". You can measure the speed/quality of a route from one machine to another. has servers all over the world to test the connection between one of the servers and your machine. The connection is affected by all routers through which your packets are hopping. For a lot of money you can rent a dedicated line for yourself from one location to another, in this case the bandwith and latency of your connection between the two locations can be guaranteed. (some multinational companies do that between their offices). Note that the overall quality of the communication channel is the quality of the worst hop/router in the path of your communication. Your packets may go through superfast routers that are not overloaded on 99.99% of the packet route but if one slow overloaded router gets into the path of your packets then your connection slows down. Another important thing is that usually there are 2 separate values that worth measuring in case of "connection speed": bandwith and latency. Measuring bandwith is straightforward, you send a big bunch of bytes from one machine to another using your protocol (TCP or your custom protocol over UDP) and then you calculate the megabytes per second. You have to send a lot of data as some transfer algorithms (like TCP) start with slow data transfer and reach their max bandwith to avoid network congestion and you want to see as little as possible from this slow start in your averaging. You can write a smart detection that doesn't calculate in the slow start if you have the patience. The latency is usually measured by sending a few udp packets and measuring their roundtrip time. The latency might be affected by the size of the sent/received upd packets.

1 solution

It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to and ask there.

But be aware: you get what you pay for. Pay peanuts, get monkeys
Purevochir 7-Apr-13 4:44am
Just examples.. I need theory to measure internet speed help me

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