-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
138 lines (108 loc) · 5.29 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---------------------------------------------------------
Netronome INT Transit Device Demo
---------------------------------------------------------
--------------------
P4 Application
--------------------
The P4 application forwards only INT VXLAN GPE packets from vf2 (v0.2)
to vf0 (v0.0), from vf0 to vf1 (v0.1) and vf1 to vf2 again. Each hop through
the dataplane will insert INT instructions, most significantly:
* switch ID in slot 0
* ingress timestamp in slot 1
* egress timestamp in slot 2
All non INT packets will be dropped.
Files for the project are found in dataplane/p4src and dataplane/csrc; rules
can be found in dataplane/p4cfg.
To build the firmware enter dataplane/build and run 'make'. Be sure to set the
SDKDIR environment variable to the path of your NFP SDK toolchain directory.
Note: one could edit the rules in dataplane/p4cfg and change v0.2 to p0 to use the
physical port rather than the VF netdev. The VF netdev is used so this demo
can be run with only the Netronome NIC for convenience sake
Note: that the demo called for a non-compliant INT implementation.
Look out for the INT_TO_SPEC define which enables the "to-spec" behavior.
---------------------
Host ifbounce utility
---------------------
In host/ifbounce is a simple C program which uses raw sockets to read and write
back a packet on a given linux network interface.
One can introduce latency in this application using SIGUSR1/2. Refer to the
source code for more info.
In host/ifbounce run 'make' to build.
---------------------------------
Using the INT traffic dumper tool
---------------------------------
in host/traffic there is a tool decode_gpe_int.py
which can parse and dump gpe INT traffic
run it on an interface like tcpdump:
./decode_gpe_int.py vf0_0
or on a pcap file:
./decode_gpe_int.py gpe_int_3sets.pcap
-----------------------------------------------------
Running the Demo
-----------------------------------------------------
Make sure the NFP SDK P4 runtime server is running in NETDEV mode (the default).
Enter dataplane/build and run "./load.sh". This will load firmware and
rules.
run the traffic bounce utility on two terminals:
./host/ifbounce/ifbounce vf0_0
and
./host/ifbounce/ifbounce vf0_1
this will return whatever traffic arrives on vf0_0 and vf0_1 back on the same
port untouched.
on one terminal run:
./host/traffic/decode_gpe_int.py vf0_2
this will display the traffic into and out of the Netronome NIC.
on another terminal run to inject a packet:
tcpreplay -i vf0_2 host/traffic/gpe_bfoot.pcap
you should see the following output (note that your timestamp will be different):
packet #0
packet #1
[0] switch_id | bos : 0x0 | switch_id : 0xcafe |
[0] ingress_ts | bos : 0x0 | value : 0x7661ee71 |
[0] egress_ts | bos : 0x0 | value : 0x7661fe71 |
[1] switch_id | bos : 0x0 | switch_id : 0xcafe |
[1] ingress_ts | bos : 0x0 | value : 0x7661ca93 |
[1] egress_ts | bos : 0x0 | value : 0x7661da93 |
[2] switch_id | bos : 0x0 | switch_id : 0xcafe |
[2] ingress_ts | bos : 0x0 | value : 0x7661a076 |
[2] egress_ts | bos : 0x1 | value : 0x0x7661ba93 |
The first packet going into vf0_2 is a GPE INT packet with no instructions,
the second packet has instruction added for all three ingress stages.
-----------------------------------------------------
Installing and Testing P4 INT Transit with ICONICS:
-----------------------------------------------------
1. Follow instructions on http://iconicsp4.cloudapp.net/ to install the NFP SDK RTE, setup access to the ICONICS repository and identifying your SmartNIC
To install the P4 basic loadbalancer and metering application:
yum install nfp-sdk6-p4-config-<smartnic>-p4_int_transit-<version>.noarch
List all the available packages in the repo:
repoquery -qa --repoid=iconics
2. The ifbounce, decode_gpe_int.py and the needed pcap files will be installed to:
/opt/nfp_pif/etc/smartnic-configs/<smartnic>-p4_int_transit/
3. Wait (around 2 minutes) for firmware to load onto the SmartNIC:
Use ifconfig to see when VFs have loaded before trying to run tests or look in /var/log/nfp-sdk6-rte.log
4. Run the test
Run the traffic bounce utility on two terminals:
ifbounce vf0_0
and
ifbounce vf0_1
this will return whatever traffic arrives on vf0_0 and vf0_1 back on the same
port untouched.
On one terminal run:
decode_gpe_int.py vf0_2
this will display the traffic into and out of the Netronome NIC.
on another terminal run to inject a packet:
tcpreplay -i vf0_2 gpe_bfoot.pcap
you should see the following output (note that your timestamp will be different):
packet #0
packet #1
[0] switch_id | bos : 0x0 | switch_id : 0xcafe |
[0] ingress_ts | bos : 0x0 | value : 0x7661ee71 |
[0] egress_ts | bos : 0x0 | value : 0x7661fe71 |
[1] switch_id | bos : 0x0 | switch_id : 0xcafe |
[1] ingress_ts | bos : 0x0 | value : 0x7661ca93 |
[1] egress_ts | bos : 0x0 | value : 0x7661da93 |
[2] switch_id | bos : 0x0 | switch_id : 0xcafe |
[2] ingress_ts | bos : 0x0 | value : 0x7661a076 |
[2] egress_ts | bos : 0x1 | value : 0x0x7661ba93 |
The first packet going into vf0_2 is a GPE INT packet with no instructions,
the second packet has instruction added for all three ingress stages.