from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.setP4SourceAll('p4src/cm-sketch.p4') net.addHost('h1') net.addHost('h2') net.addLink("h1", "s1") net.addLink("h2", "s1") # Assignment strategy net.mixed() # Nodes general options net.disablePcapDumpAll() net.disableLogAll() net.enableCli() net.startNetwork()
# 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') net.setIntfIp('h2', 's4', '10.0.2.2/24') net.addLink('s4', 'h3') net.setIntfIp('s4', 'h3', '10.250.250.1/24') net.setIntfIp('h3', 's4', '10.250.250.2/24') # Nodes general options net.enablePcapDumpAll()
# Network general options net.setLogLevel('info') net.enableCli() # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.addP4Switch('s2', cli_input='s2-commands.txt') net.addP4Switch('s3', cli_input='s3-commands.txt') net.setP4SourceAll('forwarding_two_tables.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addLink('h1', 's1') net.addLink('h2', 's2') net.addLink('s1', 's2') net.addLink('s1', 's3') net.addLink('h3', 's3') net.addLink('h4', 's3') # Assignment strategy net.mixed() # Nodes general options net.enablePcapDumpAll() net.enableLogAll() # Start the network net.startNetwork()
# 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 net.mixed() # Nodes general options net.enablePcapDumpAll()
# Network general options net.setLogLevel('info') # Network definition net.addP4Switch('s1') net.addP4Switch('s2') net.addP4Switch('s3') net.addP4Switch('s4') net.setP4SourceAll('p4src/fast_reroute.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addLink("h1", "s1") net.addLink("h2", "s2") net.addLink("h3", "s3") net.addLink("h4", "s4") net.addLink("s1", "s2", weight=1) net.addLink("s2", "s3", weight=1) net.addLink("s3", "s4", weight=5) net.addLink("s4", "s1", weight=1) net.addLink("s1", "s3", weight=10) net.addLink("s2", "s4", weight=10) # Assignment strategy net.l3() # Nodes general options net.disablePcapDumpAll()
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') net.enableCli() net.disableArpTables() # Network definition net.addP4Switch('s1') net.setP4Source('s1', './p4src/l2_learning_digest.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addLink('s1', 'h1') net.addLink('s1', 'h2') net.addLink('s1', 'h3') net.addLink('s1', 'h4') # 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') net.enableCli() # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.setP4SourceAll('ecn.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addLink('h1', 's1') net.addLink('h2', 's1') net.addLink('h3', 's1', bw=0.5) # Assignment strategy net.l3() # Nodes general options 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', 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('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") net.addLink("h6", "s6") net.addLink("h7", "s6") net.addLink("h8", "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")
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') net.addLink("h1", "s1") net.addLink("h2", "s1") net.addLink("h3", "s2") net.addLink("h4", "s2") net.addLink("s1", "s9") net.addLink("s1", "s10") net.addLink("s2", "s9") net.addLink("s2", "s10") net.addLink("s9", "s17") net.addLink("s9", "s18") net.addLink("s10", "s19") net.addLink("s10", "s20") net.addLink("h5", "s3") net.addLink("h6", "s3") net.addLink("h7", "s4") net.addLink("h8", "s4")
# 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.setP4SourceAll('p4src/loadbalancer.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addHost('h4') net.addLink("h1", "s1") net.addLink("h2", "s1") net.addLink("h3", "s3") net.addLink("h4", "s3") net.addLink("s1", "s2") net.addLink("s2", "s3") net.setBwAll(10) # Assignment strategy net.l3() # Nodes general options net.enablePcapDumpAll() net.enableLogAll() net.enableCli() 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.setP4Source('s1', 'multi_queueing.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addLink('s1', 'h1') net.addLink('s1', 'h2') net.addLink('s1', 'h3', bw=5) # Assignment strategy net.mixed() # Nodes general options net.enablePcapDumpAll() net.enableLogAll() # Start network net.startNetwork()
net.setLogLevel('info') # Network definition net.addP4Switch('s1') net.addP4Switch('s2') net.addP4Switch('s3') 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", "s3") net.addLink("h3", "s2") net.addLink("h4", "s2") net.addLink("h5", "s3") net.addLink("h6", "s3") net.setBwAll(10) # Assignment strategy net.l3() # Nodes general options net.disablePcapDumpAll()
net.setLogLevel('info') net.enableCli() # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.addP4Switch('s2', cli_input='s2-commands.txt') net.addP4Switch('s3', cli_input='s3-commands.txt') net.addP4Switch('s4', cli_input='s4-commands.txt') net.addP4Switch('s5', cli_input='s5-commands.txt') net.addP4Switch('s6', cli_input='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 net.mixed() # Nodes general options net.enablePcapDumpAll()
# 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') net.addLink('s3', 'h3') net.addLink('s3', 'h4') net.addLink('s3', 's4') net.addLink('s4', 'h6') net.addLink('s4', 'h5') # Assignment strategy net.l2() # Nodes general options net.enableCpuPortAll() net.enablePcapDumpAll()
# Network general options net.setLogLevel('info') net.enableCli() # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.addP4Switch('s2', cli_input='s2-commands.txt') net.addP4Switch('s3', cli_input='s3-commands.txt') net.addP4Switch('s4', cli_input='s4-commands.txt') net.setP4SourceAll('p4src/source_routing.p4') net.addHost('h1') net.addHost('h2') net.addLink('h1', 's1') net.addLink('s1', 's2') net.addLink('s1', 's3') net.addLink('s2', 's4') net.addLink('s3', 's4') net.addLink('s4', 'h2') # Assignment strategy net.mixed() # Nodes general options net.enablePcapDumpAll() net.enableLogAll() # Start network net.startNetwork()
# 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('basics.p4') net.addHost('h1') net.addHost('h2') net.addHost('h3') net.addLink("h1", "s1", port2=1) net.addLink("s1", "s2", port1=2, port2=1) net.addLink("s1", "s3", port1=3, port2=1) net.addLink("s2", "s4", port1=2, port2=1) net.addLink("s3", "s4", port1=2, port2=2) net.addLink("s4", "s5", port1=3, port2=1) net.addLink("s4", "s6", port1=4, port2=1) net.addLink("s5", "s7", port1=2, port2=1) net.addLink("s6", "s7", port1=2, port2=2) net.addLink("s7", "h2", port1=3) net.addLink("s7", "h3", port1=4) # Assignment strategy net.l3() # Nodes general options
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.addLink("s4", "s6") net.addLink("s5", "s7") net.addLink("s6", "s7") net.addLink("s7", "h5") net.addLink("s7", "h6") net.addLink("h3", "s3") net.addLink("h4", "s5")
from p4utils.mininetlib.network_API import NetworkAPI net = NetworkAPI() # Network general options net.setLogLevel('info') # Network definition net.addP4Switch('s1', cli_input='s1-commands.txt') net.addP4Switch('s2', cli_input='s2-commands.txt') net.setP4SourceAll('heavy_hitter.p4') net.addHost('h1') net.addHost('h2') net.addLink("h1", "s1", port2=1) net.addLink("s1", "s2", port1=2, port2=2) net.addLink("s2", "h2", port1=1) # Assignment strategy net.mixed() # Nodes general options net.disablePcapDumpAll() net.disableLogAll() net.enableCli() net.startNetwork()