sFlow allows you to monitor the real-time traffic in data networks that contain switches and routers. It uses the sampling mechanism in the sFlow Agent software on switches and routers for monitoring traffic and to forward the sample data on ingress and egress ports to the central data collector, also called the sFlow Analyzer.
The sFlow Agent, which is embedded in the Cisco NX-OS software, periodically samples or polls the interface counters that are associated with a data source of the sampled packets. The data source can be an Ethernet interface, an EtherChannel interface, or a range of Ethernet interfaces. The sFlow Agent queries the Ethernet port manager for the respective EtherChannel membership information and also receives notifications from the Ethernet port manager for membership changes.
When you enable sFlow sampling in the Cisco NX-OS software, based on the sampling rate and the hardware internal random number, the ingress packets and egress packets are sent to the CPU as an sFlow-sampled packet. The sFlow Agent processes the sampled packets and sends an sFlow datagram to the sFlow Analyzer. In addition to the original sampled packet, an sFlow datagram includes the information about the ingress port, egress port, and the original packet length. An sFlow datagram can have multiple sFlow samples.
Licensing Requirements
This feature does not require a license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.
Prerequisites
You must enable the sFlow feature using the feature sflow command to configure sFlow.
Guidelines and Limitations for sFlow
When you plan your sFlow configuration, consider the following:
When you enable sFlow for an interface, it is enabled for both ingress and egress. You cannot enable sFlow for only ingress or only egress.
sFlow egress sampling for multicast, broadcast, or unknown unicast packets is not supported.
You should configure the sampling rate based on the sFlow configuration and traffic in the system.
Cisco Nexus 3000 Series supports only one sFlow collector.
Default Settings for sFlow
Table 1 Default sFlow Parameters
Parameters
Default
sFlow sampling-rate
4096
sFlow sampling-size
128
sFlow max datagram-size
1400
sFlow collector-port
6343
sFlow counter-poll-interval
20
Configuring sFLow
Enabling the sFlow Feature
You must enable the sFlow feature before you can configure sFlow on the switch.
You can configure the maximum number of seconds between successive samples of the counters that are associated with the data source. A sampling interval of 0 disables counter sampling.
Before You Begin
Ensure that you have enabled the sFlow feature.
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
[no] sflow counter-poll-intervalpoll-interval
Configures the sFlow poll interval for an interface. The range for the poll-interval is from 0 to 2147483647 seconds. The default value is 20.
The default ip-address is 0.0.0.0, which means that all sampling is disabled on the switch. You must specify a valid IP address to enable sFlow functionality.