From: "Jim C. Brown" <jma5@umd.edu>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Connecting vde and LAN
Date: Fri, 12 Aug 2005 14:07:15 -0400 [thread overview]
Message-ID: <20050812180715.GA3920@jbrown.mylinuxbox.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0508121154450.23562@filer.marasystems.com>
On Fri, Aug 12, 2005 at 12:02:46PM +0200, Henrik Nordstrom wrote:
> >This solves the problem quite nicely, and it is probably the simplest to
> >implement, but requires changing the hardware.
> >
> >I'm trying to figure out how to achieve the same effect with eth0 and tap0
> >(as opposed to eth0 and eth1).
>
> Not easily done as you are then missing the switch component looping the
> frames back to eth0.
>
Well, I'm also comparing this to, say, a user space bridge of tap0 and tap1.
For that, we are also missing the switch component, but this is easy to solve.
The user space component simply needs the file descriptors of both tap0 and
tap1, then when it receives a packet on tap0 it can simply write it to tap1 and
vice versa. Since writing a packet to the file descriptor of a tap device
causes the upper layer protocol layers to take a look at it, the issue doesn't
exist here.
>From a brief look at the kernel code, it looks like netif_rx() can be used to
achieve the same effect for a real ethernet card. Packets that are recieved
by the device driver are queued with netif_rx() to be interpreted by the
host OS protocol stack, so if vde_pcap could call netif_rx() directly then it
could inject packets at the ethernet frame level to the host OS directly.
Unfortuantly vde_pcap is a userland program and netif_rx() is a kernel function,
so unless netif_rx() is exposed thru a procfs interface or something similar
there is no way to take advantage of it.
> >If we had a), then vde_pcap would "just work" - there'd be no need to
> >fiddle
> >with faking things on tap devices or etc.
>
> Not fully. Without having the bridge component in the mix frames sent by
> the guest to the host is likely to be echoed out on the LAN.
>
Ideally, packets destined for the host will end up in the OS's protocol stack
and stay there, while packets destined elsewhere will actually go thru the
NIC and into the LAN.
Of course, vde_pcap could write packets for the host via netif_rx() and send
the rest thru the packet socket. AFAICS packets sent thru netif_rx() will not
be echoed back out the device again.
> >Most of these are my goals as well (except I don't mind having to run a
> >bit of
> >glue in a startup script).
>
> If you are prepared to run a bit of glue in system startup scripts then
> use bridgeing with a tap device. This provides the absolutely cleanest
> networking capabilities.
>
That is very true.
>
> Regards
> Henrik
>
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
next prev parent reply other threads:[~2005-08-12 18:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-10 12:27 [Qemu-devel] Connecting vde and LAN Oliver Gerlich
2005-07-10 16:42 ` Henrik Nordstrom
2005-07-10 17:37 ` Jim C. Brown
2005-07-10 18:23 ` Oliver Gerlich
2005-07-10 18:58 ` Jim C. Brown
2005-07-11 2:21 ` Henrik Nordstrom
2005-07-11 2:33 ` Jim C. Brown
2005-07-11 7:50 ` Henrik Nordstrom
2005-07-11 15:02 ` Jim C. Brown
2005-07-11 23:01 ` Jim C. Brown
2005-07-12 2:49 ` Henrik Nordstrom
2005-07-12 22:25 ` Jim C. Brown
2005-08-04 10:14 ` Henrik Nordstrom
2005-08-05 16:54 ` Jim C. Brown
2005-08-10 19:07 ` Jim C. Brown
2005-08-11 14:56 ` Henrik Nordstrom
2005-08-11 16:24 ` Oliver Gerlich
2005-08-11 16:56 ` Jim C. Brown
2005-08-12 10:02 ` Henrik Nordstrom
2005-08-12 18:07 ` Jim C. Brown [this message]
2005-08-11 17:00 ` Paul Brook
2005-08-12 0:11 ` Herbert Poetzl
2005-08-12 9:53 ` Henrik Nordstrom
2005-07-10 17:48 ` Oliver Gerlich
2005-07-11 1:36 ` Henrik Nordstrom
2005-07-12 19:43 ` Ross Kendall Axe
2005-07-12 20:31 ` Oliver Gerlich
2005-07-13 3:02 ` Ross Kendall Axe
2005-07-10 18:27 ` Bakul Shah
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=20050812180715.GA3920@jbrown.mylinuxbox.org \
--to=jma5@umd.edu \
--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).