View previous topic :: View next topic |
Author |
Message |
dman777 Veteran
Joined: 10 Jan 2007 Posts: 1004
|
Posted: Wed Sep 28, 2011 1:32 am Post subject: VDE Swtich- Packets Duplicate? |
|
|
I was thinking about doing a VDE switch with KVM and guests. I read on the Gentoo wiki that packets are duplicated from the eth0 to the switch. Is this correct?
Packets
|
|
Eth0
|
|------------------------|
^Packets Duplicate^
|..............................|
Host ...............VDE Switch
And if so, does this mean:
1) The packet load is doubled because they are duplicated?
2) Packets that get duplicated to the switch do not go through iptables?
3) The Host is going to recieve all the packets that are getting duplicated to the switch?
4) Will out going packets from the VM Guests appear to originate from the Host instead of the Guests(just like KVM's defualt Slirp network)? |
|
Back to top |
|
|
xming Guru
Joined: 02 Jul 2002 Posts: 441
|
Posted: Thu Sep 29, 2011 11:41 am Post subject: |
|
|
Do you really need VDE? VDE does everything in userspace, while Linux Bridge does all in kernel space, speed difference is enormous, unless you need those features provided by VDE, you are probably better off with linux bridge. _________________ http://wojia.be |
|
Back to top |
|
|
jormartr Apprentice
Joined: 02 Jan 2008 Posts: 174
|
Posted: Fri Sep 30, 2011 12:42 pm Post subject: |
|
|
Please correct me if I am wrong, but AFAIK with bridges any host may sniff packets from the other hosts on the bridge (like in a network hub), and with VDE, that is not possible (like with a network switch).
Thank you. |
|
Back to top |
|
|
xming Guru
Joined: 02 Jul 2002 Posts: 441
|
Posted: Fri Sep 30, 2011 2:28 pm Post subject: |
|
|
host and hosts? I presume you mean host and guests, host can always sniff guests' traffic not matter what you use, unless you use pci-passthru for the NICs. Linux bridge is a bridge not hub, so one guest can not see other guests' traffic. _________________ http://wojia.be |
|
Back to top |
|
|
dman777 Veteran
Joined: 10 Jan 2007 Posts: 1004
|
Posted: Sat Oct 01, 2011 4:55 am Post subject: |
|
|
jormartr wrote: | Please correct me if I am wrong, but AFAIK with bridges any host may sniff packets from the other hosts on the bridge (like in a network hub), and with VDE, that is not possible (like with a network switch).
Thank you. |
I was under the same impression. In a bridge, it seems the bridge would be a virtual hub since there is no MAC filtering(otherwise it would be a switch) all guests will have to receive all packets. If not, how else will a guest receive it's intended packet without getting all other guests packets? |
|
Back to top |
|
|
xming Guru
Joined: 02 Jul 2002 Posts: 441
|
Posted: Sat Oct 01, 2011 4:56 pm Post subject: |
|
|
dman777 wrote: | jormartr wrote: | Please correct me if I am wrong, but AFAIK with bridges any host may sniff packets from the other hosts on the bridge (like in a network hub), and with VDE, that is not possible (like with a network switch).
Thank you. |
I was under the same impression. In a bridge, it seems the bridge would be a virtual hub since there is no MAC filtering(otherwise it would be a switch) all guests will have to receive all packets. If not, how else will a guest receive it's intended packet without getting all other guests packets? |
If a bridge is a virtual hub then it would be called as a hub. A bridge is a bridge (L2 device), a hub is L1 device, and a switch is L2, so a bridge is more like a switch than it is to a hub. I know plenty of switch which can't do MAC filtering, are they suddenly hubs? And who says that bridges can't do MAC filtering? To differentiate these devices you need to know the OSI layers well so you know where to put them.
And btw what the heck do you need mac filtering for? Are you sure you are using the correct terminology? _________________ http://wojia.be |
|
Back to top |
|
|
dman777 Veteran
Joined: 10 Jan 2007 Posts: 1004
|
Posted: Sun Oct 02, 2011 1:36 am Post subject: |
|
|
Yes..I am aware of the correct term.
I was told on #network that filtering on the lowest level(mac address) is always best. Since promisc mode on a Nic isn't as secure as non-promisc mode, I see the logic in that....it's better the physical device(nic) drops the packet rather than reach the OS and the kernel drops it.
I thought the convention was hubs don't filter on a mac addresses. If this is true, than what would diff. between a switch and a hub if they both filter on mac address? |
|
Back to top |
|
|
xming Guru
Joined: 02 Jul 2002 Posts: 441
|
Posted: Sun Oct 02, 2011 8:53 am Post subject: |
|
|
Oh my I give up. Where the hell did I ever said the hubs can do MAC filtering? _________________ http://wojia.be |
|
Back to top |
|
|
malern Apprentice
Joined: 19 Oct 2006 Posts: 170
|
Posted: Mon Oct 03, 2011 4:41 pm Post subject: |
|
|
I used to use vde_switch with vde_pcapplug on a dev machine. Like xming says, it was horribly inefficient, but I wanted something quick and easy to setup. I was running 4 or 5 guests at a time for web development, so not massively hardcore network requirements, but they shovelled a decent amount of traffic (they could easily saturate my 100mb link). I never benchmarked it but there was never any noticeable increase in lag or load due to running everything through vde (I was using reasonable modern hardware for the host though).
vde_switch by itself won't send/receive anything over eth0 (or any other interface) by default, it only routes things to the other guests connected to it. There's a number of ways to connect it to a real interface though. I went with vde_pcapplug because it was mind numbingly easy to setup, you just run "vde_pcapplug eth0" and it uses pcap to sniff and inject things into eth0. The guests appear as normal hosts on the LAN (i.e. there's no NAT or anything going on). The downside is it bypasses iptables and all the regular networking stuff, plus you can't communicate with the actual host only the rest of the network, which is a bit of a pain.
I think the duplication that the wiki talks about basically refers to copying the packets from the vde_switch program to a real interface. Really it just means it's forwarding the packets to somewhere else, you won't get any hosts seeing the same packet twice. |
|
Back to top |
|
|
jormartr Apprentice
Joined: 02 Jan 2008 Posts: 174
|
Posted: Thu Oct 06, 2011 8:25 pm Post subject: |
|
|
I have been trying to capture traffic from a guest, while using a bridged setup, and it could not read anything that was not sent to it, or broadcasted.
Now I am switching to bridges again...
Thank you guys. |
|
Back to top |
|
|
|