Previous Page Next Page

New Features Supported with NetFlow Version 9

The flexibility and extensibility of the NetFlow version 9 protocol offers new possibilities for the metering process. This section lists a series of features enabled on top of NetFlow version 9.

SCTP Export

In the following example, shown in Figure 7-9, the router exports flow records for two different applications:

Figure 7-9. Scenario: SCTP Export


The following CLI configures the scenario shown in Figure 7-9. The backup restore time for the billing scenario has been set to a minimum value. As a result, a smaller number of flow records are transferred to the primary collector in case of backup and restore. This is less critical for the monitoring case.

Router(config)# ip flow-export destination 10.10.10.10 9999 sctp
Router(config-flow-export-sctp)# reliability partial buffer-limit 100
Router(config-flow-export-sctp)# backup destination 11.11.11.11 9999
Router(config-flow-export-sctp)# backup fail-over 1000
Router(config-flow-export-sctp)# backup mode fail-over

Router(config)# ip flow-aggregation cache destination-prefix
Router(config-flow-cache)# export destination 12.12.12.12 9999 sctp
Router(config-flow-export-sctp)# backup destination 13.13.13.13 9999
Router(config-flow-export-sctp)# backup mode redundant
Router(config-flow-export-sctp)# backup restore-time 1
Router(config-flow-export-sctp)# exit
Router(config-flow-cache)# enabled

In the following show command, you see that the backup association to 11.11.11.11 is not connected (backup mode failover), while the backup association to 13.13.13.13 is connected because the selected mode is redundant:

Router# show ip flow export sctp verbose
IPv4 main cache exporting to 10.10.10.10, port 9999, partial
status: connected
backup mode: fail-over
104 flows exported in 84 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 1000 milli-seconds
restore time:   25 seconds
backup: 11.11.11.11, port 9999
   status: not connected
   fail-overs: 0
   0 flows exported in 0 sctp messages.
   0 packets dropped due to lack of SCTP resources
destination-prefix cache exporting to 12.12.12.12, port 9999, full
status: connected
backup mode: redundant
57 flows exported in 42 sctp messages.
0 packets dropped due to lack of SCTP resources
fail-over time: 25 milli-seconds
restore time:   1 seconds
backup: 13.13.13.13, port 9999
   status: connected
   fail-overs: 0
   0 flows exported in 0 sctp messages.
   0 packets dropped due to lack of SCTP resources


					  

Sampled NetFlow

Due to the increasing interface speed and the higher density of ports on network elements, sampling becomes a very relevant feature in NetFlow. Without sampling, network elements gather so many flow records that these flows consumes a significant part of the total CPU utilization. In addition, the bandwidth requirements for the export link to the collector increase, and the collector requires extensive resources to process all exported flow records.

Sampled NetFlow significantly decreases CPU utilization. On average, at a Cisco 7500, sampling 1:1000 packets reduces the CPU utilization by 82 percent, and sampling 1:100 packets reduces the CPU utilization by 75 percent. The conclusion is that sampled NetFlow is a significant factor in reducing CPU utilization.

Even with NetFlow implementations in hardware ASIC on Cisco platforms such as the Catalyst 4500, 6500, 7600, 10000, and 12000 routers, sampled NetFlow offers advantages. Exporting flow records has a major impact on the CPU utilization on hardware-based NetFlow implementations.

Chapter 2 describes the different types of sampling in detail. Random packet sampling is statistically more accurate than deterministic packet sampling because it avoids any bias due to potential traffic repetitions and patterns.

Packet-Based Sampling on the Routers

NetFlow's ability to sample packets was first implemented as a feature called Sampled NetFlow. It uses deterministic sampling, which selects every n-th packet for NetFlow processing on a per-interface basis. For example, if you set the sampling rate to 1 out of 100 packets, Sampled NetFlow samples packets 1, 101, 201, 301, and so on. The Sampled NetFlow feature does not support random sampling and thus can result in inaccurate statistics when traffic arrives with fixed patterns.

Even though the Cisco 12000 router still offers Sampled NetFlow, the majority of the Cisco platforms offer Random Sampled NetFlow. Random Sampled NetFlow selects incoming packets based on a random selection algorithm so that on average one out of n sequential packets is selected for NetFlow processing. For example, if you set the sampling rate to 1 out of 100 packets, NetFlow might sample packets 5, 120, 199, 302, and so on. The sample configuration 1:100 provides NetFlow data on 1 percent of the total traffic. The n value is a configurable parameter, ranging from 1 to 65,535.

The Modular QoS Command-Line Interface (MQC) consists of three components:

This section offers a typical configuration example on a router, with three configuration steps.

Step 1: Defining a NetFlow Sampler Map

A NetFlow sampler map defines a set of properties (such as the sampling rate and the NetFlow sampler name) for NetFlow sampling. Each NetFlow sampler map can be applied to one or many subinterfaces, as well as physical interfaces. For example, you can create a NetFlow sampler map named mysampler1 with the following properties: random sampling mode and a sampling rate of 1 out of 100 packets. This NetFlow sampler map can be applied to any number of subinterfaces, each of which would refer to mysampler1 to perform NetFlow sampling. In this case, traffic from these multiple subinterfaces is merged into flows, which introduces even more randomness than sampling per single subinterface does.

router(config)# flow-sampler-map mysampler1
router(config-sampler)# mode random one-out-of 100

Step 2: Applying a NetFlow Sampler Map to an Interface

The following example shows how to apply a NetFlow sampler map called mysampler1 to Ethernet interface 1:

router(config)# interface ethernet 1/0
router(config-if)# flow-sampler mysampler1

Enabling Random Sampled NetFlow on a physical interface does not automatically enable it on all its subinterfaces. In addition, disabling Random Sampled NetFlow on a physical interface or subinterface does not enable full NetFlow. This restriction prevents the unwanted transition from sampling to full NetFlow. Instead, full NetFlow must be configured explicitly.

Router# show flow-sampler
Sampler : mysampler1, id : 1, packets matched : 10, mode : random sampling mode
  sampling interval is : 100


					  

Step 3: Checking the NetFlow Cache

The following example displays the NetFlow output of the show ip cache verbose flow command, in which the sampler, class-id, and general flags are set:

Router# show ip cache verbose flow
...
SrcIf          SrcIPaddress    DstIf          DstIPaddress     Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop               B/Pk  Active
BGP: BGP NextHop

Et1/0          8.8.8.8         Et0/0*         9.9.9.9          01 00  10       3
0000 /8  302                   0800 /8  300   3.3.3.3                100     0.1
BGP: 2.2.2.2         Sampler: 1  Class: 1  FFlags: 01


					  

The ID of the class that matches a packet is stored in the flow. The class ID is exported with version 9. A mapping of the class ID to the class name is sent to the collector using the options templates in NetFlow data export version 9. The collector maintains a mapping table from the class ID to the class name, and the table associates a class name with a flow at the collector so that you can determine which flow is filtered by a specific class.

For information, NetFlow flags (FFlags) that might appear in the show ip cache verbose flow command output are as follows:

Sending the Flow-Sampler Information

When the collector receives sampled flow records, a correlation between the sampled traffic and actual traffic that passed the device is required. An approximation is to multiply the sampled number of packet and bytes with the sampling rate. This implies that for each sampler ID the sampling rate is known to the collector. NetFlow version 9 exports the sampling rate in an option template field that matches the sampler ID of the exported flow records.

router(config)# ip flow-export version 9 options sampler

The previous CLI entry enables the export of an option containing random-sampler configuration, including the sampler ID, the sampling mode, and the sampling interval for each configured random sampler. In our example, the collector receives a flow record with the sampler ID equal to 1, along with an option template record containing sampler ID = 1, mode = random sampled NetFlow, and sampling rate = 100.

Flow-Based Sampled NetFlow on the Catalyst

On the Catalyst 6500/Cisco 7600, the NetFlow cache on the Policy Feature Card (PFC) captures statistics for flows routed in hardware. These platforms do not support packet sampling, because the collection process is implemented in ASICs and does not have any impact on the CPU utilization. Although the metering process is implemented in hardware, the flow export still requires software processing, which has a CPU impact. To reduce this, the PFC supports flow-based sampling, which decreases the CPU utilization, because only a subset of flow records is exported. As opposed to packet-based sampling, flow-based sampling is a post-processing feature, which means a sampling mechanism selects a subset of the existing flow entries for export to a collector.

With a Supervisor Engine 720, sampled NetFlow always uses the full-interface flow mask. With a Supervisor Engine 2, sampled NetFlow uses the full-interface or destination-source-interface flow masks. Sampled NetFlow per LAN port is supported with the full-interface flow mask or the destination-source-interface flow mask. This is a major enhancement compared to Supervisor Engine 2 functions and the other flow masks, where sampled NetFlow can be applied only at the device level instead of the interface level.

Two different flavors of flow-based sampling exist: time-based sampling and packet-based sampling.

Time-based sampling exports a snapshot of the NetFlow cache at certain intervals. The time-based sampling rate is specified in Table 7-5, which displays the corresponding sampling time and export interval for a given sampling rate.

Table 7-5. Time-Based Sampling Rate and Export Interval
Sampling Rate (R)Sampling Interval P (ms)Sampling Time ΔT (ms)Idle Time I (ms)
6481921288064
1288192648128
2568192328160
5128192168176
1024819288184
2048819248188
409616384416380
819232768432762


The sampling interval (P) is the time between two purging events of the NetFlow cache, where ΔT is the length of the sampling window in which a snapshot of all flows traversing the device is taken. The idle time (I) is the sampling interval minus the active sampling time (I = P – ΔT). At time 0, the table is cleared, and flow entries are added. At time 0 + ΔT, all flows are exported, the table is flushed again, and the idle time starts. At time 0 + P the cache is cleared without exporting any data, and all previous steps are repeated cyclically.

For time-based sampled NetFlow, the export interval cannot be configured; the sampling time is calculated as ΔT = P/R. Note that the sampling rate is globally defined for the entire Catalyst chassis.

For example, if you configure a rate of 64, flow-based sampled NetFlow meters traffic for the first 128 ms of a total interval of 4096 ms. If the rate is 2048, sampled NetFlow accounts traffic from the first 4 ms of a 8192-ms interval.

The following configuration enables time-based sampling on the fastethernet 5/12 interface, with a sampling rate of 1 in 64:

Catalyst(config)# mls sampling time-based 64
Catalyst(config)# interface fastethernet 5/12
Catalyst(config-if)# mls netflow sampling

Packet-based sampling allows the post-processing of flow records based on the number of packets observed in the flow. At each sampling interval (configured in milliseconds), NetFlow exports the flow records for which the number of packets is greater than the configured packet-based sampling rate. The user-configurable parameters are the packet rate and the sampling interval. If no sampling interval is specified, 8192 is used as a default.

Packet-based sampling uses the following formula to sample a flow: the number of times sampled is approximately the length divided by the rate (packets_in_flow/sampling_rate). For example, if the flow is 32768 packets long and the sampling rate is 1024, the flow is sampled approximately 32 times (32768/1024).

Catalyst(config)# mls sampling packet-based rate [interval]

NetFlow Input Filters

NetFlow Input Filters provide traffic metering on a specific subset of traffic by creating input filters. For example, you can select traffic from a specific group of hosts. NetFlow Input Filters is another NetFlow preprocessing feature, similar to packet-based Random Sampled NetFlow.

For the NetFlow Input Filters feature, classification of packets can be based on any of the following: IP source and destination addresses, Layer 4 protocol and port numbers, incoming interface, MAC address, IP Precedence, DSCP value, Layer 2 information (such as Frame Relay DE bits or Ethernet 802.1p bits), and Network-Based Application Recognition (NBAR). First, the packets are classified (filtered) on these criteria, and then they are grouped into NetFlow flows.

The filtering mechanism uses the MQC to classify flows. You can create multiple filters with matching samplers per subinterface. You can also configure different sampling rates by defining higher sampling rates for high-priority traffic classes and lower sampling rates for low-priority traffic. Figure 7-10 shows a typical example. You probably have a tight SLA linked with the VoIP traffic; therefore, full packet monitoring is executed on this traffic class, while a sampling rate of 1:100 checks the SLA on the VPN traffic. Finally, for monitoring purposes, sampled NetFlow classifies the best-effort traffic with a 1:1000 sampling rate.

Figure 7-10. NetFlow Input Filters Example


MQC offers multiple policy actions, such as limiting bandwidth rates and queuing management. These policies are applied only if a packet matches a criterion in a class map that is applied to the subinterface. A class map contains a set of match clauses and instructions on how to evaluate the clauses and acts as a filter for the policies. The NetFlow Input Filters feature combines NetFlow accounting with the MQC infrastructure. This implies that flow accounting is done on a packet format if it satisfies the match clauses.

NetFlow Input Filters require no additional memory. When comparing native NetFlow with NetFlow Input Filters, it enables a smaller number of NetFlow cache entries, because it can significantly reduce the number of flows. Accounting of classified traffic saves router resources by reducing the number of flows being processed and exported.

NetFlow Input Filters is supported in versions 5 and 9. The following four steps describe a configuration example combined with different sampling rates for different classifications:

Step 1.
Creating a class map for a policy map:

Referring to Figure 7-10, the VoIP traffic is classified with access list 101 and a precedence of 5 (DSCP value of 40), and the VPN traffic is classified with access list 102:

router(config)# class-map my_high_importance_class
router(config-cmap)# match access-group 101
router(config-cmap)# match dscp cs5
router(config)# class-map my_medium_importance_class
router(config-cmap)# match access-group 102

Step 2.
Creating a sampler map for a policy map:

In the following example, three sampler maps called my_high_sampling, my_medium sampling, and my_low_sampling are created for use with a policy map:

router(config)# flow-sampler-map my_high_sampling
router(config-sampler)# mode random one-out-of 1
router(config)# flow-sampler-map my_medium_sampling
router(config-sampler)# mode random one-out-of 100
router(config)# flow-sampler-map my_low_sampling
router(config-sampler)# mode random one-out-of 1000

Step 3.
Creating a policy containing NetFlow sampling actions:

The following example shows how to create a class-based policy containing three NetFlow sampling actions. In this example, a sampling action named my_high_sampling is applied to a class named my_high_importance_class, a sampling action named my_medium_sampling is applied to a class named my_medium_importance_class, and a sampling action named my_low_sampling is applied to the default class:

router(config)# policy-map mypolicymap
router(config-pmap)# class my_high_importance_class
router(config-pmap-c)# netflow-sampler my_high_sampling
router(config-pmap)# class my_medium_importance_class
router(config-pmap-c)# netflow-sampler my_medium_sampling
router(config-pmap)# class class-default
router(config-pmap-c)# netflow-sampler my_low_sampling

Step 4.
Applying a policy to an interface:

The following example shows how to apply a policy containing NetFlow sampling actions to an interface. In this example, a policy named mypolicymap is attached to interface POS1/0:

router(config)# interface POS1/0
router(config-if)# service-policy input mypolicymap

MPLS-Aware NetFlow

NetFlow can be used effectively in an MPLS network for VPN accounting and capacity planning. Ingress NetFlow can be used to account for traffic entering an MPLS VPN network from the customer site. The customer name can be linked to the associated VRF with the particular customer site by correlating it with the ifIndex value. MPLS-Aware NetFlow is a feature dedicated to the monitoring of MPLS flows, because it aggregates traffic per MPLS label within the MPLS core. This feature meters how much traffic is destined for a specific Provider Edge (PE) router in the network, allowing an operator to calculate a traffic matrix between PE routers in the MPLS network.

An MPLS flow contains up to three incoming MPLS labels of interest, with experimental bits (EXP) and the end-of-stack (S) bit in the same positions in the packet label stack. MPLS-Aware NetFlow captures MPLS traffic that contains Layer 3 IP and Layer 2 non-IP packets and uses the NetFlow version 9 export format.

When MPLS traffic is observed, MPLS-Aware NetFlow captures and reports up to three labels of interest and the label type and associated IP address of the top label, along with the normal NetFlow version 5 data record. Unlike NetFlow, MPLS-Aware NetFlow reports a 0 value for IP next hop, source and destination BGP Autonomous System numbers, or source and destination prefix masks for MPLS packets. A Label Switch Router (LSR) does not have routing information about the IP addresses in the MPLS packets payload. Other fields, such as source IP address, destination IP address, transport layer protocol, source application port number, destination application port number, IP type of service (ToS), TCP flags, input interface, and output interface, may be utilized as key-fields.

When you configure the MPLS-Aware NetFlow feature, you can select MPLS label positions in the incoming label stack that are of interest. You can capture up to three labels from positions 1 to 6 in the MPLS label stack. Label positions are counted from the top of the stack. For example, the position of the top label is 1, the position of the next label is 2, and so on. You enter the stack location value as an argument to the following command:

router(config)# ip flow-cache mpls label-positions [label-position-1 [label-
position-2
  [label-position-3]]] [no-ip-fields] [mpls-length]


					  

The label-position-n argument represents the position of the label on the incoming label stack. For example, the ip flow-cache mpls label-positions 1 3 4 command configures MPLS-Aware NetFlow to capture and export the first (top), third, and fourth labels. mpls-length reports the length of the MPLS packets, as opposed to the included IP packet length. If the no-ip-fields option is specified, the IP-related fields are reported with null values. With the introduction of Flexible NetFlow supporting MPLS fields, a more convenient solution would be the definition of a new template without those fields containing null values.

In Figure 7-11, some VPN traffic comes from the Customer Edge router 1 (CE1), enters the MPLS core via the Provider Edge router 1 (PE1), is metered with MPLS-Aware NetFlow at Provider router 1 (P1), and exits on PE2, PE3, or PE4.

Figure 7-11. NetFlow Input Filters Example


The following configuration enables MPLS-Aware NetFlow on the PE1-facing interface of P1. It uses the top MPLS label as the key-field (along with the 3 EXP bits and the bottom of the stack bit [S bit]). The bytes reported by NetFlow include the full MPLS packet lengths.

Router(config)#ip flow-cache mpls label-positions 1 no-ip-fields mpls-length


					  

The following show command illustrates that NetFlow cache contains this flow, with a top label of 486, with the 3 EXP bits value of 4, with a bottom-of-the-stack S bit value of 0, and, most importantly, with the Forwarding Equivalent Class (FEC) value of 10.10.10.3. The FEC value points to the loopback of the exit PE router, which is the exit point of the core network.

P1# show ip flow verbose cache
...
SrcIf  SrcIPaddress DstIf  DstIPaddress  Pr  TOS  Flgs  Pkts
Port  Msk  AS  Port  Msk  AS  NextHop  B/Pk  Active
PO2/0  0.0.0.0      PO3/0  0.0.0.0       00  00   10    1729
0000  /0   0   0000  /0   0   0.0.0.0   792  14.6
Pos:Lbl-Exp-S 1:486-4-0 (LDP/10.10.10.3)

Enabling MPLS-Aware NetFlow on all PE-facing interfaces of the P routers produces flow records that provide input to capacity planning tools to draw the core traffic matrix.

BGP Next-Hop Information Element

The BGP next hop is an important key-field in network-wide capacity planning where the core traffic is required, because the BGP next hop characterizes the network's exit point.

NetFlow adds the BGP next-hop information to the flow records to the main cache and—if aggregation is enabled—to the BGP Next-Hop ToS aggregation cache. The router performs a lookup on the destination IP address in the BGP table and adds the BGP next-hop information to each NetFlow flow record. This action adds an extra 16 bytes to the flow entry, resulting in a total of 80 bytes per entry.

Router(config)# ip flow-export version 9 [origin-as | peer-as] bgp-nexthop

This command enables the export of origin or peer AS information as well as BGP next-hop information from the NetFlow main cache. The origin-as option exports the flow's source and destination BGP AS, and peer-as exports the adjacent source and destination BGP AS.

Router# show ip cache verbose flow
...
SrcIf          SrcIPaddress    DstIf          DstIPaddress    Pr TOS Flgs Pkts
Port Msk AS                    Port Msk AS    NextHop              B/Pk   Active
BGP:BGP_NextHop
Et0/0/2        10.10.10.100    Et0/0/4        10.20.10.10     01 00  10   20
0000 /8  10                    0800 /8  20    10.10.10.6            100   0.0
BGP:10.10.10.1


					  

The following command enables the BGP Next-Hop ToS aggregation. It reports the BGP origin and destination BGP Autonomous System (AS) value, the input and output interfaces, the DSCP, and the BGP next hop. In addition, the following information elements are present in all aggregations: number of flows, number of packets, number of bytes, and the sysUpTime of the flow start and end time. Note that for ingress NetFlow, the DSCP information element value is the one contained in the observed packet, before any QoS operations are applied on the packet.

Router(config)# ip flow-aggregation cache bgp-nexthop-tos
Router(config-flow-cache)# enabled

Router# show ip cache flow aggregation bgp-nexthop-tos
...
Src If         Src AS  Dst If         Dst AS  TOS Flows   Pkts  B/Pk Active
BGP NextHop
Et0/0/2        10      Et0/0/4          20     00    9     36     40 8.2
BGP:10.10.10.1

Enabling the BGP Next-Hop ToS feature on all the CE-facing interface of the PE routers would produce flow records that, when combined, would produce the core traffic matrix as input to any capacity planning tools. The principles are similar to MPLS-Aware NetFlow. The differences are that NetFlow is enabled at different routers, that MPLS-Aware NetFlow might produce fewer flow records due to the MPLS top-label aggregation, and that the BGP Next-Hop ToS aggregation monitors only IP traffic.

NetFlow Multicast

NetFlow Multicast provides usage information about network traffic for a complete multicast traffic monitoring solution, because it allows metering multicast-specific data for multicast flows, along with the traditional NetFlow data records.

NetFlow Multicast offers three configuration choices:

The following example shows how to configure multicast egress NetFlow accounting on the Ethernet 0/0 interface:

Router(config)# interface ethernet 0/0
Router(config-if)# ip multicast netflow egress

The following example shows how to configure multicast ingress NetFlow accounting on the ingress Ethernet 1/0 interface:

Router(config)# interface serial 2/1/1.16
Router(config-if)# ip multicast netflow ingress
Router# show ip cache verbose flow
...
SrcIf          SrcIPaddress    DstIf          DstIPaddress     Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop               B/Pk  Active
IPM:OPkts    OBytes
Et1/1/1        11.0.0.1        Null           227.1.1.1        01 55  10     100
0000 /8  0                     0000 /0  0     0.0.0.0                 28     0.0
IPM:  200    5600
Et1/1/1        11.0.0.1        Se2/1/1.16     227.1.1.1        01 55  10     100
0000 /8  0                     0000 /0  0     0.0.0.0                 28     0.0


					  

The IPM:OPkts column displays the number of IP multicast output packets, the IPM:OBytes column displays the number of IPM output bytes, and the DstIPaddress column displays the destination IP address for the IP Multicast output packets.

In this example, the first flow is monitored with Multicast NetFlow ingress. The replication factor is 2, as you can deduce from the 200 multicast output packets and the 100 observed packets. Note that the destination interface reports Null, because in this case, NetFlow does not have an information element suitable for reporting a set of multiple interfaces. The second flow in the cache reports the same multicast flow metered by Multicast NetFlow egress: the destination interface is correct, and the number of packets is 100, as observed on the outgoing interface. This flow does not report the IPM:OPkts and IPM:OBytes because unicast and multicast flows cannot be distinguished at the egress interface.

Figure 7-12 illustrates a typical multicast flow, coming from the source 10.0.0.2 and multicast to 224.10.10.100.

Figure 7-12. NetFlow Multicast Configuration Scenarios, Part 1


Figure 7-13 displays relevant IP Multicast information elements of the flow records, with the three possible configuration scenarios.

Figure 7-13. NetFlow Multicast Configuration Scenarios, Part 2


Another interesting feature of NetFlow Multicast is the accounting for multicast packets that fail the Reverse Path Forwarding (RPF) check:

Router(config)# ip multicast netflow rpf-failure

In multicast, the primary purpose of the RPF check is to prevent loops, which could lead to multicast storms. NetFlow Multicast accounts the dropped packets and supplies relevant information for multicast routing debugging.

NetFlow Layer 2 and Security Monitoring Exports

The NetFlow Layer 2 and Security Monitoring Exports feature adds the ability for NetFlow to capture the values from several extra fields in Layer 3 IP traffic and Layer 2 LAN traffic to identify network attacks and their origin.

The following fields are reported:

NetFlow reports the minimum and maximum values of TTL and packet length in a flow; note that these two attributes are non-key-fields. Reporting only the value of a specific packet in the flow (such as the first or the last) would not offer relevant information for security analysis.

To enable NetFlow version 9 to report the described functions, the following additional configuration command is required:

Router(config)# ip flow-capture {icmp | ip-id | mac-addresses | packet-length |
  ttl | vlan-id}


					  

A typical flow in the NetFlow cache looks like this:

Router# show ip cache verbose flow
...
SrcIf          SrcIPaddress    DstIf          DstIPaddress     Pr TOS Flgs  Pkts
Port Msk AS                    Port Msk AS    NextHop               B/Pk  Active
Et0/0.1        10.251.138.218  Et1/0.1        172.16.10.2     06 80   00      65
0015 /0  0                     0015 /0  0     0.0.0.0                840    10.8
MAC: (VLAN id)  aaaa.bbbb.cc03  (005)          aaaa.bbbb.cc06   (006)
Min plen:      840                            Max plen:        840
Min TTL:       59                             Max TTL:           59
IP id:            0


					  

Top Talkers

The NetFlow Top Talkers feature can be useful for analyzing network traffic in any of the following ways:

The Top Talkers feature allows the top flows to be sorted for easier monitoring, troubleshooting, and retrieval at the CLI level. Top talkers can be sorted by the following criteria:

In addition to sorting top talkers, specific criteria provide a structured output. The match command, which acts as a filter, is used to specify the criteria, such as source IP address, destination IP address, application port, and many more.

The match command has the following syntax:

match {[byte-range [max-byte-number min-byte-number | max max-byte-number | min  min-
byte-number] | class-map map-name | destination [address ip-address [mask | /nn] | as
as-number | port [max-port-number min-port-number | max max-port-number | min  min-
port-number] | direction [ingress | egress] | flow-sampler flow-sampler-name |  input-
interface interface-type interface-number | nexthop-address ip-address [mask | /nn] |
output-interface interface-type interface-number | packet-range [ max-packets min-
packets | max max-packets | min min-packets] | protocol [protocol-number | udp | tcp] |
source [address ip-address [mask | /nn] | as as-number | port  max-port-number min-
port-number | max max-port-number | min min-port-number] | tos [tos-byte | dscp dscp |
precedence precedence]

Table 7-6 lists the different match statement options for the NetFlow Top Talkers feature.

Table 7-6. match Statement Options for the NetFlow Top Talkers Feature
OptionDescription
source addressSpecifies that the match criterion is based on the source IP address.
destination addressSpecifies that the match criterion is based on the destination IP address.
nexthop addressSpecifies that the match criterion is based on the next-hop IP address.
ip-addressIP address of the source, destination, or next-hop address to be matched.
MaskAddress mask in dotted-decimal format.
/nnAddress mask as entered in Classless Interdomain Routing (CIDR) format. An address mask of 255.255.255.0 is equivalent to a /24 mask in CIDR format.
source portSpecifies that the match criterion is based on the source port.
destination portSpecifies that the match criterion is based on the destination port.
port-numberSpecifies that the match criterion is based on the port number.
min portThe minimum port number to be matched. Any port number equal to or greater than this number constitutes a match. Range: 0 to 65535.
max portThe maximum port number to be matched. Any port number equal to or less than this number constitutes a match. Range: 0 to 65535.
min port max portA range of port numbers to be matched. Range: 0 to 65535.
source asSpecifies that the match criterion is based on the source autonomous system.
destination asSpecifies that the match criterion is based on the destination autonomous system.
as-numberThe autonomous system number to be matched.
input-interfaceSpecifies that the match criterion is based on the input interface.
output-interfaceSpecifies that the match criterion is based on the output interface.
interfaceThe interface to be matched.
tosSpecifies that the match criterion is based on the type of service (ToS).
tos-valueThe ToS to be matched.
dscp dscp-valueDifferentiated Services Code Point (DSCP) value to be matched.
precedence precedence-valuePrecedence value to be matched.
ProtocolSpecifies that the match criterion is based on the protocol.
Protocol-numberThe protocol number to be matched. Range: 0 to 255.
tcpThe protocol number to be matched as TCP.
udpThe protocol number to be matched as UDP.
flow-samplerThe match criterion is based on top talker sampling.
flow-sampler-nameName of the top talker sampler to be matched.
class-mapSpecifies that the match criterion be based on a class map.
ClassName of the class map to be matched.
packet-rangeThe match criterion is based on the number of IP datagrams in the flows.
byte-rangeThe match criterion is based on the size in bytes of the IP datagrams in the flows.
min-range-number max-range-numberRange of bytes or packets to be matched. Range 1 to 4,294,967,295.
min minimum-rangeMinimum number of bytes or packets to be matched. Range: 1 to 4,294,967,295.
max maximum-rangeMaximum number of bytes or packets to be matched. Range: 1 to 4,294,967,295.
min minimum-range max maximum-rangeRange of bytes or packets to be matched. Range: 1 to 4,294,967,295.


Here is a simple example of configuration for the Top Talkers NetFlow feature:

Router(config)# ip flow-top-talkers
Router(config-flow-top-talkers)# top 50
Router(config-flow-top-talkers)# sort-by bytes
Router(config-flow-top-talkers)# cache-timeout 2000

This example specifies a collection of the top 50 flows, sorted by bytes. The top talker list is processed only once in a configurable interval (timeout period), because constant processing of large numbers of flow records would be too CPU-intensive. The cache-timeout specifies the length of time, in seconds, for which the list of top talkers is retained. A long timeout period limits the impact on system resources. If a request is made more than once during the timeout period, the same results are displayed, and the list of top talkers is not recalculated until the timeout period expires. A short timeout period ensures that the latest list of top talkers is retrieved; however, the list of top talkers is lost when the timeout period expires. It is advised that you configure the timeout period to be equal to or greater than the time it takes the network management system (NMS) to retrieve the top talkers list. The following example completes the preceding example by adding two match statements. Only flows that fit these criteria are taken into account for the top talkers list.

Router(config)# ip flow-top-talkers
Router(config-flow-top-talkers)# top 50
Router(config-flow-top-talkers)# sort-by bytes
Router(config-flow-top-talkers)# cache-timeout 2000
Router(config-flow-top-talkers)# match destination port min 80 max 80
Router(config-flow-top-talkers)# match destination address 10.10.10.0/24

The match statements are used to filter the number of entries in the cache. A range of information element values, such as application port range, is also a valid option.

The NetFlow MIB and Top Talkers feature can be configured for a router either by entering command-line interface (CLI) commands or by using the SNMP interface that is available in the CISCO-NETFLOW-MIB. As well as allowing the configuration of the NetFlow Top Talkers feature, the cnfTopFlows group in the CISCO-NETFLOW-MIB permits the retrieval of the top flow records.

Another simple but very interesting feature allows the user to sort and aggregate flows in the NetFlow cache in various ways. With the "dynamic top talkers" feature (note that the "dynamic" keyword is added compared to the "top talkers" previously described), the user can specify how to sort and aggregate the flow records. The main advantage compared to the NetFlow Top Talkers is that the user does not have to configure the search criteria before generating the top talkers list. Therefore, the show command is executed ad hoc, with specific arguments, to delve into the data of interest.

For example, consider the possible output from the show ip flow top 5 aggregate source-address command:

Note

IPV4 SRC-ADDR is shown in uppercase (capital) letters because it is the field that the display is aggregated on.


The sorted-by option, which specifies which field to sort by, offers the following arguments:

- aggregate— Sorts by the aggregated field in the display data.

- bytes— Sorts by the number of bytes in the display data.

- flows— Sorts by the number of flows in the display data.

- packets— Sorts by the number of packets in the display data.

The match option, which specifies the filtering criteria, offers the possibility to select any fields from the cache. This means that the full content of Table 7-8 and some morefields, such as ICMP type, ICMP code, incoming MAC address, outgoing MAC address, TTL, and so on.

Flexible NetFlow

As mentioned earlier, Flexible NetFlow allows the network administrator to configure key-fields and non-key-fields for a flow record, effectively customizing the data collection for an application-specific set of requirements. The key-fields determine how traffic is attributed to a flow, and the non-key-fields provide additional information about the traffic in the flow record. A change in the value of a non-key-field does not create a new flow. Values for the majority of non-key-fields are taken only from the first packet in the flow. There are a few exceptions to this rule. For example, the minimum and maximum packet length fields are monitored and potentially updated for each packet in a flow.

The benefits of Flexible NetFlow include the following:

Flexible NetFlow is a great innovation that has the potential to change how accounting is done in networks. With the latest extensions, such as MAC address reporting and BGP traffic index, Flexible NetFlow is now ready to replace legacy accounting features such as Cisco IP accounting and BGP Policy Accounting. The permanent cache can even mimic the running counters of a MIB table with the advantage of defining the table columns with Flexible NetFlow key-fields and non-key-fields.

Figure 7-14 shows the major components of Flexible NetFlow.

Figure 7-14. Flexible NetFlow Components


Flow Monitors are the Flexible NetFlow components that are applied to interfaces for traffic monitoring. Flow Monitors consist of a Flow Cache definition, which is the data structure whose content is specified by the Flow Record definition attached to the Flow Monitor. The Flow Cache is automatically created when a Flow Monitor is applied to an interface. Flow Records are collected based on the definitions of key-fields and non-key-fields and are stored in the Flow Cache.

Based on the Flow Exporter characteristics (such as export format, export destination, and transport protocol), flow records are sent to a remote NetFlow collector. Flow Exporters are created as separate entities in the configuration and are assigned to Flow Monitors.

The term "flexible" in Flexible NetFlow is applicable to both the flow record definition and the infrastructure. Indeed, several Flow Monitors can monitor the same packets for different purposes and therefore create multiple Flow Caches. Note that it is possible with traditional NetFlow under the condition that multiple router-based aggregations are enabled, aggregating the flow records from the main cache.

The new Flexible NetFlow CLI specifies a series of predefined records to allow a phased approach to Flexible NetFlow: you can start using the new CLI while exporting the same information as in NetFlow version 5 and then tune the flow monitor with the user-defined records. Flexible NetFlow includes several predefined records. Two of them (netflow-original and netflow ipv4 original-output) emulate original (ingress) NetFlow and the egress NetFlow Accounting feature, respectively.

The Flexible NetFlow feature is available with Cisco IOS Software Releases 12.4(9)T and 12.0(33)S.

Fields in Flexible NetFlow

Looking at the list of new key-fields shown in Table 7-7, the number increased considerably compared to traditional NetFlow. Here are just a few of the fields that were added:

Table 7-7. Flexible Flow Record: Key-Fields
IPv4TransportRoutingFlowInterface
IP (Source or Destination)Payload SizeDestination PortTCP Flag: ACKSource ASSampler IDInput
Prefix (Source or Destination)Packet Section (Header)Source PortTCP Flag: CWRDestination ASDirectionOutput
Mask (Source or Destination)Packet Section (Payload)ICMP CodeTCP Flag: ECEPeer AS  
Minimum-Mask (Source or Destination)TTLICMP TypeTCP Flag: FINTraffic Index (BGP PA)
ProtocolOptions BitmapIGMP TypeTCP Flag: PSHForwarding Status
Fragmentation FlagsVersionTCP ACK NumberTCP Flag: RSTIS-Multicast
Fragmentation OffsetPrecedenceTCP Header LengthTCP Flag: SYNIGP Next Hop
IDDSCPTCP Sequence NumberTCP Flag: URGBGP Next Hop
Header LengthTOSTCP Window-SizeUDP Message Length 
Total Length TCP Source PortUDP Source Port


The list of non-key-fields also has been extended, as shown in Table 7-8. The number of bytes and packets can be selected between the counters 32-bit and 64-bit (with the long keyword). The minimum and maximum total length of the packets of the flow, and the minimum and maximum TTL, are among the non-key-fields.

Table 7-8. Flexible Flow Record: Non-Key-Fields
CounterIPv4Timestamp
BytesTotal Length MinimumsysUpTime First Packet
Bytes LongTotal Length MaximumsysUpTime First Packet
Bytes Square SumTTL Minimum 
Bytes Square Sum LongTTL Maximum
Packets 
Packets Long


Furthermore, any of the key-fields specified in Table 7-7 can be reported as non-key-fields. In this case, its content is the value of the first packet observed in the flow. The only exceptions are the TCP flags and the fragment offset.

The answer to the question of when to select a key-field versus a non-key-field depends on the application using the flow records. For example, should the output interface be a key-field or a non-key-field? Think about a scenario of a load-balancing network design, where you want flow records for each path. The output interface must be a key-field. Otherwise, if reported as a non-key-field, its value is the output interface of the first packet observed in the flow, which is the path the first packet took.

Packet Sections

Flexible NetFlow records let you monitor a contiguous section of a packet of a user-configurable size. This can be exported in a flow record as a key-field or a non-key-field, along with other fields and attributes of the packet. The section may also include Layers 3 and 4 and some payload data from the packet.

The packet section fields let you monitor any packet fields that are not covered by the predefined key-fields. The packet sections feature provides more detailed monitoring, facilitates the investigation of distributed denial of service (DDoS) attacks, and lets you implement other security applications such as URL monitoring.

Flexible NetFlow has the following predefined types of packet sections of a user-configurable size:

Flexible NetFlow Cache Types

There are three types of Flow Caches: normal, immediate, and permanent.

The default Flow Cache type is normal. In this mode, the entries in the cache are aged out according to the timeout active and timeout inactive settings. When a cache entry is aged out, it is removed from the cache and exported via any exporters configured.

A Flow Cache of type immediate ages out every record as soon as it is created. As a result, every flow contains just one packet. This mode is desirable when only very small flows are expected or when a minimum amount of latency is required between seeing a packet and exporting a flow. A typical example is attack detection in security monitoring—specifically if the packet section is used as a key-field.

Note

In case of an immediate cache, there is no difference between key and non-key-fields.


Note that the immediate cache type may result in a large number of export flow records, which can overload low-speed links and overwhelm a NetFlow collector. Therefore, using sampling in conjunction with the immediate cache is strongly recommended.

A Flow Cache of type permanent never ages out any flows. This behavior is useful when you expect to see a small number of flows and there is a need to keep long-term statistics on the router. For example, when monitoring IP ToS as a key-field, there are only 256 values, resulting in a maximum of 256 flow entries in the cache. Permanent caches are also useful for billing applications and for an edge-to-edge traffic matrix where a fixed set of flows are being tracked. Update messages are sent periodically to flow exporters. The export interval can be configured with the timeout update command. Note that when a permanent cache becomes full, new flows are not added and a "Packets not added" counter in the cache statistics (show flow monitor monitor-name cache) reflects the number of unaccounted packets.

Comparison of Original NetFlow and Flexible NetFlow

Some features from the original NetFlow versions (1, 5, 7, 8) are not supported yet with Flexible NetFlow. The objective of Flexible NetFlow is to support all features over time; however, some of the unsupported features can be mimicked easily. Table 7-9 provides a feature-by-feature comparison of original NetFlow and Flexible NetFlow and describes how to emulate a feature.

Table 7-9. NetFlow Feature Comparison
FeatureOriginal NetFlowFlexible NetFlowComments
NetFlow Data CaptureSupportedSupportedData capture is available with the predefined[*] and user-defined records in Flexible NetFlow.
NetFlow Data ExportSupportedSupportedFlow exporters export data from the Flexible NetFlow flow monitor caches to remote systems.
NetFlow for IPv6Supported in version 9Should be available by the time this book is published.IP version 6 monitoring.
MPLS-Aware NetFlowSupported in version 9Not supportedMPLS core monitoring.
MPLS Egress NetFlowSupported in version 9Not supportedMPLS edge monitoring.
NetFlow BGP Next HopSupported in version 9SupportedAvailable in the predefined and user-defined keys in Flexible NetFlow records.
Random Packet Sampled NetFlowSupportedSupportedAvailable with Flexible NetFlow sampling.
NetFlow version 9 Export FormatSupported in version 9SupportedAvailable with Flexible NetFlow exporters.
NetFlow subinterfaceSupportedSupportedFlexible NetFlow monitors can be assigned to subinterfaces.
Multiple Export DestinationsSupportedSupportedAvailable with Flexible NetFlow exporters.
NetFlow ToS-Based Router AggregationSupportedSupportedAvailable in the predefined and user-defined records in Flexible NetFlow records.
NetFlow Minimum Prefix Mask for Router-Based AggregationSupportedSupportedAvailable in the predefined and user-defined records.
NetFlow Input FiltersSupported in version 9Not supportedMQC filters.
NetFlow MIBSupportedNot supportedNetFlow statistics via MIB.
NetFlow MIB and Top TalkersSupportedNot supportedTop Talkers statistics in the NetFlow MIB.
NetFlow Dynamic Top Talkers CLISupported in version 9Not supportedTop Talker statistics via CLI.
NetFlow MulticastSupportedNot supportedFlexible NetFlow collects statistics for multicast flows. However, specific additional fields such as replication counts for bytes (OBYTES) and packets (OPACKETS) are not supported by Flexible NetFlow in Cisco IOS Software Release 12.4(9)T.
NetFlow Layer 2 and Security Monitoring ExportsSupported in version 9Not supportedMonitoring of Layer 2 details.
Egress NetFlow AccountingSupportedSupportedFlexible NetFlow monitors can be used to monitor egress traffic on interfaces and subinterfaces.
NetFlow Reliable Export with SCTPSupported in version 9Not supported 


[*] Flexible NetFlow has several predefined keys that emulate data analysis with original NetFlow.

 

CLI Operations

This section describes the most important configuration commands to enable Flexible NetFlow on Cisco routers. Figure 7-15 displays, using a very simple example, the different configuration steps:

1.
Exporter configuration

2.
Flow Record configuration

3.
Flow Monitor configuration

4.
Interface configuration

Figure 7-15. Flexible NetFlow: High-Level View of the Configuration


Note that the CLI configuration of Flexible NetFlow for predefined records, which is considered an intermediate step toward flexible records configuration, is not described in this book.

The most important configuration commands to enable Flexible NetFlow on Cisco routers are as follows:

Flexible NetFlow Examples

The following examples are just two of many possible scenarios of how Flexible NetFlow can be used. The associated CLI configuration and show commands are illustrated for the first scenario only.

By targeting specific information, you can reduce the amount of collected data and the number of exported flows, allowing enhanced scalability and aggregation. If you are interested in TCP application analysis, with Flexible NetFlow you configure the tracking of the source and destination IP addresses, protocol, TCP source, and destination ports. The collected flow records provide traffic statistics for each application port number. For the same scenario in original NetFlow, you would collect more data records based on the seven tuples flow definition and aggregate them afterwards. In Flexible NetFlow, the aggregation is provided with the key-field definition, avoiding collection of unnecessary fields (four fields compared to seven).

Here's the configuration for the preceding scenario:

flow exporter my-exporter
 destination 10.10.10.10
 source FastEthernet0/0
 ttl 2

flow record my-record
 match ipv4 source address
 match ipv4 destination address
 match transport tcp source-port
 match transport tcp destination-port
 collect counter packets
 collect counter bytes

flow monitor my-monitor
 record my-record
 exporter my-exporter
 statistics packet size

interface fastethernet0/0
 ip flow monitor my-monitor input

In this case, the NetFlow Collector 10.10.10.10 is situated two hops away from the router. The router's fastethernet0/0 IP address identifies the exporting router. Instead of browsing the full configuration for Flexible NetFlow-related commands, the following set of show commands has been added:

show running flow exporter
show running flow monitor
show running flow record

These show commands allow the configuration to be verified. For example:

Router#show flow exporter my-exporter
Flow Exporter my-exporter:
  Description:              User defined
  Tranport Configuration:
    Destination IP address: 10.10.10.10
    Source IP address:      10.48.71.24
    Source Interface:       FastEthernet0/0
    Transport Protocol:     UDP
    Destination Port:       9995
    Source Port:            50232
    DSCP:                   0x0
    TTL:                    2

Router#show flow record my-record
flow record my-record:
  Description:        User defined
  No. of users:       1
  Total field space:  22 bytes
  Fields:
    match ipv4 source address
    match ipv4 destination address
    match transport tcp source-port
    match transport tcp destination-port
    collect counter packets
    collect counter bytes


					  

The following show command, which describes the newly created NetFlow version 9 template, is of great help when troubleshooting:

Router#show flow exporter templates

Flow Exporter my-exporter:
  Client: Flow Monitor my-monitor
  Exporter Format: NetFlow Version 9
  Template ID    : 258
  Record Size    : 20
  Template layout
  _____________________________________________________________________
  |                 Field                   |  Type | Offset |  Size   |
  ---------------------------------------------------------------------
  | ipv4 source address                     |     8 |     0  |     4   |
  | ipv4 destination address                |    12 |     4  |     4   |
  | transport tcp source-port               |   182 |     8  |     2   |
  | transport tcp destination-port          |   183 |    10  |     2   |
  | counter packets                         |     2 |    12  |     4   |
  | counter bytes                           |     1 |    16  |     4   |
  --------------------------------------------------------------------

Router#show flow interface fastethernet0/0
Interface FastEthernet0/0
  FNF:  monitor:          my-monitor
  direction:       Input
  traffic(ip):     on


					  

The next three commands display the content of the cache, with three different options: record, table, and csv:

Router#show flow monitor my-monitor cache format record
  Cache type:                            Normal
  Cache size:                              4096
  Current entries:                           45
  High Watermark:                            45

  Flows added:                               45
  Flows aged:                                 0
    - Active timeout   (  1800 secs)          0
    - Inactive timeout (    15 secs)          0
    - Event aged                              0
    - Watermark aged                          0
    - Emergency aged                          0
IPV4 SOURCE ADDRESS:       10.48.71.17
IPV4 DESTINATION ADDRESS:  10.48.71.24
TCP SOURCE PORT:           0
TCP DESTINATION PORT:      0
counter packets:           6
counter bytes:             456

IPV4 SOURCE ADDRESS:       10.48.71.129
IPV4 DESTINATION ADDRESS:  10.48.71.24
TCP SOURCE PORT:           0
TCP DESTINATION PORT:      0
counter packets:           28
counter bytes:             3136

IPV4 SOURCE ADDRESS:       10.48.71.199
IPV4 DESTINATION ADDRESS:  10.48.71.24
TCP SOURCE PORT:           11011
TCP DESTINATION PORT:      18710
counter packets:           15
counter bytes:             702
...

Router#show flow monitor my-monitor cache format table
  Cache type:                            Normal
  Cache size:                              4096
  Current entries:                           45
  High Watermark:                            45

  Flows added:                               45
  Flows aged:                                 0
    - Active timeout   (  1800 secs)          0
    - Inactive timeout (    15 secs)          0
    - Event aged                              0
    - Watermark aged                          0
    - Emergency aged                          0

IPV4 SRC ADDR  IPV4 DST ADDR  TCP SRC PORT  TCP DST PORT  pkts    bytes
=============  =============  ============  ============  ====    =====
10.48.71.17    10.48.71.24               0             0     7      532
10.48.71.129   10.48.71.24               0             0     30    3360
10.48.71.199   10.48.71.24           11011         18710     15     702
...

Router#show flow monitor my-monitor cache format csv
  Cache type:                            Normal
  Cache size:                              4096
  Current entries:                           45
  High Watermark:                            45

  Flows added:                               45
  Flows aged:                                 0
    - Active timeout   (  1800 secs)          0
    - Inactive timeout (    15 secs)          0
    - Event aged                              0
    - Watermark aged                          0
    - Emergency aged                          0
IPV4 SRC ADDR,IPV4 DST ADDR,TCP SRC PORT,TCP DST PORT,pkts,bytes
10.48.71.17,10.48.71.24,0,0,7,532
10.48.71.129,10.48.71.24,0,0,29,3248
10.48.71.199,10.48.71.24,11011,18710,15,702


					  

Some of the flow records in the cache, and therefore in the NetFlow Collector, have a value of 0 for the source and destination TCP ports. However, the IANA port assignment lists the value 0 as reserved for both TCP and UDP. Although the configuration has defined the TCP source and destination ports as key-fields, this TCP flow key does not work as a filter. In other words, this does not imply that only TCP flows are monitored. If a UDP flow is monitored, the values of the source and destination ports are 0. So the NetFlow Collector must filter out the flow records with the source and destination value of 0. Note that flexible filtering will be implemented in the future.

Note

If a field is not available for a packet, Flexible NetFlow reports this field with a value of 0.


For troubleshooting purposes, statistics such as the current number of entries and the high watermark are available:

Router#show flow monitor my-monitor statistics
  Cache type:                            Normal
  Cache size:                              4096
  Current entries:                           51
  High Watermark:                            51

  Flows added:                               51
  Flows aged:                                 0
    - Active timeout   (  1800 secs)          0
    - Inactive timeout (    15 secs)          0
    - Event aged                              0
    - Watermark aged                          0
    - Emergency aged                          0

Packet size distribution (2350 total packets):
   1-32   64   96  128  160  192  224  256  288  320  352  384  416
   .000 .127 .500 .126 .013 .016 .002 .035 .036 .004 .037 .028 .042

    448  480  512  544  576 1024 1536 2048 2560 3072 3584 4096 4608
   .000 .014 .000 .004 .004 .005 .000 .000 .000 .000 .000 .000 .000

In the exporter statistics output, which reports the export failures, most of the counters must be 0 (except potentially for the first export packets if ARP is required).

Router#show flow exporter my-exporter statistics
Flow Exporter my-exporter:
  Packet send statistics:
    Ok 0
    No FIB 0
    Adjacency failure 0
    Enqueued to process level 2
    Enqueueing failed 0
    IPC failed 0
    Output failed 0
    Fragmentation failed 0
    Encap fixup failed 0
    No destination address 0
  Client send statistics:
    Client: Flow Monitor my-monitor
      Records added 0
      Packets sent 0 (0 bytes)
      Packets dropped 0 (0 bytes)
      No Packet available errors 0

Finally, the following command displays NetFlow version 9 export IDs for all fields that are supported by Flexible NetFlow. This facilitates the lookup within the NetFlow version 9 RFC (RFC 3954), the IPFIX Information Model RFC, and the IPFIX IANA registry:

Router#show flow exporter export-ids netflow-v9
Export IDs used by fields in NetFlow-common export format:
  ip version                                 :    60
  ip tos                                     :   194
  ip dscp                                    :   195
  ip precedence                              :   196
  ip protocol                                :     4
  ip ttl                                     :   192
  ip ttl minimum                             :    52
  ip ttl maximum                             :    53
  ip length header                           :   189
  ip length payload                          :   204
  ip section header                          :   313
  ip section payload                         :   314
  routing source as                          :    16
  routing destination as                     :    17
  routing source as peer                     :   129
  routing destination as peer                :   128
  routing source traffic-index               :    92
  routing destination traffic-index          :    93
  routing forwarding-status                  :    89
  routing is-multicast                       :   206
  routing next-hop address ipv4              :    15
  routing next-hop address ipv4 bgp          :    18
  routing next-hop address ipv6 bgp          :    63
  ipv4 header-length                         :   207
  ipv4 tos                                   :     5
  ipv4 total-length                          :   190
  ipv4 total-length minimum                  :    25
  ipv4 total-length maximum                  :    26
  ipv4 id                                    :    54
  ipv4 fragmentation flags                   :   197
  ipv4 fragmentation offset                  :    88
  ipv4 source address                        :     8
  ipv4 source prefix                         :    44
  ipv4 source mask                           :     9
  ipv4 destination address                   :    12
  ipv4 destination prefix                    :    45
  ipv4 destination mask                      :    13
  ipv4 option map                            :   208
  transport source-port                      :     7
  transport destination-port                 :    11
  transport icmp ipv4 type                   :   176
  transport icmp ipv4 code                   :   177
  transport igmp type                        :    33
  transport tcp source-port                  :   182
  transport tcp destination-port             :   183
  transport tcp sequence-number              :   184
  transport tcp acknowledgement-number       :   185
  transport tcp header-length                :   188
  transport tcp window-size                  :   186
  transport tcp urgent-pointer               :   187
  transport tcp flags                        :     6
  transport udp source-port                  :   180
  transport udp destination-port             :   181
  transport udp message-length               :   205
  interface input snmp                       :    10
  interface output snmp                      :    14
  interface name                             :    82
  interface description                      :    83
  flow direction                             :    61
  flow exporter                              :   144
  flow sampler                               :    48
  flow sampler algorithm export              :    49
  flow sampler interval                      :    50
  flow sampler name                          :    84
  flow class                                 :    51
  v9-scope system                            :     1
  v9-scope interface                         :     2
  v9-scope linecard                          :     3
  v9-scope cache                             :     4
  v9-scope template                          :     5
  counter flows                              :     3
  counter bytes                              :     1
  counter bytes long                         :     1
  counter packets                            :     2
  counter packets long                       :     2
  counter bytes squared long                 :   198
  counter bytes permanent                    :    85
  counter packets permanent                  :    86
  counter bytes squared permanent            :   199
  counter bytes exported                     :    40
  counter packets exported                   :    41
  counter flows exported                     :    42
  timestamp sys-uptime first                 :    22
  timestamp sys-uptime last                  :    21


					  

The second scenario deals with security. Flexible NetFlow is an excellent attack detection feature. It can track all parts of the IPv4 header and even packet sections, and can aggregate the data into flows. It is expected that security detection systems will listen to NetFlow data and, upon finding an issue in the network, create a cache that will be configured to track specific information and pinpoint details about the attack pattern or worm propagation. The capability to create caches ad hoc positions Flexible NetFlow as an enhanced security detection feature, compared to current flow technologies. It is anticipated that Flexible NetFlow will track common attacks such as port scans for worm target discovery and worm propagation. The TCP SYN flood attack is a simpler approach in which TCP flags are used to send a large number of connection requests to a server. The attacking device sends a stream of TCP SYN packets to a given destination address but never sends an ACK in response to the destination's SYN-ACK as part of the TCP three-way handshake. This results in a large number of open TCP requests, finally consuming all the victim's resources. The flow information needed for this security monitoring requires the tracking of three key-fields: destination address or subnet, TCP flags, and packet count. The network element may monitor some general NetFlow information initially, and this data may trigger the setup of an additional Flow Monitor, providing a more detailed view of this particular attack. If the security application identifies the attack's root cause, it might then configure an additional Flow Monitor to gather payload information or sections of packets to take a deeper look at a signature within the packet. Because the configuration for this example can be easily derived from the previous example (TCP application monitoring), the CLI and show commands are not displayed. An interesting example of how to use the permanent cache type of Flexible NetFlow for capacity planning is included in Chapter 14, "Capacity Planning Scenarios."

Previous Page Next Page