Solved

Simulate low bandwidth/high latency - ET

Posted on 2014-02-20
20
748 Views
Last Modified: 2014-03-18
I am doing testing for a virtual desktop environment. I have a few Zero clients and i want to test them in low bandwidth and/or high latency environments.
Someone told me about a device often used by VoiP technicians that goes between ethernet cable and switch that can simulate either low bandwidth, high latency, etc (and you can adjust the levels). I searched online but cannot find anything of this sort. All i am finding is software that does this.
Anyone know of such devices?
0
Comment
Question by:tabush
  • 10
  • 8
  • 2
20 Comments
 
LVL 19

Expert Comment

by:regmigrant
ID: 39876330
Our lab here use IPNetSIm - link below - which is great but pricey for a one off. You might consider using an old desktop with a couple of NiCs and some of the open source software. There's a howto link below.

http://www.gl.com/ipnetsim.html
http://www.freebsd.org/doc/en/articles/filtering-bridges/article.html
0
 
LVL 57

Accepted Solution

by:
giltjr earned 500 total points
ID: 39876609
I would also suggest using a old PC with a couple of NIC's.

I use Linux with netem (network emulation).  netem can do a ton of stuff, but what I mainly use it for is to:

simulate various network bandwidth
simulate various levels of latency
simulate various levels of packet drops

I setup a  Linux box with Apache and PHP, created a web page where you can enter the IP address of the host you want to communicate and then select from a list pre-set bandwidth and latency options.  Click and off you go.

My company bought a device that cost over USD $2K and it didn't support some of what my setup did.  The only advantage it had was that it was a very small physical foot print, about 4"x4"x3/4" versus  old Dell tower.  Of course you can always use one of the newer smaller PC's as long as you can get two NIC's in it.

I lend out my box to our application development QA team so they can test what our customer will see.
0
 
LVL 19

Expert Comment

by:regmigrant
ID: 39876616
If you want something portable a laptop with an extra NIC via USB or PC Card would work if you can get Linux drivers for the extra network connectors
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 2

Author Comment

by:tabush
ID: 39877568
Thanks giltjr,
Which linux OS would you recommend? All of these are supported: Fedora, OpenSuse, Gentoo, Debian, Mandriva, Ubuntu

I have very little experience with linux so which would be the most simple to use?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39877655
I use Fedora, only because I started out using Red Hat Linux.  I have used OpenSuse before also, but only because we have one product that uses SuSE Enterprise and i needed something to test on.

I have not used the others, but for the most part Linux is Linux.

Doing this is kind of a one of.  Even people that manage Linux would have some difficulty doing this only because in involves using netem which probably 90% of Linux admins have never touched, even if they have heard of it.   I'll try to write up what I did and also post my scripts over the next couple of days.
0
 
LVL 2

Author Comment

by:tabush
ID: 39882949
Thanks giltjr,
Can you also share the commands to bridge the two adapters? I was going to follow these directions (http://tdistler.com/2011/06/10/netem-wan-emulation-how-to-setup-a-netem-box) however someone wrote in the comments that when they brought "bridge adapter up it caused a loop killing the entire office network connection."
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39883243
The site you referenced has the instruction you need to bridge the network adapters.

The only thing you will need to check is how your Linux distribution names network interfaces.  The site uses the "old" eth0, eth1 type names.  New Linux distributions names the network interfaces based on if the are on the mother board (em1, em2, ect.) or in PCI adapter cards where the name is based on what PCI slot the card is in and how many ports are on the card.

The other thing will need to do is add something so that when you reboot the computer the bridge is setup again.  I don't see where his instructions are doing that so if you were to reboot the PC the bridge would be "gone".

I need to clean up some stuff in my files, they have some internal documentation that is unique to my company and I can let that out.
0
 
LVL 2

Author Comment

by:tabush
ID: 39884058
I followed his instructions and everything looks to be setup correctly however the "bridged" computer (wyse zero client) is not getting a connection.
The linux machine has internet connection and i confirmed bridge is setup by running "brctl show br0"
I also ran the command to remove any filtering that may be in place.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39884467
Try issing the command:

ifconfig

on the Linux machine. You should see the br0 interface, and both Ethernet interfaces up.
0
 
LVL 2

Author Comment

by:tabush
ID: 39886557
Everything looks good. Do you see anything wrong here.
Network cable is plugged into p3p1 and cable from em1 goes to my zero client.
Note, right now p3p1 has an IP however i tried the command that sets IP of both nics to 0.0.0.0 and that didnt do it either.

[root@localhost ~]# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::223:aeff:feb0:f21b  prefixlen 64  scopeid 0x20<link>
        ether 00:23:ae:b0:f2:1b  txqueuelen 0  (Ethernet)
        RX packets 548  bytes 41010 (40.0 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 8  bytes 648 (648.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::223:aeff:feb0:f21b  prefixlen 64  scopeid 0x20<link>
        ether 00:23:ae:b0:f2:1b  txqueuelen 1000  (Ethernet)
        RX packets 33  bytes 6194 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 338  bytes 23761 (23.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 21  memory 0xfe6e0000-fe700000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 207  bytes 18954 (18.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 207  bytes 18954 (18.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p3p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.37.164  netmask 255.255.255.0  broadcast 192.168.37.255
        inet6 fe80::2c0:ddff:fe10:f4f8  prefixlen 64  scopeid 0x20<link>
        ether 00:c0:dd:10:f4:f8  txqueuelen 256  (Ethernet)
        RX packets 12427  bytes 6354365 (6.0 MiB)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 4309  bytes 443748 (433.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 18  
[root@localhost ~]# brctl show br0
bridge name    bridge id        STP enabled    interfaces
br0        8000.0023aeb0f21b       no                 em1
                                                                         p3p1
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39886651
You need Apache and PHP installed and Apache needs to be configured to support server side installs.

You can remotely manage the "network emulation" box by giving interface br0 an IP address that is valid for your subnet.  Otherwise you need to access the box physically.

You will need to change the nic names in setib.html and setib.php.  On my PC em1 is the server side interface and p3p1 is the client side.  Make sure you know which NIC you want on which side.  The commands are interface and direction unique.  If you connect the network cables in correctly, then you get "normal" traffic bandwidth and latency.

I have it setup to simulate 2% packet loss and 0.4%  duplicate packets.  You can change this by adjusting the number in the setib.php file.

Three files here.  Once you download them rename them by removing the ".txt"

setib.shtml: main web page.  When you want to set the bandwidth you point your browser to the IP address or host name of the "bandwidth emulation box" with the url /setib.shtm, like http://localhost/setib.shtml.   On that page you enter the IP address of the sever you want to test with and then select one of the options from the pull down list.

setib.php: php file to issue the command to set or clear bandwidth emulation settings.

bandwidth.html: file that gets included in setib.shmtl that has a list of pre-set bandwidth and latency options.  You can add or modify as you see fit.
bandwidth.html.txt
setib.php.txt
setib.shtml.txt
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39886657
Just saw your other post.

I would suggest you run tcpdump against em1 and p3p1.

tcpdump -s0 -i em1 -w tdem1.cap &
tcpdump -s0 -i p3p1 -w tdp3p1.cap &

try to access something from the workstation.  Then kill both of the tcpdump commands and look at with wireshark.

I would also (as I sated in my prior post) but the IP address on the br0 interface.
0
 
LVL 2

Author Comment

by:tabush
ID: 39934255
Finally got the bridge up and working. Think i was using a bad nic card originally.

Now i will work on the rest of configuration.
0
 
LVL 2

Author Comment

by:tabush
ID: 39934309
Should all 3 files be placed in /var/www/html/  ?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39934527
Yes.
0
 
LVL 2

Author Comment

by:tabush
ID: 39934709
thanks. Can you also post how to make the bridge permanent (wont delete on reboot)?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39934985
What Linux distribution are you using?
0
 
LVL 2

Author Comment

by:tabush
ID: 39935038
Fedora release 20 (Heisenbug)
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39935092
I'm working from home today and don't have access to my system.  I get it to you tomorrow, I'm running an older level of  Fedora.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 39938015
So I don't have to retype it, here is a link.

Basically in /etc/sysconfig/network-scripts you setup the ifcfg-xxx files as needed.  

http://acidborg.wordpress.com/2010/01/20/how-to-configure-a-network-bridge-in-red-hat-fedora/
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dell OpenManage 8.3 Windows 10 2 192
Setting Port speed and duplex on Cisco 3560 switch 2 51
cisco switch POE watt limitation 5 78
Etherchannel balancing 10 21
This comprehensive conference-networking guide will help you prep, practice and pack for success, reach out with purpose and confidence, capitalize on connections, and turn all those new leads into long-term connections.
In this guide, I outline 7 key steps to help technology professionals grow their careers. Whether you have been working in technology for 10 years or for 10 days, follow these steps to help you achieve your career goals and pursue your passions.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question