20210510 Programming Protocol-independent Packet Processors ( P4 ) - 1
課堂資料

課堂練習
1

cd p4-test/1gedit p4app.json basic.p4 cmd.txt 
cd 1sed -i '/^$/d' p4app.jsonsed -i '/^$/d' basic.p4sed -i '/^$/d' cmd.txtp4run
net
h1 ping h2 -c 5
table_clear phy_forward後
h1 ping h2 -c 5
table_add phy_forward後
h1 ping h2 -c 5
simple_switch_CLI --thrift-port 9090table_info phy_forwardtable_dump phy_forward
table_clear phy_forwardtable_dump phy_forward
table_add phy_forward forward 1 => 2table_add phy_forward forward 2 => 1table_dump phy_forward
cd ..1 - 1
cd 1-1gedit p4app.json basic.p4
cd 1-1p4run
h1 ping h2 -c 52
cd p4-testcd 2誤關
gedit basic.p4 cmd.txt p4app.json
p4run
h1 ping h2 -c 5
變更
mac_forward後
h1 ping h2 -c 5
simple_switch_CLI --thrift-port 9090help
table_dump mac_forwardtable_clear mac_forwardtable_dump mac_forward
lsrm basic.p4i basic.json topology.dbrm -rf log pcaplsp4run
h1 ping h2 -c 5
變更
mac_forward => 1後
h1 ping h2 -c 5變更
mac_forward => 2後
h1 ping h2 -c 5exitp4run
查看完log之後
h1 ping h2 -c 5
simple_switch_CLI --thrift-port 9090table_add mac_forward forward 00:00:0a:00:01:01 => 1table_add mac_forward forward 00:00:0a:00:01:02 => 2table_dump mac_forward
p4run 後
cd p4-testcd 2cd loggedit s1.log
Previous20210503 Containernet / Mininet-Wifi ( Miniedit )Next20210517 Programming Protocol-independent Packet Processors ( P4 ) - 2
Last updated
Was this helpful?