'Create a sub_port and a peer
We create a sub_port that uses vlan as segmentation ID. In the vm
namespace we create a vlan subinterface on the same vlan.
A peer on the same network is created. When pinging from the peer
to the sub_port packets will be tagged using the internal vlan ID
of the network. The sub_port will remove that vlan tag and push the
vlan specified in the segmentation ID. The packets will finally reach
the vlan subinterface in the vm namespace.'

def add_vlan_interface_and_peer(self, vlan, ip_cidr):

    network = netaddr.IPNetwork(ip_cidr)
    net_helpers.create_vlan_interface(self._vm.namespace, self._vm.port.name, self.vm_mac_address, network, vlan)
    self._ip_vlan = str(network.ip)
    ip_cidr = net_helpers.increment_ip_cidr(ip_cidr, 1)
    self._peer2 = self.useFixture(machine_fixtures.FakeMachine(self.bridge, ip_cidr))
