Re: Strange network behaviour

Lynn Kerby
2007-12-05T19:49:02Z

On Dec 5, 2007, at 10:05 AM, Simon Gao wrote:
> I also saw the similar problem. However, it happens with I have
> several
> KVM guests running and sharing the same network bridge. If just one
> single KVM guest, then everything works fine.
>
> Simon

I think I've been through similar problems as well.

Initially my guests would experience massive packet losses and huge
delays somtime shortly after the second guest started. Often the
first guest continued to operate fairly well, but it was noticably
degraded. That is when I switched from the default QEMU ne2k device
to the rtl8139 for all my virtual network taps.

A bunch of debugging eventually led me to check the mac addresses of
all my guests on the bridge. Not the host side TAP address, but the
guest's mac address. In my environment I found cases where more than
one of the guests on the bridge had the same mac address and rewrote
my startup scripts and configs to always assign a unique mac address
to each network device.

I thought perhaps this may be related to something in KVM-55, but
I've just shutdown and restarted my VMs on the KVM-55 modules and
userspace and am not seeing any network problems with my VMs.

Here are the kvm/qemu command lines for 3 of my machines: (2
FreeBSD-6.2 servers and a Ubuntu-7.10 server)
> /usr/local/bin/qemu-system-x86_64 -name FreeBSD_6.2 -hda /vm_img/
> bsd_dz1/disk0.qcow -m 256 -boot c -smp 1 -usb -usbdevice tablet -
> vnc :0 -serial telnet::4100,server,nowait -monitor telnet::
> 4200,server,nowait -net
> nic,vlan=0,macaddr=52:54:00:12:34:56,model=rtl8139 -net
> tap,vlan=0,ifname=tap0,script=/etc/kvm/kvm-ifup -net
> nic,vlan=1,model=rtl8139 -net tap,vlan=1,ifname=dmz0,script=/etc/
> kvm/kvm-ifup

> /usr/local/bin/qemu-system-x86_64 -name DOM9-BSD62 -hda /vm_img/
> bsd_in1/dom9-disk1.qcow -hdb /vm_img/bsd_in1/dom9-disk2.raw -m 512 -
> boot c -smp 2 -usb -usbdevice tablet -vnc :9 -serial telnet::
> 4109,server,nowait -monitor telnet::4209,server,nowait -net
> nic,vlan=0,macaddr=52:54:09:12:34:56,model=rtl8139 -net
> tap,vlan=0,ifname=tap1,script=/etc/kvm/kvm-ifup

> /usr/local/bin/qemu-system-x86_64 -name DOMT2-UbuSrv7.10 -hda /dev/
> vg_r5/dom_t2 -m 512 -boot c -smp 1 -vnc :8 -serial telnet::
> 4108,server,nowait -monitor telnet::4208,server,nowait -net
> nic,vlan=0,macaddr=52:54:08:12:34:56,model=rtl8139 -net
> tap,vlan=0,ifname=tap2,script=/etc/kvm/kvm-ifup

The kvm-ifup script referenced in these commands is very similar to
the standard qemu-ifup except that it deals with multiple bridges,
based on the interface name. It may be worth noting that I'm not
explicitly assigning a mac address to interface dmz0 in the first
example, but other interfaces on that network all have unique mac
addresses so it isn't critical.

You might want to examine the output of 'brctl showmacs br0' (use
your bridge name in place of br0) and also check the interface stats
on the bridge and any troublesome tap interfaces.

Lynn Kerby
San Martin, CA