Betterspeedtest.sh doesn't work

Hi

# sh betterspeedtest.sh -4 -H netperf-eu -t 180
2022-05-11 05:09:13 Testing against netperf-eu (ipv4) with 5 simultaneous sessions while pinging gstatic.com (180 seconds in each direction)
.betterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found

 Download: 0.00 Mbpsbetterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found

  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000
.betterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found
betterspeedtest.sh: line 169: netperf: not found

   Upload: 0.00 Mbps
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000

then:

opkg search netperf
root@port4:/tmp# opkg list | grep netperf
netperf - 2.7.0-2 - Network performance measurement tool
speedtest-netperf - 1.0.0-1 - Script to measure the performance of your network and router.  Please see https://github.com/openwrt/packages/blob/master/net/speedtest-netperf/files/README.md for further information.

# opkg install netperf
Installing netperf (2.7.0-2) to root...
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/arm_cortex-a15_neon-vfpv4/packages/netperf_2.7.0-2_arm_cortex-a15_neon-vfpv4.ipk
Configuring netperf.
Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC

why this is a server?

not working

sh betterspeedtest.sh -4 -H netperf-eu -t 180
2022-05-11 05:12:38 Testing against netperf-eu (ipv4) with 5 simultaneous sessions while pinging gstatic.com (180 seconds in each direction)
.ping: bad address 'gstatic.com'

 Download: 0.00 Mbps
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000
sh: can't kill pid 30296: No such process
.ping: bad address 'gstatic.com'
.
   Upload: 0.00 Mbps
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000
sh: can't kill pid 30316: No such process

next try

sh betterspeedtest.sh -4 -H netperf-eu -t 180 -p swisscom.com
2022-05-11 05:13:21 Testing against netperf-eu (ipv4) with 5 simultaneous sessions while pinging swisscom.com (180 seconds in each direction)
.
 Download: 0.00 Mbps.
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000
.
   Upload: 0.00 Mbps
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000

I get empty results

How-To use betterspeedtest.sh?

See @richb-hanover-priv 's github for instructions -

Appears you missed what packages to install -

opkg update
opkg install netperf
opkg install git
cd /usr/lib
git clone https://github.com/richb-hanover/OpenWrtScripts.git

Still not working, same error

git clone https://github.com/richb-hanover/OpenWrtScripts.git
Cloning into 'OpenWrtScripts'...
git: 'remote-https' is not a git command. See 'git --help'.

opkg install git-http

git clone https://github.com/richb-hanover/OpenWrtScripts.git


/usr/lib/OpenWrtScripts

-rw-r--r--    1 root     root          3657 May 11 05:39 tunnelbroker.sh
drwxr-xr-x    2 root     root           304 May 11 05:39 tests
drwxr-xr-x    2 root     root           240 May 11 05:39 sample_output
-rwxr-xr-x    1 root     root          5805 May 11 05:39 opkgscript.sh
-rw-r--r--    1 root     root           257 May 11 05:39 networkhammer.sh
-rwxr-xr-x    1 root     root          7010 May 11 05:39 netperfrunner.sh
drwxr-xr-x    2 root     root           240 May 11 05:39 lib
-rw-r--r--    1 root     root          4858 May 11 05:39 idlelatency.sh
-rwxr-xr-x    1 root     root          3094 May 11 05:39 getstats.sh
-rwxr-xr-x    1 root     root         10108 May 11 05:39 config-openwrt.sh
-rwxr-xr-x    1 root     root          8205 May 11 05:39 betterspeedtest.sh
drwxr-xr-x    2 root     root           288 May 11 05:39 TestScripts
-rw-r--r--    1 root     root         14332 May 11 05:39 README.md
-rw-r--r--    1 root     root         18025 May 11 05:39 LICENSE


# sh betterspeedtest.sh -4 -H netperf-eu -t 180 -p swisscom.com
2022-05-11 05:40:24 Testing against netperf-eu (ipv4) with 5 simultaneous sessions while pinging swisscom.com (180 seconds in each direction)
.
 Download: 0.00 Mbps
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000
.
   Upload: 0.00 Mbps
  Latency: (in msec, 1 pings, 0.00% packet loss)
      Min: 0.000
    10pct: 0.000
   Median: 0.000
      Avg: 0.000
    90pct: 0.000
      Max: 0.000

and


# opkg install netperf
Package netperf (2.7.0-2) installed in root is up to date.

I couldn't get the git clone stuff to work, so just create OpenWrtScripts in /user/lib and copy the script(s) there.

After that, it works.

Using username "root".


BusyBox v1.33.2 (2022-04-16 12:59:34 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 21.02.3, r16554-1d4dea6d4f
 -----------------------------------------------------
root@OpenWrt:/usr/lib/OpenWrtScripts# sh betterspeedtest.sh -4 -H netperf.buffer
bloat.net -t 60

2022-05-10 20:49:10 Testing against netperf.bufferbloat.net (ipv4) with 5 simultaneous sessions while pinging gstatic.com (60 seconds in each direction)
.............................................................
 Download:  39.23 Mbps
  Latency: (in msec, 57 pings, 0.00% packet loss)
      Min: 7.375
    10pct: 10.412
   Median: 70.957
      Avg: 73.173
    90pct: 134.740
      Max: 144.489
.............................................................
   Upload:  47.2 Mbps
  Latency: (in msec, 61 pings, 0.00% packet loss)
      Min: 7.544
    10pct: 18.082
   Median: 30.758
      Avg: 32.770
    90pct: 36.230
      Max: 144.985
root@OpenWrt:/usr/lib/OpenWrtScripts#

1 Like

I needed to whitelist gstatic.com.

gstatic.com is a known malware domain.

https://example.org/cgi-bin/luci/admin/services/adblock/whitelist

then its working

@anon89577378 my results

# sh betterspeedtest.sh -4 -H netperf.bufferbloat.net -t 60
2022-05-11 06:12:15 Testing against netperf.bufferbloat.net (ipv4) with 5 simultaneous sessions while pinging gstatic.com (60 seconds in each direction)
.............................................................
 Download: 99.08 Mbps
  Latency: (in msec, 60 pings, 0.00% packet loss)
      Min: 11.101
    10pct: 11.155
   Median: 14.651
      Avg: 25.609
    90pct: 54.742
      Max: 64.526
...............................................................
   Upload: 100.34 Mbps
  Latency: (in msec, 63 pings, 0.00% packet loss)
      Min: 11.443
    10pct: 11.470
   Median: 12.780
      Avg: 46.738
    90pct: 148.189
      Max: 226.388

is there an issue with my results? Does it look good?

It belongs to Google, I doubt it has anything to do with malware.

If you're on 10 mbit, they're awesome, if you're on 1gbit, they suck...

There's no real need for setting up a blocking DNS for the router itself, it's enough to do it for the clients.

1 Like

Not true at all. Google is the biggest developer of malware. Very few of Google's software projects have little or no malware (I'm thinking of Kubernetes, Go and others).

Surveillance capitalism and advertising is malware. Ask Richard Stallman, he will confirm this.

This my provider advertises

100 Mbit/s max. Download
100 Mbit/s max. Upload

How to do that? That's a great idea.

You should probably read up on the definition of the word malware ...

Then you're spot on.

That's how it was, by default, you need to undo what you've done with the WAN DNS settings.

1 Like

I dont understand that. It means my results are fine?

This?

If you're on a 100/100 connection, you're fine.

However, you're testing from the router to the endpoint.

You may get different results on a client device such as a laptop or smartphone...and using a tool like Ookla's Speedtest app, and Waveform's bufferbloat/speedtest site.

1 Like

I was just about to mention that running the script on a low-power router can skew the results quite heavily, like e.g. I get completely different results on a real, proper PC on the network than when running the script on a MT7621A-based Xiaomi-router. The router could only get to around ~130Mbps download-speeds and it also got higher ping-latencies, whereas the PC got ~500Mbps and around 16ms ping-latencies for all the different fields.

2 Likes

Quick note, better speedtest allows you to specify the histnameIP-address to use for the latency/RTT measurements:

# Usage: sh betterspeedtest.sh [ -4 -6 ] [ -H netperf-server ] [ -t duration ] [ -p host-to-ping ] [ -i ] [ -n simultaneous-sessions ]

# “H” and “host” DNS or IP address of the netperf server host (default: netperf.bufferbloat.net)
# “t” and “time” Time to run the test in each direction (default: 60 seconds)
# “p” and “ping” Host to ping for latency measurements (default: gstatic.com)

The default gstatic.com is IMHO a decent choice as Google takes care to use anycast to make sure gstatic.com is reasonably close and well connected to your link. But if you prefer different ping-reflector hosts, betterspeedtest.sh has you covered, you just need to find a reasonable alternative. Typically hosts like 8.8.8.8, 1.1.1.1, 9.9.9.9, mensura.cdn-apple.com tend to be heavily anycasted and hence suitably close (at least in some parts of the world) but in the end you will need to pick your poison and decide which of the companies you are willing to stomach taking "services" from.

In Germany you could use 'breitbandmessung.de' which appears to be hosted by AS8767 M-Net (or you could try to get the IP addresses of actual measurement hosts) or lookingglass.telekom.com.

The bigger issue to keep in mind is that the host running the remote netperf servers is operated/financed by a private volunteer, so please do not over use betterspeedtest.sh with the default servers for stuff like automated repeating measurements...

1 Like

Its available bandwidth appears to be limited as well. As mentioned, I only got ~500Mbps down on it, whereas I get ~980 using Speedtest/Dslreports/etc. It's ok on a low-bandwidth connection, but with anything faster I'd say it merely serves to indicate whether there is something extremely wrong with the connection or not and nothing more.

2 Likes

@frollic "Use DNS servers advertised by peer" will use the DNS of my provider? My provider does censorship.

thanks for heads up. Will test on a Raspberry when at home.

thanks for the heads up. Didnt know that. Did a web search for netperf and found out this is developed before I was born :slight_smile:

Ooh, we've got a greenhorn in here! :upside_down_face:

Doesn't have to be, but some other DNS that works from where you are, like 8.8.8.8 or 1.1.1.1, etc.

I doubt your IPS is censoring the sites your router needs to access, and please note there's a difference here, between your router, and the router's clients.

I would guess that it is located on the east side of the US of A, and probably connected via a 1 Gbps link, but depending on what else the server does and how congested the path from there to ones client is one can expect to see results considerably smaller than the link speed...

Yes, it will act as forwarder to your ISPs DNS servers with that setting. All ISPs in Europe "do censorship" because they all follow the applicable laws... You can try to run your own DNS resolver and sort of side-step the ISP DNS servers, but that will likely result in sub-optimal anycast servers. Also some services require ISPs DNS servers (in my case O2 VoIP will only work using the ISPs DNS servers, I simply configured these explicitly in my VoIP base station and run my own resolver for the rest).

I may be missing something, but...why would they need to run some separate resolver? Just pointing the router to use e.g. Namecheap's DNS will skip the ISP's censorship. Namecheap's DNS-servers are pretty damn fast as well, at least for me.