Slashdot Log In
Simulating Network Latency?
Posted by
Cliff
on Fri Aug 20, 2004 05:25 PM
from the network-testbed-technology dept.
from the network-testbed-technology dept.
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?"
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
FreeBSD Dummynet (Score:4, Insightful)
What kind of question is this for ask slashdot?
Re:FreeBSD Dummynet (Score:5, Informative)
(http://randell.jesup.org/)
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)
(http://slashdot.org/)
Re:The solution is obvious. (Score:5, Funny)
(http://www.brynmosher.com/ | Last Journal: Monday August 27, @10:15PM)
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:4, Interesting)
(Last Journal: Thursday September 27, @01:43PM)
Go type 'southern hemisphere monitors' into Google.
Download a copy of SP2 (Score:4, Interesting)
(http://www.informationr.us/ | Last Journal: Monday November 05, @09:38AM)
dummynet (Score:3, Informative)
(http://hur.st/)
We use Dummynet (Score:5, Informative)
(http://blog.jwiz.org/mt/)
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)
(http://stefanco.com/ | Last Journal: Sunday October 14, @11:09AM)
Re:Stand next to the router and... (Score:5, Funny)
Dummynet is great, but... (Score:1)
(Last Journal: Sunday September 01 2002, @09:01PM)
Simple (Score:5, Funny)
Linux QoS (Score:5, Informative)
(http://phacka.sk)
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.
single-shot delays (Score:3, Interesting)
(http://i1.dk/)
OpenBSD (Score:3, Informative)
(about:mozilla)
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
NIST ATM simulator (Score:3, Informative)
nistnet (Score:5, Informative)
(http://syn.cs.pdx.edu/~jsnow | Last Journal: Sunday July 11 2004, @08:36PM)
Nistnet [nist.gov] is another tool that simulates delay.
-jim
Shaper (Score:2, Informative)
(http://coldstonelabs.org/)
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)
(Last Journal: Monday March 15 2004, @12:12AM)
Use Google? (Score:2, Informative)
Found a hardware solution for $10, Ricochet. :) (Score:4, Informative)
(Last Journal: Sunday December 17 2006, @09:20PM)
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)
(http://whatisnoise.blogspot.com/ | Last Journal: Tuesday August 21, @10:52AM)
link in Netkit.org (Score:1, Insightful)
http://www.netkit.org/docs/netkit-clark-and-nagle
JurgenK.
Nistnet (Score:2, Informative)
(http://www.acesoliton.com)
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).
VPN out and back in (Score:3, Informative)
(http://www.kevinbroderick.com/)
(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)
(https://dawgchain.at/ | Last Journal: Friday January 26 2007, @01:14PM)
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)
(Last Journal: Tuesday July 24, @05:02PM)
IPTables + Userland Queuing (Score:1)
(http://www.irisa.fr/armor/lesmembres/Varela)
Does CONFIG_NET_SCH_NETEM work for IPV6? (Score:1)
Re:FreeBSD (Score:1, Redundant)
(http://www.ferion.net/ | Last Journal: Monday May 06 2002, @02:16AM)
The point is to discuss it, not to be a human Google. Read some of the other posts that were modded up.