Flow
Configure NetFlow/IPFIX flow monitoring for traffic analysis on IOS-XR devices. Flow configuration includes exporter maps that define where flow data is sent (destination, transport, version parameters), monitor maps that define how flow data is collected (record format, exporter destination, cache parameters), and sampler maps that define sampling rates and methods for capturing network traffic patterns.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (iosxr.devices)
Section titled “configuration (iosxr.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| flow | Class | [flow] | No |
flow (iosxr.devices.configuration)
Section titled “flow (iosxr.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| exporters | List | [exporters] | No | |
| monitors | List | [monitors] | No | |
| samplers | List | [samplers] | No |
exporters (iosxr.devices.configuration.flow)
Section titled “exporters (iosxr.devices.configuration.flow)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| destination_address | Any | IP or String or String[Regex: ^.*[\$\%]\{.*$] | No | |
| destination_vrf | String | No | ||
| dfbit_set | Boolean | true, false | No | |
| dscp | Integer | min: 0, max: 63 | No | |
| packet_length | Integer | min: 512, max: 9000 | No | |
| router_id | Any | IP or String or String[Regex: ^.*[\$\%]\{.*$] | No | |
| source_address | Any | IP or String or String[Regex: ^.*[\$\%]\{.*$] | No | |
| source_interface | String | No | ||
| transport | Class | [transport] | No | |
| version | Class | [version] | No |
monitors (iosxr.devices.configuration.flow)
Section titled “monitors (iosxr.devices.configuration.flow)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| cache | Class | [cache] | No | |
| exporters | List | [exporters] | No | |
| options | Class | [options] | No | |
| record | Class | [record] | No |
samplers (iosxr.devices.configuration.flow)
Section titled “samplers (iosxr.devices.configuration.flow)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | max: 32 | Yes | |
| out_of | Integer | min: 1, max: 262144 | No | |
| random | Integer | min: 1, max: 1 | No |
transport (iosxr.devices.configuration.flow.exporters)
Section titled “transport (iosxr.devices.configuration.flow.exporters)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| udp_destination | Integer | min: 1024, max: 65535 | No |
version (iosxr.devices.configuration.flow.exporters)
Section titled “version (iosxr.devices.configuration.flow.exporters)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| format | Choice | v9, ipfix, sflow, protobuf | No | |
| options | Class | [options] | No | |
| template | Class | [template] | No |
cache (iosxr.devices.configuration.flow.monitors)
Section titled “cache (iosxr.devices.configuration.flow.monitors)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| entries | Integer | min: 4096, max: 1000000 | No | |
| hw_timeout_inactive | Integer | min: 50, max: 1800 | No | |
| timeout_active | Integer | min: 1, max: 604800 | No | |
| timeout_inactive | Integer | min: 0, max: 604800 | No | |
| timeout_rate_limit | Integer | min: 1, max: 1000000 | No | |
| timeout_update | Integer | min: 1, max: 604800 | No | |
| type | Choice | immediate, permanent | No |
exporters (iosxr.devices.configuration.flow.monitors)
Section titled “exporters (iosxr.devices.configuration.flow.monitors)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes |
options (iosxr.devices.configuration.flow.monitors)
Section titled “options (iosxr.devices.configuration.flow.monitors)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| bgpattr | Boolean | true, false | No | |
| filtered | Boolean | true, false | No | |
| outbundlemember | Boolean | true, false | No | |
| outphysint | Boolean | true, false | No | |
| sflow | Boolean | true, false | No | |
| sflow_extended_gateway | Boolean | true, false | No | |
| sflow_extended_ipv4_tunnel_egress | Boolean | true, false | No | |
| sflow_extended_ipv6_tunnel_egress | Boolean | true, false | No | |
| sflow_extended_router | Boolean | true, false | No | |
| sflow_if_counters_polling_interval | Integer | min: 5, max: 1800 | No | |
| sflow_input_ifindex | Choice | physical | No | |
| sflow_output_ifindex | Choice | physical | No | |
| sflow_sample_header_size | Integer | min: 128, max: 343 | No |
record (iosxr.devices.configuration.flow.monitors)
Section titled “record (iosxr.devices.configuration.flow.monitors)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| datalink_record | Boolean | true, false | No | |
| default_mdi | Boolean | true, false | No | |
| default_rtp | Boolean | true, false | No | |
| ipv4 | Boolean | true, false | No | |
| ipv4_as | Boolean | true, false | No | |
| ipv4_as_tos | Boolean | true, false | No | |
| ipv4_bgp_nexthop_tos | Boolean | true, false | No | |
| ipv4_destination | Boolean | true, false | No | |
| ipv4_destination_prefix | Boolean | true, false | No | |
| ipv4_destination_prefix_tos | Boolean | true, false | No | |
| ipv4_destination_tos | Boolean | true, false | No | |
| ipv4_extended | Boolean | true, false | No | |
| ipv4_gtp | Boolean | true, false | No | |
| ipv4_l2_l3 | Boolean | true, false | No | |
| ipv4_peer_as | Boolean | true, false | No | |
| ipv4_prefix | Boolean | true, false | No | |
| ipv4_prefix_port | Boolean | true, false | No | |
| ipv4_prefix_tos | Boolean | true, false | No | |
| ipv4_protocol_port | Boolean | true, false | No | |
| ipv4_protocol_port_tos | Boolean | true, false | No | |
| ipv4_source_prefix | Boolean | true, false | No | |
| ipv4_source_prefix_tos | Boolean | true, false | No | |
| ipv6 | Boolean | true, false | No | |
| ipv6_destination | Boolean | true, false | No | |
| ipv6_extended | Boolean | true, false | No | |
| ipv6_gtp | Boolean | true, false | No | |
| ipv6_l2_l3 | Boolean | true, false | No | |
| ipv6_peer_as | Boolean | true, false | No | |
| ipv6_srv6 | Boolean | true, false | No | |
| map_t | Boolean | true, false | No | |
| mpls | Boolean | true, false | No | |
| mpls_ipv4_fields | Boolean | true, false | No | |
| mpls_ipv4_ipv6_fields | Boolean | true, false | No | |
| mpls_ipv6_fields | Boolean | true, false | No | |
| mpls_labels | Integer | min: 1, max: 6 | No | |
| sflow | Boolean | true, false | No |
options (iosxr.devices.configuration.flow.exporters.version)
Section titled “options (iosxr.devices.configuration.flow.exporters.version)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| class_table_timeout | Integer | min: 0, max: 604800 | No | |
| interface_table_timeout | Integer | min: 0, max: 604800 | No | |
| sampler_table_timeout | Integer | min: 0, max: 604800 | No | |
| vrf_table_timeout | Integer | min: 0, max: 604800 | No |
template (iosxr.devices.configuration.flow.exporters.version)
Section titled “template (iosxr.devices.configuration.flow.exporters.version)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| data_timeout | Integer | min: 1, max: 604800 | No | |
| options_timeout | Integer | min: 1, max: 604800 | No | |
| timeout | Integer | min: 1, max: 604800 | No |
Example YAML Code:
Section titled “Example YAML Code:”Example-1: Flow exporter with v9 export format.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: flow: exporters: - name: EXPORTER1 destination_address: 192.0.2.1 destination_vrf: "MGMT" source_interface: GigabitEthernet0/0/0/1 dscp: 46 packet_length: 1468 dfbit_set: true transport: udp_destination: 5000 version: format: v9 template: data_timeout: 600 options_timeout: 600 timeout: 600 options: interface_table_timeout: 600 sampler_table_timeout: 600 class_table_timeout: 255 vrf_table_timeout: 300Example-2: IPv4 flow monitoring with exporter and sampler.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: flow: exporters: - name: EXPORTER1 destination_address: 192.0.2.1 transport: udp_destination: 9995 version: format: v9 monitors: - name: "FLOW_MONITOR_IPV4" record: ipv4: true exporters: - name: "EXPORTER1" cache: entries: 10000 timeout_active: 60 timeout_inactive: 15 samplers: - name: "SAMPLER_1" random: 1 out_of: 1000Example-3: IPv4 extended monitoring with sFlow options.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: flow: exporters: - name: EXPORTER1 destination_address: 10.0.0.1 transport: udp_destination: 9995 version: format: v9 - name: SFLOW_EXPORTER destination_address: 10.0.0.2 transport: udp_destination: 6343 version: format: sflow monitors: - name: "FLOW_IPV4_EXTENDED" record: ipv4_extended: true exporters: - name: "EXPORTER1" cache: entries: 50000 timeout_active: 120 timeout_inactive: 30 timeout_update: 60 options: outphysint: true filtered: true - name: "SFLOW_MONITOR" record: sflow: true options: sflow: true sflow_extended_router: true sflow_extended_gateway: true sflow_if_counters_polling_interval: 300 sflow_sample_header_size: 256 sflow_input_ifindex: physical sflow_output_ifindex: physical exporters: - name: "SFLOW_EXPORTER" cache: entries: 100000 timeout_inactive: 60 samplers: - name: "HIGH" random: 1 out_of: 100 - name: "LOW" random: 1 out_of: 10000Example-4: Hardware cache with immediate mode.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: flow: monitors: - name: "HW_FLOW_MONITOR" record: ipv4: true exporters: - name: "EXPORTER1" cache: entries: 500000 timeout_active: 300 timeout_inactive: 60 timeout_rate_limit: 5000 type: immediate hw_timeout_inactive: 300 options: bgpattr: true outbundlemember: true