OpenNebula

and VXLAN over routed multicast

Stefan Kooman / @basseroet
http://one.sadserver.nl/opennebulaconf2015

Agenda

  • Why VXLAN?
  • Why (routed) multicast?
  • How it works with OpenNebula

Why VXLAN (Virtual eXtensible Local Area Network)?

  • scalability of isolated L2 networks (16 million instead of 4096 (VLAN))
  • No need to stretch physical L2 network within / between Datacenters
  • Quick and easy to provision a isolated (virtual) network
  • Why (routed) multicast?

    • VXLAN needs multicast in physical network if there's no network controller
    • Routed multicast allows for easier scaling between datacenters based on L3

    How it works with OpenNebula

    • Makes use of VXLAN support in linux kernel (>= 3.7)
    • A 1:1 mapping of VXLAN network to a multicast group (i.e vxlan 1 maps to 239.0.0.1)

    ONE VXLAN driver code

    
    OpenNebula.exec_and_log("#{command(:ip)} link \
    add #{@nic[:vlan_dev]}" " #{mtu} type vxlan id #{@nic[:vlan_id]} \
    group #{mcs} ttl 10" " dev #{@nic[:phydev]}")
    
    
    sudo brctl addbr vxlan50
    sudo ip link set vxlan50 up
    sudo ip link add vlan601.50 mtu 1500 type vxlan id 50 \
    group 239.0.0.50 ttl 10 dev vlan601
    sudo ip link set vlan601.50 up
    sudo brctl addif vxlan50 vlan601.50
    
    
    <interface type='bridge'>
    <source bridge='vxlan50'/>
    <mac address='02:02:c0:a8:4d:01'/>
    <model type='virtio'/>
    </interface>
    
    
    vxlan50:  mtu 1500 \
    qdisc noqueue state UP group default 
        link/ether 5e:c5:a9:7f:53:74 brd ff:ff:ff:ff:ff:ff
    vlan601.50:  mtu 1500 \
    qdisc noqueue master vxlan50 state UNKNOWN group default 
        link/ether 5e:c5:a9:7f:53:74 brd ff:ff:ff:ff:ff:ff
    vnet7:  mtu 1500 \
    qdisc pfifo_fast master vxlan50 state UNKNOWN group default qlen 500
        link/ether fe:02:c0:a8:4d:02 brd ff:ff:ff:ff:ff:ff
    

    Juniper x4300 switch config

    
    interfaces {
        irb {
            unit 601 {
                family inet {
                    address 10.60.1.1/24;
                }
            }
            unit 701 {
                family inet {
                    address 10.70.1.1/24;
                }
            }
            unit 801 {
                family inet {
                    address 10.80.1.1/24;
                }
            }
        }
        lo0 {
            unit 0 {
                family inet {
                    address 172.17.1.1/32 {
                    }
                }
            }
        }
    }
    routing-options {
        router-id 172.17.1.1;
    }
    protocols {
        igmp {
            interface irb.601 {
                version 3;
                immediate-leave;
            }
            interface irb.701 {
                version 3;
                immediate-leave;
            }
            interface irb.801 {
                version 3;
                immediate-leave;
            }
            interface lo0.0 {
                version 3;
                immediate-leave;
            }
        }
        pim {
            rp {
                local {
                    family inet {
                        address 172.17.1.1;
                    }
                }
            }
            interface lo0.0 {
                mode sparse;
                version 2;
            }
            interface irb.601 {
                mode sparse;
                version 2;
            }
            interface irb.701 {
                mode sparse;
                version 2;
            }
            interface irb.801 {
                mode sparse;
                version 2;
            }
        }
    }
    vlans {
        hv_rack1 {
            vlan-id 601;
            l3-interface irb.601;
        }
        hv_rack2 {
            vlan-id 701;
            l3-interface irb.701;
        }
        hv_rack3 {
            vlan-id 801;
            l3-interface irb.801;
        }
    }
                        

    Administratively Scoped IPv4 Multicast addresses (RFC 2365)

    
    sipcalc 239.0.0.0/8
    -[ipv4 : 239.0.0.0/8] - 0
    
    [CIDR]
    Host address            - 239.0.0.0
    Host address (decimal)  - 4009754624
    Host address (hex)      - EF000000
    Network address         - 239.0.0.0
    Network mask            - 255.0.0.0
    Network mask (bits)     - 8
    Network mask (hex)      - FF000000
    Broadcast address       - 239.255.255.255
    Cisco wildcard          - 0.255.255.255
    Addresses in network    - 16777216
    Network range           - 239.0.0.0 - 239.255.255.255
    Usable range            - 239.0.0.1 - 239.255.255.254
    

    MTU

  • Increase the MTU on _all_ interfaces / switchports involved with VXLAN traffic (at least with 50 bytes)
  • MTU=1500 in vnet (default settings are 1450 in OpenNebula for VXLAN)
  • GUEST_MTU=1450 support in VM template / contextualization if you don't wan't to change MTU your network