In-Band Network Telemetry for BMv2 P4 switch
-
Install dependences:
-
Compile code:
p4c --target bmv2-v1model --std p4-16 switch.p4
This will produce
switch.jsonfile needed for BMv2. -
Setting up test network:
sudo python run/demo_net.py --json switch.json
In other terminal set up rules forwarding rules:
run/run_forwarding.sh
And set up rules for In-Band Network Telemetry:
run/run_int.sh
Now you can use the standard mininet CLI in the first terminal.
- INT metadata is placed behind IP header. So, metrics are collected also for ICMP packets.
- IP packets with metadata are not valid, because field totalLen in IP header is not updated when adding metadata.
- Probably there is a bug in BMv2. Use of field with type
varbitin metadata when cloning packet cause that only one packet is forwarded. Others are dropped. As a workaround that, valid metrics are only from last switch and the rest are junk data derived from upper layers headers and data.