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?"

6 of 76 comments (clear)

  1. Download a copy of SP2 by Marxist+Hacker+42 · · Score: 3, Interesting

    This may be the oddest use for this yet- but any large file would work >200MB. Set up your Serial port for a slow connection, say 110 baud, then start an ftp transfer in the background of SP2 from one machine to the other. That ought to simulate latency errors just fine.

    --
    SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
  2. Re:In related news by SuiteSisterMary · · Score: 3, Interesting

    Go type 'southern hemisphere monitors' into Google.

    --
    Vintage computer games and RPG books available. Email me if you're interested.
  3. single-shot delays by isj · · Score: 2, Interesting

    I have found kill -s SIGSTOP and kill -s SIGCONT on the server process useful for simulating a temporary network congestion / single packet-drop on a TCP connection.

  4. My Thesis by Xetrov · · Score: 2, Interesting

    My thesis (which I am only just starting) deals with networking, and one major part of it is in simulating different network conditions.

    I was planning to write my own wrapper around the standard socket operations which will add things like latency, unreliability etc etc (for testing the robustness of a protocol).

    However I am looking forward to seeing some of the answers here as maybe I wont have to do as much work as I previously thought ;)

  5. use a traffic limiter (shaper) by wotevah · · Score: 3, Interesting
    Use a bandwidth limiter that throttles your send rate. Someone else mentioned PF for BSD. On linux you can use the shaper module. My old notes go something like this, it might still work. Assuming eth0 is your output interface (the limiter works only on outgoing traffic, so you need the other end to do the same):
    modprobe shaper
    shapecfg attach shaper0 eth0
    shapecfg speed shaper0 9600 # in baud
    ifconfig shaper0 <eth0-address> netmask <eth0-netmask>
    # remote automatic route added by above
    route del -net <eth0-network> netmask <eth0-netmask> dev shaper0
    # add routes to be choked
    route add -host <otherhost> dev shaper0
    # or if going through a router
    route add -net <othernet> gw <router> dev shaper0
    ...you get the idea. I wonder if iptools makes this a bit less hacky.
  6. Re:FreeBSD Dummynet by Drakon · · Score: 2, Interesting

    What also may work is lowering the granularity of the timer in the kernel,
    ie HERTZ=1