The page outlines instructions to achieve INT through ONOS and P4.
For the details of the demonstration, please see followings:
$ onos-setup-p4-dev |
Clone BPFCollector repo. (See BPFCollector for details.)
$ git clone https://gitlab.com/tunv_ebpf/BPFCollector.git $ cd BPFCollector $ git checkout -t origin/spec_1.0 |
Enable JIT for eBPF to make BPFCollector run faster
$ sudo sysctl net/core/bpf_jit_enable=1 |
Install Cython to run the InfluxDB Client with better performance
$ pip install Cython |
Add virtual interfaces for collector
$ sudo ip link add veth_1 type veth peer name veth_2 $ sudo ip link set dev veth_1 up $ sudo ip link set dev veth_2 up |
Look for this line:
from mininet.link import TCLink |
Change the line as follows:
from mininet.link import TCLink, Intf |
Look for this line:
net.build() |
Below this line, add the followings:
collectorIntf = Intf( 'veth_1', node=net.nameToNode[ "s12" ] ) |
Run ONOS
$ ONOS_APPS=drivers.bmv2,proxyarp,lldpprovider,hostprovider,fwd bazel run onos-local -- clean |
Launch Mininet
$ sudo -E $ONOS_ROOT/tools/test/topos/bmv2-demo.py --onos-ip=127.0.0.1 --pipeconf-id=org.onosproject.pipelines.int |
Launch the collector
$ sudo systemctl start influxdb $ sudo python BPFCollector/InDBClient.py veth_2 |
Activate In-band telemetry control application
$ onos-app localhost activate org.onosproject.inbandtelemetry |
Add mirroring configuration on the switch for telemetry report
$ simple_switch_CLI --thrift-port `cat /tmp/bmv2-s12-thrift-port` RuntimeCmd: mirroring_add 500 5 (500: REPORT_MIRROR_SESSION_ID defined in int_definitions.p4) (5: port number to send mirrored packet, in this case veth_1) |
Generate some traffic to monitor
mininet> h11 iperf -c h22 -u -t 10000 |