# Network general options net.setLogLevel('info') net.setCompiler(p4rt=True) # Network definition net.addP4RuntimeSwitch('s1') net.addP4RuntimeSwitch('s2') net.addP4RuntimeSwitch('s3') net.addP4RuntimeSwitch('s4') net.addP4RuntimeSwitch('s5') net.addP4RuntimeSwitch('s6') net.addP4RuntimeSwitch('s7') net.setP4SourceAll('rsvp.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addHost('h5') net.addHost('h6') net.addLink("h1", "s1") net.addLink("h2", "s1") net.addLink("s1", "s2") net.addLink("s1", "s3") net.addLink("s2", "s4") net.addLink("s3", "s4") net.addLink("s2", "s5") net.addLink("s3", "s6") net.addLink("s4", "s5")
net = NetworkAPI() # Network general options net.setLogLevel('info') net.enableCli() net.execScript('sudo python controller_two_tables.py populate 50000') # Network definition net.addP4Switch('s1') net.addP4Switch('s2') net.addP4Switch('s3') net.addP4Switch('s4') net.setP4SourceAll('forwarding_two_tables.p4') net.addHost('h1') net.setDefaultRoute('h1', '10.0.1.1') net.addHost('h2') net.setDefaultRoute('h2', '10.0.2.1') net.addHost('h3') net.setDefaultRoute('h3', '10.250.250.1') net.addLink('h1', 's1') net.setIntfIp('h1', 's1', '10.0.1.2/24') net.setIntfIp('s1', 'h1', '10.0.1.1/24') net.addLink('s1', 's2') net.addLink('s1', 's3') net.addLink('s2', 's4') net.addLink('s3', 's4') net.addLink('s4', 'h2') net.setIntfIp('s4', 'h2', '10.0.2.1/24')
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()
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') 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.addHost('h9') net.addHost('h10') net.addHost('h11') net.addHost('h12') net.addHost('h13') net.addHost('h14') net.addHost('h15') net.addHost('h16')