zoukankan      html  css  js  c++  java
  • (3) Linux Switching – Interconnecting Namespaces – brctl – ovs-vsctl – veth pair


    http://www.opencloudblog.com/?p=66


    Switching in software on Linux is one of the important parts when using virtualization technologies like KVM or LXC. Typical hosts do not provide one or more physical adapters for each NIC of a virtual machine in KVM or per container when using LXC. Something else must take the part to interconnect the virtual network interfaces.

    The software switching classical tool is the linuxbridge, which is available in the Linux kernel for a long time. The frontend to manage the linuxbridge is brctl. The newer tool is the Openvswitch (at http://openvswitch.org/). The main frontend is ovs-vsctl.

    In this post I will show multiple solutions to interconnect Linux namespaces using a software based switch. A performance analysis of these solutions will be discussed in another article later. Starting with network namespaces helps to understand the more complex situations when using KVM or LXC.

    tap interfaces

    Linux tap interfaces created with ip tuntap cannot be used to attach network namespaces to linuxbridges or the openvswitch.

    veth pair

    The simple solution to connect two network namespaces is the usage of one veth pair. This has been discussed in a previous artice.

    veth pair

    Connecting namespaces using a veth pair

    The command sequence has been discussed in a previous article, but we show the commands here again

     linux bridge and two veth pairs

    When more than two network namespaces (or KVM or LXC instances) must be connected a switch should be used. Linux offers as one solution the well known linux bridge.

    Connecting namespaces using a linux bridge and two veth pairs

    Connecting namespaces using a linux bridge and two veth pairs

    We need for this setup one switch, and two connectors. In this setup we use a linuxbridge and two veth pairs.

    The commands to create this setup are:

    openvswitch and two veth pairs

    Another solution is to use the openvswitch instead of the „old“ linuxbrige. The configuration is nearly the same as for the linuxbridge.

    Connecting namespaces using the openvswitch and two veth pairs

    Connecting namespaces using the openvswitch and two veth pairs

    We need for this setup one switch, and two connectors. In this setup we use an openvswitch and two veth pairs.

    The commands to create this setup are:

    openvswitch and two openvswitch ports

    Another solution is to use the openvswitch and make use of the openvswitch internal ports. This avoids the usage of the veth pairs, which must be used in all other solutions.

    Connecting namespaces using the openvswitch and two openvswitch ports

    Connecting namespaces using the openvswitch and two openvswitch ports

    We need for this setup one switch, and two connectors. In this setup we use an openvswitch and two openvswitch ports.

    The commands to create this setup are:

     Performance

    In another article I will show some performance numbers for the four presented solutions. There are noticeable differences with respect to throughput and CPU usage.


  • 相关阅读:
    ROS学习笔记六:xxx.launch文件详解
    XML 基础学习
    Qt之界面(自定义标题栏、无边框、可移动、缩放)
    (转)YV12 and NV12
    FFMPEG的解码后的数据格式
    (转)使用AfxGetMainWnd函数的一个心得
    mout系统流程
    关于多画面窗口切换的刷新重绘问题
    (转)Invalidate、RedrawWindow与UpdateWindow的区别
    (转)关于三星cortex A9 Sate4412 开发板 uboot 启动的一些问题释疑
  • 原文地址:https://www.cnblogs.com/ztguang/p/12644971.html
Copyright © 2011-2022 走看看