Simulating Network Latency? 76
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?"
FreeBSD Dummynet (Score:4, Insightful)
What kind of question is this for ask slashdot?
Re:FreeBSD Dummynet (Score:3, Informative)
Re:FreeBSD Dummynet (Score:2)
The typical kind of question that involves some topic already explored indepth somewhere else on the web and has a potential solution.
Re:FreeBSD Dummynet (Score:3, Interesting)
ie HERTZ=1
Re:FreeBSD Dummynet (Score:5, Informative)
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!
Re:FreeBSD Dummynet (Score:5, 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.
The solution is obvious. (Score:5, Funny)
Re:The solution is obvious. (Score:5, Funny)
In related news (Score:5, Funny)
Made all the better when they discover that southern hemisphere monitors actually *are* different for exactly the same reason.
Dave
Re:In related news (Score:3, Insightful)
I call bull. The Earth's magnetic field is far too weak to have an effect on anything like that. Besides, don't you think someone might notice if it mattered whether your monitor was facing north or south? You really shouldn't believe everything your BOFH tells you.
Re:In related news (Score:4, Interesting)
Go type 'southern hemisphere monitors' into Google.
!bull (Score:3, Informative)
To be fair though, I did try out a nothern hemisphere monitor once (I am in Australia) and don't remember noticing any difference.
There are variations between the magnetic lines of the earth all
Re: (Score:1)
Re:In related news (Score:1)
Re:In related news (Score:3, Informative)
He's right about the monitors (Score:2)
I work for a newspaper and we need _good_ monitors for colour correction. I'm all too familiar with this issue (and the issue of not having the money for the monitors we need anyway... *sigh*).
Re:In related news (Score:2)
In the past, monitors weren't large enough to be affected much by shadow mask magnification, so they didn't include their own degaussing coils. It was easy to screw one up with a magnetic field back then, and it might take the user a while to find someone with the tool to fix it. (Video arcades usually
Re:In related news (Score:1)
Easy for you to say !
Re:In related news (Score:1)
A bit off-topic, but can somebody elaborate a bit on this? I know monitors use coils to bend the electron beams in order to scan the beams accross the surface of the monitor, but I don't think this would be affected by the northern vs. southern hemisphere (anymore than turning your monitor to face south instead of north).
Re:The solution is obvious. (Score:1)
And of course, make sure the cable is coiled up like hell rather than straight...
Download a copy of SP2 (Score:4, Interesting)
dummynet (Score:3, Informative)
We use Dummynet (Score:5, Informative)
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.
Stand next to the router and... (Score:5, Funny)
Re:Stand next to the router and... (Score:1)
Re:Stand next to the router and... (Score:5, Funny)
Re:Stand next to the router and... (Score:3, Informative)
simulate lightening by plugging a network cable into a 220V plug
Enter the Etherkiller [fiftythree.org].
Re:FreeBSD (Score:1, Redundant)
The point is to discuss it, not to be a human Google. Read some of the other posts that were modded up.
Dummynet is great, but... (Score:1)
Dumbass (Score:2)
Re:Dumbass (Score:1)
$2000 will also buy you... (Score:1)
I think this guy is looking for hardware because the commercial latency simulators are ~$2000.
So is a pair of good PCs running free latency simulation software.
Simple (Score:5, Funny)
Re:Simple (Score:3, Informative)
Re:Simple (Score:3, Informative)
Linux QoS (Score:5, Informative)
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.
sleep()? ;-) (Score:2)
Paul B.
To add to that a little... (Score:1)
-ReK
single-shot delays (Score:3, Interesting)
OpenBSD (Score:3, Informative)
For openbsd you can throttle bandwidth right in PF [openbsd.org].
Just cap whichever queue you want at whatever rate you want.
My Thesis (Score:2, Interesting)
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
Re:My Thesis (Score:2)
NIST ATM simulator (Score:3, Informative)
nistnet (Score:5, Informative)
Nistnet [nist.gov] is another tool that simulates delay.
-jim
Re:nistnet (Score:2)
I'll second this. Last job I had, we used it to simulate telcom provider's networks. Very cool software.
Re:nistnet (Score:2)
An excellent example of Your Tax Dollars At Work.
Shaper (Score:2, Informative)
Shaper is a traffic shaper and a packet filter for a server and for a gateway. With only limited configuration information, that are to be supplied, this script can control which and how information flow through the box.
http://www.chronox.de/
There are other ones as well type shapper at freshmeat.
use a traffic limiter (shaper) (Score:4, Interesting)
Re:use a traffic limiter (shaper) (Score:2)
What the submitter wants is to simulate a line that already exists, and already has it's own bandwidth and latency.
Several people have answered this without understanding what the problem is. Some people say "just hose your connection with other traffic!" but that will cause packet-loss where a dedicated serial line (like a WAN) generally won't have any if it's not overload
Re:use a traffic limiter (shaper) (Score:2)
True, the shaper obviously cannot simulate all low-latency networks and I may have misinterpreted from the parent post that he was working on "low-bandwidth networks". But not knowing his purpose, listing even remote possibilities might be a good idea.
I use PFY for rate limiting. (Score:2)
Use Google? (Score:2, Informative)
Found a hardware solution for $10, Ricochet. :) (Score:4, Informative)
AT~I13 -- WAN Simulation Command and Information Display
This command enables the Ricochet modem's WAN simulation feature.
Syntax:
AT~I13
You can use this function to test various transport protocols in the presence of network delay and packet loss. This simulation only affects the modem's transport modes, i.e., LIGHT/PPP/SLIP/STREAM. If you are going to reset the WAN simulation values, then you should reboot the modem because it is not built to reset and process incoming packets at the same time. WAN simulation affects the processing of received packet, therefore, when testing the simulation needs to be set at both ends of the connection.
The incoming packets are processed in the following order. First, the drop percentage value is checked and the modem drops that N% immediately. Second, the base delay is added to a random percentage of the variable delay. Then the packet is inserted on a time ordered delivery queue. If the variable delay component is great enough, a large number of incoming packets will be reordered.
Note:
In WAN simulation, there are fewer (Time to Live) TTL expirations than in an real network because packets ending up on the delivery queue is not expiring based on the TTL value.
Two Modems... (Score:2)
link in Netkit.org (Score:1, Insightful)
http://www.netkit.org/docs/netkit-clark-and-nagle
JurgenK.
Nistnet (Score:2, Informative)
nuff said...
Here's something that may be useful... (Score:3, Informative)
Article: http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8& selm=ucggua1ghi9ic1%40corp.supernews.com&rnum= 12 [google.ca]
config NET_SCH_DELAY (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).
Re:config NET_SCH_DELAY (Score:1)
VPN out and back in (Score:3, Informative)
(This does, of course, assuming that you're testing with routable protocols)
Do what I do (Score:3, Funny)
2. Then I post a story on slashdot with a link to the apache server.
3. ???
4. Instant latency!
(And by carefully choosing the size of the documents/jpegs/mpegs I can actually simulate different kinds of latency!!!)
hub (Score:2)
I don't know if a bunch of collision will affect the latency, or just the bandwidth though.
Cisco Routers can do this too... but... (Score:2, Informative)
IPTables + Userland Queuing (Score:1)
Does CONFIG_NET_SCH_NETEM work for IPV6? (Score:1)