Virtual Networking - Page 2

Print E-mail
Article Index
Virtual Networking
Page 2
Page 3
Page 4
Page 5
All Pages

Example Networks

Below are some example networks users may configure and an explanation of how that network would be implemented in practice.

  1. A privileged user creates two (Xen) guests, each with a Virtual Network Interface. Without any special networking configuration, these two guests are connected to a default Virtual Network which contains a combined Virtual Bridge/Router/Firewall.

      +-----------+                   D           +-----------+
    | Guest | N D H | Guest |
    | A | A N C | B |
    | +---+ | T S P | +---+ |
    | |NIC| | ^ ^ ^ | |NIC| |
    +---+-+-+---+ +---+---+ +---+-+-+---+
    ^ | ^
    | +--------+ +---+---+ +--------+ |
    +-->+ vif1.0 +----+ vnbr0 +----+ vif2.0 +<--+
    +--------+ +-------+ +--------+

    Notes:

    • "vnbr0" is a bridge device with it's own IP address on the same subnet as the guests.
    • IP forwarding is enabled in Dom0. Masquerading and DNAT is implemented using iptables.
    • We run a DHCP server and a DNS proxy in Dom0 (e.g. dnsmasq)
  2. A privileged user does exactly the same thing as (1), but with QEMU guests.

                                      D
    N D H
    A N C
    T S P
    ^ ^ ^
    +---+---+
    |
    +---+---+
    +-----------+ | vnbr0 | +-----------+
    | Guest | +---+---+ | Guest |
    | A | | | B |
    | +---+ | +---+---+ | +---+ |
    | |NIC| | | vtap0 | | |NIC| |
    +---+-+-+---+ +---+---+ +---+-+-+---+
    ^ +-------+ | +-------+ ^
    | | | +---+---+ | | |
    +------>+ VLAN0 +-+ VDE +-+ VLAN0 +<------+
    | | +-------+ | |
    +-------+ +-------+

    Notes:

    • VDE is a userspace ethernet bridge implemented using vde_switch
    • "vtap0" is a TAP device created by vde_switch
    • Everything else is the same as (1)
    • This could be done without vde_switch by having Guest A create vtap0 and have Guest B connect directly to Guest A's VLAN. However, if Guest A is shut down, Guest B's network would go down.
  3. An unprivileged user does exactly the same thing as (2).

      +-----------+                               +-----------+
    | Guest | +----+----+ | Guest |
    | A | |userspace| | B |
    | +---+ | | network | | +---+ |
    | |NIC| | | stack | | |NIC| |
    +---+-+-+---+ +----+----+ +---+-+-+---+
    ^ +-------+ | +-------+ ^
    | | | +---+---+ | | |
    +------>+ VLAN0 +-+ VDE +-+ VLAN0 +<------+
    | | +-------+ | |
    +-------+ +-------+

    Notes:

    • Similar to (2) except there is can be no TAP device or bridge
    • The userspace network stack is implemented using slirpvde to provide a DHCP server and DNS proxy to the network, but also effectively a SNAT and DNAT router.
    • slirpvde implements ethernet, ip, tcp, udp, icmp, dhcp, tftp (etc.) in userspace. Completely crazy, but since the kernel apparently has no secure way to allow unprivileged users to leverage the kernel's network stack for this, then it must be done in userspace.
  4. Same as (2), except the user also creates two Xen guests.

      
    +-----------+ D +-----------+
    | Guest | N D H | Guest |
    | A | A N C | B |
    | +---+ | T S P | +---+ |
    | |NIC| | ^ ^ ^ | |NIC| |
    +---+-+-+---+ +---+---+ +---+-+-+---+
    ^ | ^
    | +--------+ +---+---+ +--------+ |
    +-->+ vif1.0 +----+ vnbr0 +----+ vif2.0 +<--+
    +--------+ +---+---+ +--------+
    |
    +---+---+
    | vtap0 |
    +---+---+
    |
    +-------+ +--+--+ +-------+
    +---->+ VLAN0 +----+ VDE +---+ VLAN0 +<-----+
    | +-------+ +-----+ +-------+ |
    V V
    +---+-+-+---+ +---+-+-+---+
    | |NIC| | | |NIC| |
    | +---+ | | +---+ |
    | Guest | | Guest |
    | C | | D |
    +-----------+ +-----------+

    Notes:

    • In this case we could do away with VDE and have each QEMU guest use its own TAP device.
  5. Same as (3) except Guests A and C are connected to a Shared Physical Interface.

     +-----------+                 |          D       +-----------+
    | Guest | ^ | N D H | Guest |
    | A | | | A N C | B |
    | +---+ | +---+---+ | T S P | +---+ |
    | |NIC| | | eth0 | | ^ ^ ^ | |NIC| |
    +---+-+-+---+ +---+---+ | +---+---+ +---+-+-+---+
    ^ | | | ^
    | +--------+ +---+---+ | +---+---+ +--------+ |
    +>+ vif1.0 +-+ ebr0 + | + vnbr0 +-+ vif2.0 +<-+
    +--------+ +---+---+ | +---+---+ +--------+
    | | |
    +---+---+ | +---+---+
    | vtap1 | | | vtap0 |
    +---+---+ | +---+---+
    | | |
    +-------+ +--+--+ | +--+--+ +-------+
    +->+ VLAN0 +--+ VDE + | + VDE +--+ VLAN0 +<-+
    | +-------+ +-----+ | +-----+ +-------+ |
    V | V
    +---+-+-+---+ | +---+-+-+---+
    | |NIC| | | | |NIC| |
    | +---+ | | | +---+ |
    | Guest | | | Guest |
    | C | | | D |
    +-----------+ | +-----------+

    Notes:

    • The idea here is that when the admin configures eth0 to be shareable, eth0 is configured as an addressless NIC enslaved to a bridge which has the MAC address and IP address that eth0 should have
    • Again, VDE is redundant here.

 

Subscribe By Email

Enter your email address:

Delivered by FeedBurner

Donate

Development & maintainance needs time & money.
With your donation you can help us to keep this project alive
Donate:
  Monthly Monthly
Currency
Amount

Translate

Amazon

Copyright @ 2010 | Tutorialsforu.info | Developed by Open Source Coders | Add your link.