# opentestpoint-probe-iptraffic

OpenTestPoint measurement probe to track IP Traffic statistics.

### Sample XML

Add an iptraffic probe element to your otestpointd configuration file:

```XML
<otestpoint id="node-1"
            discovery="0.0.0.0:8881"
	    publish="0.0.0.0:8882">
  <probe configuration="probe-iptraffic.xml">
    <plugin library="libotestpoint-probe-iptraffic.so"/>
  </probe>
</otestpoint>
```

The probe element references a probe configuration file, `probe-iptraffic.xml`.
That file names the network device where statistics are tallied:

```XML
<probe-iptraffic resetOnSend='yes'>
  <device name="eth0"/>
  <device name="eth1"/>
</probe-iptraffic>

```
`resetOnSend` is an optional attribute which when set to `yes` causes the probe to reset the tables every time it sends and update. Otherwise the tables will continuously grow.


```
[me@host]$ otestpoint-dump node-1:8882 IPTraffic

[1594727225] node-1/0 76744435-7a2b-4e53-b0bf-0e9199f1c10f
otestpoint.iptraffic.capture Measurement_pcap_tables_ipv4_udp v1 212 bytes
IPTraffic.Tables.IPv4.UDP.node-1
[] receive 
|Device|Src         |Dst        |Port|Rx Bytes|Rx Packets|
|eth0  |10.10.1.1  |224.252.1.1|10101|81722   |1409      |
|eth0  |10.10.2.1  |224.252.1.1|10201|81606   |1407      |
|eth1  |10.1.10.100|224.252.1.3|30101|166518  |2871      |
--


[1597757850] node-1/0 76744435-7a2b-4e53-b0bf-0e9199f1c10f
otestpoint.iptraffic.capture Measurement_pcap_tables_ether v1 1386 bytes
IPTraffic.Tables.Ether.node-1
[] receive
|Device|Src              |Dst              |Rx Packets|
|eth0  |02:02:00:00:00:64|33:33:00:00:00:02|256       |
|eth0  |02:02:00:00:00:c8|33:33:00:00:00:02|256       |
|eth0  |02:02:00:00:00:fa|01:00:5e:00:00:6d|29702     |
|eth0  |02:02:00:00:01:2c|01:00:5e:00:00:6d|39174     |
```
