-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.txt
96 lines (73 loc) · 2.17 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Meters example
This lab shows how to use meter in P4 by:
- match vlan traffic with meters
- update meters dynamically
How to get started:
1. create a new P4 project
2. import meter_lab.p4 (source code)
3. import meter_lab.p4cfg (configuration file)
4. download config.sh to your traffic generation server
5. follow steps below to configure and test meters
From traffic generation server:
# need to sudo
su
# to setup config
./config.sh
# configuration:
# namespace nsvf0 and p4vm1
# interface ip addr
# vf0_0 10.1.10.10/24
# vf0_0.100 1.1.100.1/24
# vf0_0.101 1.1.101.1/24
# vf0_0.102 1.1.102.1/24
# vf0_0.103 1.1.103.1/24
#
# namespace nsvf1 and p4vm2
# interface ip addr
# vf0_1 10.1.10.11/24
# vf0_1.100 1.1.100.2/24
# vf0_1.101 1.1.101.2/24
# vf0_1.102 1.1.102.2/24
# vf0_1.103 1.1.103.2/24
#
# vlan100 and 101 are connected to meters indx 0 & 1
# vlan100 from vf0 -> vf1
ip netns exec nsvf0 ping 1.1.100.2
# current meter for vlan101 (index 1) is configured incorrectly (too low)
# so ping does not return.
# vlan101 from vf0 -> vf1 -- no reply
ip netns exec nsvf0 ping 1.1.101.2
# vlan102 from vf0 -> vf1 - no meter
ip netns exec nsvf0 ping 1.1.102.2
# to change meter from linux RTE server
# to modify meter idx 1 to 128kbpps and 200k burst
rtecli meters -m 0 -c 1:0=128:200 set
# may have to wait a few minutes for interval to clear & new meter paramenters to take effect
# get meters
rtecli meters -m 0 get
# to dump all meters
rtecli meters -m 0 get
# more info
rtecli meters --help
rtecli --help
# to change meter, go to Windows VM, open Windows PowerShell
cd C:/NFP_SDK_6.0.1/p4/bin/
# to dump all meters (-r RTE_HOST use ip address of hardware)
./rtecli.exe -r 10.8.0.202 meters -m 0 get
# to modify meter idx 1 to 128kbpps and 200k burst
./rtecli.exe -r 10.8.0.202 meters -m 0 -c 1:0=128:200 set
# more info
./rtecli.exe -r 10.8.0.202 meters --help
./rtecli.exe --help
# To start VMs
./startvms.sh
# please use the VM ipaddresses from the red card
# uid=root password=netronome
# vf0_0 is assigned as eth1 in p4vm1
# vf0_1 is assigned as eth1 in p4vm2
#
# please shutdown VMs when done
virsh shutdown p4vm1
virsh shutdown p4vm2
# additional commands
virsh list