199Chapter 6Securing Linux# ping www.example.comPING (Medical web site) www.example.com (192.0.34.166): from
Wednesday, October 24th, 2007199Chapter 6Securing Linux# ping www.example.comPING www.example.com (192.0.34.166): from 10.0.0.11: 56(84)bytes of data64 bytes from 192.0.34.166: icmp_seq=1 ttl=62 time=1252 ms64 bytes from 192.0.34.166: icmp_seq=2 ttl=62 time=1218 ms64 bytes from 192.0.34.166: icmp_seq=3 ttl=62 time=1290 ms64 bytes from 192.0.34.166: icmp_seq=4 ttl=62 time=1288 ms64 bytes from 192.0.34.166: icmp_seq=5 ttl=62 time=1241 ms— www.example.com ping statistics — 6 packets transmitted, 5 received, 0% loss, time 5032msrtt min/avg/max/mdev = 1218.059/1258.384/1290.861/28.000 msIn this example, a ping packet took, on average, 1.3 seconds to make the round trip. From the first example to the second example, latency increased by a factor of 31! Adata link that goes from working normally to slowing down by a factor of 31 is aclear sign that link utilization should be investigated. For a more accurate measure of data throughput, a tool such as ttcpcan be used. Totest your connection with ttcp, you must have installed the ttcp package on machinesinside andoutside your network. If you are not sure if the package is installed, sim- ply type ttcpat a command prompt. You should see something like the following: # ttcpUsage: ttcp -t [-options] host [ < in ] ttcp -r [-options > out] Common options: -l ## length of bufs read from or written to network (default 8192) -u use UDP instead of TCP-p ## port number to send to or listen at (default 5001) -s -t: source a pattern to network-r: sink (discard) all data from network-A align the start of buffers to this modulus (default 16384) -O start buffers at this offset from the modulus (default 0) -v verbose: print more statistics-d set SO_DEBUG socket option-b ## set socket buffer size (if supported) -f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = gigaOptions specific to -t: -n## number of source bufs written to network (default 2048) -D don t buffer TCP writes (sets TCP_NODELAY socket option) Options specific to -r: -B for -s, only output full blocks as specified by -l (for TAR) -T touch : access each byte as it s readThe first step is to start up a receiver process on the server machine: # ttcp -rsttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcpttcp-r: socket12_