This section provides information to configure cflowd using the command line interface.
SR OS implementation of cflowd supports the option to analyze traffic flow. The implementation also supports the use of traffic or access list (ACL) filters to limit the type of traffic that is analyzed.
Traffic sampling does not examine all packets received by a router. Command parameters allow the rate at which traffic is sampled and sent for flow analysis to be modified. The default sampling rate is every 1000th packet. Excessive sampling over an extended period of time, for example, more than every 1000th packet, can burden router processing resources.
The following data is maintained for each individual flow in the raw flow cache:
Within the raw flow cache, the following characteristics are used to identify an individual flow:
SR OS implementation allows you to enable cflowd either at the interface level or as an action to a filter. By enabling cflowd at the interface level, all IP packets forwarded by the interface are subject to cflowd analysis. By setting cflowd as an action in a filter, only packets matching the specified filter are subject to cflowd analysis. This provides the network operator greater flexibility in the types of flows that are captured.
A collector defines how data flows should be exported from the flow cache. A maximum of five collectors can be configured. Each collector is identified by a unique IP address and UDP port value. Each collector can only export traffic in one version type: V5, V8, V9, or V10.
The parameters within a collector configuration can be modified or the defaults retained.
The autonomous-system-type command defines whether the autonomous system information to be included in the flow data is based on the originating AS or external peer AS of the flow.
V8 aggregation allows for flow data to be aggregated into larger, less granular flows. Use aggregation commands to specify the type of data to be collected. These aggregation types are only applicable to flows being exported to a V8 collector.
The following aggregation schemes are supported:
This section provides information to configure cflowd and examples of common configuration tasks. To sample traffic, the following parameters must be configured, as a minimum.
The following example shows a cflowd configuration:
This section provides a brief overview of the tasks that must be performed to configure cflowd and provides the CLI commands. To begin traffic flow sampling, cflowd must be enabled and at least one collector must be configured.
The following common (global) attributes apply to all instances of cflowd:
Cflowd is disabled by default. Cflowd is not shut down but must be configured, including at least one collector, to be active. Executing the cflowd command enables cflowd.
Use the following CLI syntax to enable cflowd:
The following example shows the default values when cflowd is initially enabled. No collectors or collector options are configured.
The following cflowd parameters apply to all instances where cflowd is enabled.
Use the following CLI commands to configure cflowd parameters:
The following example shows a sample cflowd configuration:
To configure cflowd collector parameters, enter the following commands:
The following example shows a basic cflowd configuration:
Version 9 collector example:
If the collector is configured to use either V9 or V10 (IPFIX) formats, the flow data is sent to the designated collector using one of the predefined templates. The template used is based on the type of flow for which the data was collected (IPv4, IPv6, MPLS, or Ethernet (Layer 2)), and the configuration of the template-set parameter. Table 87 lists these values and the corresponding template used to export the flow data.
Traffic Flow | Basic | MPLS-IP |
IPv4 | Basic IPv4 | MPLS-IPv4 |
IPv6 | Basic IPv6 | MPLS-IPv6 |
MPLS | Basic MPLS | MPLS-IP |
Ethernet | L2-IP | L2-IP |
Each flow exported to a collector configured for either V9 or V10 formats will be sent using one of the flow template sets listed in Table 87.
Table 88 to Table 95 list the fields in each template listed in Table 87.
Field Name | Field ID |
IPv4 Src Addr | 8 |
IPv4 Dest Addr | 12 |
IPv4 Nexthop | 15 |
BGP Nexthop | 18 |
Ingress Interface | 10 |
Egress Interface | 14 |
Packet Count | 2 |
Byte Count | 1 |
Start Time | 22 |
End Time | 21 |
Flow Start Milliseconds 1 | 152 |
Flow End Milliseconds 1 | 153 |
Src Port | 7 |
Dest Port | 11 |
Forwarding Status | 89 |
TCP control Bits (Flags) | 6 |
IPv4 Protocol | 4 |
IPv4 ToS | 5 |
IP version | 60 |
ICMP Type & Code | 32 |
Direction | 61 |
BGP Source ASN | 16 |
BGP Dest ASN | 17 |
Source IPv4 Prefix Length | 9 |
Dest IPv4 Prefix Length | 13 |
Minimum IP Total Length | 25 |
Maximum IP Total Length | 26 |
Minimum TTL | 52 |
Maximum TTL | 53 |
Multicast Replication Factor | 99 |
IsMulticast 1 | 206 |
Ingress VRFID 1 | 234 |
Egress VRFID 1 | 235 |
Note:
Field Name | Field ID |
IPv4 Src Addr | 8 |
IPv4 Dest Addr | 12 |
IPv4 Nexthop | 15 |
BGP Nexthop | 18 |
Ingress Interface | 10 |
Egress Interface | 14 |
Packet Count | 2 |
Byte Count | 1 |
Start Time | 22 |
End Time | 21 |
Flow Start Milliseconds 1 | 152 |
Flow End Milliseconds 1 | 153 |
Src Port | 7 |
Dest Port | 11 |
Forwarding Status | 89 |
TCP control Bits (Flags) | 6 |
IPv4 Protocol | 4 |
IPv4 ToS | 5 |
IP version | 60 |
ICMP Type & Code | 32 |
Direction | 61 |
BGP Source ASN | 16 |
BGP Dest ASN | 17 |
Source IPv4 Prefix Length | 9 |
Dest IPv4 Prefix Length | 13 |
MPLS Top Label Type | 46 |
MPLS Top Label IPv4 Addr | 47 |
MPLS Label 1 | 70 |
MPLS Label 2 | 71 |
MPLS Label 3 | 72 |
MPLS Label 4 | 73 |
MPLS Label 5 | 74 |
MPLS Label 6 | 75 |
MPLS Label 7 | 76 |
MPLS Label 8 | 77 |
MPLS Label 9 | 78 |
MPLS Label 10 | 79 |
Minimum IP Total Length | 25 |
Maximum IP Total Length | 26 |
Minimum TTL | 52 |
Maximum TTL | 53 |
Multicast Replication Factor | 99 |
IsMulticast 1 | 206 |
Ingress VRFID 1 | 234 |
Egress VRFID 1 | 235 |
Note:
Field Name | Field ID |
IPv6 Src Addr | 27 |
IPv6 Dest Addr | 28 |
IPv6 Nexthop | 62 |
IPv6 BGP Nexthop | 63 |
IPv4 Nexthop | 15 |
IPv4 BGP Nexthop | 18 |
Ingress Interface | 10 |
Egress Interface | 14 |
Packet Count | 2 |
Byte Count | 1 |
Start Time | 22 |
End Time | 21 |
Flow Start Milliseconds 1 | 152 |
Flow End Milliseconds 1 | 153 |
Src Port | 7 |
Dest Port | 11 |
Forwarding Status | 89 |
TCP control Bits (Flags) | 6 |
Protocol | 4 |
IPv6 Extension Hdr | 64 |
IPv6 Next Header | 193 |
IPv6 Flow Label | 31 |
ToS | 5 |
IP version | 60 |
IPv6 ICMP Type & Code | 139 |
Direction | 61 |
BGP Source ASN | 16 |
BGP Dest ASN | 17 |
IPv6 Src Mask | 29 |
IPv6 Dest Mask | 30 |
Minimum IP Total Length | 25 |
Maximum IP Total Length | 26 |
Minimum TTL | 52 |
Maximum TTL | 53 |
Multicast Replication Factor | 99 |
IsMulticast 1 | 206 |
Ingress VRFID 1 | 234 |
Egress VRFID 1 | 235 |
Note:
Field Name | Field ID |
IPv6 Src Addr | 27 |
IPv6 Dest Addr | 28 |
IPv6 Nexthop | 62 |
IPv6 BGP Nexthop | 63 |
IPv4 Nexthop | 15 |
IPv4 BGP Nexthop | 18 |
Ingress Interface | 10 |
Egress Interface | 14 |
Packet Count | 2 |
Byte Count | 1 |
Start Time | 22 |
End Time | 21 |
Flow Start Milliseconds 1 | 152 |
Flow End Milliseconds 1 | 153 |
Src Port | 7 |
Dest Port | 11 |
Forwarding Status | 89 |
TCP control Bits (Flags) | 6 |
Protocol | 4 |
IPv6 Extension Hdr | 64 |
IPv6 Next Header | 193 |
IPv6 Flow Label | 31 |
ToS | 5 |
IP version | 60 |
IPv6 ICMP Type & Code | 139 |
Direction | 61 |
BGP Source ASN | 16 |
BGP Dest ASN | 17 |
IPv6 Src Mask | 29 |
IPv6 Dest Mask | 30 |
MPLS Top Label Type | 46 |
MPLS Top Label IPv6 Addr | 47 |
MPLS Label 1 | 70 |
MPLS Label 2 | 71 |
MPLS Label 3 | 72 |
MPLS Label 4 | 73 |
MPLS Label 5 | 74 |
MPLS Label 6 | 75 |
MPLS Label 7 | 76 |
MPLS Label 8 | 77 |
MPLS Label 9 | 78 |
MPLS Label 10 | 79 |
MPLS_TOP_LABEL_TYPE | 46 |
MPLS_TOP_LABEL_ADDR | 47 |
Minimum IP Total Length | 25 |
Maximum IP Total Length | 26 |
Minimum TTL | 52 |
Maximum TTL | 53 |
Multicast Replication Factor | 99 |
IsMulticast 1 | 206 |
Ingress VRFID 1 | 234 |
Egress VRFID 1 | 235 |
Note:
Field Name | Field ID |
Start Time | 22 |
End Time | 21 |
Flow Start Milliseconds 1 | 152 |
Flow End Milliseconds 1 | 153 |
Ingress Interface | 10 |
Egress Interface | 14 |
Packet Count | 2 |
Byte Count | 1 |
Direction | 61 |
MPLS Top Label Type | 46 |
MPLS Top Label Address | 47 |
MPLS Label 1 | 70 |
MPLS Label 2 | 71 |
MPLS Label 3 | 72 |
MPLS Label 4 | 73 |
MPLS Label 5 | 74 |
MPLS Label 6 | 75 |
Note:
Field Name | Field ID |
IPv4 Src Addr | 8 |
IPv4 Dest Addr | 12 |
IPv4 Nexthop | 15 |
IPv6 Src Addr | 27 |
IPv6 Dest Addr | 28 |
IPv6 Nexthop | 62 |
Ingress Interface | 10 |
Egress Interface | 14 |
Packet Count | 2 |
Byte Count | 1 |
Start Time | 22 |
End Time | 21 |
Flow Start Milliseconds 1 | 152 |
Flow End Milliseconds 1 | 153 |
Src Port | 7 |
Dest Port | 11 |
TCP control Bits (Flags) | 6 |
IPv4 Protocol | 4 |
IPv4 ToS | 5 |
IP version | 60 |
ICMP Type & Code | 32 |
Direction | 61 |
MPLS Top Label Type | 46 |
MPLS Top Label IPv4 Addr | 47 |
MPLS Label 1 | 70 |
MPLS Label 2 | 71 |
MPLS Label 3 | 72 |
MPLS Label 4 | 73 |
MPLS Label 5 | 74 |
MPLS Label 6 | 75 |
MPLS Label 7 | 76 |
MPLS Label 8 | 77 |
MPLS Label 9 | 78 |
MPLS Label 10 | 79 |
Note:
Field Name 1 | Field ID |
MAC Src Addr | 56 |
MAC Dest Addr | 80 |
Ingress Physical Interface | 252 |
Egress Physical Interface | 253 |
Dot1q VLAN ID | 243 |
Dot1q Customer VLAN ID | 245 |
Post Dot1q VLAN ID | 254 |
Post Dot1q Customer VLAN Id | 255 |
IPv4 Src Addr | 8 |
IPv4 Dest Addr | 12 |
IPv6 Src Addr | 27 |
IPv6 Dest Addr | 28 |
Packet Count | 2 |
Byte Count | 1 |
Flow Start Milliseconds | 152 |
Flow End Milliseconds | 153 |
Src Port | 7 |
Dest Port | 11 |
TCP control Bits (Flags) | 6 |
Protocol | 4 |
IPv6 Option Header | 64 |
IPv6 Next Header | 196 |
IPv6 Flow Label | 31 |
ToS | 5 |
IP Version | 60 |
ICMP Type Code | 32 |
Note:
Field Name | Field ID |
Flow Start Milliseconds | 152 |
Flow End Milliseconds | 153 |
VRF ID | 234 |
Ingress Interface | 10 |
Packet Count | 2 |
Byte Count | 1 |
Direction | 61 |
MPLS_TOP_LABEL_TYPE | 46 |
MPLS_TOP_LABEL_ADDR | 47 |
MPLS Label-1 | 70 |
Field Name 1 | Field ID |
IPv4 Src Addr 2 | 8 |
IPv4 Dest Addr 2 | 12 |
Ingress ID | 252 |
Egress ID | 253 |
Flow Start Milliseconds | 152 |
Ingress VRF ID 2 | 234 |
Egress VRF ID 2 | 235 |
Protocol 2 | 4 |
ToS 2 | 5 |
Data Link Frame Size 3 | 312 |
Section Exported Octets 2 | 410 |
Data Link Frame Section 2 | 315 |
Notes:
When cflowd is enabled on an interface, all packets forwarded by the interface are subject to analysis according to the global cflowd configuration and sorted according to the collector configurations.
See Table 97 for configuration combinations.
When the cflowd-parameters sampling unicast type interface option is configured in the config>router>if context, the following requirements must be met to enable traffic sampling on the interface:
Depending on the option selected, either acl or interface, cflowd extracts traffic flow samples from an IP filter or an interface for analysis. All packets forwarded by the interface are analyzed according to the cflowd configuration.
The acl option must be selected to enable traffic sampling on an IP filter. Cflowd (filter-sample) must be enabled in at least one IP filter entry.
The interface option must be selected to enable traffic sampling on an interface. If cflowd is not enabled (no cflowd), traffic sampling will not occur on the interface.
When enabled on a service interface, cflowd collects routed traffic flow samples through a router for analysis. Cflowd is supported on IES and VPRN services interfaces only. Layer 2 traffic is excluded. All packets forwarded by the interface are analyzed according to the cflowd configuration. On the interface level, cflowd can be associated with a filter (ACL) or an IP interface. L2 cflowd ingress sampling in supported on VPLS and Epipe SAPs.
Packets are matched against filter entries to determine acceptability. With cflowd, only the first packet of a flow is compared. If the first packet matches the filter criteria, an entry is added to the cflowd cache. Subsequent packets in the same flow are also sampled based on the cache entry.
Because a filter can be applied to more than one interface (when configured with a scope template), the interface-disable-sample option is intended to enable or disable traffic sampling on an interface-by-interface basis. The command can be enabled or disabled as needed instead of having to create numerous filter versions.
To enable an interface for filter traffic sampling, the following requirements must be met:
or
When a filter policy is applied to a service or a network interface, sampling can be configured so that traffic matching the associated IP filter entry is sampled when the IP interface is set to cflowd ACL mode and the filter-sample command is enabled. If cflowd is either not enabled (no filter-sample) or set to the cflowd interface mode, sampling does not occur.
When the interface-disable-sample command is enabled, traffic matching the associated IP filter entry is not sampled if the IP interface is set to cflowd ACL mode.
For cflowd to be operational, the following requirements must be met:
Cflowd can also be dependent on the following entity configurations:
The combination of interface and filter entry configurations determines whether flow sampling occurs. Table 97 lists the expected results based on cflowd configuration dependencies.
Interface Setting | cflowd-parameter type Setting | Command ip-filter entry Setting | Expected Results |
IP-filter mode | ACL | filter-sample | Traffic matching is sampled at specified rate |
IP-filter mode | ACL | no filter-sample | No traffic is sampled on this interface |
IP-filter mode or cflowd not enabled on interface | ACL | interface-disable-sample | Command is ignored; no sampling occurs |
Interface mode | Interface | interface-disable-sample | Traffic matching this IP filter entry is not sampled |
Interface mode | Interface | none | All IP traffic ingressing the interface is subject to sampling |
Interface mode | Interface | filter-sample | Filter-level action is ignored; all traffic ingressing the interface is subject to sampling |
This section describes Cflowd configuration management tasks:
Cflowd parameter modifications apply to all instances where cflowd is enabled. Changes are applied immediately. Use the following cflowd commands to modify global cflowd parameters:
The following example shows the cflowd command syntax to modify configuration parameters:
The following example shows an example cflowd configuration:
Use the following commands to modify cflowd collector and aggregation parameters:
If a specific collector UDP port is not identified, flows are sent to port 2055 by default.
The following example displays basic cflowd modifications: