The wping command is a test program that sends data in a controlled manner between a WANFast client and server in order to test your WANFast connection between the two.  It can be used to: 

(back to top)

Verifying Your Installation

If you have installed both the client and server applications on a machine, you can use the applications to verify the installation.  This process is similar to the next section on verifying a connection between a client and server machine.  Prior to testing your installation, make sure that you have:

  1. Installed the WANFast software on the machine that you are testing.  See Getting Started.
  2. Created your WANFast key pair.  See Create or Import Your Key Pair.

In a command prompt window, change to your home WANFast directory.  On Linux this will be ~/.wfst.  On Windows this will be C:/Users/UserName/AppData/Local/WANFast.  If the directory does not exist, then you will need to create or import your key pair. Now copy your public key to the end of your authorized_keys file.   On linux this would be:

cat wfst.pub >> authorized_keys

On Windows this would be:

type wfst.pub >> authorized_keys

You can now test the installation by running the command:

wping localhost 

If you specified anything other than the default WANFast port (4900), then you will need to use the command:

wping --server-port=PORT localhost

 where PORT is the same value that you specified during the installation.

There should be no need to configure the local Windows or Linux firewall as the installation process does this for you. 

If the installation was successful, wping will continue printing lines similar to:

Sent 1 BW 0.1 mbps

once a second until you type control C to stop the command.  If there are any errors or warnings, check the next section for diagnostics.

(back to top)

Verifying the Connection Between a WANFast Client and Server

Prior to testing your connection to to WANFast server, make sure that you have:

  1. Installed the WANFast software on both the client and server machines.  See Getting Started.
  2. Created your WANFast key pair.  See Create or Import Your Key Pair.
  3. Distributed your public key to the server.  See Add Your Public Key to One or More Servers.
  4. Configured any firewalls between the client and server to allow access to the WANFast port on the server machine.

To test a connection to a server, simply run the following command:

wping [--server-port=PORT] [username@]address 

where address is the host address or IP address of the server and username is optionally the name of the user account to log into on the server.  This attempts to establish a WANFast session to the specified account on the target machine using the configured TCP port of the server.  If you have installed the server on a non-standard port (i.e., on any port other than 4900), then you must include the option --server-port=PORT to identify the target port number.  If no username is specified, your current login ID will be used. 

If it is successful establishing a connection, wping will continue printing lines similar to:

Sent 1 BW 0.1 mbps

once a second until you type control C to stop the command.  You have successfully verified the WANFast configuration for the client and server.

The first time that you run the command you will receive the message:

Host (52.43.139.230) key (v958fgH5/f+E5NvSnu6MdfroBehsf+rdHZlOsSGxkfA==) not found.  Add to known_hosts? (y/N)

It is generally safe to enter "Yes" and accept the server's public key.  In high security applications you should first verify the displayed key hash against the file wfst.hash in the server's WANFast directory.

Possible Warnings and Error Messages

WARNING: Host (127.0.0.1) key (C2H47RCJbJLZ813WG2yOW9RW+YdvQT6mnsQZiiNUsXs==) has changed.  Update known_hosts? (y/N) 

The public key on that server has changed for some reason.  This would be suspicious on a production server.  Be sure that the key change is legitimate before type "Y" to proceed. 

Your WANFast private key (/home/cwatt/.wfst/wfst.key) cannot be read.
Either the file doesn't exist, it is encrypted, or it is in an incorrect format.
...

Most likely you have not set up your WANFast account.  See Getting Started.

Server error: Not authorized: User@127.0.0.1 (ID=User@wanfast.net) --> User

You have not added your public key correctly to the authorized_keys file in the target user account on the server.

Server error: You have insecure file permissions on the file /home/cwatt/.wfst/authorized_keys

You need to run the command wfstPerms to set the security attributes on your WANFast files.

Your license has expired.  Please contact WANFast sales to renew your license

Your license is not installed correctly or has expired.  You will need to install your master license file, wfst.mst. See Install a Production License.  If you do not have a master license file, you will need to purchase one from WANFast Sales.

connect() -- 110, Connection timed out

The client was unable to initiate a TCP connection to the WANFast port on the server.  Most likely you have specified an incorrect address or the server cannot be access due to network or firewall constraints.  Make sure that any firewalls are configured to allow access. See Install the Software or Open Firewall Ports

connect() -- 111, Connection refused

The client was unable to initiate a TCP connection to the WANFast port on the server because it was rejected by the server, or it was rejected by a firewall.  Verify that the wfstd process is running on the server, that it is configured for the correct port, that you have specifying the correct port during the login attempt, and that all firewalls are configured to allow the connection.  

connect() -- 113, No route to host

Most likely you have specified an incorrect host name or IP address.

(back to top)

Tuning the Configuration Between a Client and Server

After you have verified your connection to a server, you are ready to tune your WANFast configuration to achieve the maximum transfer speed with that server.  The default configuration file that is created during your WANFast installation is designed to provide reasonable throughput with minimal impact upon the client machine's performance.  The default encryption algorithm (hc-128-spookyv2) is the fastest of the supported 128-bit stream ciphers.  See WANFast Security for information on the available algorithms.  The default compression algorithm (lz4) is much faster than the other algorithms, but the slower algorithms provide much better compression.  Together the defaults can transfer file data at over 10Gbps, provided that your 

First choose your encryption algorithm.  For all but the most secure applications the default algorithm (hc-128-spookyv2) is recommended as it provides the fastest 128-bit encryption with message authentication and integrity.  See WANFast Security for information on the available algorithms.  Then run either:

wping --tune --save=new.cfg [--server-port=PORT] [username@]address 

or

wping --tune -n EncryptionAlgorithm --save=new.cfg [--server-port=PORT] [username@]address 

where EncryptionAlgorithm is the name of the selected encryption algorithm if you want to use something other than the default.  In either case the command will run for several minutes, printing out the results of its tests similar to the following.  It will save the final results in the file, new.cfg.

$ wping -n hc-128-spookyv2 --tune --save=new.cfg This email address is being protected from spambots. You need JavaScript enabled to view it.
Tuning for maximum throughput
Selected Encryption: hc-128-spookyv2
Tuning Compression:
null
Sent 19105 buffers, 312099280 bytes in 5.1 seconds. BW 494.3 mbps, Line 495.1 mbps
Compression ratio: 1.00.  Buffers compressed 100.0%.

lz4
Sent 29617 buffers, 483823312 bytes in 5.0 seconds. BW 771.6 mbps, Line 553.9 mbps
Compression ratio: 1.40.  Buffers compressed 70.4%.

zstd-1
Sent 32620 buffers, 527139200 bytes in 5.0 seconds. BW 839.9 mbps, Line 451.7 mbps
Compression ratio: 1.87.  Buffers compressed 100.0%.

... skipping many more compression tests

FASTEST ALGORITHM: zstd-2: 1052.6 mbps
Tuning Pool Size: Running with 2 cores

Pool Size: -p 2
Sent 14743 buffers, 238246880 bytes in 5.0 seconds. BW 378.3 mbps, Line 198.3 mbps
Compression ratio: 1.91.  Buffers compressed 100.0%.

Pool Size: -p 3
Sent 38546 buffers, 622903360 bytes in 5.0 seconds. BW 994.3 mbps, Line 521.2 mbps
Compression ratio: 1.91.  Buffers compressed 100.0%.

... skipping many more pool size tests

FASTEST POOL SIZE: -p 16: 1060.1 mbps

The contents of the new configuration file will look similar to:

log-level = 0x1
pool-size = 16
ctl-pool-size = 3
compress = true
auto-compress = true
compress-alg = zstd-2
encrypt = true
encrypt-alg = hc-128-spookyv2

You can rename the new configuration file to wfst.cfg and copy it to the machine's WANFast configuration directory or your own personal WANFast  directory.  If you are transferring files between many servers that require different configurations, save the configuration file as something other than wfst.cfg and use the -f FileName option when starting a WANFast command to select the configuration.

(back to top)

Measuring Achievable Throughput

To measure achievable throughput between two machines, set the delay between packets to zero, e.g., 

./wping -I60 -d0 -Q -u This email address is being protected from spambots. You need JavaScript enabled to view it.
Waiting ...
Sent 2777435 TX 2898006 lost 123235/6723 4.3% TP 530.4 BW 559.5 mbps, win 40/0 RTT 0/91.4/383
UDP Session SUCCESSFUL

The -u option tells wping to use the UDP transprot.  The -I 60 option specifies sending packets for 60 seconds.  The -d 0 option specifies no delay between packets, i.e., as fast as possible.   The results show a packet loss rate of 4.3%, an achieved throughput of 560 Mbps, and an average RTT of 91 ms.  These are actual measurements run between Amazon's EC2 data centers in Virginia and Oregon.   The packet loss rate and the wide variance in RTT is not typical for Amazon's internal network.  Their internal network was pretty busy.  Note that the full loss rate of 4.3% cannot be attributed to Amazon's network.  When configured this way to achieve maximum throughput, wping pushes the network, aggravating the packet loss.

We can compare this to the throughput that can be achieved using the tunnel transport by switching the -u to -w:

./wping -I60 -d0 -Q -w This email address is being protected from spambots. You need JavaScript enabled to view it.
Waiting ...
Sent 345525 BW 184.1 mbps
Tunnel Session SUCCESSFUL

We see that this significantly slower than the UDP transport.  The packet loss rate really slows down TCP connections.

We can also use wping to measure the throughput that would be achieved using a single TCP connection -- i.e., without using WANFast -- by using the -T option:

./wping -I60 -d0 -Q -T This email address is being protected from spambots. You need JavaScript enabled to view it.
Sent 81901 BW 44.4 mbps
Single TCP Connection SUCCESSFUL

This is quite slow, as again the packet loss rate causes havoc with TCP connections.  The WANFast tunnel was more than 4x as fast because it multiplexed the data over 6 parallel TCP connections.

These results are fairly typical of busy network conditions over a WAN, even over a top class network as provided by Amazon.  The UDP transport transferred data more than 12x faster than applications like ftp/sftp that use a single TCP connection.  The tunnel transport was more than 4x faster.   The larger the RTT and the larger the packet loss, the greater this advantage becomes.

The following three tests were run between two Ubuntu 18 virtual machines running on Amazon t3.micro instances, one in Virginia and one in Oregon:

 root@ip-172-31-18-208:/root/.wfst# wping -I60 -d0 -Q -T 18.236.233.121
Sent 48901 BW 26.4 mbps
Single TCP Connection SUCCESSFUL
root@ip-172-31-18-208:/root/.wfst# wping -I60 -d0 -Q -w 18.236.233.121 Waiting ... Sent 118694 BW 63.2 mbps Tunnel Session SUCCESSFUL
root@ip-172-31-18-208:/root/.wfst# wping -I60 -d0 -Q -u 18.236.233.121 Waiting ... Sent 3991063 TX 3992380 lost 1317/195 0.0% TP 762.1 BW 770.7 mbps, win 40/0 RTT 3/83.5/186 UDP Session SUCCESSFUL

Even though the WAN connection looks pretty good with low loss rate, the single TCP connection is only good for 26.4Mbps.   The WANFast tunnel with 6 parallel TCP connections is 2.4x faster.  But the UDP transport is a whopping 28x faster.  

Note that when you test throughput on a LAN, or within a single region in a cloud, where the RTT is < 10ms and the loss rate is essentially zero, the tunnel transport can often give you better throughput than the UDP transport.  The maximum potential throughput from a tunnel is > 2Gbps.  The maximum potential throughput for the UDP transport is < 1Gbps as it uses smaller data block sizes to fit within a single Ethernet packet, requires more overhead to track and retransmit lost packets, and takes a larger processing hit from the encryption algorithm (as it must reinitialize for every data block).

(back to top)

Testing the Effect of Configuration Changes on Throughput

By adding command options to the wping command used above to measure throughput, you can see how configuration changes effect throughput.  Consider the five examples below:

wping -I10 -d0 -T -Q -E This email address is being protected from spambots. You need JavaScript enabled to view it.
Sent 545501 BW 1773.5 mbps

wping -I10 -d0 -w -Q This email address is being protected from spambots. You need JavaScript enabled to view it. Waiting ... Sent 602089 BW 1779.2 mbps

wping -I10 -d0 -w -Q -n aesctr-128 This email address is being protected from spambots. You need JavaScript enabled to view it. Waiting ... Sent 79092 BW 233.7 mbps

wping -I10 -d0 -w -Q -c -z zlib-1 This email address is being protected from spambots. You need JavaScript enabled to view it. Waiting ... Sent 53700 BW 158.1 mbps

wping -I10 -d0 -w -Q -c -z zlib-9 This email address is being protected from spambots. You need JavaScript enabled to view it. Waiting ... Sent 49500 BW 145.8 mbps

The first example tests the maximum speed of a single TCP connection over a LAN with no encryption.  It achieves a throughput of 1774 Mbps.  

The second example tests tunnel performance over the same LAN using the default settings to achieve a throughput of 1779 Mbps.  This is about the same speed as the single raw TCP connection, but is fully encrypted using the default hc-128 algorithm.  Note that the encrypted tunnel does consume more CPU than the raw TCP connection.

The third example changes the encryption algorithm to AES in CTR mode with a 128-bit key.  This significantly slows down data transfer to 233 Mbps.  The default encryption algorithm, hc-128, is an extremely fast 128-bit stream cipher designed for high speed network communications, and is much faster than the AES standard algorithm with comparable key size.

The fourth example returns to the default encryption algorithm, but turns on compression using the fastest (and therefore less compressive) setting.  This slows performance to 158Mbps.  So unless your WAN link is running below this, turning on compression does not help.

The final example tests compression again, this time with the slowest and most compressive setting.  This slows down a bit more to 145Mbps.  But if your network is significantly slower that this, you can often greatly improve your throughput using this setting, provided the files you are copying are not already compressed, encrypted, or otherwise random.

(back to top)

Diagnosing Throughput Issues

As shown in the figure below, there are three primary factors that can limit your maximum transfer speed:

  1. The read speed of the disk on the source machine
  2. The write speed of the disk on the target machine
  3. The achievable transfer speed over the network

 

The read and write disk speeds are absolute limits to the speed at which very large files can be transferred.  You can only transfer it as fast as it can be read from the source disk.  And while most modern file systems provide large, fast caching on the write side, if your file is more than a few GB in size, eventually the cache will be exhausted and the data must go onto the target disk, at which point the transfer will slow down.  See below to learn how to measure your disk speed.

(back to top)

Measuring Disk Speed

The WANFast wcp command has built in disk speed diagnostics.  Beware, running these diagnostics will consume all of the disk bandwidth.  Other applications that use the disk will see a severe performance impact for the duration of the test.  Think twice about running these tests on a busy production server.

The Disk Write Test

The disk write test creates a file and writes random data to it as fast as possible until it reaches the specified size.  Most disk systems provide substantial caching for disk writes, so you will typically need to write a file of several GB to exhaust the cache and observe the true disk speed.

wcp --disk-wr-test -s SIZE FileName

where SIZE is the desired size in MB.  Thus -s 5000 would create a 5GB file.

The Disk Read Test

The disk read test is run as follows:

wcp --disk-rd-test FileName

It will read the file as fast as possible.  As with the write test, in order to avoid the disk cache and observe the true disk speed, the file should be several GB in size.

(back to top)

The wping Command Syntax

All WANFast options for the wping client can only be specified on the command line. You can use either the short or long form of the option.  The short form is -F V, where is the one-character option and V is the value (if required).  The long form is --option-name=option-value with no spaces between the name, '=', and value.  If the value includes spaces, such as for a path name, enclose the value in double quotes, --option-name="option value".  

When using an option in the configuration file, use the long form of the option without the leading "--".   In the configuration file it is OK to have spaces between the option name, '=', and value, and OK to have spaces in the value.  You can add a comment line to your configuration file by starting the line with '#'.

SYNTAX: C:/Program Files/WANFast/wping.exe [OPTIONS] UserName@Address
    [-a int   | --count=int]              Just send N packets
    [-d int   | --delay=int]              Delay between packets in ms
    [-I int   | --scan-interval=int]      Just send for N seconds
    [-Z       | --compressible]           Use compressible, text data
    [-T       | --single-tcp]             Run wping test using a single TCP connection.
    [-t path  | --test-file=path]         Specify the name of a file containing test data
    [-w       | --tunnel-transport]       Use WANFast tunnel data transport [default]
    [           --block-size=int]         Specify file read/write block size 512,1024,1280,1440
    [-y       | --accept-hosts]           Silently accept unknown hosts.
    [-p int   | --pool-size=int]          Size of connection pool [1-16]
    [-x MBPS  | --max-bandwidth=MBPS]     Max bandwidth per VC in mbps [MBPS=int].
    [-c       | --compress]               Compress all data transfers
    [-C       | --no-compress]            Do not compress any data transfers [default]
    [-k       | --auto-compress]          Automatically determine whether to compress
    [-z alg   | --compress-alg=alg]       Specify the compression algorithm [alg=string]
    [-e       | --encrypt]                Encrypt with the default algorithm [default]
    [-E       | --no-encrypt]             Do not encrypt
    [-n alg   | --encrypt-alg=alg]        Specify the stream encryption algorithm [alg=string]
    [-b alg   | --block-encrypt-alg=alg]  Specify the block encryption algorithm [alg=string]
    [-i path  | --identity-file=path]     Identity file path.
    [-A path  | --authorized-keys=path]   Specify the path to the authorized keys file
    [-f path  | --config-file=path]       Configuration file path.
    [-g path  | --log-file=path]          Log file path.
    [-D int   | --log-level=int]          Set log level.
    [-Q       | --quiet]                  Quiet output
    [-V       | --verbose]                Verbose output
    [           --config]                 Print configuration
    [-v       | --version]                Version
    [-q c|e   | --query=c|e]              List supported compression (c) or encryption (e) algorithms
    [-F ID    | --create-key-file=ID]     Create a keyfile [ID = hostname, IP, or email]
    [-M       | --import-key-file]        Import a keyfile [keyFilePath] [ID]
    [           --server-port=port]       Specify the WFST service port [port=int].
    [           --tcp-keep-alive=int]     Set the keep-alive timeout used by all TCP connections

(back to top)