#!/usr/bin/env python

'''
    /2\ /5\
h1-1   4   7-h2
    \3/ \6/
'''


from mininet.cli import CLI
from mininet.node import Link
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.term import makeTerm
from functools import partial


def ofp_version(switch, protocols):
    protocols_str = ','.join(protocols)
    command = 'ovs-vsctl set Bridge %s protocols=%s' % (switch, protocols)
    switch.cmd(command.split(' '))

if '__main__' == __name__:
    net = Mininet(controller=RemoteController)
    c0 = net.addController('c0')

    h1 = net.addHost('h1')
    h2 = net.addHost('h2')

    s1 = net.addSwitch('s1')
    s2 = net.addSwitch('s2')
    s3 = net.addSwitch('s3')
    s4 = net.addSwitch('s4')
    s5 = net.addSwitch('s5')
    s6 = net.addSwitch('s6')
    s7 = net.addSwitch('s7')

    net.addLink(h1, s1)

    net.addLink(s1, s2)
    net.addLink(s1, s3)

    net.addLink(s2, s4)
    net.addLink(s3, s4)

    net.addLink(s4, s5)
    net.addLink(s4, s6)

    net.addLink(s5, s7)
    net.addLink(s6, s7)

    net.addLink(s7, h2)

    net.build()
    c0.start()
    s1.start([c0])
    s2.start([c0])
    s3.start([c0])
    s4.start([c0])
    s5.start([c0])
    s6.start([c0])
    s7.start([c0])


    ofp_version(s1, ['OpenFlow13'])
    ofp_version(s2, ['OpenFlow13'])
    ofp_version(s3, ['OpenFlow13'])
    ofp_version(s4, ['OpenFlow13'])
    ofp_version(s5, ['OpenFlow13'])
    ofp_version(s6, ['OpenFlow13'])
    ofp_version(s7, ['OpenFlow13'])

    CLI(net)
    net.stop()

@@ -523,16 +523,54 @@
 ntroller
+, autoStaticArp=True, autoSetMacs=True
 )%0A    c0

Add static mac and arp