from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.enableCli() # Network definition net.addP4Switch('s1', cli_input='direct_commands.txt') net.setP4Source('s1', 'direct_meter.p4') net.addHost('h1') net.addHost('h2') net.addLink('s1', 'h1') net.addLink('s1', 'h2') # Nodes general options net.enablePcapDumpAll() net.enableLogAll() # Start network net.startNetwork()
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.enableCli() # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.setP4SourceAll('copy_to_cpu.p4') net.addHost('h1') net.addHost('h2') net.addLink('h1', 's1') net.addLink('h2', 's1') # Assignment strategy net.l3() # Nodes general options net.enableCpuPortAll() net.enablePcapDumpAll() net.enableLogAll() # Start the network net.startNetwork()
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.enableCli() # Network definition net.addP4Switch('s1') net.setP4Source('s1', 'repeater_with_table.p4') net.setP4CliInput('s1', 's1-commands.txt') net.addHost('h1') net.addHost('h2') net.addLink('s1', 'h1') net.addLink('s1', 'h2') # Assignment strategy net.l2() # Nodes general options net.enablePcapDumpAll() net.enableLogAll() # Start network net.startNetwork()
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') # Network definition net.addP4Switch('s1', cli_input='sw-commands/s1-commands.txt') net.addP4Switch('s2', cli_input='sw-commands/s2-commands.txt') net.addP4Switch('s3', cli_input='sw-commands/s3-commands.txt') net.addP4Switch('s4', cli_input='sw-commands/s4-commands.txt') net.addP4Switch('s5', cli_input='sw-commands/s5-commands.txt') net.addP4Switch('s6', cli_input='sw-commands/s6-commands.txt') net.setP4SourceAll('p4src/ecmp.p4') net.addHost('h1') net.addHost('h2') net.addLink("h1", "s1") net.addLink("h2", "s6") net.addLink("s1", "s2") net.addLink("s1", "s3") net.addLink("s1", "s4") net.addLink("s1", "s5") net.addLink("s2", "s6") net.addLink("s3", "s6") net.addLink("s4", "s6") net.addLink("s5", "s6") # Assignment strategy
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.disableArpTables() net.execScript('python l2_learning_controller.py s1 cpu &', reboot=True) net.execScript('python l2_learning_controller.py s2 cpu &', reboot=True) net.execScript('python l2_learning_controller.py s3 cpu &', reboot=True) net.execScript('python l2_learning_controller.py s4 cpu &', reboot=True) # Network definition net.addP4Switch('s1') net.setP4Source('s1','./p4src/l2_learning_copy_to_cpu.p4') net.addP4Switch('s2') net.setP4Source('s2','./p4src/l2_learning_copy_to_cpu.p4') net.addP4Switch('s3') net.setP4Source('s3','./p4src/l2_learning_copy_to_cpu.p4') net.addP4Switch('s4') net.setP4Source('s4','./p4src/l2_learning_copy_to_cpu.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addHost('h5') net.addHost('h6') net.addLink('s1', 'h1') net.addLink('s1', 'h2') net.addLink('s2', 's1') net.addLink('s2', 's3')
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.execScript('python routing-controller.py', reboot=True) # Network definition net.addP4Switch('s1') net.addP4Switch('s2') net.addP4Switch('s3') net.addP4Switch('s4') net.addP4Switch('s5') net.addP4Switch('s6') net.addP4Switch('s7') net.addP4Switch('s8') net.addP4Switch('s9') net.addP4Switch('s10') net.addP4Switch('s11') net.addP4Switch('s12') net.addP4Switch('s13') net.addP4Switch('s14') net.addP4Switch('s15') net.addP4Switch('s16') net.addP4Switch('s17') net.addP4Switch('s18') net.addP4Switch('s19') net.addP4Switch('s20') net.setP4SourceAll('p4src/loadbalancer.p4')
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.execScript('python routing-controller.py', reboot=True) # Network definition net.addP4Switch('s1') net.addP4Switch('s2') net.addP4Switch('s3') net.addP4Switch('s4') net.addP4Switch('s5') net.addP4Switch('s6') net.setP4SourceAll('p4src/loadbalancer.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addHost('h5') net.addHost('h6') net.addHost('h7') net.addHost('h8') net.addLink("h1", "s1") net.addLink("h2", "s1") net.addLink("h3", "s1") net.addLink("h4", "s1") net.addLink("h5", "s6")