RtTcpipClient
The RtTcpipClient sample sends either UDP or TCP packets to a running instance of the RtTcpipServer sample, receives the packets echoed from the server, and accumulates statistics regarding the round-trip packet times. The server is specified by the IP address and port number. These, along with the protocol (UDP or TCP), packet size, and number of packets sent/received, are command-line arguments.
Statistics are displayed for every 500 packets sent. Minimum, average, and maximum round-trip packet times are displayed, along with the throughput. Once all packets are sent, statistics are displayed for all packets, and a histogram like that of SRTM is provided, showing the frequency with which various round-trip latencies were encountered. The congestion of the LAN and the determinism of the systems running the client and server samples are all factors to consider when interpreting the results.
If a UDP socket is not bound to an IP address, and the system has configured several IP addresses on the same subnet as the destination IP address (or the route to the destination), UDP datagrams will be sent using the first IP address configured for this subnet.
The various command line options are described below.
RTSS Usage
RTSSrun rttcpipclient.rtss i=IP_address [options]
Windows Usage
RtTcpipClient.exe i=IP_address [options]
Options
| Option | Description |
|---|---|
|
a=<ip> switch |
Specify an IP address to bind the client socket to. |
|
b=0,1 |
0=don't include the first 500 packets in performance metrics (default), 1=include the first 500 packets |
|
c= |
Connection loops (default=1) |
|
g=(1 or 0) |
This option only affects result printouts (default is 1). Use g=0 if you are running 100 MB or 10 MB connection. |
|
i= |
Destination IP address in dot notation. |
|
k |
Kill the server; remote shutdown of the Server |
|
m= |
Message loops (default=10000) |
|
n=0,1 |
0=disable Nagle Algorithm (default), 1=Enable Nagle Algorithm Note: Both the RtTcpipClient and RtTcpipServer must have the use of the Nagle Algorithm in the same state. Either both have the Nagle Algorithm disabled or both have the Nagle Algorithm enabled. |
|
o= |
Scope Id of link-local IPv6 address |
|
p=nn |
nn port number (default is 9999) |
|
r=nn |
Calculate and print the report at an interval of every nn number of loops (default is 500) |
|
s=packet size |
Packet size sent (default=1024) in bytes. |
|
e=nn |
Limits data size of send call |
|
/? |
/? displays usage |
|
/silent |
No printouts will occur after initialization |
|
t=nn |
Select timeout in ms. used only with UDP send (default is 1000) |
|
/udp |
Use UDP instead of defaulting to TCP |
|
w=nn |
Socket window size (SO_SNDBUF and SO_RCVBUF) options |
Output
In TCP mode (default), the console output should look like this:
*** RtTcpIpClient: WinSock started ***
*** Message Size = 1024 ***
*** Connection Loops = 1 ***
*** Message Loops = 10000 ***
*** Port = 9999 ***
*** SocketType = TCP ***
*** Do Not Include the first 500 packets in Performance measurement ***
Using server address : 192.168.200.199
*** Socket loop (1 of 1) ***
*** Client: socket created(0) ***
*** TimeStamp is Disabled ***
*** Nagle Algorithm is Disabled ***
*** Client: connected socket(0)***
500 packets (0 errors) min 100 us max 336 us avg 126 us rate 126 Mbps
1000 packets (0 errors) min 99 us max 542 us avg 123 us rate 129 Mbps
1500 packets (0 errors) min 100 us max 406 us avg 119 us rate 134 Mbps
2000 packets (0 errors) min 100 us max 6870 us avg 136 us rate 117 Mbps
2500 packets (0 errors) min 100 us max 4797 us avg 134 us rate 119 Mbps
3000 packets (0 errors) min 100 us max 239 us avg 113 us rate 141 Mbps
3500 packets (0 errors) min 97 us max 2537 us avg 126 us rate 126 Mbps
4000 packets (0 errors) min 98 us max 255 us avg 120 us rate 132 Mbps
4500 packets (0 errors) min 101 us max 253 us avg 121 us rate 131 Mbps
5000 packets (0 errors) min 100 us max 3423 us avg 126 us rate 126 Mbps
5500 packets (0 errors) min 99 us max 322 us avg 120 us rate 132 Mbps
6000 packets (0 errors) min 99 us max 279 us avg 126 us rate 126 Mbps
6500 packets (0 errors) min 97 us max 2427 us avg 127 us rate 125 Mbps
7000 packets (0 errors) min 98 us max 270 us avg 114 us rate 139 Mbps
7500 packets (0 errors) min 98 us max 205 us avg 111 us rate 144 Mbps
8000 packets (0 errors) min 98 us max 622 us avg 111 us rate 143 Mbps
8500 packets (0 errors) min 97 us max 284 us avg 111 us rate 143 Mbps
9000 packets (0 errors) min 97 us max 207 us avg 110 us rate 144 Mbps
9500 packets (0 errors) min 98 us max 289 us avg 115 us rate 138 Mbps
10000 packets (0 errors) min 98 us max 225 us avg 112 us rate 141 Mbps
10000 packet processed, 0 Errors, closing socket 0
*** Test Results ***
Packet Size = 1024 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 97 us
Maximum Time = 6870 us
Errors = 0
Lost Packets = 0
Packets received after timeout (1000 ms) = 0
Distribution...
0us-<200us 9911 packets (99.110 %)
200us-<400us 81 packets (0.810 %)
400us-<600us 2 packets (0.020 %)
600us-<800us 1 packets (0.010 %)
800us-<1000us 0 packets (0.000 %)
1000us-<1200us 0 packets (0.000 %)
1200us-<1400us 0 packets (0.000 %)
1400us-<1600us 0 packets (0.000 %)
1600us-<1800us 0 packets (0.000 %)
1800us-<2000us 0 packets (0.000 %)
2000us-<2200us 0 packets (0.000 %)
>2200us 5 packets (0.050 %)
Total packets = 10000
In UDP mode, the console output should look like this:
*** RtTcpIpClient: WinSock started ***
*** Message Size = 1024 ***
*** Connection Loops = 1 ***
*** Message Loops = 10000 ***
*** Port = 9999 ***
*** SocketType = UDP ***
*** Do Not Include the first 500 packets in Performance measurement ***
Using server address : 192.168.200.199
*** Socket loop (1 of 1) ***
*** Client: socket created(4) ***
*** Client: connected socket(4)***
500 packets (0 errors) min 106 us max 5921 us avg 147 us rate 108 Mbps
1000 packets (0 errors) min 111 us max 2871 us avg 144 us rate 110 Mbps
1500 packets (0 errors) min 101 us max 1882 us avg 131 us rate 121 Mbps
2000 packets (0 errors) min 105 us max 367 us avg 129 us rate 123 Mbps
2500 packets (0 errors) min 102 us max 5787 us avg 135 us rate 118 Mbps
3000 packets (0 errors) min 103 us max 3102 us avg 132 us rate 121 Mbps
3500 packets (0 errors) min 99 us max 241 us avg 129 us rate 123 Mbps
4000 packets (0 errors) min 106 us max 259 us avg 144 us rate 111 Mbps
4500 packets (0 errors) min 108 us max 298 us avg 141 us rate 112 Mbps
5000 packets (0 errors) min 112 us max 274 us avg 150 us rate 106 Mbps
5500 packets (0 errors) min 109 us max 469 us avg 145 us rate 109 Mbps
6000 packets (0 errors) min 110 us max 697 us avg 149 us rate 107 Mbps
6500 packets (0 errors) min 102 us max 287 us avg 135 us rate 117 Mbps
7000 packets (0 errors) min 102 us max 358 us avg 130 us rate 122 Mbps
7500 packets (0 errors) min 102 us max 245 us avg 122 us rate 130 Mbps
8000 packets (0 errors) min 101 us max 361 us avg 123 us rate 130 Mbps
8500 packets (0 errors) min 105 us max 492 us avg 124 us rate 128 Mbps
9000 packets (0 errors) min 102 us max 258 us avg 115 us rate 138 Mbps
9500 packets (0 errors) min 101 us max 254 us avg 118 us rate 135 Mbps
10000 packets (0 errors) min 102 us max 255 us avg 120 us rate 132 Mbps
10000 packet processed, 0 Errors, closing socket 4
*** Test Results ***
Packet Size = 1024 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 99 us
Maximum Time = 5921 us
Errors = 0
Lost Packets = 0
Packets received after timeout (1000 ms) = 0
Distribution...
0us-<200us 9396 packets (93.960 %)
200us-<400us 596 packets (5.960 %)
400us-<600us 2 packets (0.020 %)
600us-<800us 1 packets (0.010 %)
800us-<1000us 0 packets (0.000 %)
1000us-<1200us 0 packets (0.000 %)
1200us-<1400us 0 packets (0.000 %)
1400us-<1600us 0 packets (0.000 %)
1600us-<1800us 0 packets (0.000 %)
1800us-<2000us 1 packets (0.010 %)
2000us-<2200us 0 packets (0.000 %)
>2200us 4 packets (0.040 %)
Total packets = 10000
Note: Don't pay close attention to the “rate” information, as RtTcpipClient is not optimized for throughput (it waits to receive a response before it sends the next request to the server). The most relevant value is the round-trip time, which reflects the latency encountered in the network and the Stack.
APIs Referenced
RTAPI
Supported Windows API
- GetLastError
- GetProcessHeap
- HeapAlloc
- HeapFree
- QueryPerformanceCounter
- QueryPerformanceFrequency
- Sleep
Winsock BSD API
- bind
- closesocket
- connect
- freeaddrinfo
- getaddrinfo
- htons
- inet_pton
- recv
- select
- send
- setsockopt
- socket
- WSACleanup
- WSAGetLastError
- WSASetLastError
- WSAStartup
Related topics: