Write a simple server that will echo whatever it receives.
The Tcl time
command will report how long a command takes
to run.
timescript ?count?
script |
The script to evaluate |
count |
Optional number of times to evaluate the script |
For example:
% time {expr $i+$j}
45 microseconds per iteration
% time {expr {$i+$j}}
31 microseconds per iteration
Write a client which will connect to the echo server and report the length of time it takes to send a string to the server and receive the answer.
The client should have a short loop to send multiple strings are report the times.
You can test this by running the client and server on the same system. This will give you an idea for how fast the TCP stack in your system is.
Just for comparison, a client that takes averages 10 readings with different sizes of data generates a report like this for a satellite modem and a 28.8 plain modem.
The satellite has high bandwidth, but very high latency. The phone modem has low latency and also a low bandwidth limit.
Satellite | Phone |
---|---|
Message Size: 104 : 68.4 ch/sec | Message Size: 104 : 479.5 ch/sec |
Message Size: 208 : 139.3 ch/sec | Message Size: 208 : 859.8 ch/sec |
Message Size: 416 : 240.1 ch/sec | Message Size: 416 : 1359.8 ch/sec |
Message Size: 832 : 552.7 ch/sec | Message Size: 832 : 1789.4 ch/sec |
Message Size: 1664 : 1051.4 ch/sec | Message Size: 1664 : 2955.9 ch/sec |
Message Size: 3328 : 1833.1 ch/sec | Message Size: 3328 : 3641.6 ch/sec |
Message Size: 6656 : 2150.6 ch/sec | Message Size: 6656 : 3643.5 ch/sec |
Message Size: 13312 : 6755.2 ch/sec | Message Size: 13312 : 4744.4 ch/sec |
Message Size: 26624 : 5781.1 ch/sec | Message Size: 26624 : 4430.1 ch/sec |
Message Size: 53248 : 15162.0 ch/sec | Message Size: 53248 : 4908.7 ch/sec |