public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Andersson <johan-K1d2hC3PsOJeoWH0uzbU5w@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: tap + bridge mtu/fragmentation problem
Date: Mon, 04 Feb 2008 22:18:00 +0100	[thread overview]
Message-ID: <47A78108.8040607@e-626.net> (raw)

Hi!

I just tried out KVM for the first time, and most things work amazingly 
  well!

However I experience strange problems with the networking. I am using 
kvm command like this:
kvm -hda hda.cow -m 512 -smp 1 -k fi -net 
nic,model=ne2k_pci,macaddr=52:54:01:00:00:02 -net tap

I have set up a bridge, br0, which I have added eth0 to.
The problem is that large frames doesn't seem to get forwarded correctly 
from eth0 to tap0. As I don't see this problem when only using the 
bridge (ie bridging eth0 to eth1), my guess is that there is some mtu 
difference between the tap0 and eth0 interface. Both eth0 and tap0 (and 
consequently br0) have an mtu of 1500.

130.100.71.82 is the guest os (Gentoo Linux and Windows 2003 Server 
tested in this case with the same result).
130.100.71.1 is the default gw on the network eth0 is connected to.

First, a ping of size 1468, as seen on tap0:
20:54:25.552524 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto 
ICMP (1), length 1496) 130.100.71.82 > 130.100.71.1: ICMP echo request, 
id 4628, seq 1, length 1476
20:54:25.553486 IP (tos 0x0, ttl 64, id 345, offset 0, flags [none], 
proto ICMP (1), length 1496) 130.100.71.1 > 130.100.71.82: ICMP echo 
reply, id 4628, seq 1, length 1476
Ok, ping successfull.

Then a one byte longer ping, as seen on eth0:
21:00:07.852892 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto 
ICMP (1), length 1497) 130.100.71.82 > 130.100.71.1: ICMP echo request, 
id 31764, seq 1, length 1477
21:00:07.853848 IP (tos 0x0, ttl 64, id 362, offset 0, flags [none], 
proto ICMP (1), length 1497) 130.100.71.1 > 130.100.71.82: ICMP echo 
reply, id 31764, seq 1, length 1477
So the responce arrives to eth0 ok, however not to tap0:
20:59:18.908282 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto 
ICMP (1), length 1497) 130.100.71.82 > 130.100.71.1: ICMP echo request, 
id 27156, seq 1, length 1477

Then, if we step up to 1473 bytes, as seen on eth0:
21:34:37.319976 IP (tos 0x0, ttl 64, id 55481, offset 0, flags [+], 
proto ICMP (1), length 1500) 130.100.71.82 > 130.100.71.1: ICMP echo 
request, id 56598, seq 5, length 1480
21:34:37.320129 IP (tos 0x0, ttl 64, id 55481, offset 1480, flags 
[none], proto ICMP (1), length 21) 130.100.71.82 > 130.100.71.1: icmp
21:34:37.320980 IP (tos 0x0, ttl 64, id 226, offset 0, flags [+], proto 
ICMP (1), length 1500) 130.100.71.1 > 130.100.71.82: ICMP echo reply, id 
56598, seq 5, length 1480
21:34:37.320983 IP (tos 0x0, ttl 64, id 226, offset 1480, flags [none], 
proto ICMP (1), length 21) 130.100.71.1 > 130.100.71.82: icmp
Now the request is fragmented (correctly), but the first (and large) 
fragment of the responce gets lost in the bridge:
21:39:03.725524 IP (tos 0x0, ttl 64, id 57750, offset 0, flags [+], 
proto ICMP (1), length 1500) 130.100.71.82 > 130.100.71.1: ICMP echo 
request, id 13847, seq 1, length 1480
21:39:03.725667 IP (tos 0x0, ttl 64, id 57750, offset 1480, flags 
[none], proto ICMP (1), length 21) 130.100.71.82 > 130.100.71.1: icmp
21:39:03.726535 IP (tos 0x0, ttl 64, id 2494, offset 1480, flags [none], 
proto ICMP (1), length 21) 130.100.71.1 > 130.100.71.82: icmp

Does anyone have an idea why it does like this, or how I can get around it?

I'm using Gentoo Linux amd64 on a Intel Core2 Duo, and kvm-60. I have 
tried with both kernel 2.6.23 and 2.6.24, with the same result. I have 
also tried with both ne2k_pci and rtl8139 nics.

/Johan Andersson



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

                 reply	other threads:[~2008-02-04 21:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A78108.8040607@e-626.net \
    --to=johan-k1d2hc3psojeowh0uzbu5w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox