User guide
Create traffic selector rules
Pifina only captures traffic flows, which have been defined by the user. This will be done using a match-action table, where the user can define any parsed header fields to match on during the PIFINA library generation.
As soon as the tofino-probe
and the collector are running, follow the steps below:
- open the PIFINA web application and go to the
Configuration
navigation item in the menu. - Select your Tofino switch
- Click on
Create new rule
button inActive match selector entries
section - Add your traffic selector rules as hex values
- Click on
Add
button
Monitor user defined register
PIFINA is able to monitor and visualise any registers in use. You can use this feature to implement a low/high watermark metric by yourself.
- open the PIFINA web application and go to the
Configuration
navigation item in the menu. - Select your Tofino switch
- Click on
Add new register
button inProbes for user application owned registers
section - Click on
show all available registers
to view all available registers - Click on the name of the register you would like to monitor
- Define the register index position, which you would like to monitor.
- Click on
Add
button
Generate P4 skeleton application by PIFINA cli
Use the flag --gen-skeleton
to generate a skeleton for a P4 application enriched with PIFINA.
The key flags defines the name of the header fields to match on for interesting packets.
./pifina generate --gen-skeleton --key hdr.ethernet.ether_type:exact \
--key hdr.gqtrp.rel:ternary --key hdr.gqtrp.k:ternary \
--output ~/src/myapp/include
Add additional metrics to PIFINA dashboard
- Define a new constant with the name of the new metric to match on in the web application in the
pifina-sdk/frontend/src/lib/models/metricNames.ts
file
export const PROBE_ETHTOOL_RX_OOB = "rx_out_of_buffer"
- Add a new property for the new metric in the
PIFINA_CHART_CONFIG
constant located in thepifina-sdk/frontend/src/lib/config/chartConfig.ts
file.
export const PIFINA_PROBE_CHART_CFG: PIFINA_CHART_CONFIG = {
// ...
[pb.PROBE_ETHTOOL_RX_OOB]: {
yAxisName: pb.Y_AXIS_NAME_EVENTS_COUNT,
title: "Out of buffer events for RX"
},
- Set the title of the chart with the
title
property - Set the y-axis title with
yAxisName
property. - You can optionally change the tick format of the x axis using the propery
tickFormat
. You can find the available options for the tick format on the D3 site - Afterwards, you need to define the position of the chart in the dashboard in the
pifina-sdk/frontend/src/lib/config/dashboardConfig.ts
file. - If you use an two-sized array, then the chart will share the row with another chart. If you directly define the chart name without an inner array, then the chart will use the full row.
port const PIFINA_ETHTOOL_CHART_ORDER = [
// ...
// 2 charts in 1 row
[PROBE_ETHTOOL_RX_PAUSE, PROBE_ETHTOOL_TX_PAUSE],
// 1 chart in 1 row
PROBE_ETHTOOL_RX_OOB
]