gedit p4app.json ip_forward.p4 cmd1.txt cmd2.txt
h1 arp -s 10.0.1.254 00:01:0a:00:01:FE
h2 arp -s 10.0.1.254 00:01:0a:00:01:FE
修改規則後
動態修改規則
simple_switch_CLI --thrift-port 9090
table_dump mac_forward
table_delete mac_forward 2
table_delete mac_forward 2
table_dump mac_forward
table_add mac_forward forward 00:00:0a:00:01:FE => 3
table_dump mac_forward
cd p4-test/monitor_qlen
gedit p4app.json ip_forward.p4 cmd.txt
simple_switch_CLI --thrift-port 9090
echo "register_read qdepth" | simple_switch_CLI --thrift-port 9090
echo "register_read qdepth 2" | simple_switch_CLI --thrift-port 9090
echo "register_read qdepth 2" | simple_switch_CLI --thrift-port 9090 | grep qdepth
echo "register_read qdepth 2" | simple_switch_CLI --thrift-port 9090 | grep qdepth | awk '{print $NF}'
iperf -c 10.0.2.1 -u -b 20M -t 100
cd p4-test/monitor_qlen
sh monitor_qlens1h2.sh
date +%s%N | cut -b1-13
unit is micosecond 10^-6 second
mv -f monitor_linkbw.zip monitor_linkbw/
unzip monitor_linkbw.zip
gedit p4app.json ip_forward.p4 cmd.txt
iperf -c 10.0.2.1 -u -b 1M -t 100
cd Downloads/monitor_linkbw
simple_switch_CLI --thrift-port 9090
counter_read egressPortCounter 2
echo "counter_read egressPortCounter 2" | simple_switch_CLI --thrift-port 9090
echo "counter_read egressPortCounter 2" | simple_switch_CLI --thrift-port 9090 | grep egressPortCounter
echo "counter_read egressPortCounter 2" | simple_switch_CLI --thrift-port 9090 | grep egressPortCounter | tr "=" " " | ")" " "
echo "counter_read egressPortCounter 2" | simple_switch_CLI --thrift-port 9090 | grep egressPortCounter | tr "=" " " | ")" " " | awk '{print $NF}'
echo "2*3-3+2.1" | bc
echo "2*3-3+2.1/8" | bc
gedit p4app.json cmd1.txt cmd2.txt cmd3.txt
h1 arp -s 10.0.1.254 00:01:0a:00:01:FE
h2 arp -s 10.0.1.254 00:01:0a:00:01:FE
修改規則後
simple_switch_CLI --thrift-port 9090
table_dump mac_forward
table_delete mac_forward 2
table_dump mac_forward
table_add mac_forward forward 00:00:0a:00:01:FE => 3
table_dump mac_forward
cp -r monitor_linkbw monitor_bw
cp -r cmd.txt cmd1.txt
cp -r cmd.txt cmd2.txt
cp -r cmd.txt cmd3.txt
cp -r monitor_s1h2bw.sh monitor_bw.sh
gedit p4app.json ip_forward.p4 cmd1.txt cmd2.txt cmd3.txt monitor_bw.sh
cd Downloads/monitor_bw
iperf -c 10.0.2.1 -u -b 1M -t 100
iperf -c 10.0.3.1 -u -b 2M -t 100
iperf -c 10.0.1.2 -u -b 3M -t 100