NISTNet: Emulating Networks on Your Own LAN
Pages: 1, 2, 3
Let's try another test. Let's this time try having NISTNet emulate a circuit
with 25% datagram loss. To do this we edit our rule, entering 0 into
the delay field, entering 25 into the "Drop %"
field and again hitting "Update". When we run our ping test it now looks like:
ping -c 10 -i 2 -s 1460 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 1460 data bytes
1468 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=1014.3 ms
1468 bytes from 192.168.2.1: icmp_seq=2 ttl=254 time=1011.1 ms
1468 bytes from 192.168.2.1: icmp_seq=3 ttl=254 time=1004.4 ms
1468 bytes from 192.168.2.1: icmp_seq=4 ttl=254 time=1027.4 ms
1468 bytes from 192.168.2.1: icmp_seq=6 ttl=254 time=1033.9 ms
1468 bytes from 192.168.2.1: icmp_seq=7 ttl=254 time=1056.5 ms
1468 bytes from 192.168.2.1: icmp_seq=9 ttl=254 time=1043.5 ms
--- 192.168.2.1 ping statistics ---
10 packets transmitted, 7 packets received, 30% packet loss
round-trip min/avg/max = 1004.4/1027.3/1056.5 ms
Ten datagrams is too short a test to expect very accurate results for this sort of test, but it's clear that again NISTNet has done what we've asked of it.
Finally, let's change our test such that rather than dropping 25% of datagrams,
we duplicate them. To do this we zero the drop field, and enter 25
into the "Dup %" field instead, hitting the "Update" button
once more to activate the change. Our ping test now looks like:
ping -c 10 -i 2 -s 1460 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 1460 data bytes
1468 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=1097.0 ms
1468 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=1698.0 ms (DUP!)
1468 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=1893.2 ms (DUP!)
1468 bytes from 192.168.2.1: icmp_seq=1 ttl=254 time=1013.8 ms
1468 bytes from 192.168.2.1: icmp_seq=2 ttl=254 time=1137.5 ms
1468 bytes from 192.168.2.1: icmp_seq=3 ttl=254 time=1080.7 ms
1468 bytes from 192.168.2.1: icmp_seq=4 ttl=254 time=993.6 ms
1468 bytes from 192.168.2.1: icmp_seq=5 ttl=254 time=993.7 ms
1468 bytes from 192.168.2.1: icmp_seq=6 ttl=254 time=1219.9 ms
1468 bytes from 192.168.2.1: icmp_seq=6 ttl=254 time=1770.3 ms (DUP!)
1468 bytes from 192.168.2.1: icmp_seq=6 ttl=254 time=1828.0 ms (DUP!)
1468 bytes from 192.168.2.1: icmp_seq=7 ttl=254 time=1266.5 ms
1468 bytes from 192.168.2.1: icmp_seq=7 ttl=254 time=1514.3 ms (DUP!)
1468 bytes from 192.168.2.1: icmp_seq=8 ttl=254 time=1041.2 ms
1468 bytes from 192.168.2.1: icmp_seq=9 ttl=254 time=1065.5 ms
--- 192.168.2.1 ping statistics ---
10 packets transmitted, 10 packets received, +5 duplicates, 0% packet loss
round-trip min/avg/max = 993.6/1307.5/1893.2 ms
Magic stuff!
|
|
You can design tests that combine all of these together, and of course we've only looked at the simplest of capabilities. NISTNet has a whole suite of much more sophisticated things it can do with datagrams.
One final thing to look at are the statistics that are collected in real time. Start a ping test and scroll the right-hand panel across to the right-most fields. You will see running tallies of packet sizes, bytes transmitted, average bandwidth, and others. These are useful for keeping an eye on progress of the tests.
If you're in a situation where you need to quickly test how a network application or protocol will perform under realistically poor conditions, then NISTNet provides an excellent solution. Mark has gone to a lot of work to ensure that the emulation is as accurate and useful as possible, and I'm sure you'll agree that it truly is one of those tools that you know will come in handy one day; keep it around.
Terry Dawson is the author of a number of network-related HOWTO documents for the Linux Documentation Project, a co-author of the 2nd edition of O'Reilly's Linux Network Administrators Guide, and is an active participant in a number of other Linux projects.
Read more Linux Network Administration columns.
Discuss this article in the O'Reilly Network Linux Forum.
Return to the Linux DevCenter.
