From Troubleshooting with the Windows Sysinternals Tools. Get your copy here
PSPing Server mode
After determining that you can connect to a TCP port, your next question might be, “How long does it take to send a megabyte of data? Or download a hundred megabytes? How much data can I upload in a minute?” To perform tests like these, the server has to cooperate. You can’t send lots of data to a server unless the program on the other end is willing to accept that data, nor expect a server to send you arbitrary quantities of data in a way that lets you obtain reliable performance measurements. In particular, the program on the server has to be focused on network communications and can’t spend its time performing large amounts of file I/O, for example.
PsPing
To meet that need, PsPing offers a server mode that’s designed to interoperate with the PsPing
client. A single instance of the PsPing server supports both the PsPing latency and bandwidth tests described later in this chapter—TCP or UDP, upload, or download—and remains active until you exit.
It can also create temporary firewall rules enabling PsPing to listen for inbound connections from remote systems.
Use the –s option to run PsPing in server mode. The complete server-mode, command-line syntax is
psping [-6|-4] [-f] -s address:port
address | The IPv4 or IPv6 address of the listening interface. If you specify an IPv6 address, you must enclose it in square brackets. The address can also be a local server name, in which case PsPing will pick an available IPv4 or IPv6 interface. |
port | The TCP port number that PsPing opens for inbound connections. For UDP tests, the PsPing client will first establish a TCP connection to this port and send instructions to the PsPing server. The PsPing server will then open an inbound UDP port with the same port number. |
–6 –4 |
When you are specifying the address as a server name that has both IPv4 and IPv6 interfaces, –6 forces using the IPv6 interface, and –4 forces using the IPv4 interface. |
–f | Creates temporary firewall rules allowing PsPing.exe to open and listen on the specified inbound TCP and UDP ports. This option requires administrative rights. These firewall rules are deleted when you press Ctrl+C to exit PsPing server mode. |
To end PsPing server mode, press Ctrl+C. Before it exits, PsPing deletes any firewall rules that it
created. Note that if PsPing is terminated in another manner, it will not be able to clean up and the firewall rules will remain in place.
TCP/UDP latency test
PsPing latency testing consists of repeatedly sending a fixed amount of data to a server and
measuring the time it takes from the beginning of each transmission until the client receives the
server’s acknowledgement that it has received the data. You can specify whether to send TCP or UDP, and whether to test uploading from the client to the server or downloading from the server to the client. All the data is sent in a single connection from a single thread: PsPing does not open a new connection for each iteration. Note that an instance of PsPing running in server mode must be listening at the target destination and port.
The command-line syntax for PsPing’s latency testing is
psping -l requestsize[k|m] -n count[s] [-r] [-u] [-w count] [-f] [-h [buckets|val1,val2,…]]
[-6|-4] destination:port
–l requestsize[k|m] –n count[s] –r –u –w count –f |
Specifies the amount of data to send in each test. Append “k” for kilobytes or “m” for megabytes. Note that the maximum with UDP is slightly less than 64k. Without “s”, specifies how many times to send the requested data. With “s” appended, it performs testing for count seconds. For example, this command sends 8 kilobytes of data 10 times: psping –l 8k –n 10 192.168.1.123:1001 This command sends 8 kilobytes of data repeatedly for 10 seconds: psping –l 8k –n 10s 192.168.1.123:1001 The count begins after all warmup operations have completed. Requested data is sent from the server to the client instead of from the client to the server. Tests UDP latency instead of TCP. Data is sent over UDP instead of TCP. Warmup: starts by sending the requested data count times but does not include measurements in the results. If this option is not specified, PsPing performs five warmup operations. Creates a temporary outbound firewall rule allowing PsPing to connect to a remote server. This should rarely be needed. Requires administrative rights. |
–h –h buckets –h val1,val2,… –6 –4 destination:port |
Outputs the results as a histogram, with a default of 20 evenly-spaced buckets. PsPing histograms are described later in this chapter. When you are specifying the destination as a name rather than as an IP address, –6 forces using IPv6 and –4 forces using IPv4. The host and TCP port number with which to communicate. The destination can be specified as an IPv4 address, an IPv6 address, or a resolvable server name. An IPv6 address must be specified within square brackets to distinguish the address from the port number—for example: psping –l 8k –n 10 [fe80::b0ef:4695:cb8e:feb4]:1001 The destination and port must be an instance of PsPing running in server mode. |
To read more, see the book.