speed-test-lib icon indicating copy to clipboard operation
speed-test-lib copied to clipboard

bitrate is very very high!! (not correct)

Open mjhram opened this issue 8 years ago • 10 comments

Hi, The bitrate I obtained in upload (.startFixedUpload("2.testdebit.info", 80, "/", 10000000, 10000);) is very high, which indicates an error in calculation somewhere... following is sample of output. real bitrate should be around 100kbps, but output is ~262Mbps.

V/speedtest: [UL PROGRESS] progress : 0.6554%
V/speedtest: [UL PROGRESS] rate in bit/s   : 262140000.0000
V/speedtest: [UL PROGRESS] progress : 1.3107%
V/speedtest: [UL PROGRESS] rate in bit/s   : 262140000.0000
V/speedtest: [UL PROGRESS] progress : 1.966%
V/speedtest: [UL PROGRESS] rate in bit/s   : 262140000.0000
V/speedtest: [UL PROGRESS] progress : 2.6214%
V/speedtest: [UL PROGRESS] rate in bit/s   : 299588571.4288

mjhram avatar Feb 18 '17 15:02 mjhram

The issue is the same as #11 the problem is with flush() socket method. In some versions of Android, socket is not actually flushing (SO post). This behavior happens at the upload beginning and stabilizes after that. The workaround is to calculate only after a setup time for instance :

speedTestSocket.setUploadSetupTime(4000);
speedTestSocket.startFixedUpload("2.testdebit.info", 80, "/", 10000000, 10000);

bertrandmartel avatar Feb 19 '17 00:02 bertrandmartel

Hi, I noticed another issue, which I don't know its reason: When I try the DownloadFileExample with host="download.thinkbroadband.com" & uri="/20MB.zip", from PC, the file is downloaded correctly. Whey I try the android example with the same host&uri on mobile, the file starts downloading and then stopped, as if the host is waiting something, then off course timeout is raised. The download rate of the mobile is about 2.4Mbps and for PC, I used the mobile as a hotspot. Thanks

mjhram avatar Mar 01 '17 05:03 mjhram

I've tried your endpoint and it's working fine for me on Android & PC (tried also with access point), what's your Android version ? Did you try another server URL, do you see the same behavior ?

bertrandmartel avatar Mar 01 '17 12:03 bertrandmartel

Thanks for your reply. I am using Galaxy S5 with Android 6.0.1. Following are some tries:

  1. I installed xampp and downloading from local server. The download completed without any issue.
  2. I used my own file on external server (http://ajerlitaxi.com/3gtests/files_db/dummy.bin), but also have the same issue. Download stopped after downloading about ~11MB. I think the issue is in TCP protocol, but I cannot find it. I am looking for some way to capture packets. I tried tPacketCapture (which uses VPN), but it has some issues. Now I am looking for someway without VPN.

mjhram avatar Mar 05 '17 09:03 mjhram

I capture packets using PC Wireshark: dump.pcapng Now, I used the PC as a hotspot and connect the mobile to it, so that I can capture packets using WireShark. If you can have a look, and help me find what is wrong, I would be appreciated. I think the peer ip is: 157.240.9.50 (Wireshark filter: ip.addr == 157.240.9.50)

mjhram avatar Mar 05 '17 18:03 mjhram

I've tested your server and it's working fine for me on PC, mobile with 4G, mobile with Wifi (even with very low speed 1XX ko/s). Can you test with Mobile Wifi, do you see the same behavior ? Is it the same with other speed test server from this list

157.240.9.50 seems to be facebook.com, and the traffic is TLS so it's not related to your problem. The IP is 66.96.147.168 and I didn't find it in your capture

You should see something like : speed

By the way, could you check you haven't some download data limitation app or anything application related on your mobile. You can test on other smartphone to look if you have the same behavior

bertrandmartel avatar Mar 05 '17 21:03 bertrandmartel

I tried using rooted device with Android Icecream Sandwich and capture using "tcpdump" tool. I used two different mobiles as hotspot with different data plans (low and high data rate). I select a host from the Server List http://spt001.gorannet.net/speedtest/random3000x3000.jpg (ip: 95.159.66.9). Same issue happened. Following are dump files:

  • at low data rate: dmp2.pcap (3.2M)
  • at high data rate: dmp.pcap (12.7M) I have no WiFi Network for now, but I will find one and test on it. And I have no data limitation app.

mjhram avatar Mar 07 '17 06:03 mjhram

There seems to be a packet loss that trigger the whole dupACK, but this won't tell us the problem to fix. I will give you a version where you can modify socket parameter to test if that helps. For instance disabling KeepAlive among other things. I will try also 3G/2G, 2G only and 3G only to see if that change something for me

bertrandmartel avatar Mar 08 '17 01:03 bertrandmartel

I've made some experiences with LTE networks since then but couldn't reproduce your issue. Did you make some progress with this ?

bertrandmartel avatar May 11 '17 02:05 bertrandmartel

Unfortunately no

mjhram avatar May 11 '17 05:05 mjhram