www.howtonetwork.org

CCNA & CCNP Certifcation Training

  • About
  • Contact
  • FAQ
  • Join
  • Home
  • CCNA
    • ICND1
    • ICND2
    • 101 CCNA LABS
  • CCNP
    • ROUTE
    • SWITCH
    • TSHOOT
    • 101 CCNP LABS
  • CompTIA
    • Security+
    • Network+
  • Design
    • CCDA
    • CCDP
You are here: Home / ICND2 / Day 40 – Syslog, SNMP, and Netflow / Day 40 Tasks / Cisco IOS NetFlow

Cisco IOS NetFlow

Like SNMP, Cisco IOS NetFlow is a powerful maintenance and monitoring tool that can be used to baseline network performance and assist in troubleshooting. However, there are some significant differences between Cisco IOS NetFlow and SNMP. The first difference is that while SNMP reports primarily on device statistics (e.g., resource utilisation, etc.), Cisco IOS NetFlow reports on traffic statistics (e.g., packets and bytes).

The second difference between these two tools is that SNMP is a poll-based protocol, meaning that the managed device is polled for information. It can also be considered push-based in the instance that a SNMP device sends a trap (event report) to a management station. Cisco IOS NetFlow, however, is a push-based technology, meaning that the device on which NetFlow is configured sends out information that it has collected locally to a central repository. For this reason, NetFlow and SNMP complement each other and should be used together as part of the standard network maintenance and monitoring toolkit. However, they are not replacements for each other; this is often a misunderstood concept and it is important that you remember this.

An IP flow is based on a set of five, and up to seven, IP packet attributes, which may include the following:

  • Destination IP address
  • Source IP address
  • Source port
  • Destination port
  • Layer 3 protocol type
  • Class of Service
  • Router or switch interface

In addition to these IP attributes, other additional information is also included with a flow. This additional information includes timestamps, which are useful for calculating packets and bytes per second. Timestamps also provide information on the life (duration) of a flow. The flow also includes next-hop IP address information, including BGP routing autonomous systems information. Subnet mask information for the flow source and destination addresses is also included, in addition to flags for TCP traffic, which can be used to examine the TCP handshakes.

In short, Cisco IOS NetFlow can be used for network traffic accounting, usage-based network billing, network planning, security, Denial of Service (DoS) monitoring capabilities, and network monitoring, in addition to providing information about network users and applications, peak usage times, and traffic routing. All of this makes it a very powerful maintenance, monitoring, and troubleshooting tool.

Cisco IOS NetFlow gathers the flow information and stores it in a database called the NetFlow cache or simply the flow cache. Flow information is retained until the flow is terminated or stopped, times out, or the cache is filled. Two methods can be used to access the data stored in the flow: using the CLI (i.e., using show commands) or exporting the data and then viewing it using some type of reporting tool. Figure 40.5 below illustrates NetFlow operation on a Cisco IOS router and how the flow cache is populated:

 40.5

Figure 40.5 – Basic NetFlow Operation and Flow Cache Population

 

Referencing Figure 40.5, ingress traffic is received on the local router. This traffic is inspected by the router and IP attribute information is used to create a flow. The flow information is then stored in the flow cache. This information can be viewed using the CLI or can also be exported to an external destination, referred to as a NetFlow Collector, where the same information can then be viewed using an application reporting tool. The following steps are used to implement NetFlow data reporting to the NetFlow Collector:

  1. Cisco IOS NetFlow is configured on the device to capture flows to the NetFlow cache.
  2. NetFlow export is configured to send flows to the Collector.
  3. The NetFlow cache is searched for flows that have been inactive for a certain period of time, have been terminated, or, for active flows, that last greater than the active timer.
  4. Those identified flows are exported to the NetFlow Collector server.
  5. Approximately 30 to 50 flows are bundled together and are typically transported via UDP.
  6. The NetFlow Collector software creates real-time or historical reports from the data.

Three primary steps are required when configuring Cisco IOS NetFlow, as follows:

  1. Configure the interface to capture flows into the NetFlow cache using the ip flow ingress interface configuration command on all interfaces for which you want information to be captured and stored in the flow cache. It is important to remember that NetFlow is configured on a per-interface basis only.

Note from Dario:  The ip route-cache flow command will enable flows on the physical interface and all subinterfaces associated with it.

The ip flow ingress command will enable flows on individual subinterfaces, as opposed to all of them on the same interface. This comes in handy when you are not interested in seeing flows on subinterfaces X, Y, and Z, but you do want to see flows on subinterfaces A, B, and C from that same physical interface.

Additionally, with NetFlow v5, the only option was to monitor inbound statistics using the ip flow ingress command. However, with the release of NetFlow v9, you now have the option to monitor traffic leaving each interface using the ip flow egress command.

Note: Effective with Cisco IOS Releases 12.4(2)T and 12.2(18)SXD, the ip route-cache flow command has been replaced by the ip flow ingress command. Effective with Cisco IOS Releases 12.2(25)S, the output of the show running configuration command was modified so that the ip route-cache flow command, as well as the ip flow ingress command, will appear when either command is configured.

The NetFlow information is then stored on the local router and can be viewed using the show ip cache flow command on the local device.

In the event that you want to export data to the NetFlow Collector, two additional tasks will be required, as follows:

  1. Configure the Cisco IOS NetFlow version or format using the ip flow-export version [1 | 5 | 9] global configuration command. NetFlow version 1 (v1) is the original format supported in the initial NetFlow releases. This version should be used only when it is the only NetFlow data export format version that is supported by the application that you are using to analyse the exported NetFlow data. Version 5 exports more fields than version 1 does and is the most widely deployed version. Version 9 is the latest Cisco IOS NetFlow version and is the basis of a new IETF standard. Version 9 is a flexible export format version.
  2. Configure and specify the IP address of the NetFlow Collector, and then specify the UDP port that the NetFlow Collector will use to receive the UDP export from the Cisco device, using the ip flow-export destination [hostname | address] <port> [udp] global configuration command. The [udp] keyword is optional and does not need to be specified when using this command because User Datagram Protocol (UDP) is the default transport protocol used when sending data to the NetFlow Collector.

The following example illustrates how to enable NetFlow for a specified router interface:

R1#config tEnter configuration commands, one per line.  End with CNTL/Z.R1(config)#interface Serial0/0R1(config-if)#ip flow ingress

R1(config-if)#end

Following this configuration, the show ip cache flow command can be used to view collected statistics in the flow cache, as illustrated in the output below:

R1#show ip cache flow

IP packet size distribution (721 total packets):

   1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480

   .000 .980 .016 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000

    512  544  576 1024 1536 2048 2560 3072 3584 4096 4608

   .002 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000

IP Flow Switching Cache, 278544 bytes

  4 active, 4092 inactive, 56 added

  1195 ager polls, 0 flow alloc failures

  Active flows timeout in 30 minutes

  Inactive flows timeout in 15 seconds

IP Sub Flow Cache, 21640 bytes

  4 active, 1020 inactive, 56 added, 56 added to flow

  0 alloc failures, 0 force free

  1 chunk, 1 chunk added

  last clearing of statistics never

Protocol         Total    Flows   Packets Bytes  Packets Active(Sec) Idle(Sec)

——–         Flows     /Sec     /Flow  /Pkt     /Sec     /Flow     /Flow

TCP-Telnet           2      0.0        34    40      0.0      10.5      15.7

TCP-WWW              2      0.0         9    93      0.0       0.1       1.5

UDP-NTP              1      0.0         1    76      0.0       0.0      15.4

UDP-other           42      0.0         5    59      0.0       0.0      15.7

ICMP                 5      0.0        10    64      0.0       0.0      15.1

Total:              52      0.0         7    58      0.0       0.4      15.1

SrcIf      SrcIPaddress   DstIf   DstIPaddress   Pr SrcP DstP  Pkts

Se0/0      150.1.1.254    Local   10.0.0.1       01 0000 0800   339

Se0/0      10.0.0.2       Local   1.1.1.1        06 C0B3 0017     7

Se0/0      10.0.0.2       Local   10.0.0.1       11 07AF D0F1     1

Se0/0      10.0.0.2       Local   10.0.0.1       11 8000 D0F1    10

Se0/0      150.1.1.254    Local   10.0.0.1       01 0000 0800   271

Se0/0      10.0.0.2       Local   1.1.1.1        06 C0B3 0017    59

The following example illustrates how to configure and enable NetFlow data collection for the specified router interfaces, and then export the data to a NetFlow Collector with the IP address 150.1.1.254 over UDP port 5000 using NetFlow version 5 data format:

R1(config)#interface Serial0/0R1(config-if)#ip flow ingressR1(config-if)#exitR1(config)#interface FastEthernet0/0

R1(config-if)#ip flow ingress

R1(config-if)#exit

R1(config)#interface Serial0/1

R1(config-if)#exit

R1(config)#ip flow-export version 5

R1(config)#ip flow-export destination 150.1.1.254 5000

R1(config)#exit

Following this configuration, the collected information can then be viewed using an application reporting tool on the NetFlow Collector. Despite the export of data, the show ip cache flow command can still be used to view statistics on the local device, which can be a useful tool when troubleshooting network issues or problem reports.

 

Troubleshooting Utilising NetFlow Data

A typical enterprise network has thousands of connections generating massive amounts of NetFlow data in only a short period of time. NetFlow data can be transformed into useful graphs and tables that help network administrators understand what is going on inside the network.  NetFlow data can assist with the following:

  • Improve overall network performance
  • Support latency-sensitive applications, such as voice over IP (VoIP)
  • Better manage traffic spikes
  • Enforce network policies
  • Expose traffic patterns that point to malicious activities

NetFlow statistics can also help administrators understand what percentage of network resources is being consumed by each data type at any given time. You can see at a glance how much bandwidth is being used by e-mail, accounting and ERP systems, and other applications, as well as how many users are watching YouTube videos or making Internet phone calls during the work day.

NetFlow data can be presented in an easy to understand format that enables administrators to easily drill down into more details. They can examine traffic flows by user, application, department, conversation, interface, and protocol. Some examples of situations that can be solved using NetFlow data include the following:

  • Capacity issues: NetFlow can clearly show what applications use the most bandwidth and when. This information can help in changing the application traffic patterns in order to improve network performance. This can also be applied to user traffic.
  • Security issues: NetFlow data can detect unauthorised traffic patterns across the network and can stop the threat before any harm is done to the network.
  • VoIP problems (poor quality, for example) can be corrected after being identified using NetFlow analysers. NetFlow reports can show insufficient bandwidth, latency, or jitter issues that affect the VoIP calls.

Prev

About Us

This is a free bonus site for members of www.howtonetwork.com

Copyright

The content on this copyright Reality Press Ltd.
Copyright Reality Press Ltd.