2.10. telemetry

2.10.1. IPFIXSetup suite

IPFIX setup library

class resources.libraries.python.telemetry.IPFIXSetup.IPFIXSetup

Bases: object

Class contains methods for seting up IPFIX reporting on DUTs.

static assign_classify_table_to_exporter(node, table_id, ip_version='ip4')

Assign a classify table to an IPFIX exporter. Classified packets will be included in the IPFIX flow report.

  • node (dict) – DUT node.
  • table_id (int) – ID of a classify table.
  • ip_version (str) – Version of IP protocol. Valid options are ip4, ip6.
static assign_interface_to_flow_table(node, interface, table_id, ip_version='ip4')

Assigns a VPP interface to the specified classify table for IPFIX flow data collection.

  • node (dict) – DUT node.
  • interface (str or int) – An interface on the DUT node.
  • table_id (int) – ID of a classify table.
  • ip_version (str) – Version of IP protocol. Valid options are ip4, ip6.
static set_ipfix_stream(node, domain=None, src_port=None)

Set an IPFIX export stream. Can be used to break up IPFIX reports into separate reporting domains.

  • node (dict) – DUT node.
  • domain (int) – Desired index number of exporting domain.
  • src_port (int) – Source port to use when sending IPFIX packets. Default is the standard IPFIX port 4739.
static setup_ipfix_exporter(node, collector, source, fib=None, mtu=None, interval=None)

Setup an IPFIX exporter on node to export collected flow data.

  • node (dict) – DUT node.
  • collector (str) – IP address of flow data collector.
  • source (str) – IP address of local interface to send flow data from.
  • fib (int) – fib table ID.
  • mtu (int) – Maximum transfer unit of path to collector.
  • interval (int) – Frequency of sending template packets, in seconds.

2.10.2. IPFIXUtil suite

IPFIX utilities library. Provides classes that allow scapy to work with IPFIX packets.

Note: Template and data sets in one packet are not supported. Option template sets (Set_ID = 3) are not supported.
class resources.libraries.python.telemetry.IPFIXUtil.IPFIXData(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)

Bases: scapy.packet.Packet

Class for IPFIX data layer. Needs to be updated with a template before use.

fields_desc = []
name = 'IPFIX flow data'
class resources.libraries.python.telemetry.IPFIXUtil.IPFIXHandler

Bases: object

Class for handling IPFIX packets. To use, create instance of class before dissecting IPFIX packets with scapy, then run update_template every time an IPFIX template packet is received.

template_elements = {193: <Field ().Next_header>, 4: <Field ().Protocol_ID>, 7: <Field ().src_port>, 8: <Field ().IPv4_src>, 11: <Field ().dst_port>, 12: <Field ().IPv4_dst>, 86: <Field ().packetTotalCount>, 27: <Field ().IPv6_src>, 28: <Field ().IPv6_dst>, 180: <Field ().udp_src_port>, 181: <Field ().udp_dst_port>, 182: <Field ().tcp_src_port>, 183: <Field ().tcp_dst_port>}

Updates IPFIXData class with new data template. Registers IPFIX data layer with scapy using the new template.

Parameters:packet (scapy.Ether) – Packet containing an IPFIX template.
class resources.libraries.python.telemetry.IPFIXUtil.IPFIXHeader(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)

Bases: scapy.packet.Packet

Class for IPFIX header.

fields_desc = [<Field (IPFIXHeader).Version>, <Field (IPFIXHeader).Message Length>, <Field (IPFIXHeader).Timestamp(UTC)>, <Field (IPFIXHeader).Sequence Number>, <Field (IPFIXHeader).Observation Domain ID>, <Field (IPFIXHeader).Set_ID>, <Field (IPFIXHeader).Set_Length>]
name = 'IPFIX header'
class resources.libraries.python.telemetry.IPFIXUtil.IPFIXTemplate(_pkt='', post_transform=None, _internal=0, _underlayer=None, **fields)

Bases: scapy.packet.Packet

Class for IPFIX template layer.

fields_desc = [<Field (IPFIXTemplate).Template_ID>, <Field (IPFIXTemplate).nFields>, <Field (IPFIXTemplate).Template>]
name = 'IPFIX template'

2.10.3. SPAN suite

SPAN setup library

class resources.libraries.python.telemetry.SPAN.SPAN

Bases: object

Class contains methods for setting up SPAN mirroring on DUTs.

static set_span_mirroring(node, src_if, dst_if)

Set Span mirroring on the specified node.

  • node (dict) – DUT node.
  • src_if (str) – Interface to mirror traffic from.
  • dst_if (str) – Interface to mirror traffic to.
static vpp_get_span_configuration(node)

Get full SPAN configuration from VPP node.

Parameters:node (dict) – DUT node.
Returns:Full SPAN configuration as list. One list entry for every source/destination interface pair.
Return type:list of dict
static vpp_get_span_configuration_by_interface(node, dst_interface, ret_format='sw_if_index')

Get a list of all interfaces currently being mirrored to the specified interface.

  • node (dict) – DUT node.
  • dst_interface (str or int) – Name, sw_if_index or key of interface.
  • ret_format (string) – Optional. Desired format of returned interfaces.

List of SPAN source interfaces for the provided destination interface.

Return type: