qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@voltaire.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: Herbert Xu <herbert.xu@redhat.com>,
	Jan Kiszka <jan.kiszka@web.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] net: add raw backend
Date: Thu, 16 Jul 2009 11:29:34 +0300	[thread overview]
Message-ID: <4A5EE4EE.1090308@voltaire.com> (raw)
In-Reply-To: <20090715203806.GF3056@shareable.org>

Jamie Lokier wrote:
> When using a bridge, you set the IP address on the bridge itself (for example, br0).  DHCP runs on the bridge itself, so does the rest of the Linux host stack, although you can use raw sockets on the other interfaces. But reading and controlling the hardware is done on the interfaces. So if you have some program like NetworkManager which checks if you have a wire plugged into eth0, it has to read eth0 to get the wire status, but it has to run DHCP on br0.
Yes, I understand that if the guest want to communicate with the host in 
a bridged environment, the IP has to be set on the bridge. With "DHCP" 
do you refer to dhcp server or to dhcp relay or something else? I assume 
its not a server, since you mentioned a NON NAT environment.

> A bridge is quite simple to configure. Unfortunately because Linux requires all the IP configuration on the bridge device, but network device control on the network device, bridges don't work well with automatic configuration tools.
seems like this scheme/problem is similar to bonding, where the IP 
configuration is done to the bond device but people may still want to do 
control the slave devices, I am not sure why such tools need the device 
to have an IP, but it seems less relevant for this thread.

> Have you measured it?
Yes, I will send soon some data.

> Unfortunately that's usually impossible. Most switches don't do U turns, and a lot of simple networks don't have any switches except a home router

Again, as I wrote, the U turn can be done in three places: software 
bridge, virtual HW bridge inside the  NIC, or at an external switch. 
With virtualuzation becoming more common, options 2 and 3 will be more 
and more available, where the packet socket approach is valid for both 
of them.

> No, it makes performance _much_ worse if you have packets leaving the host, do a U turn and come back on the same link.  Much better to use a bridge inside the host.  Probably ten times faster because host's internal networking is much faster than a typical gigabit link :-)

My benchmark was focusing on packets per second for VM <--> world and 
not on VM/VM communication. I tend to think that with KVM and the raw 
mode or kernel virtio-net backend with both requiring U turn, the VM/VM 
performance will be no less in most if not all measures (namely, packets 
per second, cpu utilization, bandwidth, latency, etc). Still, its quite 
clear that both these mode can be useful for people that want to max the 
VM <---> world communication performance.


> Sometimes it would be useful to send it outside the host and U turn, but not very often; only for diagnostics I would think.  And even that can be done with Linux bridges, using VLANs :-)
mmm, I wasn't sure if you refer to Linux vlans (8021q devices) or the 
Qemu vlan... can you elaborate?

> If you don't need any host<->VM networking, maybe a raw packet socket is faster
> But are you sure it's faster? I'd want to see measurements before I believe it.
fair enough

Or.

  parent reply	other threads:[~2009-07-16  8:30 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 15:46 [Qemu-devel] [PATCH] net: add raw backend Or Gerlitz
2009-07-01 16:21 ` Jamie Lokier
2009-07-02 12:25   ` Or Gerlitz
2009-07-03  2:39     ` Jamie Lokier
2009-07-07 13:33       ` Or Gerlitz
2009-07-07 14:57         ` Jamie Lokier
2009-07-08 14:45           ` Or Gerlitz
2009-07-14 13:54             ` Or Gerlitz
2009-07-15 20:38             ` Jamie Lokier
2009-07-15 21:06               ` Jan Kiszka
2009-07-15 21:52                 ` Jamie Lokier
2009-07-16  8:29               ` Or Gerlitz [this message]
2009-07-20 14:13               ` [Qemu-devel] [PATCH] net: add raw backend - some performance measurements Or Gerlitz
2009-07-20 15:53                 ` Herbert Xu
2009-07-20 18:20                   ` Michael S. Tsirkin
2009-07-21  1:46                     ` Herbert Xu
2009-07-21  7:03                   ` Or Gerlitz
2009-07-21  7:25                     ` Herbert Xu
2009-07-21 10:17                       ` Or Gerlitz
2009-07-21 10:27                       ` Michael S. Tsirkin
2009-07-21 11:05                         ` Or Gerlitz
2009-07-21 12:01                           ` Michael S. Tsirkin
2009-07-21 12:14                             ` Herbert Xu
2009-07-21 13:41                               ` Or Gerlitz
     [not found] ` <5b31733c0907011250i7afcdbcdnb844290de4ad64f2@mail.gmail.com>
2009-07-02 12:08   ` [Qemu-devel] [PATCH] net: add raw backend Or Gerlitz
2009-07-02 15:43 ` Michael S. Tsirkin
2009-07-07 14:45   ` Or Gerlitz
2009-07-07 14:49     ` Michael S. Tsirkin
2009-07-08 14:46       ` Or Gerlitz
2009-07-08 15:06       ` Or Gerlitz

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=4A5EE4EE.1090308@voltaire.com \
    --to=ogerlitz@voltaire.com \
    --cc=herbert.xu@redhat.com \
    --cc=jamie@shareable.org \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).