Help with speed test application development


I am developing an application which is similar to

I need your advice on how to achive the ping and download and upload speeds. I have experience in as3, but very new to this kind of applications. can you please give your thoughts on how this application is developed.

I assume the application needs to download a file, based on the data loaded in that specific time we calculate the download speed. i am not sure about the upload and the ping.
Please share your ideas and links where i can get more info about it.

Thanks in advance,