Slashdot Mirror


Simulating Network Latency?

ixmo asks: "I've just come around an interesting problem: to simulate low-bandwidth network links without buying expensive WAN simulators, I can connect two old Cisco routers back to back with serial cables, and control the bandwidth via the 'clock rate' IOS command, but how can I simulate network latency? Is there some OS tool or patch (for Linux/OpenBSD) that allows for tuning of network delay? Any hints?"

12 of 76 comments (clear)

  1. The solution is obvious. by mayoff · · Score: 5, Funny

    Use a longer cable.

    1. Re:The solution is obvious. by BrynM · · Score: 4, Funny
      Use a longer cable.
      Or do what my last job did: Use CAT-3! Oh, you're just testing... Too bad they weren't.
      --
      US Democracy:The best person for the job (among These pre-selected choices...)
  2. We use Dummynet by jshare · · Score: 4, Informative
    We use FreeBSD and its "dummynet" capabilites. (Perhaps other BSDs have this as well?)

    You can get m0n0wall and stick it on random hardware. I think you then have to recompile the kernel to enable dummynet.

    We use a Soekris 4501. It'll only bridge upto about 50mbit of traffic, but if you want to simulate T1 speeds it'll be fine. Beefier hardware (the soekris box is roughly a 133MHz 486) will probably let you max out at wire speed.

  3. Stand next to the router and... by stefanlasiewski · · Score: 4, Funny

    Stand next to the router and simulate rough conditions... ... yank out the wire a couple times. ... play kick the router. ... simulate lightening by plugging a network cable into a 220V plug ... paint sunspots on your face and spew out some EMF pulses like the sun.

    --
    "Can of worms? The can is open... the worms are everywhere."
    1. Re:Stand next to the router and... by Piquan · · Score: 4, Funny

      Don't forget the most fun part of cable simulation: the backhoe!

  4. In related news by WasterDave · · Score: 4, Funny

    It's good fun telling people who come down here to visit (New Zealand) that the twists in our cat 5 go the other way - because the earth's magnetic field is reversed.

    Made all the better when they discover that southern hemisphere monitors actually *are* different for exactly the same reason.

    Dave

    --
    I write a blog now, you should be afraid.
  5. Simple by Anonymous Coward · · Score: 5, Funny

    Sign up with Comcast.

  6. Linux QoS by Phacka · · Score: 5, Informative

    Network emulator
    CONFIG_NET_SCH_NETEM:
    Say Y if you want to emulate network delay, loss, and packet re-ordering. This is often useful to simulate networks when testing applications or protocols.

  7. nistnet by j1m+5n0w · · Score: 4, Informative

    Nistnet is another tool that simulates delay.

    -jim

  8. Re:FreeBSD Dummynet by jesup · · Score: 4, Informative

    Dummynet can absolutely do it. Put a PC with BSD & Dummynet and two ethernet interfaces in to simulate delay/loss/BW restrictions/etc. Very configurable. You can chose which packets are affected.

    Worst problem: fixed delay, not bell-curve/whatever. You can roughly approximate delay variance by several rules of varying probabilities. Also, loss is random not bursty. For most testing, this is fine.

    It can take a little while to get used to configuring it. Don't forget to make it act like a network in both directions!

  9. Re:FreeBSD Dummynet by Piquan · · Score: 4, Informative

    Dummynet can absolutely do it. Put a PC with BSD & Dummynet and two ethernet interfaces in to simulate delay/loss/BW restrictions/etc. Very configurable. You can chose which packets are affected.

    You betcha. At a job I previously had, supporting TCP/IP for a large Unix producer, I had a FreeBSD box set up for just this purpose. It only had one ether interface, and was in a different part of the building from the test lab, but that didn't matter; I'd use PPP over TCP to connect to the test machines.

    I'd use it to test how different OSs (including our own) would handle different bandwidth*delay products, packet loss, etc. For instance, one I found out that a customer was having problems with a lossy WAN connection to an NT server. I experimented with high packet loss percentages, and changed the rules to narrow down the problem. Turns out that NT won't retransmit a FIN packet, at least not back then.

    When I left that job, my coworkers insisted that I show them how to set up that box to run those kinds of experiments.

    Quite an educational experience, too. It's one thing to read Richard Stevens describing congestion avoidance algorithms; it's something else to watch them in action.

  10. config NET_SCH_DELAY by Kevin+Burtch · · Score: 5, Informative


    I'm shocked no-one has posted this!

    It's been in the kernel for while, though I don't know much about using it. I never bothered even looking at it (had no need) until a coworker wanted to use it (on Thursday) to do some testing and asked me about it.

    Here's the chunk of Kconfig:

    config NET_SCH_DELAY
    tristate "Delay simulator"
    depends on NET_SCHED
    help
    Say Y if you want to delay packets by a fixed amount of
    time. This is often useful to simulate network delay when
    testing applications or protocols.

    To compile this driver as a module, choose M here: the module
    will be called sch_delay.

    Please reply to this if you have been able to get this working... the tuning parameters to tc we found give errors (and yes, we built installed the latest iproute2 tarball).
    Then again, we only spent a few minutes playing with it (he had to leave).

    --
    - Preferences: Solaris 10 (servers), Ubuntu (desktops), Solaris 11 (personal servers) -