1 """Custom LACP topology for LACP Module testing
3 1.Two hosts(H1,H2) two interface each connected with Switch(S1)
4 2.Two hosts(H3,H4) one interface each connected with Switch(S1)
15 | H1 |- - - - - - -| S1 |- - - - -| H3 |
16 | |- - - - - - -| | | |
17 - - - eth2 - - - - - - - -
23 Execute Custom topology:
24 sudo mn --custom LACP_custom1.py --switch ovsk,protocols=OpenFlow13 --topo=lacp
27 1.remoteController IP will be replaced in LACP_custom1.py using sed command during the robot execution
28 2.bonding.conf will be copied the mininet server under /etc/modprobe.d
29 3.h1-bonding.sh h2-bonding.sh will be executed in respective h1,h2 host console
32 from mininet.cli import CLI
33 from mininet.net import Mininet
34 from mininet.node import OVSController,RemoteController
35 from mininet.topo import Topo
36 from mininet.link import Link
38 class LacpTopo( Topo):
39 net = Mininet(controller=RemoteController)
40 c0 = net.addController('c0',controller=RemoteController,ip='CONTROLLER')
41 s1 = net.addSwitch('s1')
42 h1 = net.addHost('h1',mac='00:00:00:00:00:11')
43 h2 = net.addHost('h2',mac='00:00:00:00:00:22')
44 h3 = net.addHost('h3',mac='00:00:00:00:00:33',ip='10.1.1.3')
45 h4 = net.addHost('h4',mac='00:00:00:00:00:44',ip='10.1.1.4')
55 s1.cmd('sudo ovs-vsctl set bridge s1 protocols=OpenFlow13')
56 print h1.cmd('./h1-bond0.sh')
57 print h2.cmd('./h2-bond0.sh')
61 topos = { 'lacp': (lambda: LacpTopo() ) }