Mike Walter writes:
> We've determined an average workstation latency (simply using PING) for a 
> workstation "far, far away" as being about 380-400ms.
> 
> But we don't know what it would be like to actually WORK on that 
> workstation day-in and day-out.  Most of the work would be in support of 
> Linux for System z servers.  Most likely via SSH (using SecureCRT from 
> VanDyke Software), but also some 3270 usage, net surfing, and Lotus Notes.
> 
> Does anyone know of a way to set a reliable minimum or "min-max range" 
> latency on a given workstation so that effects on productivity can be 
> measured?

Yes, Linux has plenty of fancy traffic control functionality
configurable with the "tc" userland utility that's part of the
iproute2 package that will have come with your distro.

What you probably want is the netem ("Network Emulation") queue
discipline. Simulating real networks is rather complex but you can
start by doing things like imposing packet delays based on a chosen
probability distribution. My PC here has ping times of about 45ms
to google:

        [~]pc# ping -n www.google.co.uk
        PING www.l.google.com (216.239.59.99) 56(84) bytes of data.
        64 bytes from 216.239.59.99: icmp_seq=1 ttl=241 time=44.0 ms
        64 bytes from 216.239.59.99: icmp_seq=2 ttl=241 time=47.1 ms
        64 bytes from 216.239.59.99: icmp_seq=3 ttl=241 time=45.7 ms

so if I do

        # tc qdisc del dev eth0 root netem delay 345ms 10ms

then it imposes a(n outgoing) additional packet delay of average
345ms plus/minus 10ms (uniform distribution) giving me:

        [~]pc# ping -n www.google.co.uk
        PING www.l.google.com (216.239.59.147) 56(84) bytes of data.
        64 bytes from 216.239.59.147: icmp_seq=1 ttl=241 time=383 ms
        64 bytes from 216.239.59.147: icmp_seq=2 ttl=241 time=395 ms
        64 bytes from 216.239.59.147: icmp_seq=3 ttl=241 time=390 ms

You can do more complex things with netem: e.g. choose different
probably distributions either built-in or read from a text file
you've lovingly constructed to emulate a given real network),
impose packet loss, duplication, corruption re-ordering and so on.
You can then filter and/or send those through other queue
disciplines to do other packet shaping, bandwidth limiting etc.
I've just found
    http://www.linux-foundation.org/en/Net:Netem
which is a good introduction to using netem. At the bottom of that
page in the Links section is a link to a paper of Stephen Hemminger
    http://developer.osdl.org/shemminger/LCA2005_paper.pdf
which goes into great detail about simulating the characteristics of
a particular network.

The main thing is that, since you can only directly control
outgoing packets (unless you have similar traffic shaping at the
remote end) you probably want to do the tc stuff on a Linux guest
router sitting in between the far end and your target host so use
tc in combination with your routing tables and maybe qdisc filters
to pick out the traffic you want slowing down (if not all of it).

--Malcolm

Malcolm Beattie <[EMAIL PROTECTED]>
System z SWG/STG, Europe
IBM UK

Reply via email to